Skip to content

Commit bb3d8c5

Browse files
committed
Bless/update tests.
1 parent d6c6ff1 commit bb3d8c5

14 files changed

+58
-33
lines changed

tests/ui/borrowck/clone-on-ref.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ LL | drop(x);
3030
| ^ move out of `x` occurs here
3131
LL |
3232
LL | println!("{b}");
33-
| --- borrow later used here
33+
| - borrow later used here
3434
|
3535
help: if `T` implemented `Clone`, you could clone the value
3636
--> $DIR/clone-on-ref.rs:11:8
@@ -57,7 +57,7 @@ LL | drop(x);
5757
| ^ move out of `x` occurs here
5858
LL |
5959
LL | println!("{b:?}");
60-
| ----- borrow later used here
60+
| - borrow later used here
6161
|
6262
note: if `A` implemented `Clone`, you could clone the value
6363
--> $DIR/clone-on-ref.rs:19:1

tests/ui/consts/recursive-const-in-impl.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: queries overflow the depth limit!
2-
--> $DIR/recursive-const-in-impl.rs:11:14
2+
--> $DIR/recursive-const-in-impl.rs:11:20
33
|
44
LL | println!("{}", Thing::<i32>::X);
5-
| ^^^^
5+
| ^^^^^^^^^^^^^^^
66
|
77
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "14"]` attribute to your crate (`recursive_const_in_impl`)
88
= note: query depth increased by 9 when simplifying constant for the type system `main::promoted[1]`

tests/ui/impl-trait/precise-capturing/foreign-2021.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | x.push(0);
88
| ^^^^^^^^^ mutable borrow occurs here
99
...
1010
LL | println!("{h}");
11-
| --- immutable borrow later used here
11+
| - immutable borrow later used here
1212
|
1313
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
1414
--> $DIR/foreign-2021.rs:7:13

tests/ui/impl-trait/precise-capturing/migration-note.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | x.push(1);
2323
| ^^^^^^^^^ mutable borrow occurs here
2424
...
2525
LL | println!("{a}");
26-
| --- immutable borrow later used here
26+
| - immutable borrow later used here
2727
|
2828
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
2929
--> $DIR/migration-note.rs:16:13
@@ -99,7 +99,7 @@ LL | x.push(1);
9999
| ^ second mutable borrow occurs here
100100
...
101101
LL | println!("{a}");
102-
| --- first borrow later used here
102+
| - first borrow later used here
103103
|
104104
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
105105
--> $DIR/migration-note.rs:63:13
@@ -175,7 +175,7 @@ LL | s.f = 1;
175175
| ^^^^^^^ `s.f` is assigned to here but it was already borrowed
176176
...
177177
LL | println!("{a}");
178-
| --- borrow later used here
178+
| - borrow later used here
179179
|
180180
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
181181
--> $DIR/migration-note.rs:112:13
@@ -197,7 +197,7 @@ LL | s.f = 1;
197197
| ^^^^^^^ `s.f` is assigned to here but it was already borrowed
198198
...
199199
LL | println!("{a}");
200-
| --- borrow later used here
200+
| - borrow later used here
201201
|
202202
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
203203
--> $DIR/migration-note.rs:128:13
@@ -219,7 +219,7 @@ LL | s.f;
219219
| ^^^ use of borrowed `s.f`
220220
...
221221
LL | println!("{a}");
222-
| --- borrow later used here
222+
| - borrow later used here
223223
|
224224
note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
225225
--> $DIR/migration-note.rs:140:13

tests/ui/issues/issue-27592.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ impl ::std::fmt::Write for Stream {
1515
fn main() {
1616
write(|| format_args!("{}", String::from("Hello world")));
1717
//~^ ERROR cannot return value referencing temporary value
18-
//~| ERROR cannot return reference to temporary value
18+
//~| ERROR cannot return reference to local binding
1919
}

tests/ui/issues/issue-27592.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | write(|| format_args!("{}", String::from("Hello world")));
77
| | temporary value created here
88
| returns a value referencing data owned by the current function
99

10-
error[E0515]: cannot return reference to temporary value
10+
error[E0515]: cannot return reference to local binding
1111
--> $DIR/issue-27592.rs:16:14
1212
|
1313
LL | write(|| format_args!("{}", String::from("Hello world")));

tests/ui/issues/issue-69455.stderr

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
error[E0284]: type annotations needed
2-
--> $DIR/issue-69455.rs:29:41
1+
error[E0283]: type annotations needed
2+
--> $DIR/issue-69455.rs:29:20
33
|
44
LL | println!("{}", 23u64.test(xs.iter().sum()));
55
| ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
@@ -35,5 +35,4 @@ LL | println!("{}", 23u64.test(xs.iter().sum::<S>()));
3535

3636
error: aborting due to 2 previous errors
3737

38-
Some errors have detailed explanations: E0283, E0284.
39-
For more information about an error, try `rustc --explain E0283`.
38+
For more information about this error, try `rustc --explain E0283`.

tests/ui/sized/unsized-binding.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let x = *""; //~ ERROR E0277
3-
println!("{}", x);
4-
println!("{}", x);
3+
drop(x);
4+
drop(x);
55
}

tests/ui/suggestions/bound-suggestions.stderr

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0277]: `impl Sized` doesn't implement `Debug`
22
--> $DIR/bound-suggestions.rs:9:22
33
|
44
LL | println!("{:?}", t);
5-
| ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug`
5+
| ---- ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug`
6+
| |
7+
| required by a bound introduced by this call
68
|
79
help: consider restricting opaque type `impl Sized` with trait `Debug`
810
|
@@ -13,7 +15,9 @@ error[E0277]: `T` doesn't implement `Debug`
1315
--> $DIR/bound-suggestions.rs:15:22
1416
|
1517
LL | println!("{:?}", t);
16-
| ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
18+
| ---- ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
19+
| |
20+
| required by a bound introduced by this call
1721
|
1822
help: consider restricting type parameter `T` with trait `Debug`
1923
|
@@ -24,7 +28,9 @@ error[E0277]: `T` doesn't implement `Debug`
2428
--> $DIR/bound-suggestions.rs:21:22
2529
|
2630
LL | println!("{:?}", t);
27-
| ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
31+
| ---- ^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
32+
| |
33+
| required by a bound introduced by this call
2834
|
2935
help: consider further restricting type parameter `T` with trait `Debug`
3036
|
@@ -47,7 +53,9 @@ error[E0277]: `X` doesn't implement `Debug`
4753
--> $DIR/bound-suggestions.rs:33:22
4854
|
4955
LL | println!("{:?}", x);
50-
| ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
56+
| ---- ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
57+
| |
58+
| required by a bound introduced by this call
5159
|
5260
help: consider further restricting type parameter `X` with trait `Debug`
5361
|
@@ -58,7 +66,9 @@ error[E0277]: `X` doesn't implement `Debug`
5866
--> $DIR/bound-suggestions.rs:39:22
5967
|
6068
LL | println!("{:?}", x);
61-
| ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
69+
| ---- ^ `X` cannot be formatted using `{:?}` because it doesn't implement `Debug`
70+
| |
71+
| required by a bound introduced by this call
6272
|
6373
help: consider further restricting type parameter `X` with trait `Debug`
6474
|

tests/ui/suggestions/issue-97760.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `<impl IntoIterator as IntoIterator>::Item` doesn't implement `std::fmt::Display`
2-
--> $DIR/issue-97760.rs:4:19
2+
--> $DIR/issue-97760.rs:4:20
33
|
44
LL | println!("{x}");
55
| ^^^ `<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter

