forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122449 - compiler-errors:stranded-opaque, r=oli-obk Delay a bug for stranded opaques r? oli-obk Fixes rust-lang#122445
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
trait Trait {} | ||
|
||
impl Trait for i32 {} | ||
|
||
// Since `Assoc` doesn't actually exist, it's "stranded", and won't show up in | ||
// the list of opaques that may be defined by the function. Make sure we don't | ||
// ICE in this case. | ||
fn produce<T>() -> impl Trait<Assoc = impl Trait> { | ||
//~^ ERROR associated type `Assoc` not found for `Trait` | ||
16 | ||
} | ||
|
||
fn main () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0220]: associated type `Assoc` not found for `Trait` | ||
--> $DIR/stranded-opaque.rs:8:31 | ||
| | ||
LL | fn produce<T>() -> impl Trait<Assoc = impl Trait> { | ||
| ^^^^^ associated type `Assoc` not found | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0220`. |