From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- src/test/ui/type/issue-100584.rs | 15 ++++++++ src/test/ui/type/issue-100584.stderr | 44 ++++++++++++++++++++++ src/test/ui/type/type-alias-bounds.rs | 2 +- src/test/ui/type/type-arg-out-of-scope.stderr | 12 +++--- .../type-ascription-instead-of-initializer.stderr | 2 +- src/test/ui/type/type-check-defaults.stderr | 8 ++-- ...-check-fn-with-more-than-65535-arguments.stderr | 16 ++++---- .../type/type-params-in-different-spaces-2.stderr | 12 ++++-- 8 files changed, 87 insertions(+), 24 deletions(-) create mode 100644 src/test/ui/type/issue-100584.rs create mode 100644 src/test/ui/type/issue-100584.stderr (limited to 'src/test/ui/type') 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 where U: Bound = U::Assoc; //~ WARN not enforced in type aliases // Do this instead: type T4 = ::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 = ::Assoc; //~ WARN not enforced in type aliases type T6 = ::std::vec::Vec; //~ 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(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: `bar` + | - ^ 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 @@ -14,9 +14,9 @@ error[E0401]: can't use generic parameters from outer function 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: `bar` + | - ^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `` 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); - | ^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator` + | ^^^^^^^^^^^^^ 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` @@ -12,10 +12,10 @@ 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:27 + --> $DIR/type-check-defaults.rs:8:38 | LL | struct WellFormedNoBounds>(Z); - | ^^^^^^^^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator` + | ^^^^^^^^^^^^^ 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` 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` 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` is not implemented for `Self` + | ------ ^ the trait `Tr` 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) -> Self where Self: Tr { | +++++++++++++++++ error[E0277]: the trait bound `Self: Tr` 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` is not implemented for `Self` + | ------ ^ the trait `Tr` is not implemented for `Self` + | | + | required by a bound introduced by this call | help: consider further restricting `Self` | -- cgit v1.2.3