-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Closed as not planned
Copy link
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.