]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dep-graph/dep-graph-variance-alias.rs
Rollup merge of #94577 - RalfJung:simd-miri, r=scottmcm
[rust.git] / src / test / ui / dep-graph / dep-graph-variance-alias.rs
1 // Test that changing what a `type` points to does not go unnoticed
2 // by the variance analysis.
3
4 // incremental
5 // compile-flags: -Z query-dep-graph
6
7 #![feature(rustc_attrs)]
8 #![allow(dead_code)]
9 #![allow(unused_variables)]
10 fn main() {}
11
12 #[rustc_if_this_changed]
13 struct Foo<T> {
14     f: T,
15 }
16
17 type TypeAlias<T> = Foo<T>;
18
19 #[rustc_then_this_would_need(variances_of)] //~ ERROR OK
20 struct Use<T> {
21     x: TypeAlias<T>,
22 }