Closed
Description
trait Svc<Req> {
type Res;
}
// ICEs:
trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
// works:
// trait MkSvc<Target, Req> = Svc<Target> where <Self as Svc<Target>>::Res: Svc<Req>;
Related playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e29c998d2dc1d0c0ef60f4f3bd5ae934
The compiler outputs:
error: internal compiler error: src/librustc/hir/map/mod.rs:546: ty_param_owner: trait alias MkSvc (id=17) not a type parameter
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: rustc 1.35.0-nightly (88f755f8a 2019-03-07) running on x86_64-unknown-linux-gnu
cc #41517