Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. -- <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --Strangely the backtrace is empty (I got the error output section with ). Should I report that bug separately?
This also crashes on nightly, but it has a backtrace there (not that it's very helpful): can you see if using nightly gets you a backtrace?
I can't get a normal backtrace even on nightly, however I can get one with (on both stable and nightly), but I don't think it will be very helpful:
For s you can get the backtrace for where they were originally issued with : (Should we automatically capture backtraces of when is set?)
I can see how this would be fixed by , but we don't have a test like this. Marking as needs-test.

Discussion:
<ins> // check-pass // edition:2018 type BoxFuture<T> = std::pin::Pin<Box<dyn std::future::Future<Output=T>>>; fn main() { f(); } async fn f() { run("dependency").await; } struct InMemoryStorage; struct User<'dep> { dep: &'dep str, } impl<'a> StorageRequest<InMemoryStorage> for SaveUser<'a> { fn execute(&self) -> BoxFuture<Result<(), String>> { todo!() } } trait Storage { type Error; } impl Storage for InMemoryStorage { type Error = String; } trait StorageRequestReturnType { type Output; } trait StorageRequest<S: Storage>: StorageRequestReturnType { fn execute( &self, ) -> BoxFuture<Result<<Self as StorageRequestReturnType>::Output, <S as Storage>::Error>>; } struct SaveUser<'a> { name: &'a str, } impl<'a> StorageRequestReturnType for SaveUser<'a> { type Output = (); } impl<'dep> User<'dep> { async fn save<S>(self) where S: Storage, for<'a> SaveUser<'a>: StorageRequest<S>, { SaveUser { name: "Joe" } .execute() .await; } } async fn run<S>(dep: &str) where S: Storage, for<'a> SaveUser<'a>: StorageRequest<S>, { User { dep }.save().await; } </ins>

<ins> // check-pass trait Bar { type Type; } struct Foo<'a>(&'a ()); impl<'a> Bar for Foo<'a> { type Type = (); } fn func<'a>(_: <Foo<'a> as Bar>::Type) {} fn assert_is_func<A>(_: fn(A)) {} fn test() where for<'a> <Foo<'a> as Bar>::Type: Sized, { assert_is_func(func); } fn main() {} </ins>

<ins> // check-pass pub trait Indexable { type Idx; } impl Indexable for u8 { type Idx = u8; } impl Indexable for u16 { type Idx = u16; } pub trait Indexer<T: Indexable>: std::ops::Index<T::Idx, Output = T> {} trait StoreIndex: Indexer<u8> + Indexer<u16> {} fn foo(st: &impl StoreIndex) -> &dyn StoreIndex { st as &dyn StoreIndex } fn main() {} </ins>

<ins> #![feature(unboxed_closures)] trait SomeTrait<'a> { type Associated; } fn give_me_ice<T>() { callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>(); //~^ ERROR: the trait bound `T: SomeTrait<'_>` is not satisfied } fn callee<T: Fn<(&'static (),)>>() { println!("{}", std::any::type_name::<<T as FnOnce<(&'static (),)>>::Output>()); } fn main() { give_me_ice::<()>(); } </ins>

<ins> error[E0277]: the trait bound `T: SomeTrait<'_>` is not satisfied --> $DIR/issue-85455.rs:8:5 | LL |     callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>(); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SomeTrait<'_>` is not implemented for `T` | help: consider restricting type parameter `T` | LL | fn give_me_ice<T: SomeTrait<'_>>() { |                 +++++++++++++++ error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>