mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
40c972e335
Strip placeholders from hidden types before remapping generic parameter When remapping generic parameters in the hidden type to the generic parameters of the definition of the opaque, we assume that placeholders cannot exist. Instead of just patching that site, I decided to handle it earlier, directly in `infer_opaque_types`, where we are already doing all the careful lifetime handling. fixes #122694 the reason that ICE now occurred was that we stopped treating `operation` as being in the defining scope, so the TAIT became part of the hidden type of the `async fn`'s opaque type instead of just bailing out as ambiguos I think ```rust use std::future::Future; mod foo { type FutNothing<'a> = impl 'a + Future<Output = ()>; //~^ ERROR: unconstrained opaque type } async fn operation(_: &mut ()) -> () { //~^ ERROR: concrete type differs from previous call(operation).await //~^ ERROR: concrete type differs from previous } async fn call<F>(_f: F) where for<'any> F: FnMut(&'any mut ()) -> foo::FutNothing<'any>, { //~^ ERROR: expected generic lifetime parameter, found `'any` } ``` would have already had the same ICE before https://github.com/rust-lang/rust/pull/121796 |
||
---|---|---|
.. | ||
constraints | ||
diagnostics | ||
polonius | ||
region_infer | ||
type_check | ||
util | ||
borrow_set.rs | ||
borrowck_errors.rs | ||
consumers.rs | ||
dataflow.rs | ||
def_use.rs | ||
facts.rs | ||
lib.rs | ||
location.rs | ||
member_constraints.rs | ||
nll.rs | ||
path_utils.rs | ||
place_ext.rs | ||
places_conflict.rs | ||
prefixes.rs | ||
renumber.rs | ||
session_diagnostics.rs | ||
universal_regions.rs | ||
used_muts.rs |