From 10b6daa6c8e1e4b2a041c3a28cae8e1c139c1bd2 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 20 May 2019 01:08:52 +0100 Subject: [PATCH] Reblessed tests. --- .../libtest-json/output.json | 2 +- src/test/run-pass/multi-panic.rs | 2 +- .../rustdoc-ui/failed-doctest-output.stdout | 2 +- .../associated-type-bounds/duplicate.stderr | 7 +- .../associated-type-bounds/dyn-lcsit.stderr | 6 + .../implied-region-constraints.stderr | 9 +- .../ui/associated-type-bounds/lcsit.stderr | 6 + .../associated-types-path-2.stderr | 2 +- .../borrowck/borrowck-closures-two-mut.stderr | 104 ++---------- src/test/ui/borrowck/borrowck-reinit.stderr | 16 +- .../ui/borrowck/borrowck-storage-dead.stderr | 12 +- src/test/ui/borrowck/immutable-arg.stderr | 14 +- src/test/ui/borrowck/issue-41962.stderr | 24 +-- .../const-param-before-other-params.stderr | 14 +- .../deprecation-in-staged-api.stderr | 2 +- .../yield-while-local-borrowed.stderr | 32 +--- src/test/ui/indexing-requires-a-uint.stderr | 2 +- .../integer-literal-suffix-inference.stderr | 36 ++-- src/test/ui/issues/issue-13359.stderr | 4 +- src/test/ui/issues/issue-31910.stderr | 2 +- src/test/ui/issues/issue-45697-1.stderr | 14 +- src/test/ui/issues/issue-45697.stderr | 14 +- src/test/ui/issues/issue-46471-1.stderr | 17 +- src/test/ui/issues/issue-46471.stderr | 20 +-- src/test/ui/issues/issue-46472.stderr | 24 +-- .../liveness-assign-imm-local-notes.stderr | 51 ++---- ...od-ambig-one-trait-unknown-int-type.stderr | 2 +- .../ui/mismatched_types/issue-26480.stderr | 2 +- .../ui/moves/moves-based-on-type-tuple.stderr | 16 +- src/test/ui/nll/get_default.stderr | 58 ++----- .../ui/nll/loan_ends_mid_block_pair.stderr | 60 +------ .../ui/nll/loan_ends_mid_block_vec.stderr | 110 +++--------- .../nll/region-ends-after-if-condition.stderr | 32 +--- src/test/ui/nll/return_from_loop.stderr | 32 +--- src/test/ui/numeric/const-scope.stderr | 2 +- src/test/ui/numeric/len.stderr | 2 +- src/test/ui/numeric/numeric-cast-2.stderr | 6 +- src/test/ui/numeric/numeric-cast.stderr | 156 +++++++++--------- src/test/ui/pattern/const-pat-ice.stderr | 2 +- src/test/ui/pub/pub-restricted.stderr | 19 ++- src/test/ui/repeat_count.stderr | 4 +- src/test/ui/shift-various-bad-types.stderr | 2 +- src/test/ui/symbol-names/basic.stderr | 2 +- src/test/ui/symbol-names/impl1.stderr | 4 +- ...ounds-inconsistent-projection-error.stderr | 2 +- .../ui/tutorial-suffix-inference-test.stderr | 4 +- 46 files changed, 267 insertions(+), 688 deletions(-) create mode 100644 src/test/ui/associated-type-bounds/dyn-lcsit.stderr create mode 100644 src/test/ui/associated-type-bounds/lcsit.stderr diff --git a/src/test/run-make-fulldeps/libtest-json/output.json b/src/test/run-make-fulldeps/libtest-json/output.json index c8b3d081869..0caf268aa00 100644 --- a/src/test/run-make-fulldeps/libtest-json/output.json +++ b/src/test/run-make-fulldeps/libtest-json/output.json @@ -2,7 +2,7 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:8:5\nnote: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:8:5\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" } { "type": "test", "event": "started", "name": "c" } { "type": "test", "name": "c", "event": "ok" } { "type": "test", "event": "started", "name": "d" } diff --git a/src/test/run-pass/multi-panic.rs b/src/test/run-pass/multi-panic.rs index 900b2b2206f..8bc00020652 100644 --- a/src/test/run-pass/multi-panic.rs +++ b/src/test/run-pass/multi-panic.rs @@ -8,7 +8,7 @@ fn check_for_no_backtrace(test: std::process::Output) { let mut it = err.lines(); assert_eq!(it.next().map(|l| l.starts_with("thread '' panicked at")), Some(true)); - assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` \ + assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \ environment variable to display a backtrace.")); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next(), None); diff --git a/src/test/rustdoc-ui/failed-doctest-output.stdout b/src/test/rustdoc-ui/failed-doctest-output.stdout index 0c42c652d78..e362ecf349e 100644 --- a/src/test/rustdoc-ui/failed-doctest-output.stdout +++ b/src/test/rustdoc-ui/failed-doctest-output.stdout @@ -27,7 +27,7 @@ stderr: stderr 1 stderr 2 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:7:1 -note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr index fbf02ddc703..68367c91654 100644 --- a/src/test/ui/associated-type-bounds/duplicate.stderr +++ b/src/test/ui/associated-type-bounds/duplicate.stderr @@ -1,3 +1,9 @@ +warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash + --> $DIR/duplicate.rs:7:12 + | +LL | #![feature(impl_trait_in_bindings)] + | ^^^^^^^^^^^^^^^^^^^^^^ + error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified --> $DIR/duplicate.rs:12:36 | @@ -624,4 +630,3 @@ error: could not find defining uses error: aborting due to 93 previous errors -For more information about this error, try `rustc --explain E0719`. diff --git a/src/test/ui/associated-type-bounds/dyn-lcsit.stderr b/src/test/ui/associated-type-bounds/dyn-lcsit.stderr new file mode 100644 index 00000000000..5fe4818ef8f --- /dev/null +++ b/src/test/ui/associated-type-bounds/dyn-lcsit.stderr @@ -0,0 +1,6 @@ +warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash + --> $DIR/dyn-lcsit.rs:4:12 + | +LL | #![feature(impl_trait_in_bindings)] + | ^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr index b07b20272a8..9968f3e8bac 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.stderr +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.stderr @@ -2,9 +2,7 @@ error[E0623]: lifetime mismatch --> $DIR/implied-region-constraints.rs:19:64 | LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) - | ------------- - | | - | this type is declared with multiple lifetimes... + | ------------- this type is declared with multiple lifetimes... ... LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; | ^^^^^ ...but data with one lifetime flows into the other here @@ -13,13 +11,10 @@ error[E0623]: lifetime mismatch --> $DIR/implied-region-constraints.rs:40:72 | LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) - | -------------- - | | - | this type is declared with multiple lifetimes... + | -------------- this type is declared with multiple lifetimes... ... LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x; | ^^ ...but data with one lifetime flows into the other here error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/associated-type-bounds/lcsit.stderr b/src/test/ui/associated-type-bounds/lcsit.stderr new file mode 100644 index 00000000000..8fda11beddc --- /dev/null +++ b/src/test/ui/associated-type-bounds/lcsit.stderr @@ -0,0 +1,6 @@ +warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash + --> $DIR/lcsit.rs:4:12 + | +LL | #![feature(impl_trait_in_bindings)] + | ^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr index c25f12d0087..1405cb1b473 100644 --- a/src/test/ui/associated-types/associated-types-path-2.stderr +++ b/src/test/ui/associated-types/associated-types-path-2.stderr @@ -49,7 +49,7 @@ error[E0308]: mismatched types | LL | let _: i32 = f2(2i32); | ^^^^^^^^ expected i32, found u32 -help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit | LL | let _: i32 = f2(2i32).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr index e881201ddfc..bffb1164074 100644 --- a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr +++ b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr @@ -1,80 +1,5 @@ -error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) - --> $DIR/borrowck-closures-two-mut.rs:14:24 - | -LL | let c1 = to_fn_mut(|| x = 4); - | -- - previous borrow occurs due to use of `x` in closure - | | - | first mutable borrow occurs here -LL | let c2 = to_fn_mut(|| x = 5); - | ^^ - borrow occurs due to use of `x` in closure - | | - | second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) - --> $DIR/borrowck-closures-two-mut.rs:26:24 - | -LL | let c1 = to_fn_mut(|| set(&mut x)); - | -- - previous borrow occurs due to use of `x` in closure - | | - | first mutable borrow occurs here -LL | let c2 = to_fn_mut(|| set(&mut x)); - | ^^ - borrow occurs due to use of `x` in closure - | | - | second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) - --> $DIR/borrowck-closures-two-mut.rs:34:24 - | -LL | let c1 = to_fn_mut(|| x = 5); - | -- - previous borrow occurs due to use of `x` in closure - | | - | first mutable borrow occurs here -LL | let c2 = to_fn_mut(|| set(&mut x)); - | ^^ - borrow occurs due to use of `x` in closure - | | - | second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) - --> $DIR/borrowck-closures-two-mut.rs:42:24 - | -LL | let c1 = to_fn_mut(|| x = 5); - | -- - previous borrow occurs due to use of `x` in closure - | | - | first mutable borrow occurs here -LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) - | ^^ - borrow occurs due to use of `x` in closure - | | - | second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) - --> $DIR/borrowck-closures-two-mut.rs:55:24 - | -LL | let c1 = to_fn_mut(|| set(&mut *x.f)); - | -- - previous borrow occurs due to use of `x` in closure - | | - | first mutable borrow occurs here -LL | let c2 = to_fn_mut(|| set(&mut *x.f)); - | ^^ - borrow occurs due to use of `x` in closure - | | - | second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) - --> $DIR/borrowck-closures-two-mut.rs:14:24 +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:12:24 | LL | let c1 = to_fn_mut(|| x = 4); | -- - first borrow occurs due to use of `x` in closure @@ -84,12 +9,11 @@ LL | let c2 = to_fn_mut(|| x = 5); | ^^ - second borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here -LL | LL | drop((c1, c2)); | -- first borrow later used here -error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) - --> $DIR/borrowck-closures-two-mut.rs:26:24 +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:23:24 | LL | let c1 = to_fn_mut(|| set(&mut x)); | -- - first borrow occurs due to use of `x` in closure @@ -99,12 +23,11 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); | ^^ - second borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here -LL | LL | drop((c1, c2)); | -- first borrow later used here -error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) - --> $DIR/borrowck-closures-two-mut.rs:34:24 +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:30:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -114,12 +37,11 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); | ^^ - second borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here -LL | LL | drop((c1, c2)); | -- first borrow later used here -error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) - --> $DIR/borrowck-closures-two-mut.rs:42:24 +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:37:24 | LL | let c1 = to_fn_mut(|| x = 5); | -- - first borrow occurs due to use of `x` in closure @@ -129,12 +51,12 @@ LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nes | ^^ - second borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here -... +LL | LL | drop((c1, c2)); | -- first borrow later used here -error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) - --> $DIR/borrowck-closures-two-mut.rs:55:24 +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:49:24 | LL | let c1 = to_fn_mut(|| set(&mut *x.f)); | -- - first borrow occurs due to use of `x` in closure @@ -144,10 +66,10 @@ LL | let c2 = to_fn_mut(|| set(&mut *x.f)); | ^^ - second borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here -... +LL | LL | drop((c1, c2)); | -- first borrow later used here -error: aborting due to 10 previous errors +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/borrowck/borrowck-reinit.stderr b/src/test/ui/borrowck/borrowck-reinit.stderr index 3618a7cb2cd..f8f14b6435f 100644 --- a/src/test/ui/borrowck/borrowck-reinit.stderr +++ b/src/test/ui/borrowck/borrowck-reinit.stderr @@ -1,15 +1,5 @@ -error[E0382]: use of moved value: `x` (Ast) - --> $DIR/borrowck-reinit.rs:8:16 - | -LL | drop(x); - | - value moved here -LL | let _ = (1,x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait - -error[E0382]: use of moved value: `x` (Mir) - --> $DIR/borrowck-reinit.rs:8:16 +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-reinit.rs:6:16 | LL | let mut x = Box::new(0); | ----- move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -19,6 +9,6 @@ LL | drop(x); LL | let _ = (1,x); | ^ value used here after move -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/borrowck/borrowck-storage-dead.stderr b/src/test/ui/borrowck/borrowck-storage-dead.stderr index c291ed224eb..5b9f49c2e7c 100644 --- a/src/test/ui/borrowck/borrowck-storage-dead.stderr +++ b/src/test/ui/borrowck/borrowck-storage-dead.stderr @@ -1,15 +1,9 @@ -error[E0381]: use of possibly uninitialized variable: `x` (Ast) - --> $DIR/borrowck-storage-dead.rs:18:17 +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-storage-dead.rs:16:17 | LL | let _ = x + 1; | ^ use of possibly uninitialized `x` -error[E0381]: use of possibly uninitialized variable: `x` (Mir) - --> $DIR/borrowck-storage-dead.rs:18:17 - | -LL | let _ = x + 1; - | ^ use of possibly uninitialized `x` - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/borrowck/immutable-arg.stderr b/src/test/ui/borrowck/immutable-arg.stderr index 8b21e926666..7255ca327e7 100644 --- a/src/test/ui/borrowck/immutable-arg.stderr +++ b/src/test/ui/borrowck/immutable-arg.stderr @@ -1,19 +1,11 @@ -error[E0384]: cannot assign twice to immutable variable `_x` (Ast) - --> $DIR/immutable-arg.rs:4:5 - | -LL | fn foo(_x: u32) { - | -- first assignment to `_x` -LL | _x = 4; - | ^^^^^^ cannot assign twice to immutable variable - -error[E0384]: cannot assign to immutable argument `_x` (Mir) - --> $DIR/immutable-arg.rs:4:5 +error[E0384]: cannot assign to immutable argument `_x` + --> $DIR/immutable-arg.rs:2:5 | LL | fn foo(_x: u32) { | -- help: make this binding mutable: `mut _x` LL | _x = 4; | ^^^^^^ cannot assign to immutable argument -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/borrowck/issue-41962.stderr b/src/test/ui/borrowck/issue-41962.stderr index fd4d318b5dd..422d1605aa4 100644 --- a/src/test/ui/borrowck/issue-41962.stderr +++ b/src/test/ui/borrowck/issue-41962.stderr @@ -1,29 +1,11 @@ -error[E0382]: use of partially moved value: `maybe` (Ast) - --> $DIR/issue-41962.rs:7:30 - | -LL | if let Some(thing) = maybe { - | ----- ^^^^^ value used here after move - | | - | value moved here - | - = note: move occurs because the value has type `std::vec::Vec`, which does not implement the `Copy` trait - -error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) - --> $DIR/issue-41962.rs:7:21 - | -LL | if let Some(thing) = maybe { - | ^^^^^ value moved here in previous iteration of loop - | - = note: move occurs because the value has type `std::vec::Vec`, which does not implement the `Copy` trait - -error[E0382]: use of moved value (Mir) - --> $DIR/issue-41962.rs:7:21 +error[E0382]: use of moved value + --> $DIR/issue-41962.rs:5:21 | LL | if let Some(thing) = maybe { | ^^^^^ value moved here, in previous iteration of loop | = note: move occurs because value has type `std::vec::Vec`, which does not implement the `Copy` trait -error: aborting due to 3 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr index 78f129e79ea..33f981d1eba 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.stderr @@ -4,17 +4,17 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ -error: type parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:4:21 - | -LL | fn foo(_: &T) { - | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` - error: lifetime parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:8:21 + --> $DIR/const-param-before-other-params.rs:4:21 | LL | fn bar(_: &'a ()) { | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` +error: type parameters must be declared prior to const parameters + --> $DIR/const-param-before-other-params.rs:8:21 + | +LL | fn foo(_: &T) { + | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` + error: aborting due to 2 previous errors diff --git a/src/test/ui/deprecation/deprecation-in-staged-api.stderr b/src/test/ui/deprecation/deprecation-in-staged-api.stderr index 6a8056ec2d9..c6881d5a573 100644 --- a/src/test/ui/deprecation/deprecation-in-staged-api.stderr +++ b/src/test/ui/deprecation/deprecation-in-staged-api.stderr @@ -1,4 +1,4 @@ -error: `#[deprecated]` cannot be used in staged api, use `#[rustc_deprecated]` instead +error: `#[deprecated]` cannot be used in staged API; use `#[rustc_deprecated]` instead --> $DIR/deprecation-in-staged-api.rs:8:1 | LL | fn main() { } diff --git a/src/test/ui/generator/yield-while-local-borrowed.stderr b/src/test/ui/generator/yield-while-local-borrowed.stderr index 56f425b7e70..c1513ef9b71 100644 --- a/src/test/ui/generator/yield-while-local-borrowed.stderr +++ b/src/test/ui/generator/yield-while-local-borrowed.stderr @@ -1,39 +1,21 @@ -error[E0626]: borrow may still be in use when generator yields (Ast) - --> $DIR/yield-while-local-borrowed.rs:15:22 - | -LL | let a = &mut 3; - | ^ -... -LL | yield(); - | ------- possible yield occurs here - -error[E0626]: borrow may still be in use when generator yields (Ast) - --> $DIR/yield-while-local-borrowed.rs:43:22 - | -LL | let b = &a; - | ^ -... -LL | yield(); - | ------- possible yield occurs here - -error[E0626]: borrow may still be in use when generator yields (Mir) - --> $DIR/yield-while-local-borrowed.rs:15:17 +error[E0626]: borrow may still be in use when generator yields + --> $DIR/yield-while-local-borrowed.rs:13:17 | LL | let a = &mut 3; | ^^^^^^ -... +LL | LL | yield(); | ------- possible yield occurs here -error[E0626]: borrow may still be in use when generator yields (Mir) - --> $DIR/yield-while-local-borrowed.rs:43:21 +error[E0626]: borrow may still be in use when generator yields + --> $DIR/yield-while-local-borrowed.rs:40:21 | LL | let b = &a; | ^^ -... +LL | LL | yield(); | ------- possible yield occurs here -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0626`. diff --git a/src/test/ui/indexing-requires-a-uint.stderr b/src/test/ui/indexing-requires-a-uint.stderr index 9dafe1c24f1..3300db58d44 100644 --- a/src/test/ui/indexing-requires-a-uint.stderr +++ b/src/test/ui/indexing-requires-a-uint.stderr @@ -12,7 +12,7 @@ error[E0308]: mismatched types | LL | bar::(i); // i should not be re-coerced back to an isize | ^ expected isize, found usize -help: you can convert an `usize` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit | LL | bar::(i.try_into().unwrap()); // i should not be re-coerced back to an isize | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/integer-literal-suffix-inference.stderr index b5b3f27f0e6..80b601dc439 100644 --- a/src/test/ui/integer-literal-suffix-inference.stderr +++ b/src/test/ui/integer-literal-suffix-inference.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | id_i8(a16); | ^^^ expected i8, found i16 -help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(a16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ error[E0308]: mismatched types | LL | id_i8(a32); | ^^^ expected i8, found i32 -help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(a32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ error[E0308]: mismatched types | LL | id_i8(a64); | ^^^ expected i8, found i64 -help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -42,7 +42,7 @@ error[E0308]: mismatched types | LL | id_i16(a32); | ^^^ expected i16, found i32 -help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | LL | id_i16(a32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,7 +52,7 @@ error[E0308]: mismatched types | LL | id_i16(a64); | ^^^ expected i16, found i64 -help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | LL | id_i16(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ error[E0308]: mismatched types | LL | id_i32(a64); | ^^^ expected i32, found i64 -help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | LL | id_i32(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +117,7 @@ error[E0308]: mismatched types | LL | id_i8(c16); | ^^^ expected i8, found i16 -help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(c16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -127,7 +127,7 @@ error[E0308]: mismatched types | LL | id_i8(c32); | ^^^ expected i8, found i32 -help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(c32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -137,7 +137,7 @@ error[E0308]: mismatched types | LL | id_i8(c64); | ^^^ expected i8, found i64 -help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | LL | id_i8(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -156,7 +156,7 @@ error[E0308]: mismatched types | LL | id_i16(c32); | ^^^ expected i16, found i32 -help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | LL | id_i16(c32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -166,7 +166,7 @@ error[E0308]: mismatched types | LL | id_i16(c64); | ^^^ expected i16, found i64 -help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | LL | id_i16(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -194,7 +194,7 @@ error[E0308]: mismatched types | LL | id_i32(c64); | ^^^ expected i32, found i64 -help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | LL | id_i32(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -231,7 +231,7 @@ error[E0308]: mismatched types | LL | id_u8(b16); | ^^^ expected u8, found u16 -help: you can convert an `u16` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit | LL | id_u8(b16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -241,7 +241,7 @@ error[E0308]: mismatched types | LL | id_u8(b32); | ^^^ expected u8, found u32 -help: you can convert an `u32` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit | LL | id_u8(b32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -251,7 +251,7 @@ error[E0308]: mismatched types | LL | id_u8(b64); | ^^^ expected u8, found u64 -help: you can convert an `u64` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit | LL | id_u8(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -270,7 +270,7 @@ error[E0308]: mismatched types | LL | id_u16(b32); | ^^^ expected u16, found u32 -help: you can convert an `u32` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit | LL | id_u16(b32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -280,7 +280,7 @@ error[E0308]: mismatched types | LL | id_u16(b64); | ^^^ expected u16, found u64 -help: you can convert an `u64` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit | LL | id_u16(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -308,7 +308,7 @@ error[E0308]: mismatched types | LL | id_u32(b64); | ^^^ expected u32, found u64 -help: you can convert an `u64` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit | LL | id_u32(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr index b16b7a5b2cf..7cfd754f72d 100644 --- a/src/test/ui/issues/issue-13359.stderr +++ b/src/test/ui/issues/issue-13359.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | foo(1*(1 as isize)); | ^^^^^^^^^^^^^^ expected i16, found isize -help: you can convert an `isize` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit | LL | foo((1*(1 as isize)).try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ error[E0308]: mismatched types | LL | bar(1*(1 as usize)); | ^^^^^^^^^^^^^^ expected u32, found usize -help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | LL | bar((1*(1 as usize)).try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-31910.stderr b/src/test/ui/issues/issue-31910.stderr index 8dd9287ffec..e7555b958a3 100644 --- a/src/test/ui/issues/issue-31910.stderr +++ b/src/test/ui/issues/issue-31910.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | X = Trait::Number, | ^^^^^^^^^^^^^ expected isize, found i32 -help: you can convert an `i32` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | LL | X = Trait::Number.try_into().unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-45697-1.stderr b/src/test/ui/issues/issue-45697-1.stderr index 854e18003f3..30c69f19658 100644 --- a/src/test/ui/issues/issue-45697-1.stderr +++ b/src/test/ui/issues/issue-45697-1.stderr @@ -1,12 +1,4 @@ -error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Ast) - --> $DIR/issue-45697-1.rs:20:9 - | -LL | let z = copy_borrowed_ptr(&mut y); - | - borrow of `*y.pointer` occurs here -LL | *y.pointer += 1; - | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here - -error[E0503]: cannot use `*y.pointer` because it was mutably borrowed (Mir) +error[E0503]: cannot use `*y.pointer` because it was mutably borrowed --> $DIR/issue-45697-1.rs:20:9 | LL | let z = copy_borrowed_ptr(&mut y); @@ -17,7 +9,7 @@ LL | *y.pointer += 1; LL | *z.pointer += 1; | --------------- borrow later used here -error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Mir) +error[E0506]: cannot assign to `*y.pointer` because it is borrowed --> $DIR/issue-45697-1.rs:20:9 | LL | let z = copy_borrowed_ptr(&mut y); @@ -28,7 +20,7 @@ LL | *y.pointer += 1; LL | *z.pointer += 1; | --------------- borrow later used here -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0503, E0506. For more information about an error, try `rustc --explain E0503`. diff --git a/src/test/ui/issues/issue-45697.stderr b/src/test/ui/issues/issue-45697.stderr index 01ae416b1cf..26749d36f0b 100644 --- a/src/test/ui/issues/issue-45697.stderr +++ b/src/test/ui/issues/issue-45697.stderr @@ -1,12 +1,4 @@ -error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Ast) - --> $DIR/issue-45697.rs:20:9 - | -LL | let z = copy_borrowed_ptr(&mut y); - | - borrow of `*y.pointer` occurs here -LL | *y.pointer += 1; - | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here - -error[E0503]: cannot use `*y.pointer` because it was mutably borrowed (Mir) +error[E0503]: cannot use `*y.pointer` because it was mutably borrowed --> $DIR/issue-45697.rs:20:9 | LL | let z = copy_borrowed_ptr(&mut y); @@ -17,7 +9,7 @@ LL | *y.pointer += 1; LL | *z.pointer += 1; | --------------- borrow later used here -error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Mir) +error[E0506]: cannot assign to `*y.pointer` because it is borrowed --> $DIR/issue-45697.rs:20:9 | LL | let z = copy_borrowed_ptr(&mut y); @@ -28,7 +20,7 @@ LL | *y.pointer += 1; LL | *z.pointer += 1; | --------------- borrow later used here -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0503, E0506. For more information about an error, try `rustc --explain E0503`. diff --git a/src/test/ui/issues/issue-46471-1.stderr b/src/test/ui/issues/issue-46471-1.stderr index 51026c9f2d8..b09f31729a5 100644 --- a/src/test/ui/issues/issue-46471-1.stderr +++ b/src/test/ui/issues/issue-46471-1.stderr @@ -1,16 +1,5 @@ -error[E0597]: `z` does not live long enough (Ast) - --> $DIR/issue-46471-1.rs:6:14 - | -LL | &mut z - | ^ borrowed value does not live long enough -LL | }; - | - `z` dropped here while still borrowed -... -LL | } - | - borrowed value needs to live until here - -error[E0597]: `z` does not live long enough (Mir) - --> $DIR/issue-46471-1.rs:6:9 +error[E0597]: `z` does not live long enough + --> $DIR/issue-46471-1.rs:4:9 | LL | &mut z | ^^^^^^ @@ -20,6 +9,6 @@ LL | &mut z LL | }; | - `z` dropped here while still borrowed -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/issues/issue-46471.stderr b/src/test/ui/issues/issue-46471.stderr index 90202e307eb..935414c1f3f 100644 --- a/src/test/ui/issues/issue-46471.stderr +++ b/src/test/ui/issues/issue-46471.stderr @@ -1,21 +1,9 @@ -error[E0597]: `x` does not live long enough (Ast) - --> $DIR/issue-46471.rs:5:6 - | -LL | &x - | ^ borrowed value does not live long enough -... -LL | } - | - borrowed value only lives until here - | - = note: borrowed value must be valid for the static lifetime... - -error[E0515]: cannot return reference to local variable `x` (Mir) - --> $DIR/issue-46471.rs:5:5 +error[E0515]: cannot return reference to local variable `x` + --> $DIR/issue-46471.rs:3:5 | LL | &x | ^^ returns a reference to data owned by the current function -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0515, E0597. -For more information about an error, try `rustc --explain E0515`. +For more information about this error, try `rustc --explain E0515`. diff --git a/src/test/ui/issues/issue-46472.stderr b/src/test/ui/issues/issue-46472.stderr index 0cc93a081b2..6e561e03a8b 100644 --- a/src/test/ui/issues/issue-46472.stderr +++ b/src/test/ui/issues/issue-46472.stderr @@ -1,20 +1,5 @@ -error[E0597]: borrowed value does not live long enough (Ast) - --> $DIR/issue-46472.rs:4:10 - | -LL | &mut 4 - | ^ temporary value does not live long enough -... -LL | } - | - temporary value only lives until here - | -note: borrowed value must be valid for the lifetime 'a as defined on the function body at 3:8... - --> $DIR/issue-46472.rs:3:8 - | -LL | fn bar<'a>() -> &'a mut u32 { - | ^^ - -error[E0515]: cannot return reference to temporary value (Mir) - --> $DIR/issue-46472.rs:4:5 +error[E0515]: cannot return reference to temporary value + --> $DIR/issue-46472.rs:2:5 | LL | &mut 4 | ^^^^^- @@ -22,7 +7,6 @@ LL | &mut 4 | | temporary value created here | returns a reference to data owned by the current function -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0515, E0597. -For more information about an error, try `rustc --explain E0515`. +For more information about this error, try `rustc --explain E0515`. diff --git a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr index e15290f0b9e..c646912d3b6 100644 --- a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr @@ -1,36 +1,5 @@ -error[E0384]: cannot assign twice to immutable variable `x` (Ast) - --> $DIR/liveness-assign-imm-local-notes.rs:13:9 - | -LL | x = 2; - | ----- first assignment to `x` -LL | x = 3; - | ^^^^^ cannot assign twice to immutable variable - -error[E0384]: cannot assign twice to immutable variable `x` (Ast) - --> $DIR/liveness-assign-imm-local-notes.rs:25:13 - | -LL | x = 2; - | ----- first assignment to `x` -LL | x = 3; - | ^^^^^ cannot assign twice to immutable variable - -error[E0384]: cannot assign twice to immutable variable `x` (Ast) - --> $DIR/liveness-assign-imm-local-notes.rs:35:13 - | -LL | x = 1; - | ^^^^^ cannot assign twice to immutable variable - -error[E0384]: cannot assign twice to immutable variable `x` (Ast) - --> $DIR/liveness-assign-imm-local-notes.rs:38:13 - | -LL | x = 1; - | ----- first assignment to `x` -... -LL | x = 2; - | ^^^^^ cannot assign twice to immutable variable - -error[E0384]: cannot assign twice to immutable variable `x` (Mir) - --> $DIR/liveness-assign-imm-local-notes.rs:13:9 +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/liveness-assign-imm-local-notes.rs:10:9 | LL | let x; | - help: make this binding mutable: `mut x` @@ -40,8 +9,8 @@ LL | x = 2; LL | x = 3; | ^^^^^ cannot assign twice to immutable variable -error[E0384]: cannot assign twice to immutable variable `x` (Mir) - --> $DIR/liveness-assign-imm-local-notes.rs:25:13 +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/liveness-assign-imm-local-notes.rs:21:13 | LL | let x; | - help: make this binding mutable: `mut x` @@ -51,8 +20,8 @@ LL | x = 2; LL | x = 3; | ^^^^^ cannot assign twice to immutable variable -error[E0384]: cannot assign twice to immutable variable `x` (Mir) - --> $DIR/liveness-assign-imm-local-notes.rs:35:13 +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/liveness-assign-imm-local-notes.rs:30:13 | LL | let x; | - help: make this binding mutable: `mut x` @@ -60,18 +29,18 @@ LL | let x; LL | x = 1; | ^^^^^ cannot assign twice to immutable variable -error[E0384]: cannot assign twice to immutable variable `x` (Mir) - --> $DIR/liveness-assign-imm-local-notes.rs:38:13 +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/liveness-assign-imm-local-notes.rs:32:13 | LL | let x; | - help: make this binding mutable: `mut x` ... LL | x = 1; | ----- first assignment to `x` -... +LL | } else { LL | x = 2; | ^^^^^ cannot assign twice to immutable variable -error: aborting due to 8 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index 49c72a655e5..b1bd749bef4 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types | LL | let y: usize = x.foo(); | ^^^^^^^ expected usize, found isize -help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | LL | let y: usize = x.foo().try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/mismatched_types/issue-26480.stderr b/src/test/ui/mismatched_types/issue-26480.stderr index 1a81df8e2c4..881d9fd3202 100644 --- a/src/test/ui/mismatched_types/issue-26480.stderr +++ b/src/test/ui/mismatched_types/issue-26480.stderr @@ -6,7 +6,7 @@ LL | $arr.len() * size_of($arr[0])); ... LL | write!(hello); | -------------- in this macro invocation -help: you can convert an `usize` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit | LL | ($arr.len() * size_of($arr[0])).try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/moves/moves-based-on-type-tuple.stderr b/src/test/ui/moves/moves-based-on-type-tuple.stderr index c49dbdab402..2e1ddbdf57f 100644 --- a/src/test/ui/moves/moves-based-on-type-tuple.stderr +++ b/src/test/ui/moves/moves-based-on-type-tuple.stderr @@ -1,15 +1,5 @@ -error[E0382]: use of moved value: `x` (Ast) - --> $DIR/moves-based-on-type-tuple.rs:6:13 - | -LL | box (x, x) - | - ^ value used here after move - | | - | value moved here - | - = note: move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait - -error[E0382]: use of moved value: `x` (Mir) - --> $DIR/moves-based-on-type-tuple.rs:6:13 +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-tuple.rs:4:13 | LL | fn dup(x: Box) -> Box<(Box,Box)> { | - move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -18,6 +8,6 @@ LL | box (x, x) | | | value moved here -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/nll/get_default.stderr b/src/test/ui/nll/get_default.stderr index abb5343845b..af79771e7e1 100644 --- a/src/test/ui/nll/get_default.stderr +++ b/src/test/ui/nll/get_default.stderr @@ -1,41 +1,5 @@ -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) - --> $DIR/get_default.rs:23:17 - | -LL | match map.get() { - | --- immutable borrow occurs here -... -LL | map.set(String::new()); // Ideally, this would not error. - | ^^^ mutable borrow occurs here -... -LL | } - | - immutable borrow ends here - -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) - --> $DIR/get_default.rs:35:17 - | -LL | match map.get() { - | --- immutable borrow occurs here -LL | Some(v) => { -LL | map.set(String::new()); // Both AST and MIR error here - | ^^^ mutable borrow occurs here -... -LL | } - | - immutable borrow ends here - -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast) - --> $DIR/get_default.rs:41:17 - | -LL | match map.get() { - | --- immutable borrow occurs here -... -LL | map.set(String::new()); // Ideally, just AST would error here - | ^^^ mutable borrow occurs here -... -LL | } - | - immutable borrow ends here - -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir) - --> $DIR/get_default.rs:23:17 +error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable + --> $DIR/get_default.rs:21:17 | LL | fn ok(map: &mut Map) -> &String { | - let's call the lifetime of this reference `'1` @@ -47,10 +11,10 @@ LL | return v; | - returning this value requires that `*map` is borrowed for `'1` ... LL | map.set(String::new()); // Ideally, this would not error. - | ^^^ mutable borrow occurs here + | ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir) - --> $DIR/get_default.rs:35:17 +error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable + --> $DIR/get_default.rs:32:17 | LL | fn err(map: &mut Map) -> &String { | - let's call the lifetime of this reference `'1` @@ -59,13 +23,13 @@ LL | match map.get() { | --- immutable borrow occurs here LL | Some(v) => { LL | map.set(String::new()); // Both AST and MIR error here - | ^^^ mutable borrow occurs here -... + | ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here +LL | LL | return v; | - returning this value requires that `*map` is borrowed for `'1` -error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir) - --> $DIR/get_default.rs:41:17 +error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable + --> $DIR/get_default.rs:37:17 | LL | fn err(map: &mut Map) -> &String { | - let's call the lifetime of this reference `'1` @@ -77,8 +41,8 @@ LL | return v; | - returning this value requires that `*map` is borrowed for `'1` ... LL | map.set(String::new()); // Ideally, just AST would error here - | ^^^ mutable borrow occurs here + | ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here -error: aborting due to 6 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/nll/loan_ends_mid_block_pair.stderr b/src/test/ui/nll/loan_ends_mid_block_pair.stderr index 85703bda31c..eb8442b31d7 100644 --- a/src/test/ui/nll/loan_ends_mid_block_pair.stderr +++ b/src/test/ui/nll/loan_ends_mid_block_pair.stderr @@ -1,59 +1,5 @@ -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:14:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -LL | capitalize(c); -LL | data.0 = 'e'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:17:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -... -LL | data.0 = 'f'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:19:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -... -LL | data.0 = 'g'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:28:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -LL | capitalize(c); -LL | data.0 = 'e'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:30:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -... -LL | data.0 = 'f'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) - --> $DIR/loan_ends_mid_block_pair.rs:32:5 - | -LL | let c = &mut data.0; - | ------ borrow of `data.0` occurs here -... -LL | data.0 = 'g'; - | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here - -error[E0506]: cannot assign to `data.0` because it is borrowed (Mir) - --> $DIR/loan_ends_mid_block_pair.rs:14:5 +error[E0506]: cannot assign to `data.0` because it is borrowed + --> $DIR/loan_ends_mid_block_pair.rs:12:5 | LL | let c = &mut data.0; | ----------- borrow of `data.0` occurs here @@ -64,6 +10,6 @@ LL | data.0 = 'e'; LL | capitalize(c); | - borrow later used here -error: aborting due to 7 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/nll/loan_ends_mid_block_vec.stderr b/src/test/ui/nll/loan_ends_mid_block_vec.stderr index a3f1391f001..c0b97bea348 100644 --- a/src/test/ui/nll/loan_ends_mid_block_vec.stderr +++ b/src/test/ui/nll/loan_ends_mid_block_vec.stderr @@ -1,111 +1,39 @@ -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) +error[E0499]: cannot borrow `data` as mutable more than once at a time + --> $DIR/loan_ends_mid_block_vec.rs:11:5 + | +LL | let slice = &mut data; + | --------- first mutable borrow occurs here +LL | capitalize(slice); +LL | data.push('d'); + | ^^^^ second mutable borrow occurs here +... +LL | capitalize(slice); + | ----- first borrow later used here + +error[E0499]: cannot borrow `data` as mutable more than once at a time --> $DIR/loan_ends_mid_block_vec.rs:13:5 | LL | let slice = &mut data; - | ---- first mutable borrow occurs here -LL | capitalize(slice); -LL | data.push('d'); - | ^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) - --> $DIR/loan_ends_mid_block_vec.rs:16:5 - | -LL | let slice = &mut data; - | ---- first mutable borrow occurs here + | --------- first mutable borrow occurs here ... LL | data.push('e'); | ^^^^ second mutable borrow occurs here ... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) - --> $DIR/loan_ends_mid_block_vec.rs:19:5 - | -LL | let slice = &mut data; - | ---- first mutable borrow occurs here -... -LL | data.push('f'); - | ^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) - --> $DIR/loan_ends_mid_block_vec.rs:29:5 - | -LL | let slice = &mut data; - | ---- first mutable borrow occurs here LL | capitalize(slice); -LL | data.push('d'); - | ^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here + | ----- first borrow later used here -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) - --> $DIR/loan_ends_mid_block_vec.rs:31:5 +error[E0499]: cannot borrow `data` as mutable more than once at a time + --> $DIR/loan_ends_mid_block_vec.rs:15:5 | LL | let slice = &mut data; - | ---- first mutable borrow occurs here -... -LL | data.push('e'); - | ^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) - --> $DIR/loan_ends_mid_block_vec.rs:33:5 - | -LL | let slice = &mut data; - | ---- first mutable borrow occurs here + | --------- first mutable borrow occurs here ... LL | data.push('f'); | ^^^^ second mutable borrow occurs here LL | -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) - --> $DIR/loan_ends_mid_block_vec.rs:13:5 - | -LL | let slice = &mut data; - | --------- first mutable borrow occurs here -LL | capitalize(slice); -LL | data.push('d'); - | ^^^^ second mutable borrow occurs here -... LL | capitalize(slice); | ----- first borrow later used here -error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) - --> $DIR/loan_ends_mid_block_vec.rs:16:5 - | -LL | let slice = &mut data; - | --------- first mutable borrow occurs here -... -LL | data.push('e'); - | ^^^^ second mutable borrow occurs here -... -LL | capitalize(slice); - | ----- first borrow later used here - -error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) - --> $DIR/loan_ends_mid_block_vec.rs:19:5 - | -LL | let slice = &mut data; - | --------- first mutable borrow occurs here -... -LL | data.push('f'); - | ^^^^ second mutable borrow occurs here -... -LL | capitalize(slice); - | ----- first borrow later used here - -error: aborting due to 9 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/nll/region-ends-after-if-condition.stderr b/src/test/ui/nll/region-ends-after-if-condition.stderr index aa876a0bcb3..c03e3857906 100644 --- a/src/test/ui/nll/region-ends-after-if-condition.stderr +++ b/src/test/ui/nll/region-ends-after-if-condition.stderr @@ -1,39 +1,15 @@ -error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) - --> $DIR/region-ends-after-if-condition.rs:19:9 - | -LL | let value = &my_struct.field; - | --------------- immutable borrow occurs here -LL | if value.is_empty() { -LL | my_struct.field.push_str("Hello, world!"); - | ^^^^^^^^^^^^^^^ mutable borrow occurs here -... -LL | } - | - immutable borrow ends here - -error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) - --> $DIR/region-ends-after-if-condition.rs:29:9 - | -LL | let value = &my_struct.field; - | --------------- immutable borrow occurs here -LL | if value.is_empty() { -LL | my_struct.field.push_str("Hello, world!"); - | ^^^^^^^^^^^^^^^ mutable borrow occurs here -... -LL | } - | - immutable borrow ends here - -error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Mir) - --> $DIR/region-ends-after-if-condition.rs:29:9 +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable + --> $DIR/region-ends-after-if-condition.rs:26:9 | LL | let value = &my_struct.field; | ---------------- immutable borrow occurs here LL | if value.is_empty() { LL | my_struct.field.push_str("Hello, world!"); - | ^^^^^^^^^^^^^^^ mutable borrow occurs here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here ... LL | drop(value); | ----- immutable borrow later used here -error: aborting due to 3 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/nll/return_from_loop.stderr b/src/test/ui/nll/return_from_loop.stderr index 09882d55cb7..efd56ea2dd5 100644 --- a/src/test/ui/nll/return_from_loop.stderr +++ b/src/test/ui/nll/return_from_loop.stderr @@ -1,39 +1,15 @@ -error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Ast) - --> $DIR/return_from_loop.rs:22:9 - | -LL | let value = &mut my_struct.field; - | --------------- first mutable borrow occurs here -LL | loop { -LL | my_struct.field.push_str("Hello, world!"); - | ^^^^^^^^^^^^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Ast) - --> $DIR/return_from_loop.rs:35:9 - | -LL | let value = &mut my_struct.field; - | --------------- first mutable borrow occurs here -LL | loop { -LL | my_struct.field.push_str("Hello, world!"); - | ^^^^^^^^^^^^^^^ second mutable borrow occurs here -... -LL | } - | - first borrow ends here - -error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Mir) - --> $DIR/return_from_loop.rs:22:9 +error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time + --> $DIR/return_from_loop.rs:20:9 | LL | let value = &mut my_struct.field; | -------------------- first mutable borrow occurs here LL | loop { LL | my_struct.field.push_str("Hello, world!"); | ^^^^^^^^^^^^^^^ second mutable borrow occurs here -... +LL | LL | value.len(); | ----- first borrow later used here -error: aborting due to 3 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/numeric/const-scope.stderr b/src/test/ui/numeric/const-scope.stderr index ead3a79da02..3f69bcc7d4a 100644 --- a/src/test/ui/numeric/const-scope.stderr +++ b/src/test/ui/numeric/const-scope.stderr @@ -37,7 +37,7 @@ error[E0308]: mismatched types | LL | let d: i8 = c; | ^ expected i8, found i32 -help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | LL | let d: i8 = c.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/numeric/len.stderr b/src/test/ui/numeric/len.stderr index 5a9349b4c0f..c767bdd9bd5 100644 --- a/src/test/ui/numeric/len.stderr +++ b/src/test/ui/numeric/len.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | test(array.len()); | ^^^^^^^^^^^ expected u32, found usize -help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | LL | test(array.len().try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/numeric/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr index be4411e630b..f58389ce96c 100644 --- a/src/test/ui/numeric/numeric-cast-2.stderr +++ b/src/test/ui/numeric/numeric-cast-2.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | let x: u16 = foo(); | ^^^^^ expected u16, found i32 -help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | LL | let x: u16 = foo().try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ error[E0308]: mismatched types | LL | let y: i64 = x + x; | ^^^^^ expected i64, found u16 -help: you can convert an `u16` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit | LL | let y: i64 = (x + x).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ error[E0308]: mismatched types | LL | let z: i32 = x + x; | ^^^^^ expected i32, found u16 -help: you can convert an `u16` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit | LL | let z: i32 = (x + x).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr index 9e7dcf7e41b..e66b83f2b39 100644 --- a/src/test/ui/numeric/numeric-cast.stderr +++ b/src/test/ui/numeric/numeric-cast.stderr @@ -3,7 +3,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected usize, found u64 -help: you can convert an `u64` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected usize, found u32 -help: you can convert an `u32` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected usize, found u16 -help: you can convert an `u16` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -33,7 +33,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected usize, found u8 -help: you can convert an `u8` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -43,7 +43,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected usize, found isize -help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected usize, found i64 -help: you can convert an `i64` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -63,7 +63,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected usize, found i32 -help: you can convert an `i32` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected usize, found i16 -help: you can convert an `i16` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -83,7 +83,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected usize, found i8 -help: you can convert an `i8` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `usize` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -93,7 +93,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected isize, found usize -help: you can convert an `usize` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -103,7 +103,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected isize, found u64 -help: you can convert an `u64` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -113,7 +113,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected isize, found u32 -help: you can convert an `u32` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,7 +123,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected isize, found u16 -help: you can convert an `u16` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -133,7 +133,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected isize, found u8 -help: you can convert an `u8` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -143,7 +143,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected isize, found i64 -help: you can convert an `i64` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -153,7 +153,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected isize, found i32 -help: you can convert an `i32` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -163,7 +163,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected isize, found i16 -help: you can convert an `i16` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -173,7 +173,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected isize, found i8 -help: you can convert an `i8` to `isize` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `isize` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -183,7 +183,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected u64, found usize -help: you can convert an `usize` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -220,7 +220,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected u64, found isize -help: you can convert an `isize` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -230,7 +230,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected u64, found i64 -help: you can convert an `i64` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -240,7 +240,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected u64, found i32 -help: you can convert an `i32` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -250,7 +250,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected u64, found i16 -help: you can convert an `i16` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -260,7 +260,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected u64, found i8 -help: you can convert an `i8` to `u64` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `u64` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -270,7 +270,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected i64, found usize -help: you can convert an `usize` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -280,7 +280,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected i64, found u64 -help: you can convert an `u64` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -290,7 +290,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected i64, found u32 -help: you can convert an `u32` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -300,7 +300,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected i64, found u16 -help: you can convert an `u16` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -310,7 +310,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected i64, found u8 -help: you can convert an `u8` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -320,7 +320,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected i64, found isize -help: you can convert an `isize` to `i64` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `i64` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -357,7 +357,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected u32, found usize -help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -367,7 +367,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected u32, found u64 -help: you can convert an `u64` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -395,7 +395,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected u32, found isize -help: you can convert an `isize` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -405,7 +405,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected u32, found i64 -help: you can convert an `i64` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -415,7 +415,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected u32, found i32 -help: you can convert an `i32` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -425,7 +425,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected u32, found i16 -help: you can convert an `i16` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -435,7 +435,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected u32, found i8 -help: you can convert an `i8` to `u32` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `u32` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -445,7 +445,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected i32, found usize -help: you can convert an `usize` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -455,7 +455,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected i32, found u64 -help: you can convert an `u64` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -465,7 +465,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected i32, found u32 -help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -475,7 +475,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected i32, found u16 -help: you can convert an `u16` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -485,7 +485,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected i32, found u8 -help: you can convert an `u8` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -495,7 +495,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected i32, found isize -help: you can convert an `isize` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -505,7 +505,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected i32, found i64 -help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -533,7 +533,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected u16, found usize -help: you can convert an `usize` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -543,7 +543,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected u16, found u64 -help: you can convert an `u64` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -553,7 +553,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected u16, found u32 -help: you can convert an `u32` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -572,7 +572,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected u16, found isize -help: you can convert an `isize` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -582,7 +582,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected u16, found i64 -help: you can convert an `i64` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -592,7 +592,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected u16, found i32 -help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -602,7 +602,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected u16, found i16 -help: you can convert an `i16` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -612,7 +612,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected u16, found i8 -help: you can convert an `i8` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `u16` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -622,7 +622,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected i16, found usize -help: you can convert an `usize` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -632,7 +632,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected i16, found u64 -help: you can convert an `u64` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -642,7 +642,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected i16, found u32 -help: you can convert an `u32` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -652,7 +652,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected i16, found u16 -help: you can convert an `u16` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -662,7 +662,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected i16, found u8 -help: you can convert an `u8` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -672,7 +672,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected i16, found isize -help: you can convert an `isize` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -682,7 +682,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected i16, found i64 -help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -692,7 +692,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected i16, found i32 -help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -711,7 +711,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected u8, found usize -help: you can convert an `usize` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -721,7 +721,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected u8, found u64 -help: you can convert an `u64` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -731,7 +731,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected u8, found u32 -help: you can convert an `u32` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -741,7 +741,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected u8, found u16 -help: you can convert an `u16` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -751,7 +751,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected u8, found isize -help: you can convert an `isize` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -761,7 +761,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected u8, found i64 -help: you can convert an `i64` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -771,7 +771,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected u8, found i32 -help: you can convert an `i32` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -781,7 +781,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected u8, found i16 -help: you can convert an `i16` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -791,7 +791,7 @@ error[E0308]: mismatched types | LL | foo::(x_i8); | ^^^^ expected u8, found i8 -help: you can convert an `i8` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `i8` to `u8` and panic if the converted value wouldn't fit | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -801,7 +801,7 @@ error[E0308]: mismatched types | LL | foo::(x_usize); | ^^^^^^^ expected i8, found usize -help: you can convert an `usize` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `usize` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -811,7 +811,7 @@ error[E0308]: mismatched types | LL | foo::(x_u64); | ^^^^^ expected i8, found u64 -help: you can convert an `u64` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `u64` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -821,7 +821,7 @@ error[E0308]: mismatched types | LL | foo::(x_u32); | ^^^^^ expected i8, found u32 -help: you can convert an `u32` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `u32` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -831,7 +831,7 @@ error[E0308]: mismatched types | LL | foo::(x_u16); | ^^^^^ expected i8, found u16 -help: you can convert an `u16` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `u16` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -841,7 +841,7 @@ error[E0308]: mismatched types | LL | foo::(x_u8); | ^^^^ expected i8, found u8 -help: you can convert an `u8` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `u8` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -851,7 +851,7 @@ error[E0308]: mismatched types | LL | foo::(x_isize); | ^^^^^^^ expected i8, found isize -help: you can convert an `isize` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -861,7 +861,7 @@ error[E0308]: mismatched types | LL | foo::(x_i64); | ^^^^^ expected i8, found i64 -help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -871,7 +871,7 @@ error[E0308]: mismatched types | LL | foo::(x_i32); | ^^^^^ expected i8, found i32 -help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -881,7 +881,7 @@ error[E0308]: mismatched types | LL | foo::(x_i16); | ^^^^^ expected i8, found i16 -help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit +help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/pattern/const-pat-ice.stderr b/src/test/ui/pattern/const-pat-ice.stderr index fabaea0535f..c4f6e021262 100644 --- a/src/test/ui/pattern/const-pat-ice.stderr +++ b/src/test/ui/pattern/const-pat-ice.stderr @@ -1,5 +1,5 @@ thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', src/librustc_mir/hair/pattern/_match.rs:1085:5 -note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: internal compiler error: unexpected panic diff --git a/src/test/ui/pub/pub-restricted.stderr b/src/test/ui/pub/pub-restricted.stderr index 7eeefa95505..596264ba16b 100644 --- a/src/test/ui/pub/pub-restricted.stderr +++ b/src/test/ui/pub/pub-restricted.stderr @@ -21,7 +21,18 @@ LL | pub (b) fn bfn() {} `pub(in path::to::module)`: visible only on the specified path error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:22:14 + --> $DIR/pub-restricted.rs:7:6 + | +LL | pub (crate::a) fn cfn() {} + | ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a` + | + = help: some possible visibility restrictions are: + `pub(crate)`: visible only on the current crate + `pub(super)`: visible only in the current module's parent + `pub(in path::to::module)`: visible only on the specified path + +error[E0704]: incorrect visibility restriction + --> $DIR/pub-restricted.rs:24:14 | LL | pub (a) invalid: usize, | ^ help: make this visible only to module `a` with `in`: `in a` @@ -32,7 +43,7 @@ LL | pub (a) invalid: usize, `pub(in path::to::module)`: visible only on the specified path error[E0704]: incorrect visibility restriction - --> $DIR/pub-restricted.rs:31:6 + --> $DIR/pub-restricted.rs:33:6 | LL | pub (xyz) fn xyz() {} | ^^^ help: make this visible only to module `xyz` with `in`: `in xyz` @@ -43,11 +54,11 @@ LL | pub (xyz) fn xyz() {} `pub(in path::to::module)`: visible only on the specified path error: visibilities can only be restricted to ancestor modules - --> $DIR/pub-restricted.rs:23:17 + --> $DIR/pub-restricted.rs:25:17 | LL | pub (in x) non_parent_invalid: usize, | ^ -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0704`. diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index 6772aa1c38d..df73ac0b182 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -42,7 +42,7 @@ error[E0308]: mismatched types | LL | let f = [0; -4_isize]; | ^^^^^^^^ expected usize, found isize -help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | LL | let f = [0; (-4_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,7 +52,7 @@ error[E0308]: mismatched types | LL | let f = [0_usize; -1_isize]; | ^^^^^^^^ expected usize, found isize -help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | LL | let f = [0_usize; (-1_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/shift-various-bad-types.stderr index 97523fe82cd..409fabb951a 100644 --- a/src/test/ui/shift-various-bad-types.stderr +++ b/src/test/ui/shift-various-bad-types.stderr @@ -27,7 +27,7 @@ error[E0308]: mismatched types | LL | let _: i32 = 22_i64 >> 1_i32; | ^^^^^^^^^^^^^^^ expected i32, found i64 -help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit +help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | LL | let _: i32 = (22_i64 >> 1_i32).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/symbol-names/basic.stderr b/src/test/ui/symbol-names/basic.stderr index 6ddd93d632e..7539cbada8b 100644 --- a/src/test/ui/symbol-names/basic.stderr +++ b/src/test/ui/symbol-names/basic.stderr @@ -1,4 +1,4 @@ -error: symbol-name(_ZN5basic4main17h08bcaf310214ed52E) +error: symbol-name(_ZN5basic4main17hd72940ef9669d526E) --> $DIR/basic.rs:3:1 | LL | #[rustc_symbol_name] diff --git a/src/test/ui/symbol-names/impl1.stderr b/src/test/ui/symbol-names/impl1.stderr index eda8646b5b4..20e48782a3a 100644 --- a/src/test/ui/symbol-names/impl1.stderr +++ b/src/test/ui/symbol-names/impl1.stderr @@ -1,4 +1,4 @@ -error: symbol-name(_ZN5impl13foo3Foo3bar17hc487d6ec13fe9124E) +error: symbol-name(_ZN5impl13foo3Foo3bar17he53b9bee7600ed8dE) --> $DIR/impl1.rs:8:9 | LL | #[rustc_symbol_name] @@ -10,7 +10,7 @@ error: def-path(foo::Foo::bar) LL | #[rustc_def_path] | ^^^^^^^^^^^^^^^^^ -error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h38577281258e1527E) +error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h86c41f0462d901d4E) --> $DIR/impl1.rs:18:9 | LL | #[rustc_symbol_name] diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr index 9acd63c2c25..e9c28248044 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr @@ -6,7 +6,7 @@ LL | fn global_bound_is_hidden() -> u8 ... LL | B::get_x() | ^^^^^^^^^^ expected u8, found i32 -help: you can convert an `i32` to `u8` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit | LL | B::get_x().try_into().unwrap() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/tutorial-suffix-inference-test.stderr b/src/test/ui/tutorial-suffix-inference-test.stderr index f51f2defd47..f3e1cc41cad 100644 --- a/src/test/ui/tutorial-suffix-inference-test.stderr +++ b/src/test/ui/tutorial-suffix-inference-test.stderr @@ -12,7 +12,7 @@ error[E0308]: mismatched types | LL | identity_u16(y); | ^ expected u16, found i32 -help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | LL | identity_u16(y.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^ @@ -22,7 +22,7 @@ error[E0308]: mismatched types | LL | identity_u16(a); | ^ expected u16, found isize -help: you can convert an `isize` to `u16` or panic if it the converted value wouldn't fit +help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit | LL | identity_u16(a.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^