Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
regression test for issue 80949.
  • Loading branch information
pnkfelix committed Feb 5, 2021
1 parent dac354f commit fb0e41f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/test/ui/mir/issue-80949.rs
@@ -0,0 +1,34 @@
// build-pass

trait Trait { type Item; }

impl<'a, X> Trait for &'a Vec<X> {
type Item = &'a X;
}

impl<X> Trait for Box<dyn Trait<Item = X>> {
type Item = X;
}

fn make_dyn_trait(_: &()) -> Box<dyn Trait<Item = &()>> {
todo!()
}

fn diff<'a, M, N, S>(_: N, _: S)
where
M: 'a,
N: Trait<Item = &'a M>,
S: Trait<Item = &'a M>,
{
todo!()
}

fn may_panic<X>(_: X) { }

fn main() {
let dyn_trait = make_dyn_trait(&());
let storage = vec![()];
let _x = may_panic(());
let storage_ref = &storage;
diff(dyn_trait, storage_ref);
}

0 comments on commit fb0e41f

Please sign in to comment.