Closed as not planned
Closed as not planned
Description
I tried this code:
trait SomeTrait<'a> {}
fn foo<'a, 'b, T: SomeTrait<'a> + SomeTrait<'b>>() {}
I expected this code to compile, but instead I got this error:
Compiling playground v0.0.1 (/playground)
error[E0283]: type annotations needed: cannot satisfy `T: SomeTrait<'a>`
--> src/lib.rs:3:19
|
3 | fn foo<'a, 'b, T: SomeTrait<'a> + SomeTrait<'b>>() {}
| ^^^^^^^^^^^^^
|
note: multiple `impl`s or `where` clauses satisfying `T: SomeTrait<'a>` found
--> src/lib.rs:3:19
|
3 | fn foo<'a, 'b, T: SomeTrait<'a> + SomeTrait<'b>>() {}
| ^^^^^^^^^^^^^ ^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0283`.
error: could not compile `playground` (lib) due to 1 previous error
Meta
Reproduces on the playground on "Stable version: 1.80.1" and "Nightly version: 1.83.0-nightly (2024-09-03 d6c8169)"
This compiles in rust 1.3.0. ICEs in rust 1.4.0-1.6.0. Fails to compile in rust 1.7.0.