-
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.
Don't immediately panic if dropck fails without returning errors
Type lowering can give non-fatal errors that dropck then uses to suppress its own errors. Assume this is the cases when we can't find the error in borrowck.
- Loading branch information
1 parent
e0be1a0
commit a4a9fb4
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`. |