Skip to content

Commit d261de6

Browse files
committed
[DO NOT MERGE] - bad changes to tests.
These still need to be fixed!
1 parent 25c2fea commit d261de6

10 files changed

+56
-34
lines changed

tests/ui/fmt/send-sync.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ error[E0277]: `Arguments<'_>` cannot be sent between threads safely
22
--> $DIR/send-sync.rs:8:10
33
|
44
LL | send(format_args!("{:?}", c));
5-
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `Arguments<'_>` cannot be sent between threads safely
6-
| |
5+
| ---- ^^^^^^^^^^^^^^^^^^^^^^^
6+
| | |
7+
| | `Arguments<'_>` cannot be sent between threads safely
8+
| | this tail expression is of type `Arguments<'_>`
79
| required by a bound introduced by this call
810
|
911
= help: the trait `Send` is not implemented for `Arguments<'_>`
@@ -17,8 +19,10 @@ error[E0277]: `Arguments<'_>` cannot be shared between threads safely
1719
--> $DIR/send-sync.rs:9:10
1820
|
1921
LL | sync(format_args!("{:?}", c));
20-
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `Arguments<'_>` cannot be shared between threads safely
21-
| |
22+
| ---- ^^^^^^^^^^^^^^^^^^^^^^^
23+
| | |
24+
| | `Arguments<'_>` cannot be shared between threads safely
25+
| | this tail expression is of type `Arguments<'_>`
2226
| required by a bound introduced by this call
2327
|
2428
= help: the trait `Sync` is not implemented for `Arguments<'_>`

tests/ui/issues/issue-69455.stderr

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ error[E0283]: type annotations needed
22
--> $DIR/issue-69455.rs:29:20
33
|
44
LL | println!("{}", 23u64.test(xs.iter().sum()));
5-
| ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
6-
| |
7-
| type must be known at this point
8-
|
9-
= note: cannot satisfy `<u64 as Test<_>>::Output == _`
10-
help: consider specifying the generic argument
5+
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
6+
| |
7+
| required by a bound introduced by this call
118
|
12-
LL | println!("{}", 23u64.test(xs.iter().sum::<S>()));
13-
| +++++
9+
= note: cannot satisfy `_: std::fmt::Display`
10+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
11+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
1412

1513
error[E0283]: type annotations needed
1614
--> $DIR/issue-69455.rs:29:41

tests/ui/lint/static-mut-refs.e2021.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ LL | let _ = format!("{:?}", Z);
9090
|
9191
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
9292
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
93+
help: use `&raw const` instead to create a raw pointer
94+
|
95+
LL | let _ = format!("{:?}", &raw const Z);
96+
| ++++++++++
9397

9498
warning: creating a shared reference to mutable static
9599
--> $DIR/static-mut-refs.rs:76:18

tests/ui/lint/static-mut-refs.e2024.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ LL | let _ = format!("{:?}", Z);
9090
|
9191
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
9292
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
93+
help: use `&raw const` instead to create a raw pointer
94+
|
95+
LL | let _ = format!("{:?}", &raw const Z);
96+
| ++++++++++
9397

9498
error: creating a shared reference to mutable static
9599
--> $DIR/static-mut-refs.rs:76:18

