about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-21 17:46:49 +0100
committerGitHub <noreply@github.com>2024-03-21 17:46:49 +0100
commit40c972e3351eba693e99a8a2e34c91b991f9b50b (patch)
tree5050ecd8ad3dcac2d94d84a2ba7e568bd6616e76 /compiler/rustc_codegen_llvm/src
parent8d1262118128b0d235f0b0c26f063082f4fc6916 (diff)
parent6623bdf68b3d6e3984885ef72d62e7df0d256f7b (diff)
downloadrust-40c972e3351eba693e99a8a2e34c91b991f9b50b.tar.gz
rust-40c972e3351eba693e99a8a2e34c91b991f9b50b.zip
Rollup merge of #122733 - oli-obk:error_prop, r=compiler-errors
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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions