summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/type')
-rw-r--r--src/test/ui/type/issue-100584.rs15
-rw-r--r--src/test/ui/type/issue-100584.stderr44
-rw-r--r--src/test/ui/type/type-alias-bounds.rs2
-rw-r--r--src/test/ui/type/type-arg-out-of-scope.stderr12
-rw-r--r--src/test/ui/type/type-ascription-instead-of-initializer.stderr2
-rw-r--r--src/test/ui/type/type-check-defaults.stderr8
-rw-r--r--src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr16
-rw-r--r--src/test/ui/type/type-params-in-different-spaces-2.stderr12
8 files changed, 87 insertions, 24 deletions
diff --git a/src/test/ui/type/issue-100584.rs b/src/test/ui/type/issue-100584.rs
new file mode 100644
index 000000000..102846563
--- /dev/null
+++ b/src/test/ui/type/issue-100584.rs
@@ -0,0 +1,15 @@
+#![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
new file mode 100644
index 000000000..e1db14d1f
--- /dev/null
+++ b/src/test/ui/type/issue-100584.stderr
@@ -0,0 +1,44 @@
+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/type-alias-bounds.rs b/src/test/ui/type/type-alias-bounds.rs
index 65b79650d..e49731725 100644
--- a/src/test/ui/type/type-alias-bounds.rs
+++ b/src/test/ui/type/type-alias-bounds.rs
@@ -52,7 +52,7 @@ type T2<U> where U: Bound = U::Assoc; //~ WARN not enforced in type aliases
// Do this instead:
type T4<U> = <U as Bound>::Assoc;
-// Make sure the help about associatd types is not shown incorrectly
+// Make sure the help about associated types is not shown incorrectly
type T5<U: Bound> = <U as Bound>::Assoc; //~ WARN not enforced in type aliases
type T6<U: Bound> = ::std::vec::Vec<U>; //~ WARN not enforced in type aliases
diff --git a/src/test/ui/type/type-arg-out-of-scope.stderr b/src/test/ui/type/type-arg-out-of-scope.stderr
index 0b6283fbc..7f18b4510 100644
--- a/src/test/ui/type/type-arg-out-of-scope.stderr
+++ b/src/test/ui/type/type-arg-out-of-scope.stderr
@@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bar(f: Box<dyn FnMut(T) -> T>) { }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bar<T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error[E0401]: can't use generic parameters from outer function
--> $DIR/type-arg-out-of-scope.rs:3:35
@@ -14,9 +14,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bar(f: Box<dyn FnMut(T) -> T>) { }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bar<T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr
index fcac6c495..de578ca93 100644
--- a/src/test/ui/type/type-ascription-instead-of-initializer.stderr
+++ b/src/test/ui/type/type-ascription-instead-of-initializer.stderr
@@ -21,7 +21,7 @@ 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
diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr
index 56a9b5317..cf77c057d 100644
--- a/src/test/ui/type/type-check-defaults.stderr
+++ b/src/test/ui/type/type-check-defaults.stderr
@@ -1,8 +1,8 @@
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
- --> $DIR/type-check-defaults.rs:6:19
+ --> $DIR/type-check-defaults.rs:6:23
|
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
- | ^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
note: required by a bound in `Foo`
@@ -12,10 +12,10 @@ LL | struct Foo<T, U: FromIterator<T>>(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:27
+ --> $DIR/type-check-defaults.rs:8:38
|
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
note: required by a bound in `Foo`
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
index 615fd2ccb..847bc517e 100644
--- 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
@@ -1,13 +1,13 @@
error: function can not have more than 65535 arguments
- --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:24
+ --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:22
|
-LL | fn _f($($t: ()),*) {}
- | ________________________^
-LL | | }
-LL | | }
-LL | |
-LL | | many_args!{[_]########## ######}
- | |____________^
+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-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr
index 53610985f..220b3929c 100644
--- a/src/test/ui/type/type-params-in-different-spaces-2.stderr
+++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
- --> $DIR/type-params-in-different-spaces-2.rs:10:9
+ --> $DIR/type-params-in-different-spaces-2.rs:10:16
|
LL | Tr::op(u)
- | ^^^^^^ the trait `Tr<U>` is not implemented for `Self`
+ | ------ ^ the trait `Tr<U>` is not implemented for `Self`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting `Self`
|
@@ -10,10 +12,12 @@ LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
| +++++++++++++++++
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
- --> $DIR/type-params-in-different-spaces-2.rs:16:9
+ --> $DIR/type-params-in-different-spaces-2.rs:16:16
|
LL | Tr::op(u)
- | ^^^^^^ the trait `Tr<U>` is not implemented for `Self`
+ | ------ ^ the trait `Tr<U>` is not implemented for `Self`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting `Self`
|