tests/ui/suggestions/bound-suggestions.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | println!("{:?}", t);
66
| |
77
| required by a bound introduced by this call
88
|
9+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
10+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
911
help: consider restricting opaque type `impl Sized` with trait `Debug`
1012
|
1113
LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
@@ -19,6 +21,8 @@ LL | println!("{:?}", t);
1921
| |
2022
| required by a bound introduced by this call
2123
|
24+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
25+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2226
help: consider restricting type parameter `T` with trait `Debug`
2327
|
2428
LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
@@ -32,6 +36,8 @@ LL | println!("{:?}", t);
3236
| |
3337
| required by a bound introduced by this call
3438
|
39+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
40+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
3541
help: consider further restricting type parameter `T` with trait `Debug`
3642
|
3743
LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
@@ -57,6 +63,8 @@ LL | println!("{:?}", x);
5763
| |
5864
| required by a bound introduced by this call
5965
|
66+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
67+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
6068
help: consider further restricting type parameter `X` with trait `Debug`
6169
|
6270
LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
@@ -70,6 +78,8 @@ LL | println!("{:?}", x);
7078
| |
7179
| required by a bound introduced by this call
7280
|
81+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
82+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
7383
help: consider further restricting type parameter `X` with trait `Debug`
7484
|
7585
LL | fn test_many_bounds_where<X>(x: X) where X: Sized + std::fmt::Debug, X: Sized {

tests/ui/suggestions/issue-97760.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ error[E0277]: `<impl IntoIterator as IntoIterator>::Item` doesn't implement `std
22
--> $DIR/issue-97760.rs:4:20
33
|
44
LL | println!("{x}");
5-
| ^^^ `<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
5+
| -^-
6+
| ||
7+
| |`<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
8+
| required by a bound introduced by this call
69
|
710
= help: the trait `std::fmt::Display` is not implemented for `<impl IntoIterator as IntoIterator>::Item`
811
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
12+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
13+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
914
help: introduce a type parameter with a trait bound instead of using `impl Trait`
1015
|
1116
LL ~ pub fn print_values<I: IntoIterator>(values: &I)

tests/ui/suggestions/path-display.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ LL | println!("{}", path);
99
= help: the trait `std::fmt::Display` is not implemented for `Path`
1010
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
1111
= note: call `.display()` or `.to_string_lossy()` to safely print paths, as they may contain non-Unicode data
12+
= note: required for `&Path` to implement `std::fmt::Display`
13+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
14+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
1215

1316
error[E0277]: `PathBuf` doesn't implement `std::fmt::Display`
1417
--> $DIR/path-display.rs:9:20
@@ -21,6 +24,8 @@ LL | println!("{}", path);
2124
= help: the trait `std::fmt::Display` is not implemented for `PathBuf`
2225
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
2326
= note: call `.display()` or `.to_string_lossy()` to safely print paths, as they may contain non-Unicode data
27+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
28+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2429

2530
error: aborting due to 2 previous errors
2631

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ LL | println!("{:?}", iter::<_>());
66
| |
77
| required by a bound introduced by this call
88
|
9-
= note: cannot satisfy `_: Iterator`
10-
note: required by a bound in `iter`
11-
--> $DIR/runaway-impl-candidate-selection.rs:8:12
12-
|
13-
LL | fn iter<T: Iterator>() -> <T as Iterator>::Item {
14-
| ^^^^^^^^ required by this bound in `iter`
9+
= note: cannot satisfy `_: Debug`
10+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
11+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
1512

1613
error: aborting due to 1 previous error
1714

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

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ LL | println!("{:?}", bar());
2020
| required by a bound introduced by this call
2121
|
2222
= help: the trait `Debug` is not implemented for `Bar`
23+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
24+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2325

2426
error: aborting due to 2 previous errors
2527

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

+8-15
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,54 @@
11
error[E0277]: `()` doesn't implement `std::fmt::Display`
22
--> $DIR/binding-assigned-block-without-tail-expression.rs:14:20
33
|
4-
LL | 42;
5-
| - help: remove this semicolon
6-
...
74
LL | println!("{}", x);
85
| -- ^ `()` cannot be formatted with the default formatter
96
| |
107
| required by a bound introduced by this call
118
|
129
= help: the trait `std::fmt::Display` is not implemented for `()`
1310
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
11+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
12+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
1413

1514
error[E0277]: `()` doesn't implement `std::fmt::Display`
1615
--> $DIR/binding-assigned-block-without-tail-expression.rs:15:20
1716
|
18-
LL | let y = {};
19-
| -- this empty block is missing a tail expression
20-
...
2117
LL | println!("{}", y);
2218
| -- ^ `()` cannot be formatted with the default formatter
2319
| |
2420
| required by a bound introduced by this call
2521
|
2622
= help: the trait `std::fmt::Display` is not implemented for `()`
2723
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
24+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
25+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2826

2927
error[E0277]: `()` doesn't implement `std::fmt::Display`
3028
--> $DIR/binding-assigned-block-without-tail-expression.rs:16:20
3129
|
32-
LL | "hi";
33-
| - help: remove this semicolon
34-
...
3530
LL | println!("{}", z);
3631
| -- ^ `()` cannot be formatted with the default formatter
3732
| |
3833
| required by a bound introduced by this call
3934
|
4035
= help: the trait `std::fmt::Display` is not implemented for `()`
4136
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
37+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
38+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
4239

4340
error[E0277]: `()` doesn't implement `std::fmt::Display`
4441
--> $DIR/binding-assigned-block-without-tail-expression.rs:17:20
4542
|
46-
LL | let s = {
47-
| _____________-
48-
LL | | S;
49-
LL | | };
50-
| |_____- this block is missing a tail expression
51-
...
5243
LL | println!("{}", s);
5344
| -- ^ `()` cannot be formatted with the default formatter
5445
| |
5546
| required by a bound introduced by this call
5647
|
5748
= help: the trait `std::fmt::Display` is not implemented for `()`
5849
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
50+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_display`
51+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
5952

6053
error[E0308]: mismatched types
6154
--> $DIR/binding-assigned-block-without-tail-expression.rs:18:18

0 commit comments

Comments
 (0)