From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/type/ascription/issue-34255-1.rs | 15 - src/test/ui/type/ascription/issue-34255-1.stderr | 41 -- src/test/ui/type/ascription/issue-47666.fixed | 4 - src/test/ui/type/ascription/issue-47666.rs | 4 - src/test/ui/type/ascription/issue-47666.stderr | 16 - src/test/ui/type/ascription/issue-54516.fixed | 7 - src/test/ui/type/ascription/issue-54516.rs | 7 - src/test/ui/type/ascription/issue-54516.stderr | 12 - src/test/ui/type/ascription/issue-60933.fixed | 5 - src/test/ui/type/ascription/issue-60933.rs | 5 - src/test/ui/type/ascription/issue-60933.stderr | 12 - src/test/ui/type/auxiliary/crate_a1.rs | 11 - src/test/ui/type/auxiliary/crate_a2.rs | 7 - src/test/ui/type/issue-100584.rs | 15 - src/test/ui/type/issue-100584.stderr | 44 -- src/test/ui/type/issue-101866.rs | 15 - src/test/ui/type/issue-101866.stderr | 18 - src/test/ui/type/issue-103271.rs | 18 - src/test/ui/type/issue-103271.stderr | 25 - ...ssue-67690-type-alias-bound-diagnostic-crash.rs | 8 - ...-67690-type-alias-bound-diagnostic-crash.stderr | 15 - src/test/ui/type/issue-91268.rs | 9 - src/test/ui/type/issue-91268.stderr | 63 -- src/test/ui/type/issue-94187-verbose-type-name.rs | 16 - src/test/ui/type/missing-let-in-binding.fixed | 5 - src/test/ui/type/missing-let-in-binding.rs | 5 - src/test/ui/type/missing-let-in-binding.stderr | 16 - src/test/ui/type/type-alias-bounds.rs | 59 -- src/test/ui/type/type-alias-bounds.stderr | 121 ---- src/test/ui/type/type-annotation-needed.rs | 10 - src/test/ui/type/type-annotation-needed.stderr | 20 - src/test/ui/type/type-arg-out-of-scope.rs | 5 - src/test/ui/type/type-arg-out-of-scope.stderr | 23 - .../type/type-ascription-instead-of-initializer.rs | 4 - .../type-ascription-instead-of-initializer.stderr | 28 - .../type-ascription-instead-of-statement-end.rs | 10 - ...type-ascription-instead-of-statement-end.stderr | 24 - src/test/ui/type/type-ascription-precedence.rs | 54 -- src/test/ui/type/type-ascription-precedence.stderr | 66 -- src/test/ui/type/type-ascription-soundness.rs | 13 - src/test/ui/type/type-ascription-soundness.stderr | 39 -- .../ui/type/type-ascription-with-fn-call.fixed | 9 - src/test/ui/type/type-ascription-with-fn-call.rs | 9 - .../ui/type/type-ascription-with-fn-call.stderr | 11 - src/test/ui/type/type-ascription.rs | 39 -- src/test/ui/type/type-check-defaults.rs | 27 - src/test/ui/type/type-check-defaults.stderr | 76 --- .../ui/type/type-check/assignment-expected-bool.rs | 34 - .../type-check/assignment-expected-bool.stderr | 141 ---- src/test/ui/type/type-check/assignment-in-if.rs | 62 -- .../ui/type/type-check/assignment-in-if.stderr | 126 ---- .../type/type-check/cannot_infer_local_or_array.rs | 3 - .../type-check/cannot_infer_local_or_array.stderr | 14 - .../type/type-check/cannot_infer_local_or_vec.rs | 4 - .../type-check/cannot_infer_local_or_vec.stderr | 14 - .../cannot_infer_local_or_vec_in_tuples.rs | 4 - .../cannot_infer_local_or_vec_in_tuples.stderr | 14 - src/test/ui/type/type-check/issue-22897.rs | 5 - src/test/ui/type/type-check/issue-22897.stderr | 9 - src/test/ui/type/type-check/issue-40294.rs | 13 - src/test/ui/type/type-check/issue-40294.stderr | 11 - src/test/ui/type/type-check/issue-41314.rs | 10 - src/test/ui/type/type-check/issue-41314.stderr | 14 - ...ssignment-match-prior-arm-bool-expected-unit.rs | 27 - ...nment-match-prior-arm-bool-expected-unit.stderr | 22 - ...8577-check-fn-with-more-than-65535-arguments.rs | 12 - ...-check-fn-with-more-than-65535-arguments.stderr | 13 - src/test/ui/type/type-check/missing_trait_impl.rs | 16 - .../ui/type/type-check/missing_trait_impl.stderr | 58 -- .../ui/type/type-check/unknown_type_for_closure.rs | 17 - .../type-check/unknown_type_for_closure.stderr | 37 - src/test/ui/type/type-dependent-def-issue-49241.rs | 6 - .../ui/type/type-dependent-def-issue-49241.stderr | 17 - src/test/ui/type/type-error-break-tail.rs | 8 - src/test/ui/type/type-error-break-tail.stderr | 15 - src/test/ui/type/type-mismatch-multiple.rs | 7 - src/test/ui/type/type-mismatch-multiple.stderr | 19 - src/test/ui/type/type-mismatch-same-crate-name.rs | 27 - .../ui/type/type-mismatch-same-crate-name.stderr | 46 -- src/test/ui/type/type-mismatch.rs | 78 --- src/test/ui/type/type-mismatch.stderr | 751 --------------------- ...pe-parameter-defaults-referencing-Self-ppaux.rs | 17 - ...arameter-defaults-referencing-Self-ppaux.stderr | 31 - .../type-parameter-defaults-referencing-Self.rs | 11 - ...type-parameter-defaults-referencing-Self.stderr | 14 - src/test/ui/type/type-parameter-names.rs | 12 - src/test/ui/type/type-parameter-names.stderr | 19 - .../ui/type/type-params-in-different-spaces-1.rs | 18 - .../type/type-params-in-different-spaces-1.stderr | 18 - .../ui/type/type-params-in-different-spaces-2.rs | 21 - .../type/type-params-in-different-spaces-2.stderr | 29 - .../ui/type/type-params-in-different-spaces-3.rs | 7 - .../type/type-params-in-different-spaces-3.stderr | 20 - src/test/ui/type/type-path-err-node-types.rs | 26 - src/test/ui/type/type-path-err-node-types.stderr | 39 -- src/test/ui/type/type-recursive-box-shadowed.rs | 12 - .../ui/type/type-recursive-box-shadowed.stderr | 17 - src/test/ui/type/type-recursive.rs | 30 - src/test/ui/type/type-recursive.stderr | 93 --- src/test/ui/type/type-shadow.rs | 8 - src/test/ui/type/type-shadow.stderr | 11 - src/test/ui/type/type-unsatisfiable.rs | 59 -- src/test/ui/type/type-unsatisfiable.usage.stderr | 11 - 103 files changed, 3242 deletions(-) delete mode 100644 src/test/ui/type/ascription/issue-34255-1.rs delete mode 100644 src/test/ui/type/ascription/issue-34255-1.stderr delete mode 100644 src/test/ui/type/ascription/issue-47666.fixed delete mode 100644 src/test/ui/type/ascription/issue-47666.rs delete mode 100644 src/test/ui/type/ascription/issue-47666.stderr delete mode 100644 src/test/ui/type/ascription/issue-54516.fixed delete mode 100644 src/test/ui/type/ascription/issue-54516.rs delete mode 100644 src/test/ui/type/ascription/issue-54516.stderr delete mode 100644 src/test/ui/type/ascription/issue-60933.fixed delete mode 100644 src/test/ui/type/ascription/issue-60933.rs delete mode 100644 src/test/ui/type/ascription/issue-60933.stderr delete mode 100644 src/test/ui/type/auxiliary/crate_a1.rs delete mode 100644 src/test/ui/type/auxiliary/crate_a2.rs delete mode 100644 src/test/ui/type/issue-100584.rs delete mode 100644 src/test/ui/type/issue-100584.stderr delete mode 100644 src/test/ui/type/issue-101866.rs delete mode 100644 src/test/ui/type/issue-101866.stderr delete mode 100644 src/test/ui/type/issue-103271.rs delete mode 100644 src/test/ui/type/issue-103271.stderr delete mode 100644 src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs delete mode 100644 src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr delete mode 100644 src/test/ui/type/issue-91268.rs delete mode 100644 src/test/ui/type/issue-91268.stderr delete mode 100644 src/test/ui/type/issue-94187-verbose-type-name.rs delete mode 100644 src/test/ui/type/missing-let-in-binding.fixed delete mode 100644 src/test/ui/type/missing-let-in-binding.rs delete mode 100644 src/test/ui/type/missing-let-in-binding.stderr delete mode 100644 src/test/ui/type/type-alias-bounds.rs delete mode 100644 src/test/ui/type/type-alias-bounds.stderr delete mode 100644 src/test/ui/type/type-annotation-needed.rs delete mode 100644 src/test/ui/type/type-annotation-needed.stderr delete mode 100644 src/test/ui/type/type-arg-out-of-scope.rs delete mode 100644 src/test/ui/type/type-arg-out-of-scope.stderr delete mode 100644 src/test/ui/type/type-ascription-instead-of-initializer.rs delete mode 100644 src/test/ui/type/type-ascription-instead-of-initializer.stderr delete mode 100644 src/test/ui/type/type-ascription-instead-of-statement-end.rs delete mode 100644 src/test/ui/type/type-ascription-instead-of-statement-end.stderr delete mode 100644 src/test/ui/type/type-ascription-precedence.rs delete mode 100644 src/test/ui/type/type-ascription-precedence.stderr delete mode 100644 src/test/ui/type/type-ascription-soundness.rs delete mode 100644 src/test/ui/type/type-ascription-soundness.stderr delete mode 100644 src/test/ui/type/type-ascription-with-fn-call.fixed delete mode 100644 src/test/ui/type/type-ascription-with-fn-call.rs delete mode 100644 src/test/ui/type/type-ascription-with-fn-call.stderr delete mode 100644 src/test/ui/type/type-ascription.rs delete mode 100644 src/test/ui/type/type-check-defaults.rs delete mode 100644 src/test/ui/type/type-check-defaults.stderr delete mode 100644 src/test/ui/type/type-check/assignment-expected-bool.rs delete mode 100644 src/test/ui/type/type-check/assignment-expected-bool.stderr delete mode 100644 src/test/ui/type/type-check/assignment-in-if.rs delete mode 100644 src/test/ui/type/type-check/assignment-in-if.stderr delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_array.rs delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_array.stderr delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_vec.rs delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs delete mode 100644 src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr delete mode 100644 src/test/ui/type/type-check/issue-22897.rs delete mode 100644 src/test/ui/type/type-check/issue-22897.stderr delete mode 100644 src/test/ui/type/type-check/issue-40294.rs delete mode 100644 src/test/ui/type/type-check/issue-40294.stderr delete mode 100644 src/test/ui/type/type-check/issue-41314.rs delete mode 100644 src/test/ui/type/type-check/issue-41314.stderr delete mode 100644 src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs delete mode 100644 src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr delete mode 100644 src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.rs delete mode 100644 src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr delete mode 100644 src/test/ui/type/type-check/missing_trait_impl.rs delete mode 100644 src/test/ui/type/type-check/missing_trait_impl.stderr delete mode 100644 src/test/ui/type/type-check/unknown_type_for_closure.rs delete mode 100644 src/test/ui/type/type-check/unknown_type_for_closure.stderr delete mode 100644 src/test/ui/type/type-dependent-def-issue-49241.rs delete mode 100644 src/test/ui/type/type-dependent-def-issue-49241.stderr delete mode 100644 src/test/ui/type/type-error-break-tail.rs delete mode 100644 src/test/ui/type/type-error-break-tail.stderr delete mode 100644 src/test/ui/type/type-mismatch-multiple.rs delete mode 100644 src/test/ui/type/type-mismatch-multiple.stderr delete mode 100644 src/test/ui/type/type-mismatch-same-crate-name.rs delete mode 100644 src/test/ui/type/type-mismatch-same-crate-name.stderr delete mode 100644 src/test/ui/type/type-mismatch.rs delete mode 100644 src/test/ui/type/type-mismatch.stderr delete mode 100644 src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs delete mode 100644 src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr delete mode 100644 src/test/ui/type/type-parameter-defaults-referencing-Self.rs delete mode 100644 src/test/ui/type/type-parameter-defaults-referencing-Self.stderr delete mode 100644 src/test/ui/type/type-parameter-names.rs delete mode 100644 src/test/ui/type/type-parameter-names.stderr delete mode 100644 src/test/ui/type/type-params-in-different-spaces-1.rs delete mode 100644 src/test/ui/type/type-params-in-different-spaces-1.stderr delete mode 100644 src/test/ui/type/type-params-in-different-spaces-2.rs delete mode 100644 src/test/ui/type/type-params-in-different-spaces-2.stderr delete mode 100644 src/test/ui/type/type-params-in-different-spaces-3.rs delete mode 100644 src/test/ui/type/type-params-in-different-spaces-3.stderr delete mode 100644 src/test/ui/type/type-path-err-node-types.rs delete mode 100644 src/test/ui/type/type-path-err-node-types.stderr delete mode 100644 src/test/ui/type/type-recursive-box-shadowed.rs delete mode 100644 src/test/ui/type/type-recursive-box-shadowed.stderr delete mode 100644 src/test/ui/type/type-recursive.rs delete mode 100644 src/test/ui/type/type-recursive.stderr delete mode 100644 src/test/ui/type/type-shadow.rs delete mode 100644 src/test/ui/type/type-shadow.stderr delete mode 100644 src/test/ui/type/type-unsatisfiable.rs delete mode 100644 src/test/ui/type/type-unsatisfiable.usage.stderr (limited to 'src/test/ui/type') diff --git a/src/test/ui/type/ascription/issue-34255-1.rs b/src/test/ui/type/ascription/issue-34255-1.rs deleted file mode 100644 index 44b47cc4e..000000000 --- a/src/test/ui/type/ascription/issue-34255-1.rs +++ /dev/null @@ -1,15 +0,0 @@ -struct Reactor { - input_cells: Vec, -} - -impl Reactor { - pub fn new() -> Self { - input_cells: Vec::new() - //~^ ERROR cannot find value `input_cells` in this scope - //~| ERROR parenthesized type parameters may only be used with a `Fn` trait - //~| ERROR missing generics for struct `Vec` - } -} - -// This case isn't currently being handled gracefully, including for completeness. -fn main() {} diff --git a/src/test/ui/type/ascription/issue-34255-1.stderr b/src/test/ui/type/ascription/issue-34255-1.stderr deleted file mode 100644 index 6819d14bb..000000000 --- a/src/test/ui/type/ascription/issue-34255-1.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0425]: cannot find value `input_cells` in this scope - --> $DIR/issue-34255-1.rs:7:9 - | -LL | input_cells: Vec::new() - | ^^^^^^^^^^^ a field by this name exists in `Self` - | -help: you might have meant to write a `struct` literal - | -LL ~ pub fn new() -> Self { SomeStruct { -LL | input_cells: Vec::new() - ... -LL | -LL ~ }} - | - -error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-34255-1.rs:7:27 - | -LL | input_cells: Vec::new() - | ^^^^^ only `Fn` traits may use parentheses - -error[E0107]: missing generics for struct `Vec` - --> $DIR/issue-34255-1.rs:7:22 - | -LL | input_cells: Vec::new() - | ^^^ expected at least 1 generic argument - | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^^^ - -help: add missing generic argument - | -LL | input_cells: Vec::new() - | ~~~~~~ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0107, E0214, E0425. -For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/type/ascription/issue-47666.fixed b/src/test/ui/type/ascription/issue-47666.fixed deleted file mode 100644 index c4db74755..000000000 --- a/src/test/ui/type/ascription/issue-47666.fixed +++ /dev/null @@ -1,4 +0,0 @@ -// run-rustfix -fn main() { - let _ = Option::Some(vec![0, 1]); //~ ERROR expected type, found -} diff --git a/src/test/ui/type/ascription/issue-47666.rs b/src/test/ui/type/ascription/issue-47666.rs deleted file mode 100644 index c67202e21..000000000 --- a/src/test/ui/type/ascription/issue-47666.rs +++ /dev/null @@ -1,4 +0,0 @@ -// run-rustfix -fn main() { - let _ = Option:Some(vec![0, 1]); //~ ERROR expected type, found -} diff --git a/src/test/ui/type/ascription/issue-47666.stderr b/src/test/ui/type/ascription/issue-47666.stderr deleted file mode 100644 index 0f90fce3a..000000000 --- a/src/test/ui/type/ascription/issue-47666.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: expected type, found `<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([0, 1]))` - --> $DIR/issue-47666.rs:3:25 - | -LL | let _ = Option:Some(vec![0, 1]); - | - ^^^^^^^^^^ - | | | - | | expected type - | | in this macro invocation - | | this macro call doesn't expand to a type - | help: maybe write a path separator here: `::` - | - = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` - = note: this error originates in the macro `$crate::__rust_force_expr` which comes from the expansion of the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/type/ascription/issue-54516.fixed b/src/test/ui/type/ascription/issue-54516.fixed deleted file mode 100644 index f78268894..000000000 --- a/src/test/ui/type/ascription/issue-54516.fixed +++ /dev/null @@ -1,7 +0,0 @@ -// run-rustfix -use std::collections::BTreeMap; - -fn main() { - println!("{}", std::mem::size_of::>()); - //~^ ERROR type ascription cannot be followed by a function call -} diff --git a/src/test/ui/type/ascription/issue-54516.rs b/src/test/ui/type/ascription/issue-54516.rs deleted file mode 100644 index 1f34e6943..000000000 --- a/src/test/ui/type/ascription/issue-54516.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-rustfix -use std::collections::BTreeMap; - -fn main() { - println!("{}", std::mem:size_of::>()); - //~^ ERROR type ascription cannot be followed by a function call -} diff --git a/src/test/ui/type/ascription/issue-54516.stderr b/src/test/ui/type/ascription/issue-54516.stderr deleted file mode 100644 index 1ab9093e5..000000000 --- a/src/test/ui/type/ascription/issue-54516.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error: type ascription cannot be followed by a function call - --> $DIR/issue-54516.rs:5:20 - | -LL | println!("{}", std::mem:size_of::>()); - | ^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | help: maybe write a path separator here: `::` - | - = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` - -error: aborting due to previous error - diff --git a/src/test/ui/type/ascription/issue-60933.fixed b/src/test/ui/type/ascription/issue-60933.fixed deleted file mode 100644 index 3e8be3875..000000000 --- a/src/test/ui/type/ascription/issue-60933.fixed +++ /dev/null @@ -1,5 +0,0 @@ -// run-rustfix -fn main() { - let _: usize = std::mem::size_of::(); - //~^ ERROR type ascription cannot be followed by a function call -} diff --git a/src/test/ui/type/ascription/issue-60933.rs b/src/test/ui/type/ascription/issue-60933.rs deleted file mode 100644 index 2a4ad7bdc..000000000 --- a/src/test/ui/type/ascription/issue-60933.rs +++ /dev/null @@ -1,5 +0,0 @@ -// run-rustfix -fn main() { - let _: usize = std::mem:size_of::(); - //~^ ERROR type ascription cannot be followed by a function call -} diff --git a/src/test/ui/type/ascription/issue-60933.stderr b/src/test/ui/type/ascription/issue-60933.stderr deleted file mode 100644 index 0b7f8edf6..000000000 --- a/src/test/ui/type/ascription/issue-60933.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error: type ascription cannot be followed by a function call - --> $DIR/issue-60933.rs:3:20 - | -LL | let _: usize = std::mem:size_of::(); - | ^^^^^^^^-^^^^^^^^^^^^^^ - | | - | help: maybe write a path separator here: `::` - | - = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` - -error: aborting due to previous error - diff --git a/src/test/ui/type/auxiliary/crate_a1.rs b/src/test/ui/type/auxiliary/crate_a1.rs deleted file mode 100644 index e2e185005..000000000 --- a/src/test/ui/type/auxiliary/crate_a1.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub struct Foo; - -pub trait Bar{} - -pub fn bar() -> Box { - unimplemented!() -} - - -pub fn try_foo(x: Foo){} -pub fn try_bar(x: Box){} diff --git a/src/test/ui/type/auxiliary/crate_a2.rs b/src/test/ui/type/auxiliary/crate_a2.rs deleted file mode 100644 index d16a4ac10..000000000 --- a/src/test/ui/type/auxiliary/crate_a2.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub struct Foo; - -pub trait Bar{} - -pub fn bar() -> Box { - unimplemented!() -} diff --git a/src/test/ui/type/issue-100584.rs b/src/test/ui/type/issue-100584.rs deleted file mode 100644 index 102846563..000000000 --- a/src/test/ui/type/issue-100584.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![deny(unused)] -fn foo(xyza: &str) { -//~^ ERROR unused variable: `xyza` - let _ = "{xyza}"; -} - -fn foo3(xyza: &str) { -//~^ ERROR unused variable: `xyza` - let _ = "aaa{xyza}bbb"; -} - -fn main() { - foo("x"); - foo3("xx"); -} diff --git a/src/test/ui/type/issue-100584.stderr b/src/test/ui/type/issue-100584.stderr deleted file mode 100644 index e1db14d1f..000000000 --- a/src/test/ui/type/issue-100584.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error: unused variable: `xyza` - --> $DIR/issue-100584.rs:2:8 - | -LL | fn foo(xyza: &str) { - | ^^^^ unused variable -LL | -LL | let _ = "{xyza}"; - | -------- you might have meant to use string interpolation in this string literal - | -note: the lint level is defined here - --> $DIR/issue-100584.rs:1:9 - | -LL | #![deny(unused)] - | ^^^^^^ - = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` -help: string interpolation only works in `format!` invocations - | -LL | let _ = format!("{xyza}"); - | ++++++++ + -help: if this is intentional, prefix it with an underscore - | -LL | fn foo(_xyza: &str) { - | ~~~~~ - -error: unused variable: `xyza` - --> $DIR/issue-100584.rs:7:9 - | -LL | fn foo3(xyza: &str) { - | ^^^^ unused variable -LL | -LL | let _ = "aaa{xyza}bbb"; - | -------------- you might have meant to use string interpolation in this string literal - | -help: string interpolation only works in `format!` invocations - | -LL | let _ = format!("aaa{xyza}bbb"); - | ++++++++ + -help: if this is intentional, prefix it with an underscore - | -LL | fn foo3(_xyza: &str) { - | ~~~~~ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/type/issue-101866.rs b/src/test/ui/type/issue-101866.rs deleted file mode 100644 index d332c4adb..000000000 --- a/src/test/ui/type/issue-101866.rs +++ /dev/null @@ -1,15 +0,0 @@ -trait TraitA { - fn func(); -} - -struct StructA {} - -impl TraitA for StructA { - fn func() {} -} - -fn main() { - TraitA::::func(); - //~^ ERROR: cannot call associated function on trait without specifying the corresponding `impl` type [E0790] - //~| help: use the fully-qualified path to the only available implementation -} diff --git a/src/test/ui/type/issue-101866.stderr b/src/test/ui/type/issue-101866.stderr deleted file mode 100644 index fe9982119..000000000 --- a/src/test/ui/type/issue-101866.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type - --> $DIR/issue-101866.rs:12:5 - | -LL | fn func(); - | ---------- `TraitA::func` defined here -... -LL | TraitA::::func(); - | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait - | -help: use the fully-qualified path to the only available implementation - | -LL - TraitA::::func(); -LL + >::func(); - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0790`. diff --git a/src/test/ui/type/issue-103271.rs b/src/test/ui/type/issue-103271.rs deleted file mode 100644 index 7cd76286a..000000000 --- a/src/test/ui/type/issue-103271.rs +++ /dev/null @@ -1,18 +0,0 @@ -fn main() { - let iter_fun = <&[u32]>::iter; - //~^ ERROR no function or associated item named `iter` found for reference `&[u32]` in the current scope [E0599] - //~| function or associated item not found in `&[u32]` - //~| HELP the function `iter` is implemented on `[u32]` - for item in iter_fun(&[1,1]) { - let x: &u32 = item; - assert_eq!(x, &1); - } - let iter_fun2 = <(&[u32])>::iter; - //~^ no function or associated item named `iter` found for reference `&[u32]` in the current scope [E0599] - //~| function or associated item not found in `&[u32]` - //~| HELP the function `iter` is implemented on `[u32]` - for item2 in iter_fun2(&[1,1]) { - let x: &u32 = item2; - assert_eq!(x, &1); - } -} diff --git a/src/test/ui/type/issue-103271.stderr b/src/test/ui/type/issue-103271.stderr deleted file mode 100644 index f4dac51b2..000000000 --- a/src/test/ui/type/issue-103271.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0599]: no function or associated item named `iter` found for reference `&[u32]` in the current scope - --> $DIR/issue-103271.rs:2:30 - | -LL | let iter_fun = <&[u32]>::iter; - | ^^^^ function or associated item not found in `&[u32]` - | -help: the function `iter` is implemented on `[u32]` - | -LL | let iter_fun = <[u32]>::iter; - | ~~~~~ - -error[E0599]: no function or associated item named `iter` found for reference `&[u32]` in the current scope - --> $DIR/issue-103271.rs:10:33 - | -LL | let iter_fun2 = <(&[u32])>::iter; - | ^^^^ function or associated item not found in `&[u32]` - | -help: the function `iter` is implemented on `[u32]` - | -LL | let iter_fun2 = <([u32])>::iter; - | ~~~~~ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs deleted file mode 100644 index 68aadcf60..000000000 --- a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Regression test for issue #67690 -// Rustc endless loop out-of-memory and consequent SIGKILL in generic new type - -// check-pass -pub type T = P; -//~^ WARN bounds on generic parameters are not enforced in type aliases - -fn main() {} diff --git a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr deleted file mode 100644 index 125ffbbb4..000000000 --- a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/issue-67690-type-alias-bound-diagnostic-crash.rs:5:15 - | -LL | pub type T = P; - | ^^^^ ^^^^ ^^^^ - | - = note: `#[warn(type_alias_bounds)]` on by default -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - pub type T = P; -LL + pub type T

= P; - | - -warning: 1 warning emitted - diff --git a/src/test/ui/type/issue-91268.rs b/src/test/ui/type/issue-91268.rs deleted file mode 100644 index f1e16bc7b..000000000 --- a/src/test/ui/type/issue-91268.rs +++ /dev/null @@ -1,9 +0,0 @@ -// error-pattern: this file contains an unclosed delimiter -// error-pattern: cannot find type `ţ` in this scope -// error-pattern: parenthesized type parameters may only be used with a `Fn` trait -// error-pattern: type arguments are not allowed on builtin type `u8` -// error-pattern: mismatched types -// ignore-tidy-trailing-newlines -// `ţ` must be the last character in this file, it cannot be followed by a newline -fn main() { - 0: u8(ţ \ No newline at end of file diff --git a/src/test/ui/type/issue-91268.stderr b/src/test/ui/type/issue-91268.stderr deleted file mode 100644 index 6c9ee9945..000000000 --- a/src/test/ui/type/issue-91268.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error: this file contains an unclosed delimiter - --> $DIR/issue-91268.rs:9:12 - | -LL | fn main() { - | - unclosed delimiter -LL | 0: u8(ţ - | - ^ - | | - | unclosed delimiter - -error: this file contains an unclosed delimiter - --> $DIR/issue-91268.rs:9:12 - | -LL | fn main() { - | - unclosed delimiter -LL | 0: u8(ţ - | - ^ - | | - | unclosed delimiter - -error[E0412]: cannot find type `ţ` in this scope - --> $DIR/issue-91268.rs:9:11 - | -LL | 0: u8(ţ - | ^ expecting a type here because of type ascription - -error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-91268.rs:9:8 - | -LL | 0: u8(ţ - | ^^^^ only `Fn` traits may use parentheses - | -help: use angle brackets instead - | -LL | 0: u8<ţ> - | ~ + - -error[E0109]: type arguments are not allowed on builtin type `u8` - --> $DIR/issue-91268.rs:9:11 - | -LL | 0: u8(ţ - | -- ^ type argument not allowed - | | - | not allowed on builtin type `u8` - | -help: primitive type `u8` doesn't have generic parameters - | -LL - 0: u8(ţ -LL + 0: u8 - | - -error[E0308]: mismatched types - --> $DIR/issue-91268.rs:9:5 - | -LL | fn main() { - | - expected `()` because of default return type -LL | 0: u8(ţ - | ^^^^^^^ expected `()`, found `u8` - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0109, E0214, E0308, E0412. -For more information about an error, try `rustc --explain E0109`. diff --git a/src/test/ui/type/issue-94187-verbose-type-name.rs b/src/test/ui/type/issue-94187-verbose-type-name.rs deleted file mode 100644 index 3713a32eb..000000000 --- a/src/test/ui/type/issue-94187-verbose-type-name.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Check to insure that the output of `std::any::type_name` does not change based on `-Zverbose` -// run-pass -// edition: 2018 -// revisions: normal verbose -// [verbose]compile-flags:-Zverbose - -use std::any::type_name; - -fn main() { - assert_eq!(type_name::<[u32; 0]>(), "[u32; 0]"); - - struct Wrapper; - assert_eq!(type_name::>(), "issue_94187_verbose_type_name::main::Wrapper<0>"); - - assert_eq!(type_name:: u32>(), "dyn core::ops::function::Fn(u32) -> u32"); -} diff --git a/src/test/ui/type/missing-let-in-binding.fixed b/src/test/ui/type/missing-let-in-binding.fixed deleted file mode 100644 index d17876889..000000000 --- a/src/test/ui/type/missing-let-in-binding.fixed +++ /dev/null @@ -1,5 +0,0 @@ -// run-rustfix -fn main() { - let mut _foo: i32 = 1; - let _foo: i32 = 4; //~ ERROR type ascription is experimental -} diff --git a/src/test/ui/type/missing-let-in-binding.rs b/src/test/ui/type/missing-let-in-binding.rs deleted file mode 100644 index ca42f2e6e..000000000 --- a/src/test/ui/type/missing-let-in-binding.rs +++ /dev/null @@ -1,5 +0,0 @@ -// run-rustfix -fn main() { - let mut _foo: i32 = 1; - _foo: i32 = 4; //~ ERROR type ascription is experimental -} diff --git a/src/test/ui/type/missing-let-in-binding.stderr b/src/test/ui/type/missing-let-in-binding.stderr deleted file mode 100644 index 12759c509..000000000 --- a/src/test/ui/type/missing-let-in-binding.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0658]: type ascription is experimental - --> $DIR/missing-let-in-binding.rs:4:5 - | -LL | _foo: i32 = 4; - | ^^^^^^^^^ - | - = note: see issue #23416 for more information - = help: add `#![feature(type_ascription)]` to the crate attributes to enable -help: you might have meant to introduce a new binding - | -LL | let _foo: i32 = 4; - | +++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/type/type-alias-bounds.rs b/src/test/ui/type/type-alias-bounds.rs deleted file mode 100644 index e49731725..000000000 --- a/src/test/ui/type/type-alias-bounds.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Test `ignored_generic_bounds` lint warning about bounds in type aliases. - -// check-pass -#![allow(dead_code)] - -use std::rc::Rc; - -type SVec = Vec; -//~^ WARN bounds on generic parameters are not enforced in type aliases [type_alias_bounds] -type S2Vec where T: Send = Vec; -//~^ WARN where clauses are not enforced in type aliases [type_alias_bounds] -type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>); -//~^ WARN bounds on generic parameters are not enforced in type aliases [type_alias_bounds] -type WVec<'b, T: 'b + 'b> = (&'b u32, Vec); -//~^ WARN bounds on generic parameters are not enforced in type aliases [type_alias_bounds] -type W2Vec<'b, T> where T: 'b, T: 'b = (&'b u32, Vec); -//~^ WARN where clauses are not enforced in type aliases [type_alias_bounds] - -static STATIC: u32 = 0; - -fn foo<'a>(y: &'a i32) { - // If any of the bounds above would matter, the code below would be rejected. - // This can be seen when replacing the type aliases above by newtype structs. - // (The type aliases have no unused parameters to make that a valid transformation.) - let mut x: SVec<_> = Vec::new(); - x.push(Rc::new(42)); // is not send - - let mut x: S2Vec<_> = Vec::new(); - x.push(Rc::new(42)); // is not `Send` - - let mut x: VVec<'static, 'a> = (&STATIC, Vec::new()); - x.1.push(y); // `'a: 'static` does not hold - - let mut x: WVec<'static, &'a i32> = (&STATIC, Vec::new()); - x.1.push(y); // `&'a i32: 'static` does not hold - - let mut x: W2Vec<'static, &'a i32> = (&STATIC, Vec::new()); - x.1.push(y); // `&'a i32: 'static` does not hold -} - -// Bounds are not checked either; i.e., the definition is not necessarily well-formed. -struct Sendable(T); -type MySendable = Sendable; // no error here! - -// However, bounds *are* taken into account when accessing associated types -trait Bound { type Assoc; } -type T1 = U::Assoc; //~ WARN not enforced in type aliases -type T2 where U: Bound = U::Assoc; //~ WARN not enforced in type aliases - -// This errors: -// `type T3 = U::Assoc;` -// Do this instead: -type T4 = ::Assoc; - -// Make sure the help about associated types is not shown incorrectly -type T5 = ::Assoc; //~ WARN not enforced in type aliases -type T6 = ::std::vec::Vec; //~ WARN not enforced in type aliases - -fn main() {} diff --git a/src/test/ui/type/type-alias-bounds.stderr b/src/test/ui/type/type-alias-bounds.stderr deleted file mode 100644 index 92e573393..000000000 --- a/src/test/ui/type/type-alias-bounds.stderr +++ /dev/null @@ -1,121 +0,0 @@ -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:8:14 - | -LL | type SVec = Vec; - | ^^^^ ^^^^ - | - = note: `#[warn(type_alias_bounds)]` on by default -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type SVec = Vec; -LL + type SVec = Vec; - | - -warning: where clauses are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:10:21 - | -LL | type S2Vec where T: Send = Vec; - | ^^^^^^^ - | -help: the clause will not be checked when the type alias is used, and should be removed - | -LL - type S2Vec where T: Send = Vec; -LL + type S2Vec = Vec; - | - -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:12:19 - | -LL | type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>); - | ^^ ^^ - | -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>); -LL + type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>); - | - -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:14:18 - | -LL | type WVec<'b, T: 'b + 'b> = (&'b u32, Vec); - | ^^ ^^ - | -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type WVec<'b, T: 'b + 'b> = (&'b u32, Vec); -LL + type WVec<'b, T> = (&'b u32, Vec); - | - -warning: where clauses are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:16:25 - | -LL | type W2Vec<'b, T> where T: 'b, T: 'b = (&'b u32, Vec); - | ^^^^^ ^^^^^ - | -help: the clause will not be checked when the type alias is used, and should be removed - | -LL - type W2Vec<'b, T> where T: 'b, T: 'b = (&'b u32, Vec); -LL + type W2Vec<'b, T> = (&'b u32, Vec); - | - -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:47:12 - | -LL | type T1 = U::Assoc; - | ^^^^^ - | -help: use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases - --> $DIR/type-alias-bounds.rs:47:21 - | -LL | type T1 = U::Assoc; - | ^^^^^^^^ -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type T1 = U::Assoc; -LL + type T1 = U::Assoc; - | - -warning: where clauses are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:48:18 - | -LL | type T2 where U: Bound = U::Assoc; - | ^^^^^^^^ - | -help: use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases - --> $DIR/type-alias-bounds.rs:48:29 - | -LL | type T2 where U: Bound = U::Assoc; - | ^^^^^^^^ -help: the clause will not be checked when the type alias is used, and should be removed - | -LL - type T2 where U: Bound = U::Assoc; -LL + type T2 = U::Assoc; - | - -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:56:12 - | -LL | type T5 = ::Assoc; - | ^^^^^ - | -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type T5 = ::Assoc; -LL + type T5 = ::Assoc; - | - -warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias-bounds.rs:57:12 - | -LL | type T6 = ::std::vec::Vec; - | ^^^^^ - | -help: the bound will not be checked when the type alias is used, and should be removed - | -LL - type T6 = ::std::vec::Vec; -LL + type T6 = ::std::vec::Vec; - | - -warning: 9 warnings emitted - diff --git a/src/test/ui/type/type-annotation-needed.rs b/src/test/ui/type/type-annotation-needed.rs deleted file mode 100644 index 347887f4b..000000000 --- a/src/test/ui/type/type-annotation-needed.rs +++ /dev/null @@ -1,10 +0,0 @@ -fn foo>(x: i32) {} -//~^ NOTE required by -//~| NOTE required by - -fn main() { - foo(42); - //~^ ERROR type annotations needed - //~| NOTE cannot infer type - //~| NOTE cannot satisfy -} diff --git a/src/test/ui/type/type-annotation-needed.stderr b/src/test/ui/type/type-annotation-needed.stderr deleted file mode 100644 index 4af4c22f7..000000000 --- a/src/test/ui/type/type-annotation-needed.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0283]: type annotations needed - --> $DIR/type-annotation-needed.rs:6:5 - | -LL | foo(42); - | ^^^ cannot infer type of the type parameter `T` declared on the function `foo` - | - = note: cannot satisfy `_: Into` -note: required by a bound in `foo` - --> $DIR/type-annotation-needed.rs:1:11 - | -LL | fn foo>(x: i32) {} - | ^^^^^^^^^^^^ required by this bound in `foo` -help: consider specifying the type argument in the function call - | -LL | foo::(42); - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/type/type-arg-out-of-scope.rs b/src/test/ui/type/type-arg-out-of-scope.rs deleted file mode 100644 index 02aad0077..000000000 --- a/src/test/ui/type/type-arg-out-of-scope.rs +++ /dev/null @@ -1,5 +0,0 @@ -// error-pattern:can't use generic parameters from outer function -fn foo(x: T) { - fn bar(f: Box T>) { } -} -fn main() { foo(1); } diff --git a/src/test/ui/type/type-arg-out-of-scope.stderr b/src/test/ui/type/type-arg-out-of-scope.stderr deleted file mode 100644 index 7f18b4510..000000000 --- a/src/test/ui/type/type-arg-out-of-scope.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/type-arg-out-of-scope.rs:3:29 - | -LL | fn foo(x: T) { - | - type parameter from outer function -LL | fn bar(f: Box T>) { } - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `` - -error[E0401]: can't use generic parameters from outer function - --> $DIR/type-arg-out-of-scope.rs:3:35 - | -LL | fn foo(x: T) { - | - type parameter from outer function -LL | fn bar(f: Box T>) { } - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.rs b/src/test/ui/type/type-ascription-instead-of-initializer.rs deleted file mode 100644 index 9f9b6f06b..000000000 --- a/src/test/ui/type/type-ascription-instead-of-initializer.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let x: Vec::with_capacity(10, 20); //~ ERROR expected type, found `10` - //~^ ERROR this function takes 1 argument -} diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr deleted file mode 100644 index de578ca93..000000000 --- a/src/test/ui/type/type-ascription-instead-of-initializer.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error: expected type, found `10` - --> $DIR/type-ascription-instead-of-initializer.rs:2:31 - | -LL | let x: Vec::with_capacity(10, 20); - | -- ^^ expected type - | || - | |help: use `=` if you meant to assign - | while parsing the type for `x` - -error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/type-ascription-instead-of-initializer.rs:2:12 - | -LL | let x: Vec::with_capacity(10, 20); - | ^^^^^^^^^^^^^^^^^^ -- argument of type `{integer}` unexpected - | -note: associated function defined here - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub fn with_capacity(capacity: usize) -> Self { - | ^^^^^^^^^^^^^ -help: remove the extra argument - | -LL | let x: Vec::with_capacity(10); - | ~~~~ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/type/type-ascription-instead-of-statement-end.rs b/src/test/ui/type/type-ascription-instead-of-statement-end.rs deleted file mode 100644 index 1d5565ab5..000000000 --- a/src/test/ui/type/type-ascription-instead-of-statement-end.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(type_ascription)] - -fn main() { - println!("test"): - 0; //~ ERROR expected type, found `0` -} - -fn foo() { - println!("test"): 0; //~ ERROR expected type, found `0` -} diff --git a/src/test/ui/type/type-ascription-instead-of-statement-end.stderr b/src/test/ui/type/type-ascription-instead-of-statement-end.stderr deleted file mode 100644 index 521ebcdf1..000000000 --- a/src/test/ui/type/type-ascription-instead-of-statement-end.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error: expected type, found `0` - --> $DIR/type-ascription-instead-of-statement-end.rs:5:5 - | -LL | println!("test"): - | - help: try using a semicolon: `;` -LL | 0; - | ^ expected type - | - = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` - = note: see issue #23416 for more information - -error: expected type, found `0` - --> $DIR/type-ascription-instead-of-statement-end.rs:9:23 - | -LL | println!("test"): 0; - | - ^ expected type - | | - | tried to parse a type due to this type ascription - | - = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` - = note: see issue #23416 for more information - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/type/type-ascription-precedence.rs b/src/test/ui/type/type-ascription-precedence.rs deleted file mode 100644 index d3aef929b..000000000 --- a/src/test/ui/type/type-ascription-precedence.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Operator precedence of type ascription -// Type ascription has very high precedence, the same as operator `as` - -#![feature(type_ascription)] - -use std::ops::*; - -struct S; -struct Z; - -impl Add for S { - type Output = S; - fn add(self, _rhs: Z) -> S { panic!() } -} -impl Mul for S { - type Output = S; - fn mul(self, _rhs: Z) -> S { panic!() } -} -impl Neg for S { - type Output = Z; - fn neg(self) -> Z { panic!() } -} -impl Deref for S { - type Target = Z; - fn deref(&self) -> &Z { panic!() } -} - -fn main() { - &S: &S; // OK - (&S): &S; // OK - &(S: &S); //~ ERROR mismatched types - - *S: Z; // OK - (*S): Z; // OK - *(S: Z); //~ ERROR mismatched types - //~^ ERROR type `Z` cannot be dereferenced - - -S: Z; // OK - (-S): Z; // OK - -(S: Z); //~ ERROR mismatched types - //~^ ERROR cannot apply unary operator `-` to type `Z` - - S + Z: Z; // OK - S + (Z: Z); // OK - (S + Z): Z; //~ ERROR mismatched types - - S * Z: Z; // OK - S * (Z: Z); // OK - (S * Z): Z; //~ ERROR mismatched types - - S .. S: S; // OK - S .. (S: S); // OK - (S .. S): S; //~ ERROR mismatched types -} diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr deleted file mode 100644 index a8139063d..000000000 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ /dev/null @@ -1,66 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:31:7 - | -LL | &(S: &S); - | ^ expected `&S`, found struct `S` - -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:35:7 - | -LL | *(S: Z); - | ^ expected struct `Z`, found struct `S` - -error[E0614]: type `Z` cannot be dereferenced - --> $DIR/type-ascription-precedence.rs:35:5 - | -LL | *(S: Z); - | ^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:40:7 - | -LL | -(S: Z); - | ^ expected struct `Z`, found struct `S` - -error[E0600]: cannot apply unary operator `-` to type `Z` - --> $DIR/type-ascription-precedence.rs:40:5 - | -LL | -(S: Z); - | ^^^^^^^ cannot apply unary operator `-` - | -note: an implementation of `std::ops::Neg` might be missing for `Z` - --> $DIR/type-ascription-precedence.rs:9:1 - | -LL | struct Z; - | ^^^^^^^^ must implement `std::ops::Neg` -note: the following trait must be implemented - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Neg { - | ^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:45:5 - | -LL | (S + Z): Z; - | ^^^^^^^ expected struct `Z`, found struct `S` - -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:49:5 - | -LL | (S * Z): Z; - | ^^^^^^^ expected struct `Z`, found struct `S` - -error[E0308]: mismatched types - --> $DIR/type-ascription-precedence.rs:53:5 - | -LL | (S .. S): S; - | ^^^^^^^^ expected struct `S`, found struct `std::ops::Range` - | - = note: expected struct `S` - found struct `std::ops::Range` - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0308, E0600, E0614. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-ascription-soundness.rs b/src/test/ui/type/type-ascription-soundness.rs deleted file mode 100644 index 08316cdcd..000000000 --- a/src/test/ui/type/type-ascription-soundness.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Type ascription doesn't lead to unsoundness - -#![feature(type_ascription)] - -fn main() { - let arr = &[1u8, 2, 3]; - let ref x = type_ascribe!(arr, &[u8]); //~ ERROR mismatched types - let ref mut x = type_ascribe!(arr, &[u8]); //~ ERROR mismatched types - match type_ascribe!(arr, &[u8]) { //~ ERROR mismatched types - ref x => {} - } - let _len = type_ascribe!(arr, &[u8]).len(); //~ ERROR mismatched types -} diff --git a/src/test/ui/type/type-ascription-soundness.stderr b/src/test/ui/type/type-ascription-soundness.stderr deleted file mode 100644 index 522d5b2e3..000000000 --- a/src/test/ui/type/type-ascription-soundness.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-ascription-soundness.rs:7:31 - | -LL | let ref x = type_ascribe!(arr, &[u8]); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` - | - = note: expected reference `&[u8]` - found reference `&[u8; 3]` - -error[E0308]: mismatched types - --> $DIR/type-ascription-soundness.rs:8:35 - | -LL | let ref mut x = type_ascribe!(arr, &[u8]); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` - | - = note: expected reference `&[u8]` - found reference `&[u8; 3]` - -error[E0308]: mismatched types - --> $DIR/type-ascription-soundness.rs:9:25 - | -LL | match type_ascribe!(arr, &[u8]) { - | ^^^ expected slice `[u8]`, found array `[u8; 3]` - | - = note: expected reference `&[u8]` - found reference `&[u8; 3]` - -error[E0308]: mismatched types - --> $DIR/type-ascription-soundness.rs:12:30 - | -LL | let _len = type_ascribe!(arr, &[u8]).len(); - | ^^^ expected slice `[u8]`, found array `[u8; 3]` - | - = note: expected reference `&[u8]` - found reference `&[u8; 3]` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-ascription-with-fn-call.fixed b/src/test/ui/type/type-ascription-with-fn-call.fixed deleted file mode 100644 index 6d96c4303..000000000 --- a/src/test/ui/type/type-ascription-with-fn-call.fixed +++ /dev/null @@ -1,9 +0,0 @@ -// run-rustfix -#![feature(type_ascription)] - -fn main() { - f() ; - f(); //~ ERROR expected type, found function -} - -fn f() {} diff --git a/src/test/ui/type/type-ascription-with-fn-call.rs b/src/test/ui/type/type-ascription-with-fn-call.rs deleted file mode 100644 index ed4f7c904..000000000 --- a/src/test/ui/type/type-ascription-with-fn-call.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-rustfix -#![feature(type_ascription)] - -fn main() { - f() : - f(); //~ ERROR expected type, found function -} - -fn f() {} diff --git a/src/test/ui/type/type-ascription-with-fn-call.stderr b/src/test/ui/type/type-ascription-with-fn-call.stderr deleted file mode 100644 index d78fd08fd..000000000 --- a/src/test/ui/type/type-ascription-with-fn-call.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0573]: expected type, found function `f` - --> $DIR/type-ascription-with-fn-call.rs:6:5 - | -LL | f() : - | - help: maybe you meant to write `;` here -LL | f(); - | ^^^ expecting a type here because of type ascription - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/type/type-ascription.rs b/src/test/ui/type/type-ascription.rs deleted file mode 100644 index e4a4c89d0..000000000 --- a/src/test/ui/type/type-ascription.rs +++ /dev/null @@ -1,39 +0,0 @@ -// run-pass - -#![allow(dead_code)] -#![allow(unused_variables)] -// Type ascription doesn't lead to unsoundness - -#![feature(type_ascription)] - -use std::mem; - -const C1: u8 = type_ascribe!(10, u8); -const C2: [u8; type_ascribe!(1, usize)] = [1]; - -struct S { - a: u8 -} - -fn main() { - assert_eq!(type_ascribe!(C1.into(), i32), 10); - assert_eq!(C2[0], 1); - - let s = S { a: type_ascribe!(10, u8) }; - let arr = &[1u8, 2, 3]; - - let mut v = type_ascribe!(arr.iter().cloned().collect(), Vec<_>); - v.push(4); - assert_eq!(v, [1, 2, 3, 4]); - - let a = type_ascribe!(1, u8); - let b = type_ascribe!(a.into(), u16); - assert_eq!(v[type_ascribe!(a.into(), usize)], 2); - assert_eq!(mem::size_of_val(&a), 1); - assert_eq!(mem::size_of_val(&b), 2); - assert_eq!(b, type_ascribe!(1, u16)); - - let mut v = Vec::new(); - type_ascribe!(v, Vec) = vec![1, 2, 3]; // Place expression type ascription - assert_eq!(v, [1u8, 2, 3]); -} diff --git a/src/test/ui/type/type-check-defaults.rs b/src/test/ui/type/type-check-defaults.rs deleted file mode 100644 index 6a0a7ed33..000000000 --- a/src/test/ui/type/type-check-defaults.rs +++ /dev/null @@ -1,27 +0,0 @@ -use std::iter::FromIterator; -use std::vec::IntoIter; -use std::ops::Add; - -struct Foo>(T, U); -struct WellFormed>(Z); -//~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32` -struct WellFormedNoBounds>(Z); -//~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32` - -struct Bounds(T); -//~^ ERROR the trait bound `String: Copy` is not satisfied [E0277] - -struct WhereClause(T) where T: Copy; -//~^ ERROR the trait bound `String: Copy` is not satisfied [E0277] - -trait TraitBound {} -//~^ ERROR the trait bound `String: Copy` is not satisfied [E0277] - -trait Super { } -trait Base: Super { } -//~^ ERROR the trait bound `T: Copy` is not satisfied [E0277] - -trait ProjectionPred> where T::Item : Add {} -//~^ ERROR cannot add `u8` to `i32` [E0277] - -fn main() { } diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr deleted file mode 100644 index 9ba63ffe9..000000000 --- a/src/test/ui/type/type-check-defaults.stderr +++ /dev/null @@ -1,76 +0,0 @@ -error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32` - --> $DIR/type-check-defaults.rs:6:23 - | -LL | struct WellFormed>(Z); - | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator` - | - = help: the trait `FromIterator` is not implemented for `i32` -note: required by a bound in `Foo` - --> $DIR/type-check-defaults.rs:5:18 - | -LL | struct Foo>(T, U); - | ^^^^^^^^^^^^^^^ required by this bound in `Foo` - -error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32` - --> $DIR/type-check-defaults.rs:8:38 - | -LL | struct WellFormedNoBounds>(Z); - | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator` - | - = help: the trait `FromIterator` is not implemented for `i32` -note: required by a bound in `Foo` - --> $DIR/type-check-defaults.rs:5:18 - | -LL | struct Foo>(T, U); - | ^^^^^^^^^^^^^^^ required by this bound in `Foo` - -error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-check-defaults.rs:11:17 - | -LL | struct Bounds(T); - | ^^^^ the trait `Copy` is not implemented for `String` - -error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-check-defaults.rs:14:42 - | -LL | struct WhereClause(T) where T: Copy; - | ^^^^ the trait `Copy` is not implemented for `String` - -error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-check-defaults.rs:17:20 - | -LL | trait TraitBound {} - | ^^^^ the trait `Copy` is not implemented for `String` - -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/type-check-defaults.rs:21:25 - | -LL | trait Base: Super { } - | ^^^^^^^^ the trait `Copy` is not implemented for `T` - | -note: required by a bound in `Super` - --> $DIR/type-check-defaults.rs:20:16 - | -LL | trait Super { } - | ^^^^ required by this bound in `Super` -help: consider further restricting type parameter `T` - | -LL | trait Base: Super where T: std::marker::Copy { } - | ++++++++++++++++++++++++++ - -error[E0277]: cannot add `u8` to `i32` - --> $DIR/type-check-defaults.rs:24:66 - | -LL | trait ProjectionPred> where T::Item : Add {} - | ^^^^^^^ no implementation for `i32 + u8` - | - = help: the trait `Add` is not implemented for `i32` - = help: the following other types implement trait `Add`: - <&'a i32 as Add> - <&i32 as Add<&i32>> - > - - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type/type-check/assignment-expected-bool.rs b/src/test/ui/type/type-check/assignment-expected-bool.rs deleted file mode 100644 index 191939bdb..000000000 --- a/src/test/ui/type/type-check/assignment-expected-bool.rs +++ /dev/null @@ -1,34 +0,0 @@ -// The purpose of this text is to ensure that we get good -// diagnostics when a `bool` is expected but that due to -// an assignment expression `x = y` the type is `()`. - -fn main() { - let _: bool = 0 = 0; //~ ERROR mismatched types [E0308] - - let _: bool = match 0 { - 0 => 0 = 0, //~ ERROR mismatched types [E0308] - _ => 0 = 0, //~ ERROR mismatched types [E0308] - }; - - let _: bool = match true { - true => 0 = 0, //~ ERROR mismatched types [E0308] - _ => (), - }; - - if 0 = 0 {} //~ ERROR mismatched types [E0308] - - let _: bool = if { 0 = 0 } { //~ ERROR mismatched types [E0308] - 0 = 0 //~ ERROR mismatched types [E0308] - } else { - 0 = 0 //~ ERROR mismatched types [E0308] - }; - - let _ = (0 = 0) //~ ERROR mismatched types [E0308] - && { 0 = 0 } //~ ERROR mismatched types [E0308] - || (0 = 0); //~ ERROR mismatched types [E0308] - - // A test to check that not expecting `bool` behaves well: - let _: usize = 0 = 0; - //~^ ERROR mismatched types [E0308] - //~| ERROR invalid left-hand side of assignment [E0070] -} diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr deleted file mode 100644 index 56494baff..000000000 --- a/src/test/ui/type/type-check/assignment-expected-bool.stderr +++ /dev/null @@ -1,141 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:6:19 - | -LL | let _: bool = 0 = 0; - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | let _: bool = 0 == 0; - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:9:14 - | -LL | 0 => 0 = 0, - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | 0 => 0 == 0, - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:10:14 - | -LL | _ => 0 = 0, - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | _ => 0 == 0, - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:14:17 - | -LL | true => 0 = 0, - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | true => 0 == 0, - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:18:8 - | -LL | if 0 = 0 {} - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if 0 == 0 {} - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:20:24 - | -LL | let _: bool = if { 0 = 0 } { - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | let _: bool = if { 0 == 0 } { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:21:9 - | -LL | 0 = 0 - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | 0 == 0 - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:23:9 - | -LL | 0 = 0 - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | 0 == 0 - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:26:13 - | -LL | let _ = (0 = 0) - | ^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | let _ = (0 == 0) - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:27:14 - | -LL | && { 0 = 0 } - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | && { 0 == 0 } - | + - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:28:12 - | -LL | || (0 = 0); - | ^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | || (0 == 0); - | + - -error[E0070]: invalid left-hand side of assignment - --> $DIR/assignment-expected-bool.rs:31:22 - | -LL | let _: usize = 0 = 0; - | - ^ - | | - | cannot assign to this expression - -error[E0308]: mismatched types - --> $DIR/assignment-expected-bool.rs:31:20 - | -LL | let _: usize = 0 = 0; - | ----- ^^^^^ expected `usize`, found `()` - | | - | expected due to this - -error: aborting due to 13 previous errors - -Some errors have detailed explanations: E0070, E0308. -For more information about an error, try `rustc --explain E0070`. diff --git a/src/test/ui/type/type-check/assignment-in-if.rs b/src/test/ui/type/type-check/assignment-in-if.rs deleted file mode 100644 index ada250df2..000000000 --- a/src/test/ui/type/type-check/assignment-in-if.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Test that the parser does not attempt to parse struct literals -// within assignments in if expressions. - -#![allow(unused_parens)] - -struct Foo { - foo: usize -} - -fn main() { - let x = 1; - let y: Foo; - - // `x { ... }` should not be interpreted as a struct literal here - if x = x { - //~^ ERROR mismatched types - println!("{}", x); - } - // Explicit parentheses on the left should match behavior of above - if (x = x) { - //~^ ERROR mismatched types - println!("{}", x); - } - // The struct literal interpretation is fine with explicit parentheses on the right - if y = (Foo { foo: x }) { - //~^ ERROR mismatched types - println!("{}", x); - } - // "invalid left-hand side of assignment" error is suppresed - if 3 = x { - //~^ ERROR mismatched types - println!("{}", x); - } - if ( - if true { - x = 4 //~ ERROR mismatched types - } else { - x = 5 //~ ERROR mismatched types - } - ) { - println!("{}", x); - } - - if x == x && x = x && x == x { - //~^ ERROR mismatched types - //~| ERROR mismatched types - //~| ERROR mismatched types - println!("{}", x); - } - - if x == x && x == x && x = x { - //~^ ERROR mismatched types - //~| ERROR mismatched types - println!("{}", x); - } - - if x = 1 && x == 1 { - //~^ ERROR mismatched types - //~| ERROR mismatched types - println!("{}", x); - } -} diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr deleted file mode 100644 index 8ab08e25e..000000000 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ /dev/null @@ -1,126 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:15:8 - | -LL | if x = x { - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if x == x { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:20:8 - | -LL | if (x = x) { - | ^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if (x == x) { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:25:8 - | -LL | if y = (Foo { foo: x }) { - | ^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if y == (Foo { foo: x }) { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:30:8 - | -LL | if 3 = x { - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if 3 == x { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:36:13 - | -LL | x = 4 - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | x == 4 - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:38:13 - | -LL | x = 5 - | ^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | x == 5 - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:44:18 - | -LL | if x == x && x = x && x == x { - | ^ expected `bool`, found `usize` - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:44:22 - | -LL | if x == x && x = x && x == x { - | ^ expected `bool`, found `usize` - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:44:8 - | -LL | if x == x && x = x && x == x { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if x == x && x == x && x == x { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:51:28 - | -LL | if x == x && x == x && x = x { - | ^ expected `bool`, found `usize` - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:51:8 - | -LL | if x == x && x == x && x = x { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if x == x && x == x && x == x { - | + - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:57:12 - | -LL | if x = 1 && x == 1 { - | ^ expected `bool`, found integer - -error[E0308]: mismatched types - --> $DIR/assignment-in-if.rs:57:8 - | -LL | if x = 1 && x == 1 { - | ^^^^^^^^^^^^^^^ expected `bool`, found `()` - | -help: you might have meant to compare for equality - | -LL | if x == 1 && x == 1 { - | + - -error: aborting due to 13 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_array.rs b/src/test/ui/type/type-check/cannot_infer_local_or_array.rs deleted file mode 100644 index af7552523..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_array.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - let x = []; //~ ERROR type annotations needed -} diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_array.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_array.stderr deleted file mode 100644 index e823bad26..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_array.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed for `[_; 0]` - --> $DIR/cannot_infer_local_or_array.rs:2:9 - | -LL | let x = []; - | ^ -- type must be known at this point - | -help: consider giving `x` an explicit type, where the placeholders `_` are specified - | -LL | let x: [_; 0] = []; - | ++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec.rs b/src/test/ui/type/type-check/cannot_infer_local_or_vec.rs deleted file mode 100644 index e72ddabf3..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let x = vec![]; - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr deleted file mode 100644 index b63d2a3b6..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed for `Vec` - --> $DIR/cannot_infer_local_or_vec.rs:2:9 - | -LL | let x = vec![]; - | ^ - | -help: consider giving `x` an explicit type, where the type for type parameter `T` is specified - | -LL | let x: Vec = vec![]; - | ++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs deleted file mode 100644 index d21456439..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let (x, ) = (vec![], ); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr deleted file mode 100644 index be60cda68..000000000 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed for `(Vec,)` - --> $DIR/cannot_infer_local_or_vec_in_tuples.rs:2:9 - | -LL | let (x, ) = (vec![], ); - | ^^^^^ - | -help: consider giving this pattern a type, where the type for type parameter `T` is specified - | -LL | let (x, ): (Vec,) = (vec![], ); - | +++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-check/issue-22897.rs b/src/test/ui/type/type-check/issue-22897.rs deleted file mode 100644 index 8171a0ef1..000000000 --- a/src/test/ui/type/type-check/issue-22897.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { } - -fn unconstrained_type() { - []; //~ ERROR type annotations needed -} diff --git a/src/test/ui/type/type-check/issue-22897.stderr b/src/test/ui/type/type-check/issue-22897.stderr deleted file mode 100644 index fae7b7926..000000000 --- a/src/test/ui/type/type-check/issue-22897.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-22897.rs:4:5 - | -LL | []; - | ^^ cannot infer type for array `[_; 0]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-check/issue-40294.rs b/src/test/ui/type/type-check/issue-40294.rs deleted file mode 100644 index 5493a4e5f..000000000 --- a/src/test/ui/type/type-check/issue-40294.rs +++ /dev/null @@ -1,13 +0,0 @@ -trait Foo: Sized { - fn foo(self); -} - -fn foo<'a,'b,T>(x: &'a T, y: &'b T) - where &'a T : Foo, //~ ERROR type annotations needed - &'b T : Foo -{ - x.foo(); - y.foo(); -} - -fn main() { } diff --git a/src/test/ui/type/type-check/issue-40294.stderr b/src/test/ui/type/type-check/issue-40294.stderr deleted file mode 100644 index 75feb5698..000000000 --- a/src/test/ui/type/type-check/issue-40294.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0283]: type annotations needed: cannot satisfy `&'a T: Foo` - --> $DIR/issue-40294.rs:6:19 - | -LL | where &'a T : Foo, - | ^^^ - | - = note: cannot satisfy `&'a T: Foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/type/type-check/issue-41314.rs b/src/test/ui/type/type-check/issue-41314.rs deleted file mode 100644 index cbd39f5f9..000000000 --- a/src/test/ui/type/type-check/issue-41314.rs +++ /dev/null @@ -1,10 +0,0 @@ -enum X { - Y(u32) -} - -fn main() { - match X::Y(0) { - X::Y { number } => {} - //~^ ERROR tuple variant `X::Y` written as struct variant - } -} diff --git a/src/test/ui/type/type-check/issue-41314.stderr b/src/test/ui/type/type-check/issue-41314.stderr deleted file mode 100644 index 4a9bf6106..000000000 --- a/src/test/ui/type/type-check/issue-41314.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0769]: tuple variant `X::Y` written as struct variant - --> $DIR/issue-41314.rs:7:9 - | -LL | X::Y { number } => {} - | ^^^^^^^^^^^^^^^ - | -help: use the tuple variant pattern syntax instead - | -LL | X::Y(number) => {} - | ~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0769`. diff --git a/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs b/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs deleted file mode 100644 index c39ab9544..000000000 --- a/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs +++ /dev/null @@ -1,27 +0,0 @@ -fn main() { - let mut i: i64; - // Expected type is an inference variable `?T` - // because the `match` is used as a statement. - // This is the "initial" type of the `coercion`. - match i { - // Add `bool` to the overall `coercion`. - 0 => true, - - // Necessary to cause the ICE: - 1 => true, - - // Suppose that we had `let _: bool = match i { ... }`. - // In that case, as the expected type would be `bool`, - // we would suggest `i == 1` as a fix. - // - // However, no type error happens when checking `i = 1` because `expected == ?T`, - // which will unify with `typeof(i = 1) == ()`. - // - // However, in #67273, we would delay the unification of this arm with the above - // because we used the hitherto accumulated coercion as opposed to the "initial" type. - 2 => i = 1, - //~^ ERROR `match` arms have incompatible types - - _ => (), - } -} diff --git a/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr b/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr deleted file mode 100644 index a431fe89c..000000000 --- a/src/test/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: `match` arms have incompatible types - --> $DIR/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs:22:14 - | -LL | / match i { -LL | | // Add `bool` to the overall `coercion`. -LL | | 0 => true, - | | ---- this is found to be of type `bool` -LL | | -LL | | // Necessary to cause the ICE: -LL | | 1 => true, - | | ---- this is found to be of type `bool` -... | -LL | | 2 => i = 1, - | | ^^^^^ expected `bool`, found `()` -... | -LL | | _ => (), -LL | | } - | |_____- `match` arms have incompatible types - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.rs b/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.rs deleted file mode 100644 index e50cc5865..000000000 --- a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.rs +++ /dev/null @@ -1,12 +0,0 @@ -macro_rules! many_args { - ([$($t:tt)*]#$($h:tt)*) => { - many_args!{[$($t)*$($t)*]$($h)*} - }; - ([$($t:tt)*]) => { - fn _f($($t: ()),*) {} //~ ERROR function can not have more than 65535 arguments - } -} - -many_args!{[_]########## ######} - -fn main() {} diff --git a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr b/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr deleted file mode 100644 index 847bc517e..000000000 --- a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: function can not have more than 65535 arguments - --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:22 - | -LL | fn _f($($t: ()),*) {} - | ^ -... -LL | many_args!{[_]########## ######} - | -------------------------------- in this macro invocation - | - = note: this error originates in the macro `many_args` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/type/type-check/missing_trait_impl.rs b/src/test/ui/type/type-check/missing_trait_impl.rs deleted file mode 100644 index 0e3e703a2..000000000 --- a/src/test/ui/type/type-check/missing_trait_impl.rs +++ /dev/null @@ -1,16 +0,0 @@ -fn main() { -} - -fn foo(x: T, y: T) { - let z = x + y; //~ ERROR cannot add `T` to `T` -} - -fn bar(x: T) { - x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T` -} - -fn baz(x: T) { - let y = -x; //~ ERROR cannot apply unary operator `-` to type `T` - let y = !x; //~ ERROR cannot apply unary operator `!` to type `T` - let y = *x; //~ ERROR type `T` cannot be dereferenced -} diff --git a/src/test/ui/type/type-check/missing_trait_impl.stderr b/src/test/ui/type/type-check/missing_trait_impl.stderr deleted file mode 100644 index 2b58cd418..000000000 --- a/src/test/ui/type/type-check/missing_trait_impl.stderr +++ /dev/null @@ -1,58 +0,0 @@ -error[E0369]: cannot add `T` to `T` - --> $DIR/missing_trait_impl.rs:5:15 - | -LL | let z = x + y; - | - ^ - T - | | - | T - | -help: consider restricting type parameter `T` - | -LL | fn foo(x: T, y: T) { - | +++++++++++++++ - -error[E0368]: binary assignment operation `+=` cannot be applied to type `T` - --> $DIR/missing_trait_impl.rs:9:5 - | -LL | x += x; - | -^^^^^ - | | - | cannot use `+=` on type `T` - | -help: consider restricting type parameter `T` - | -LL | fn bar(x: T) { - | +++++++++++++++++++++ - -error[E0600]: cannot apply unary operator `-` to type `T` - --> $DIR/missing_trait_impl.rs:13:13 - | -LL | let y = -x; - | ^^ cannot apply unary operator `-` - | -help: consider restricting type parameter `T` - | -LL | fn baz(x: T) { - | +++++++++++++++ - -error[E0600]: cannot apply unary operator `!` to type `T` - --> $DIR/missing_trait_impl.rs:14:13 - | -LL | let y = !x; - | ^^ cannot apply unary operator `!` - | -help: consider restricting type parameter `T` - | -LL | fn baz(x: T) { - | +++++++++++++++ - -error[E0614]: type `T` cannot be dereferenced - --> $DIR/missing_trait_impl.rs:15:13 - | -LL | let y = *x; - | ^^ - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0368, E0369, E0600, E0614. -For more information about an error, try `rustc --explain E0368`. diff --git a/src/test/ui/type/type-check/unknown_type_for_closure.rs b/src/test/ui/type/type-check/unknown_type_for_closure.rs deleted file mode 100644 index 167687c18..000000000 --- a/src/test/ui/type/type-check/unknown_type_for_closure.rs +++ /dev/null @@ -1,17 +0,0 @@ -fn infer_in_arg() { - let x = |b: Vec<_>| {}; //~ ERROR E0282 -} - -fn empty_pattern() { - let x = |_| {}; //~ ERROR type annotations needed -} - -fn infer_ty() { - let x = |k: _| {}; //~ ERROR type annotations needed -} - -fn ambig_return() { - let x = || -> Vec<_> { Vec::new() }; //~ ERROR type annotations needed -} - -fn main() {} diff --git a/src/test/ui/type/type-check/unknown_type_for_closure.stderr b/src/test/ui/type/type-check/unknown_type_for_closure.stderr deleted file mode 100644 index 9ae97f390..000000000 --- a/src/test/ui/type/type-check/unknown_type_for_closure.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/unknown_type_for_closure.rs:2:13 - | -LL | let x = |b: Vec<_>| {}; - | ^^^^^^^^^^^^^^ cannot infer type for struct `Vec<_>` - -error[E0282]: type annotations needed - --> $DIR/unknown_type_for_closure.rs:6:14 - | -LL | let x = |_| {}; - | ^ - | -help: consider giving this closure parameter an explicit type - | -LL | let x = |_: _| {}; - | +++ - -error[E0282]: type annotations needed - --> $DIR/unknown_type_for_closure.rs:10:14 - | -LL | let x = |k: _| {}; - | ^ cannot infer type - -error[E0282]: type annotations needed - --> $DIR/unknown_type_for_closure.rs:14:28 - | -LL | let x = || -> Vec<_> { Vec::new() }; - | ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec` - | -help: consider specifying the generic argument - | -LL | let x = || -> Vec<_> { Vec::::new() }; - | +++++ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-dependent-def-issue-49241.rs b/src/test/ui/type/type-dependent-def-issue-49241.rs deleted file mode 100644 index caf5bade5..000000000 --- a/src/test/ui/type/type-dependent-def-issue-49241.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - let v = vec![0]; - const l: usize = v.count(); //~ ERROR attempt to use a non-constant value in a constant - let s: [u32; l] = v.into_iter().collect(); - //~^ constant -} diff --git a/src/test/ui/type/type-dependent-def-issue-49241.stderr b/src/test/ui/type/type-dependent-def-issue-49241.stderr deleted file mode 100644 index af16a6e8f..000000000 --- a/src/test/ui/type/type-dependent-def-issue-49241.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0435]: attempt to use a non-constant value in a constant - --> $DIR/type-dependent-def-issue-49241.rs:3:22 - | -LL | const l: usize = v.count(); - | ------- ^ non-constant value - | | - | help: consider using `let` instead of `const`: `let l` - -note: erroneous constant used - --> $DIR/type-dependent-def-issue-49241.rs:4:18 - | -LL | let s: [u32; l] = v.into_iter().collect(); - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0435`. diff --git a/src/test/ui/type/type-error-break-tail.rs b/src/test/ui/type/type-error-break-tail.rs deleted file mode 100644 index d4e3e93d0..000000000 --- a/src/test/ui/type/type-error-break-tail.rs +++ /dev/null @@ -1,8 +0,0 @@ -fn loop_ending() -> i32 { - loop { - if false { break; } //~ ERROR mismatched types - return 42; - } -} - -fn main() {} diff --git a/src/test/ui/type/type-error-break-tail.stderr b/src/test/ui/type/type-error-break-tail.stderr deleted file mode 100644 index 16dc6475c..000000000 --- a/src/test/ui/type/type-error-break-tail.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-error-break-tail.rs:3:20 - | -LL | fn loop_ending() -> i32 { - | --- expected `i32` because of return type -LL | loop { -LL | if false { break; } - | ^^^^^ - | | - | expected `i32`, found `()` - | help: give it a value of the expected type: `break 42` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-mismatch-multiple.rs b/src/test/ui/type/type-mismatch-multiple.rs deleted file mode 100644 index 55d6ceef1..000000000 --- a/src/test/ui/type/type-mismatch-multiple.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Checking that the compiler reports multiple type errors at once - -fn main() { let a: bool = 1; let b: i32 = true; } -//~^ ERROR mismatched types -//~| expected `bool`, found integer -//~| ERROR mismatched types -//~| expected `i32`, found `bool` diff --git a/src/test/ui/type/type-mismatch-multiple.stderr b/src/test/ui/type/type-mismatch-multiple.stderr deleted file mode 100644 index 2e8654d31..000000000 --- a/src/test/ui/type/type-mismatch-multiple.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-mismatch-multiple.rs:3:27 - | -LL | fn main() { let a: bool = 1; let b: i32 = true; } - | ---- ^ expected `bool`, found integer - | | - | expected due to this - -error[E0308]: mismatched types - --> $DIR/type-mismatch-multiple.rs:3:43 - | -LL | fn main() { let a: bool = 1; let b: i32 = true; } - | --- ^^^^ expected `i32`, found `bool` - | | - | expected due to this - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-mismatch-same-crate-name.rs b/src/test/ui/type/type-mismatch-same-crate-name.rs deleted file mode 100644 index c9cdc874c..000000000 --- a/src/test/ui/type/type-mismatch-same-crate-name.rs +++ /dev/null @@ -1,27 +0,0 @@ -// aux-build:crate_a1.rs -// aux-build:crate_a2.rs - -// This tests the extra note reported when a type error deals with -// seemingly identical types. -// The main use case of this error is when there are two crates -// (generally different versions of the same crate) with the same name -// causing a type mismatch. Here, we simulate that error using block-scoped -// aliased `extern crate` declarations. - -fn main() { - let foo2 = {extern crate crate_a2 as a; a::Foo}; - let bar2 = {extern crate crate_a2 as a; a::bar()}; - { - extern crate crate_a1 as a; - a::try_foo(foo2); - //~^ ERROR mismatched types - //~| perhaps two different versions of crate `crate_a1` - //~| expected struct `main::a::Foo` - a::try_bar(bar2); - //~^ ERROR mismatched types - //~| perhaps two different versions of crate `crate_a1` - //~| expected trait `main::a::Bar` - //~| expected struct `Box<(dyn main::a::Bar + 'static)>` - //~| found struct `Box` - } -} diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr deleted file mode 100644 index fcafd315e..000000000 --- a/src/test/ui/type/type-mismatch-same-crate-name.stderr +++ /dev/null @@ -1,46 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-mismatch-same-crate-name.rs:16:20 - | -LL | a::try_foo(foo2); - | ---------- ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` - | | - | arguments to this function are incorrect - | - = note: struct `main::a::Foo` and struct `main::a::Foo` have similar names, but are actually distinct types -note: struct `main::a::Foo` is defined in crate `crate_a2` - --> $DIR/auxiliary/crate_a2.rs:1:1 - | -LL | pub struct Foo; - | ^^^^^^^^^^^^^^ -note: struct `main::a::Foo` is defined in crate `crate_a1` - --> $DIR/auxiliary/crate_a1.rs:1:1 - | -LL | pub struct Foo; - | ^^^^^^^^^^^^^^ - = note: perhaps two different versions of crate `crate_a1` are being used? -note: function defined here - --> $DIR/auxiliary/crate_a1.rs:10:8 - | -LL | pub fn try_foo(x: Foo){} - | ^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/type-mismatch-same-crate-name.rs:20:20 - | -LL | a::try_bar(bar2); - | ---------- ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` - | | - | arguments to this function are incorrect - | - = note: expected struct `Box<(dyn main::a::Bar + 'static)>` - found struct `Box` - = note: perhaps two different versions of crate `crate_a1` are being used? -note: function defined here - --> $DIR/auxiliary/crate_a1.rs:11:8 - | -LL | pub fn try_bar(x: Box){} - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-mismatch.rs b/src/test/ui/type/type-mismatch.rs deleted file mode 100644 index 11bfa3a72..000000000 --- a/src/test/ui/type/type-mismatch.rs +++ /dev/null @@ -1,78 +0,0 @@ -#![allow(non_camel_case_types)] - -trait Qux {} -struct A; -struct B; -impl Qux for A {} -impl Qux for B {} - -struct Foo(T, U, V); - -struct foo; -struct bar; - -fn want(t: T) {} - -fn have_usize(f: usize) { - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types -} - -fn have_foo(f: foo) { - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types -} - -fn have_foo_foo(f: Foo) { - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types -} - -fn have_foo_foo_b(f: Foo) { - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types -} - -fn have_foo_foo_b_a(f: Foo) { - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types - want::<&Foo>(f); //~ ERROR mismatched types -} - -fn main() {} diff --git a/src/test/ui/type/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr deleted file mode 100644 index 6c187bad0..000000000 --- a/src/test/ui/type/type-mismatch.stderr +++ /dev/null @@ -1,751 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:17:17 - | -LL | want::(f); - | ----------- ^ expected struct `foo`, found `usize` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:18:17 - | -LL | want::(f); - | ----------- ^ expected struct `bar`, found `usize` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:19:24 - | -LL | want::>(f); - | ------------------ ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:20:27 - | -LL | want::>(f); - | --------------------- ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:21:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:22:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:23:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:24:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found `usize` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found type `usize` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:28:19 - | -LL | want::(f); - | ------------- ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:29:17 - | -LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:30:24 - | -LL | want::>(f); - | ------------------ ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:31:27 - | -LL | want::>(f); - | --------------------- ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:32:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:33:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:34:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:35:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `Foo`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:39:19 - | -LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected type `usize` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:40:17 - | -LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:41:17 - | -LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `bar` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:42:24 - | -LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:43:27 - | -LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:44:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `B`, found struct `A` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo<_, B>` - found struct `Foo<_, A>` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:45:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:46:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:47:23 - | -LL | want::<&Foo>(f); - | ----------------- ^ - | | | - | | expected `&Foo`, found struct `Foo` - | | help: consider borrowing here: `&f` - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:48:26 - | -LL | want::<&Foo>(f); - | -------------------- ^ expected `&Foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:52:19 - | -LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected type `usize` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:53:17 - | -LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:54:17 - | -LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `bar` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:55:24 - | -LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:56:27 - | -LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:57:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `A`, found struct `B` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo<_, A>` - found struct `Foo<_, B>` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:58:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:59:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:60:23 - | -LL | want::<&Foo>(f); - | ----------------- ^ expected `&Foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:61:26 - | -LL | want::<&Foo>(f); - | -------------------- ^ - | | | - | | expected `&Foo`, found struct `Foo` - | | help: consider borrowing here: `&f` - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:65:19 - | -LL | want::(f); - | ------------- ^ expected `usize`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected type `usize` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:66:17 - | -LL | want::(f); - | ----------- ^ expected struct `foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:67:17 - | -LL | want::(f); - | ----------- ^ expected struct `bar`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `bar` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:68:24 - | -LL | want::>(f); - | ------------------ ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:69:27 - | -LL | want::>(f); - | --------------------- ^ expected `usize`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:70:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `A`, found struct `B` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo<_, A, B>` - found struct `Foo<_, B, A>` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:71:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `B`, found struct `A` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo<_, _, B>` - found struct `Foo<_, _, A>` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:72:22 - | -LL | want::>(f); - | ---------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:73:25 - | -LL | want::>(f); - | ------------------- ^ expected struct `bar`, found struct `foo` - | | - | arguments to this function are incorrect - | - = note: expected struct `Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:74:23 - | -LL | want::<&Foo>(f); - | ----------------- ^ expected `&Foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:75:26 - | -LL | want::<&Foo>(f); - | -------------------- ^ expected `&Foo`, found struct `Foo` - | | - | arguments to this function are incorrect - | - = note: expected reference `&Foo` - found struct `Foo` -note: function defined here - --> $DIR/type-mismatch.rs:14:4 - | -LL | fn want(t: T) {} - | ^^^^ ---- - -error: aborting due to 47 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs b/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs deleted file mode 100644 index 444453dc6..000000000 --- a/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Test a default that references `Self` which is then used in an -// object type. Issue #18956. In this case, the value is supplied by -// the user, but pretty-printing the type during the error message -// caused an ICE. - -trait MyAdd { fn add(&self, other: &Rhs) -> Self; } - -impl MyAdd for i32 { - fn add(&self, other: &i32) -> i32 { *self + *other } -} - -fn main() { - let x: i32 = 5; - let y = x as dyn MyAdd; - //~^ ERROR E0038 - //~| ERROR cast to unsized type: `i32` as `dyn MyAdd` -} diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr b/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr deleted file mode 100644 index 8a296dc7e..000000000 --- a/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0620]: cast to unsized type: `i32` as `dyn MyAdd` - --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13 - | -LL | let y = x as dyn MyAdd; - | ^^^^^^^^^^^^^^^^^^^ - | -help: consider using a box or reference as appropriate - --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13 - | -LL | let y = x as dyn MyAdd; - | ^ - -error[E0038]: the trait `MyAdd` cannot be made into an object - --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:18 - | -LL | let y = x as dyn MyAdd; - | ^^^^^^^^^^^^^^ `MyAdd` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:6:55 - | -LL | trait MyAdd { fn add(&self, other: &Rhs) -> Self; } - | ----- ^^^^ ...because method `add` references the `Self` type in its return type - | | - | this trait cannot be made into an object... - = help: consider moving `add` to another trait - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0038, E0620. -For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self.rs b/src/test/ui/type/type-parameter-defaults-referencing-Self.rs deleted file mode 100644 index e5c81556e..000000000 --- a/src/test/ui/type/type-parameter-defaults-referencing-Self.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test a default that references `Self` which is then used in an object type. -// Issue #18956. - -trait Foo { - fn method(&self); -} - -fn foo(x: &dyn Foo) { } -//~^ ERROR the type parameter `T` must be explicitly specified - -fn main() { } diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr b/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr deleted file mode 100644 index 67a4745b3..000000000 --- a/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0393]: the type parameter `T` must be explicitly specified - --> $DIR/type-parameter-defaults-referencing-Self.rs:8:16 - | -LL | trait Foo { - | ----------------- type parameter `T` must be specified for this -... -LL | fn foo(x: &dyn Foo) { } - | ^^^ help: set the type parameter to the desired type: `Foo` - | - = note: because of the default `Self` reference, type parameters must be specified on object types - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0393`. diff --git a/src/test/ui/type/type-parameter-names.rs b/src/test/ui/type/type-parameter-names.rs deleted file mode 100644 index b54a3fae0..000000000 --- a/src/test/ui/type/type-parameter-names.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Test that we print out the names of type parameters correctly in -// our error messages. - -fn foo(x: Foo) -> Bar { - x -//~^ ERROR mismatched types -//~| expected type parameter `Bar`, found type parameter `Foo` -//~| expected type parameter `Bar` -//~| found type parameter `Foo` -} - -fn main() {} diff --git a/src/test/ui/type/type-parameter-names.stderr b/src/test/ui/type/type-parameter-names.stderr deleted file mode 100644 index f0ca8afca..000000000 --- a/src/test/ui/type/type-parameter-names.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-parameter-names.rs:5:5 - | -LL | fn foo(x: Foo) -> Bar { - | --- --- --- expected `Bar` because of return type - | | | - | | expected type parameter - | found type parameter -LL | x - | ^ expected type parameter `Bar`, found type parameter `Foo` - | - = note: expected type parameter `Bar` - found type parameter `Foo` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-params-in-different-spaces-1.rs b/src/test/ui/type/type-params-in-different-spaces-1.rs deleted file mode 100644 index 6efd14d37..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-1.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::ops::Add; - -trait BrokenAdd: Copy + Add { - fn broken_add(&self, rhs: T) -> Self { - *self + rhs //~ ERROR mismatched types - //~| expected type parameter `Self`, found type parameter `T` - //~| expected type parameter `Self` - //~| found type parameter `T` - } -} - -impl> BrokenAdd for T {} - -pub fn main() { - let foo: u8 = 0; - let x: u8 = foo.broken_add("hello darkness my old friend".to_string()); - println!("{}", x); -} diff --git a/src/test/ui/type/type-params-in-different-spaces-1.stderr b/src/test/ui/type/type-params-in-different-spaces-1.stderr deleted file mode 100644 index 4e73e10a3..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-1.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-params-in-different-spaces-1.rs:5:17 - | -LL | trait BrokenAdd: Copy + Add { - | ---------------------------------------- expected type parameter -LL | fn broken_add(&self, rhs: T) -> Self { - | - found type parameter -LL | *self + rhs - | ^^^ expected type parameter `Self`, found type parameter `T` - | - = note: expected type parameter `Self` - found type parameter `T` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-params-in-different-spaces-2.rs b/src/test/ui/type/type-params-in-different-spaces-2.rs deleted file mode 100644 index 1211e465b..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test static calls to make sure that we align the Self and input -// type parameters on a trait correctly. - -trait Tr : Sized { - fn op(_: T) -> Self; -} - -trait A: Tr { - fn test(u: U) -> Self { - Tr::op(u) //~ ERROR E0277 - } -} - -trait B: Tr { - fn test(u: U) -> Self { - Tr::op(u) //~ ERROR E0277 - } -} - -fn main() { -} diff --git a/src/test/ui/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr deleted file mode 100644 index 220b3929c..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-2.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0277]: the trait bound `Self: Tr` is not satisfied - --> $DIR/type-params-in-different-spaces-2.rs:10:16 - | -LL | Tr::op(u) - | ------ ^ the trait `Tr` is not implemented for `Self` - | | - | required by a bound introduced by this call - | -help: consider further restricting `Self` - | -LL | fn test(u: U) -> Self where Self: Tr { - | +++++++++++++++++ - -error[E0277]: the trait bound `Self: Tr` is not satisfied - --> $DIR/type-params-in-different-spaces-2.rs:16:16 - | -LL | Tr::op(u) - | ------ ^ the trait `Tr` is not implemented for `Self` - | | - | required by a bound introduced by this call - | -help: consider further restricting `Self` - | -LL | fn test(u: U) -> Self where Self: Tr { - | +++++++++++++++++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type/type-params-in-different-spaces-3.rs b/src/test/ui/type/type-params-in-different-spaces-3.rs deleted file mode 100644 index ac7b0c11f..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-3.rs +++ /dev/null @@ -1,7 +0,0 @@ -trait Tr : Sized { - fn test(u: X) -> Self { - u //~ ERROR mismatched types - } -} - -fn main() {} diff --git a/src/test/ui/type/type-params-in-different-spaces-3.stderr b/src/test/ui/type/type-params-in-different-spaces-3.stderr deleted file mode 100644 index c538d6731..000000000 --- a/src/test/ui/type/type-params-in-different-spaces-3.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-params-in-different-spaces-3.rs:3:9 - | -LL | trait Tr : Sized { - | ---------------- expected type parameter -LL | fn test(u: X) -> Self { - | - ---- expected `Self` because of return type - | | - | found type parameter -LL | u - | ^ expected type parameter `Self`, found type parameter `X` - | - = note: expected type parameter `Self` - found type parameter `X` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-path-err-node-types.rs b/src/test/ui/type/type-path-err-node-types.rs deleted file mode 100644 index b3795772e..000000000 --- a/src/test/ui/type/type-path-err-node-types.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Type arguments in unresolved entities (reporting errors before type checking) -// should have their types recorded. - -trait Tr {} - -fn local_type() { - let _: Nonexistent; //~ ERROR cannot find type `Nonexistent` in this scope -} - -fn ufcs_trait() { - >::nonexistent(); //~ ERROR cannot find method or associated constant `nonexistent` -} - -fn ufcs_item() { - NonExistent::Assoc::; //~ ERROR undeclared type `NonExistent` -} - -fn method() { - nonexistent.nonexistent::(); //~ ERROR cannot find value `nonexistent` -} - -fn closure() { - let _ = |a, b: _| -> _ { 0 }; //~ ERROR type annotations needed -} - -fn main() {} diff --git a/src/test/ui/type/type-path-err-node-types.stderr b/src/test/ui/type/type-path-err-node-types.stderr deleted file mode 100644 index c1ae10efa..000000000 --- a/src/test/ui/type/type-path-err-node-types.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared type `NonExistent` - --> $DIR/type-path-err-node-types.rs:15:5 - | -LL | NonExistent::Assoc::; - | ^^^^^^^^^^^ use of undeclared type `NonExistent` - -error[E0412]: cannot find type `Nonexistent` in this scope - --> $DIR/type-path-err-node-types.rs:7:12 - | -LL | let _: Nonexistent; - | ^^^^^^^^^^^ not found in this scope - -error[E0576]: cannot find method or associated constant `nonexistent` in trait `Tr` - --> $DIR/type-path-err-node-types.rs:11:21 - | -LL | >::nonexistent(); - | ^^^^^^^^^^^ not found in `Tr` - -error[E0425]: cannot find value `nonexistent` in this scope - --> $DIR/type-path-err-node-types.rs:19:5 - | -LL | nonexistent.nonexistent::(); - | ^^^^^^^^^^^ not found in this scope - -error[E0282]: type annotations needed - --> $DIR/type-path-err-node-types.rs:23:14 - | -LL | let _ = |a, b: _| -> _ { 0 }; - | ^ - | -help: consider giving this closure parameter an explicit type - | -LL | let _ = |a: _, b: _| -> _ { 0 }; - | +++ - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0282, E0412, E0425, E0433, E0576. -For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/ui/type/type-recursive-box-shadowed.rs b/src/test/ui/type/type-recursive-box-shadowed.rs deleted file mode 100644 index e141c2149..000000000 --- a/src/test/ui/type/type-recursive-box-shadowed.rs +++ /dev/null @@ -1,12 +0,0 @@ -//FIXME(compiler-errors): This fixup should suggest the full box path, not just `Box` - -struct Box { - t: T, -} - -struct Foo { - //~^ ERROR recursive type `Foo` has infinite size - inner: Foo, -} - -fn main() {} diff --git a/src/test/ui/type/type-recursive-box-shadowed.stderr b/src/test/ui/type/type-recursive-box-shadowed.stderr deleted file mode 100644 index cb0e98287..000000000 --- a/src/test/ui/type/type-recursive-box-shadowed.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/type-recursive-box-shadowed.rs:7:1 - | -LL | struct Foo { - | ^^^^^^^^^^ -LL | -LL | inner: Foo, - | --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | inner: Box, - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/type/type-recursive.rs b/src/test/ui/type/type-recursive.rs deleted file mode 100644 index e8084f0d0..000000000 --- a/src/test/ui/type/type-recursive.rs +++ /dev/null @@ -1,30 +0,0 @@ -struct T1 { //~ ERROR E0072 - foo: isize, - foolish: T1, -} - -struct T2 { //~ ERROR E0072 - inner: Option, -} - -type OptionT3 = Option; - -struct T3 { //~ ERROR E0072 - inner: OptionT3, -} - -struct T4(Option); //~ ERROR E0072 - -enum T5 { //~ ERROR E0072 - Variant(Option), -} - -enum T6 { //~ ERROR E0072 - Variant{ field: Option }, -} - -struct T7 { //~ ERROR E0072 - foo: std::cell::Cell>, -} - -fn main() { } diff --git a/src/test/ui/type/type-recursive.stderr b/src/test/ui/type/type-recursive.stderr deleted file mode 100644 index 9a4d798f6..000000000 --- a/src/test/ui/type/type-recursive.stderr +++ /dev/null @@ -1,93 +0,0 @@ -error[E0072]: recursive type `T1` has infinite size - --> $DIR/type-recursive.rs:1:1 - | -LL | struct T1 { - | ^^^^^^^^^ -LL | foo: isize, -LL | foolish: T1, - | -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | foolish: Box, - | ++++ + - -error[E0072]: recursive type `T2` has infinite size - --> $DIR/type-recursive.rs:6:1 - | -LL | struct T2 { - | ^^^^^^^^^ -LL | inner: Option, - | -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | inner: Option>, - | ++++ + - -error[E0072]: recursive type `T3` has infinite size - --> $DIR/type-recursive.rs:12:1 - | -LL | struct T3 { - | ^^^^^^^^^ -LL | inner: OptionT3, - | -------- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | inner: Box, - | ++++ + - -error[E0072]: recursive type `T4` has infinite size - --> $DIR/type-recursive.rs:16:1 - | -LL | struct T4(Option); - | ^^^^^^^^^ -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | struct T4(Option>); - | ++++ + - -error[E0072]: recursive type `T5` has infinite size - --> $DIR/type-recursive.rs:18:1 - | -LL | enum T5 { - | ^^^^^^^ -LL | Variant(Option), - | -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | Variant(Option>), - | ++++ + - -error[E0072]: recursive type `T6` has infinite size - --> $DIR/type-recursive.rs:22:1 - | -LL | enum T6 { - | ^^^^^^^ -LL | Variant{ field: Option }, - | -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | Variant{ field: Option> }, - | ++++ + - -error[E0072]: recursive type `T7` has infinite size - --> $DIR/type-recursive.rs:26:1 - | -LL | struct T7 { - | ^^^^^^^^^ -LL | foo: std::cell::Cell>, - | -- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | foo: std::cell::Cell>>, - | ++++ + - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/ui/type/type-shadow.rs b/src/test/ui/type/type-shadow.rs deleted file mode 100644 index 48a68a390..000000000 --- a/src/test/ui/type/type-shadow.rs +++ /dev/null @@ -1,8 +0,0 @@ -fn main() { - type X = isize; - type Y = X; - if true { - type X = &'static str; - let y: Y = "hello"; //~ ERROR mismatched types - } -} diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr deleted file mode 100644 index 25b4bff4d..000000000 --- a/src/test/ui/type/type-shadow.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-shadow.rs:6:20 - | -LL | let y: Y = "hello"; - | - ^^^^^^^ expected `isize`, found `&str` - | | - | expected due to this - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type/type-unsatisfiable.rs b/src/test/ui/type/type-unsatisfiable.rs deleted file mode 100644 index 7fbbb50dc..000000000 --- a/src/test/ui/type/type-unsatisfiable.rs +++ /dev/null @@ -1,59 +0,0 @@ -// revisions: lib usage -//[lib] compile-flags: --crate-type=lib -//[lib] build-pass - -use std::ops::Sub; -trait Vector2 { - type ScalarType; - - fn from_values(x: Self::ScalarType, y: Self::ScalarType) -> Self - where - Self: Sized; - - fn x(&self) -> Self::ScalarType; - fn y(&self) -> Self::ScalarType; -} - -impl Sub for dyn Vector2 -where - T: Sub, - (dyn Vector2): Sized, -{ - type Output = dyn Vector2; - - fn sub(self, rhs: Self) -> Self::Output { - Self::from_values(self.x() - rhs.x(), self.y() - rhs.y()) - } -} - -struct Vec2 { - x: i32, - y: i32, -} - -impl Vector2 for Vec2 { - type ScalarType = i32; - - fn from_values(x: Self::ScalarType, y: Self::ScalarType) -> Self - where - Self: Sized, - { - Self { x, y } - } - - fn x(&self) -> Self::ScalarType { - self.x - } - fn y(&self) -> Self::ScalarType { - self.y - } -} - -#[cfg(usage)] -fn main() { - let hey: Box> = Box::new(Vec2 { x: 1, y: 2 }); - let word: Box> = Box::new(Vec2 { x: 1, y: 2 }); - - let bar = *hey - *word; - //[usage]~^ ERROR cannot subtract -} diff --git a/src/test/ui/type/type-unsatisfiable.usage.stderr b/src/test/ui/type/type-unsatisfiable.usage.stderr deleted file mode 100644 index 56e2e30af..000000000 --- a/src/test/ui/type/type-unsatisfiable.usage.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0369]: cannot subtract `(dyn Vector2 + 'static)` from `dyn Vector2` - --> $DIR/type-unsatisfiable.rs:57:20 - | -LL | let bar = *hey - *word; - | ---- ^ ----- (dyn Vector2 + 'static) - | | - | dyn Vector2 - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0369`. -- cgit v1.2.3