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. . --<details<summary<strongBacktrace</strong</summary<p</p</details
label +E-needs-mcve
Minimized to:
might be similar to , cc who self-assigned and probably knows more about this stuff ^^
in case we need more code snippets, here are 60 of them that that can trigger the ice in some way or another :upsidedownface:
I'm pretty sure all (or at least most) of these examples are not related. This issue is specifically the case where the code used to emit: and now ICEs. is unrelated except for the ICE message.
Ah so this () is a new one? Need to put some though into automatic ice distinction (perhaps based on query stack?)
Yeah, there's a class of ICEs that have the same name and often very different root causes (i.e. ICEs in snapshot-vec) and this is one of them.

Discussion:
use rustc_middle::ty::{ConstVid, EffectVid, FloatVid, IntVid, TyVid}; use rustc_middle::ty::{GenericArg, GenericArgKind, GenericArgs, GenericArgsRef}; use rustc_span::symbol::Symbol; <del> use rustc_span::Span; </del> <ins> use rustc_span::{Span, DUMMY_SP}; </ins> use std::cell::{Cell, RefCell}; use std::fmt;

/// This method is idempotent, but it not typically not invoked /// except during the writeback phase. pub fn fully_resolve<T: TypeFoldable<TyCtxt<'tcx>>>(&self, value: T) -> FixupResult<'tcx, T> { <del> let value = resolve::fully_resolve(self, value); assert!( value.as_ref().map_or(true, |value| !value.has_infer()), "`{value:?}` is not fully resolved" ); value </del> <ins> match resolve::fully_resolve(self, value) { Ok(value) => { if value.has_non_region_infer() { bug!("`{value:?}` is not fully resolved"); } if value.has_infer_regions() { let guar = self .tcx .sess .delay_span_bug(DUMMY_SP, format!("`{value:?}` is not fully resolved")); Ok(self.tcx.fold_regions(value, |re, _| { if re.is_var() { ty::Region::new_error(self.tcx, guar) } else { re } })) } else { Ok(value) } } Err(e) => Err(e), } </ins> } // Instantiates the bound variables in a given binder with fresh inference

/// /// /// ```rust <del> /// # #![feature(return_position_impl_trait_in_trait)] </del> /// use core::future::Future; /// pub trait Trait { ///     fn method(&self) -> impl Future<Output = ()> + Send { async {} }

<ins> // edition: 2021 pub(crate) trait Inbox<M> { async fn next(self) -> M; } pub(crate) trait Actor: Sized { type Message; async fn on_mount(self, _: impl Inbox<Self::Message>); } impl<'a> Actor for () { //~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates type Message = &'a (); async fn on_mount(self, _: impl Inbox<&'a ()>) {} } fn main() {} </ins>

<ins> error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> $DIR/unconstrained-impl-region.rs:13:6 | LL | impl<'a> Actor for () { |      ^^ unconstrained lifetime parameter error: aborting due to previous error For more information about this error, try `rustc --explain E0207`. </ins>