rustc: fix ICE when trait alias has bare Self
This commit is contained in:
parent
e68bf8ae15
commit
df05fbf006
4 changed files with 29 additions and 2 deletions
8
src/test/ui/issues/issue-59029-1.rs
Normal file
8
src/test/ui/issues/issue-59029-1.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![feature(trait_alias)]
|
||||
|
||||
trait Svc<Req> { type Res; }
|
||||
|
||||
trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
|
||||
//~^ ERROR associated type `Res` not found for `Self`
|
||||
|
||||
fn main() {}
|
||||
9
src/test/ui/issues/issue-59029-1.stderr
Normal file
9
src/test/ui/issues/issue-59029-1.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0220]: associated type `Res` not found for `Self`
|
||||
--> $DIR/issue-59029-1.rs:5:46
|
||||
|
|
||||
LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
|
||||
| ^^^^^^^^^ associated type `Res` not found
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0220`.
|
||||
8
src/test/ui/issues/issue-59029-2.rs
Normal file
8
src/test/ui/issues/issue-59029-2.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// run-pass
|
||||
#![feature(trait_alias)]
|
||||
|
||||
trait Svc<Req> { type Res; }
|
||||
|
||||
trait MkSvc<Target, Req> = Svc<Target> where <Self as Svc<Target>>::Res: Svc<Req>;
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue