diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-06-30 03:14:44 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-10-09 23:00:15 +0000 |
| commit | 2f79681fb9346ba511ad42499d12faee15e6c63a (patch) | |
| tree | 8988dcb2de19888d79ad14659eaac52d4fcf3073 /tests | |
| parent | 3d86b8acdab25399fc921ab6b522943a02bac410 (diff) | |
| download | rust-2f79681fb9346ba511ad42499d12faee15e6c63a.tar.gz rust-2f79681fb9346ba511ad42499d12faee15e6c63a.zip | |
Only emit one error per unsized binding, instead of one per usage
Fix #56607.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/sized/unsized-binding.rs | 4 | ||||
| -rw-r--r-- | tests/ui/sized/unsized-binding.stderr | 28 |
2 files changed, 3 insertions, 29 deletions
diff --git a/tests/ui/sized/unsized-binding.rs b/tests/ui/sized/unsized-binding.rs index 7d410718612..3b99b0f6e96 100644 --- a/tests/ui/sized/unsized-binding.rs +++ b/tests/ui/sized/unsized-binding.rs @@ -1,5 +1,5 @@ fn main() { let x = *""; //~ ERROR E0277 - println!("{}", x); //~ ERROR E0277 - println!("{}", x); //~ ERROR E0277 + println!("{}", x); + println!("{}", x); } diff --git a/tests/ui/sized/unsized-binding.stderr b/tests/ui/sized/unsized-binding.stderr index d508d84930a..af306685021 100644 --- a/tests/ui/sized/unsized-binding.stderr +++ b/tests/ui/sized/unsized-binding.stderr @@ -8,32 +8,6 @@ LL | let x = *""; = note: all local variables must have a statically known size = help: unsized locals are gated as an unstable feature -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/unsized-binding.rs:3:20 - | -LL | println!("{}", x); - | -- ^ doesn't have a size known at compile-time - | | - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `str` -note: required by a bound in `core::fmt::rt::Argument::<'a>::new_display` - --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/unsized-binding.rs:4:20 - | -LL | println!("{}", x); - | -- ^ doesn't have a size known at compile-time - | | - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `str` -note: required by a bound in `core::fmt::rt::Argument::<'a>::new_display` - --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 3 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. |
