Add HAS_RE_LATE_BOUND if there are bound vars

This commit is contained in:
Jack Huey 2021-04-28 10:18:52 -04:00
parent 1919b3f227
commit 31ae3b2bdb
3 changed files with 27 additions and 0 deletions

View File

@ -59,6 +59,10 @@ impl FlagComputation {
{
let mut computation = FlagComputation::new();
if !value.bound_vars().is_empty() {
computation.flags = computation.flags | TypeFlags::HAS_RE_LATE_BOUND;
}
f(&mut computation, value.skip_binder());
self.add_flags(computation.flags);

View File

@ -0,0 +1,14 @@
// build-pass
// compile-flags: --edition 2018
// compile-flags: --crate-type rlib
use std::future::Future;
async fn handle<F>(slf: &F)
where
F: Fn(&()) -> Box<dyn for<'a> Future<Output = ()> + Unpin>,
{
(slf)(&()).await;
}
fn main() {}

View File

@ -0,0 +1,9 @@
// run-pass
// compile-flags: -Zsymbol-mangling-version=v0
pub fn f<T: ?Sized>() {}
pub trait Frob<T: ?Sized> {}
fn main() {
f::<dyn Frob<str>>();
f::<dyn for<'a> Frob<str>>();
}