tests/ui/suggestions/path-display.stderr

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0277]: `Path` doesn't implement `std::fmt::Display`
22
--> $DIR/path-display.rs:5:20
33
|
44
LL | println!("{}", path);
5-
| ^^^^ `Path` cannot be formatted with the default formatter; call `.display()` on it
5+
| -- ^^^^ `Path` cannot be formatted with the default formatter; call `.display()` on it
6+
| |
7+
| required by a bound introduced by this call
68
|
79
= help: the trait `std::fmt::Display` is not implemented for `Path`
810
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
@@ -12,7 +14,9 @@ error[E0277]: `PathBuf` doesn't implement `std::fmt::Display`
1214
--> $DIR/path-display.rs:9:20
1315
|
1416
LL | println!("{}", path);
15-
| ^^^^ `PathBuf` cannot be formatted with the default formatter; call `.display()` on it
17+
| -- ^^^^ `PathBuf` cannot be formatted with the default formatter; call `.display()` on it
18+
| |
19+
| required by a bound introduced by this call
1620
|
1721
= help: the trait `std::fmt::Display` is not implemented for `PathBuf`
1822
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead

tests/ui/traits/next-solver/assembly/runaway-impl-candidate-selection.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0283]: type annotations needed
22
--> $DIR/runaway-impl-candidate-selection.rs:13:22
33
|
44
LL | println!("{:?}", iter::<_>());
5-
| ^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `iter`
5+
| ---- ^^^^^^^^^^^ cannot infer type
6+
| |
7+
| required by a bound introduced by this call
68
|
79
= note: cannot satisfy `_: Iterator`
810
note: required by a bound in `iter`

