diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/dep-graph | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/dep-graph')
18 files changed, 0 insertions, 735 deletions
diff --git a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs deleted file mode 100644 index 978c19948..000000000 --- a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Test that when a trait impl changes, fns whose body uses that trait -// must also be recompiled. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(warnings)] - -fn main() { } - -pub trait Foo: Sized { - type T; - fn method(self) { } -} - -mod x { - use Foo; - - #[rustc_if_this_changed] - impl Foo for char { type T = char; } - - impl Foo for u32 { type T = u32; } -} - -mod y { - use Foo; - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn use_char_assoc() { - // Careful here: in the representation, <char as Foo>::T gets - // normalized away, so at a certain point we had no edge to - // codegen. (But now codegen just depends on typeck.) - let x: <char as Foo>::T = 'a'; - } - - pub fn take_foo<T:Foo>(t: T) { } -} diff --git a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr deleted file mode 100644 index cdc268cff..000000000 --- a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: OK - --> $DIR/dep-graph-assoc-type-codegen.rs:29:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/dep-graph/dep-graph-caller-callee.rs b/src/test/ui/dep-graph/dep-graph-caller-callee.rs deleted file mode 100644 index 4a3a8bb6b..000000000 --- a/src/test/ui/dep-graph/dep-graph-caller-callee.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Test that immediate callers have to change when callee changes, but -// not callers' callers. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(dead_code)] - -fn main() { } - -mod x { - #[rustc_if_this_changed] - pub fn x() { } -} - -mod y { - use x; - - // These dependencies SHOULD exist: - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn y() { - x::x(); - } -} - -mod z { - use y; - - // These are expected to yield errors, because changes to `x` - // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(typeck)] //~ ERROR no path - pub fn z() { - y::y(); - } -} diff --git a/src/test/ui/dep-graph/dep-graph-caller-callee.stderr b/src/test/ui/dep-graph/dep-graph-caller-callee.stderr deleted file mode 100644 index 4d06dc7f3..000000000 --- a/src/test/ui/dep-graph/dep-graph-caller-callee.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: OK - --> $DIR/dep-graph-caller-callee.rs:21:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `x` to `typeck` - --> $DIR/dep-graph-caller-callee.rs:32:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-check-attr.rs b/src/test/ui/dep-graph/dep-graph-check-attr.rs deleted file mode 100644 index a45bf24f8..000000000 --- a/src/test/ui/dep-graph/dep-graph-check-attr.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that using rustc_clean/dirty/if_this_changed/then_this_would_need -// are forbidden when `-Z query-dep-graph` is not enabled. - -#![feature(rustc_attrs)] -#![allow(dead_code)] -#![allow(unused_variables)] - -#[rustc_clean(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph -fn main() {} - -#[rustc_if_this_changed(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph -struct Foo<T> { - f: T, -} - -#[rustc_clean(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph -type TypeAlias<T> = Foo<T>; - -#[rustc_then_this_would_need(variances_of)] //~ ERROR attribute requires -Z query-dep-graph -trait Use<T> {} diff --git a/src/test/ui/dep-graph/dep-graph-check-attr.stderr b/src/test/ui/dep-graph/dep-graph-check-attr.stderr deleted file mode 100644 index 46f4e4358..000000000 --- a/src/test/ui/dep-graph/dep-graph-check-attr.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: attribute requires -Z query-dep-graph to be enabled - --> $DIR/dep-graph-check-attr.rs:8:1 - | -LL | #[rustc_clean(hir_owner)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: attribute requires -Z query-dep-graph to be enabled - --> $DIR/dep-graph-check-attr.rs:11:1 - | -LL | #[rustc_if_this_changed(hir_owner)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: attribute requires -Z query-dep-graph to be enabled - --> $DIR/dep-graph-check-attr.rs:16:1 - | -LL | #[rustc_clean(hir_owner)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: attribute requires -Z query-dep-graph to be enabled - --> $DIR/dep-graph-check-attr.rs:19:1 - | -LL | #[rustc_then_this_would_need(variances_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.rs b/src/test/ui/dep-graph/dep-graph-struct-signature.rs deleted file mode 100644 index fcf9f6387..000000000 --- a/src/test/ui/dep-graph/dep-graph-struct-signature.rs +++ /dev/null @@ -1,87 +0,0 @@ -// Test cases where a changing struct appears in the signature of fns -// and methods. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(dead_code)] -#![allow(unused_variables)] - -fn main() { } - -#[rustc_if_this_changed] -struct WillChange { - x: u32, - y: u32 -} - -struct WontChange { - x: u32, - y: u32 -} - -// these are valid dependencies -mod signatures { - use WillChange; - - #[rustc_then_this_would_need(type_of)] //~ ERROR no path - #[rustc_then_this_would_need(associated_item)] //~ ERROR no path - #[rustc_then_this_would_need(trait_def)] //~ ERROR no path - trait Bar { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - fn do_something(x: WillChange); - } - - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - fn some_fn(x: WillChange) { } - - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - fn new_foo(x: u32, y: u32) -> WillChange { - WillChange { x: x, y: y } - } - - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - impl WillChange { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - fn new(x: u32, y: u32) -> WillChange { loop { } } - } - - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - impl WillChange { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - fn method(&self, x: u32) { } - } - - struct WillChanges { - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - x: WillChange, - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - y: WillChange - } - - // The fields change, not the type itself. - #[rustc_then_this_would_need(type_of)] //~ ERROR no path - fn indirect(x: WillChanges) { } -} - -mod invalid_signatures { - use WontChange; - - #[rustc_then_this_would_need(type_of)] //~ ERROR no path - trait A { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path - fn do_something_else_twice(x: WontChange); - } - - #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path - fn b(x: WontChange) { } - - #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path from `WillChange` - #[rustc_then_this_would_need(typeck)] //~ ERROR no path from `WillChange` - fn c(x: u32) { } -} diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr deleted file mode 100644 index cfe1e62d9..000000000 --- a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr +++ /dev/null @@ -1,134 +0,0 @@ -error: no path from `WillChange` to `type_of` - --> $DIR/dep-graph-struct-signature.rs:28:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `associated_item` - --> $DIR/dep-graph-struct-signature.rs:29:5 - | -LL | #[rustc_then_this_would_need(associated_item)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `trait_def` - --> $DIR/dep-graph-struct-signature.rs:30:5 - | -LL | #[rustc_then_this_would_need(trait_def)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:36:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:37:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:40:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:41:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:46:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:53:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:61:9 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:63:9 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `type_of` - --> $DIR/dep-graph-struct-signature.rs:68:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `type_of` - --> $DIR/dep-graph-struct-signature.rs:75:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `fn_sig` - --> $DIR/dep-graph-struct-signature.rs:81:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `fn_sig` - --> $DIR/dep-graph-struct-signature.rs:84:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `typeck` - --> $DIR/dep-graph-struct-signature.rs:85:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:32:9 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `WillChange` to `fn_sig` - --> $DIR/dep-graph-struct-signature.rs:77:9 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:48:9 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:49:9 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:55:9 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-struct-signature.rs:56:9 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 22 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs deleted file mode 100644 index 5da8df570..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Test that adding an impl to a trait `Foo` DOES affect functions -// that only use `Bar` if they have methods in common. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(dead_code)] -#![allow(unused_imports)] - -fn main() { } - -pub trait Foo: Sized { - fn method(self) { } -} - -pub trait Bar: Sized { - fn method(self) { } -} - -mod x { - use {Foo, Bar}; - - #[rustc_if_this_changed] - impl Foo for u32 { } - - impl Bar for char { } -} - -mod y { - use {Foo, Bar}; - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn with_char() { - char::method('a'); - } -} - -mod z { - use y; - - #[rustc_then_this_would_need(typeck)] //~ ERROR no path - pub fn z() { - y::with_char(); - } -} diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr deleted file mode 100644 index 6f56cbc8d..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: OK - --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:33:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `x::<impl Foo for u32>` to `typeck` - --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs deleted file mode 100644 index 590475fa0..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs +++ /dev/null @@ -1,45 +0,0 @@ -// Test that adding an impl to a trait `Foo` does not affect functions -// that only use `Bar`, so long as they do not have methods in common. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(warnings)] - -fn main() { } - -pub trait Foo: Sized { - fn foo(self) { } -} - -pub trait Bar: Sized { - fn bar(self) { } -} - -mod x { - use {Foo, Bar}; - - #[rustc_if_this_changed] - impl Foo for char { } - - impl Bar for char { } -} - -mod y { - use {Foo, Bar}; - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn call_bar() { - char::bar('a'); - } -} - -mod z { - use y; - - #[rustc_then_this_would_need(typeck)] //~ ERROR no path - pub fn z() { - y::call_bar(); - } -} diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr deleted file mode 100644 index 4e1043736..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: OK - --> $DIR/dep-graph-trait-impl-two-traits.rs:32:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `x::<impl Foo for char>` to `typeck` - --> $DIR/dep-graph-trait-impl-two-traits.rs:41:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl.rs b/src/test/ui/dep-graph/dep-graph-trait-impl.rs deleted file mode 100644 index 19002965b..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Test that when a trait impl changes, fns whose body uses that trait -// must also be recompiled. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(warnings)] - -fn main() { } - -pub trait Foo: Sized { - fn method(self) { } -} - -mod x { - use Foo; - - #[rustc_if_this_changed] - impl Foo for char { } - - impl Foo for u32 { } -} - -mod y { - use Foo; - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn with_char() { - char::method('a'); - } - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn take_foo_with_char() { - take_foo::<char>('a'); - } - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn with_u32() { - u32::method(22); - } - - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - pub fn take_foo_with_u32() { - take_foo::<u32>(22); - } - - pub fn take_foo<T:Foo>(t: T) { } -} - -mod z { - use y; - - // These are expected to yield errors, because changes to `x` - // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(typeck)] //~ ERROR no path - pub fn z() { - y::with_char(); - y::with_u32(); - } -} diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl.stderr deleted file mode 100644 index bfee6d5c8..000000000 --- a/src/test/ui/dep-graph/dep-graph-trait-impl.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: OK - --> $DIR/dep-graph-trait-impl.rs:28:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-trait-impl.rs:33:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-trait-impl.rs:38:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-trait-impl.rs:43:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `x::<impl Foo for char>` to `typeck` - --> $DIR/dep-graph-trait-impl.rs:56:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 5 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.rs b/src/test/ui/dep-graph/dep-graph-type-alias.rs deleted file mode 100644 index 0e1b3db19..000000000 --- a/src/test/ui/dep-graph/dep-graph-type-alias.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Test that changing what a `type` points to does not go unnoticed. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(dead_code)] -#![allow(unused_variables)] - -fn main() { } - - -#[rustc_if_this_changed] -type TypeAlias = u32; - -// The type alias directly affects the type of the field, -// not the enclosing struct: -#[rustc_then_this_would_need(type_of)] //~ ERROR no path -struct Struct { - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - x: TypeAlias, - y: u32 -} - -#[rustc_then_this_would_need(type_of)] //~ ERROR no path -enum Enum { - Variant1 { - #[rustc_then_this_would_need(type_of)] //~ ERROR OK - t: TypeAlias - }, - Variant2(i32) -} - -#[rustc_then_this_would_need(type_of)] //~ ERROR no path -trait Trait { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - fn method(&self, _: TypeAlias); -} - -struct SomeType; - -#[rustc_then_this_would_need(type_of)] //~ ERROR no path -impl SomeType { - #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK - fn method(&self, _: TypeAlias) {} -} - -#[rustc_then_this_would_need(type_of)] //~ ERROR OK -type TypeAlias2 = TypeAlias; - -#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK -#[rustc_then_this_would_need(typeck)] //~ ERROR OK -fn function(_: TypeAlias) { - -} diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.stderr b/src/test/ui/dep-graph/dep-graph-type-alias.stderr deleted file mode 100644 index 42ac803b2..000000000 --- a/src/test/ui/dep-graph/dep-graph-type-alias.stderr +++ /dev/null @@ -1,74 +0,0 @@ -error: no path from `TypeAlias` to `type_of` - --> $DIR/dep-graph-type-alias.rs:18:1 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:20:5 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `TypeAlias` to `type_of` - --> $DIR/dep-graph-type-alias.rs:25:1 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:28:9 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `TypeAlias` to `type_of` - --> $DIR/dep-graph-type-alias.rs:34:1 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: no path from `TypeAlias` to `type_of` - --> $DIR/dep-graph-type-alias.rs:42:1 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:49:1 - | -LL | #[rustc_then_this_would_need(type_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:52:1 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:53:1 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:36:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:44:5 - | -LL | #[rustc_then_this_would_need(fn_sig)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: OK - --> $DIR/dep-graph-type-alias.rs:45:5 - | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 12 previous errors - diff --git a/src/test/ui/dep-graph/dep-graph-variance-alias.rs b/src/test/ui/dep-graph/dep-graph-variance-alias.rs deleted file mode 100644 index 008434696..000000000 --- a/src/test/ui/dep-graph/dep-graph-variance-alias.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Test that changing what a `type` points to does not go unnoticed -// by the variance analysis. - -// incremental -// compile-flags: -Z query-dep-graph - -#![feature(rustc_attrs)] -#![allow(dead_code)] -#![allow(unused_variables)] -fn main() {} - -#[rustc_if_this_changed] -struct Foo<T> { - f: T, -} - -type TypeAlias<T> = Foo<T>; - -#[rustc_then_this_would_need(variances_of)] //~ ERROR OK -struct Use<T> { - x: TypeAlias<T>, -} diff --git a/src/test/ui/dep-graph/dep-graph-variance-alias.stderr b/src/test/ui/dep-graph/dep-graph-variance-alias.stderr deleted file mode 100644 index 554ff455a..000000000 --- a/src/test/ui/dep-graph/dep-graph-variance-alias.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: OK - --> $DIR/dep-graph-variance-alias.rs:19:1 - | -LL | #[rustc_then_this_would_need(variances_of)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - |