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-09-19 16:57:19 +00:00
|
|
|
// incremental
|
|
|
|
// compile-flags: -Z query-dep-graph
|
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
|
|
|
fn main() {}
|
2017-04-24 15:15:12 +00:00
|
|
|
|
2021-05-11 16:45:57 +00:00
|
|
|
#[rustc_if_this_changed]
|
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
|
|
|
}
|