tests/ui/type-alias-impl-trait/nested.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ error[E0277]: `Bar` doesn't implement `Debug`
1515
--> $DIR/nested.rs:17:22
1616
|
1717
LL | println!("{:?}", bar());
18-
| ^^^^^ `Bar` cannot be formatted using `{:?}` because it doesn't implement `Debug`
18+
| ---- ^^^^^ `Bar` cannot be formatted using `{:?}` because it doesn't implement `Debug`
19+
| |
20+
| required by a bound introduced by this call
1921
|
2022
= help: the trait `Debug` is not implemented for `Bar`
2123

tests/ui/type/binding-assigned-block-without-tail-expression.stderr

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ LL | 42;
55
| - help: remove this semicolon
66
...
77
LL | println!("{}", x);
8-
| ^ `()` cannot be formatted with the default formatter
8+
| -- ^ `()` cannot be formatted with the default formatter
9+
| |
10+
| required by a bound introduced by this call
911
|
1012
= help: the trait `std::fmt::Display` is not implemented for `()`
1113
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
@@ -17,7 +19,9 @@ LL | let y = {};
1719
| -- this empty block is missing a tail expression
1820
...
1921
LL | println!("{}", y);
20-
| ^ `()` cannot be formatted with the default formatter
22+
| -- ^ `()` cannot be formatted with the default formatter
23+
| |
24+
| required by a bound introduced by this call
2125
|
2226
= help: the trait `std::fmt::Display` is not implemented for `()`
2327
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
@@ -29,7 +33,9 @@ LL | "hi";
2933
| - help: remove this semicolon
3034
...
3135
LL | println!("{}", z);
32-
| ^ `()` cannot be formatted with the default formatter
36+
| -- ^ `()` cannot be formatted with the default formatter
37+
| |
38+
| required by a bound introduced by this call
3339
|
3440
= help: the trait `std::fmt::Display` is not implemented for `()`
3541
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
@@ -43,8 +49,10 @@ LL | | S;
4349
LL | | };
4450
| |_____- this block is missing a tail expression
4551
...
46-
LL | println!("{}", s);
47-
| ^ `()` cannot be formatted with the default formatter
52+
LL | println!("{}", s);
53+
| -- ^ `()` cannot be formatted with the default formatter
54+
| |
55+
| required by a bound introduced by this call
4856
|
4957
= help: the trait `std::fmt::Display` is not implemented for `()`
5058
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead

0 commit comments

Comments
 (0)