2017-04-24 15:15:12 +00:00
|
|
|
// Test that changing what a `type` points to does not go unnoticed
|
|
|
|
// by the variance analysis.
|
|
|
|
|
2021-03-06 12:55:20 +00:00
|
|
|
// compile-flags: -Z query-dep-graph -C incremental=tmp/dep-graph-variance-alias
|
2017-04-24 15:15:12 +00:00
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
2020-02-06 11:46:26 +00:00
|
|
|
#![rustc_if_this_changed(hir_crate)]
|
|
|
|
fn main() {}
|
2017-04-24 15:15:12 +00:00
|
|
|
|
|
|
|
struct Foo<T> {
|
2020-02-06 11:46:26 +00:00
|
|
|
f: T,
|
2017-04-24 15:15:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TypeAlias<T> = Foo<T>;
|
|
|
|
|
2019-03-29 16:05:40 +00:00
|
|
|
#[rustc_then_this_would_need(variances_of)] //~ ERROR OK
|
2017-04-24 15:15:12 +00:00
|
|
|
struct Use<T> {
|
2020-02-06 11:46:26 +00:00
|
|
|
x: TypeAlias<T>,
|
2017-04-24 15:15:12 +00:00
|
|
|
}
|