-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #137550 - matthewjasper:panic-later-for-missing-dropc…
…k-error, r=compiler-errors Don't immediately panic if dropck fails without returning errors This span_bug was a little too optimistic. I've decided that matching on the ErrorGuaranteed is a little more sensible than a delay bug that will always be ignored. closes #137329 r? `@compiler-errors`
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 deletions.
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,14 @@ | ||
// Regression test for #137329 | ||
|
||
trait B { | ||
type C<'a>; | ||
fn d<E>() -> F<E> { | ||
todo!() | ||
} | ||
} | ||
struct F<G> { | ||
h: Option<<G as B>::C>, | ||
//~^ ERROR missing generics for associated type `B::C` | ||
} | ||
|
||
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,19 @@ | ||
error[E0107]: missing generics for associated type `B::C` | ||
--> $DIR/dropck-after-failed-type-lowering.rs:10:25 | ||
| | ||
LL | h: Option<<G as B>::C>, | ||
| ^ expected 1 lifetime argument | ||
| | ||
note: associated type defined here, with 1 lifetime parameter: `'a` | ||
--> $DIR/dropck-after-failed-type-lowering.rs:4:10 | ||
| | ||
LL | type C<'a>; | ||
| ^ -- | ||
help: add missing lifetime argument | ||
| | ||
LL | h: Option<<G as B>::C<'a>>, | ||
| ++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0107`. |