Skip to content

Commit abb8906

Browse files
committed
Update tests.
1 parent 9f6299e commit abb8906

13 files changed

+240
-207
lines changed

src/test/ui/attributes/key-value-expansion.stderr

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ LL | bug!();
1717

1818
error: unexpected expression: `{
1919
let res =
20-
::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
21-
&[::core::fmt::ArgumentV1::new_display(&"u8")]));
20+
::alloc::fmt::format(::core::fmt::Arguments::new(&match (&"u8",) {
21+
_args =>
22+
|f: &mut ::core::fmt::Formatter<'_>| -> ::core::fmt::Result
23+
{
24+
::core::fmt::Display::fmt(_args.0, f)?;
25+
::core::result::Result::Ok(())
26+
},
27+
}));
2228
res
2329
}.as_str()`
2430
--> $DIR/key-value-expansion.rs:48:23

src/test/ui/borrowck/issue-64453.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `Arguments::<'a>::new_v1` is not yet stable as a const fn
1+
error: `Arguments::<'a>::from_static_str` is not yet stable as a const fn
22
--> $DIR/issue-64453.rs:4:31
33
|
44
LL | static settings_dir: String = format!("");

src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | let c1 : () = c;
99
| expected due to this
1010
|
1111
= note: expected unit type `()`
12-
found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
12+
found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#88t, extern "rust-call" fn(()), _#89t]]`
1313
help: use parentheses to call this closure
1414
|
1515
LL | let c1 : () = c();

src/test/ui/closures/print/closure-print-generic-verbose-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | let c1 : () = c;
99
| expected due to this
1010
|
1111
= note: expected unit type `()`
12-
found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
12+
found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#88t, extern "rust-call" fn(()), _#89t]]`
1313
help: use parentheses to call this closure
1414
|
1515
LL | let c1 : () = c();

src/test/ui/const-ptr/forbidden_slices.64bit.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ LL | pub static R4: &[u8] = unsafe {
164164
|
165165
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
166166
= note: the raw bytes of the constant (size: 16, align: 8) {
167-
╾──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
167+
╾──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
168168
}
169169

170170
error[E0080]: it is undefined behavior to use this value
@@ -176,7 +176,7 @@ LL | pub static R5: &[u8] = unsafe {
176176
= help: this code performed an operation that depends on the underlying bytes representing a pointer
177177
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
178178
= note: the raw bytes of the constant (size: 16, align: 8) {
179-
╾──────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
179+
╾──────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
180180
}
181181

182182
error[E0080]: it is undefined behavior to use this value
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
const fn failure() {
22
panic!("{:?}", 0);
3-
//~^ ERROR cannot call non-const formatting macro in constant functions
4-
//~| ERROR erroneous constant used
5-
//~| ERROR erroneous constant used
6-
//~| WARN this was previously accepted by the compiler
7-
//~| WARN this was previously accepted by the compiler
3+
//~^ ERROR
4+
//~| ERROR
5+
//~| ERROR
6+
//~| ERROR
87
}
98

109
const fn print() {
1110
println!("{:?}", 0);
12-
//~^ ERROR cannot call non-const formatting macro in constant functions
13-
//~| ERROR `Arguments::<'a>::new_v1` is not yet stable as a const fn
14-
//~| ERROR cannot call non-const fn `_print` in constant functions
15-
//~| ERROR erroneous constant used
16-
//~| ERROR erroneous constant used
17-
//~| WARN this was previously accepted by the compiler
18-
//~| WARN this was previously accepted by the compiler
11+
//~^ ERROR
12+
//~| ERROR
13+
//~| ERROR
14+
//~| WARN
1915
}
2016

2117
fn main() {}

src/test/ui/consts/const-eval/format.stderr

Lines changed: 41 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
1-
error[E0015]: cannot call non-const formatting macro in constant functions
2-
--> $DIR/format.rs:2:20
1+
error[E0658]: mutable references are not allowed in constant functions
2+
--> $DIR/format.rs:2:5
33
|
44
LL | panic!("{:?}", 0);
5-
| ^
5+
| ^^^^^^^^^^^^^^^^^
66
|
7-
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
7+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
89
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
910

10-
error[E0015]: cannot call non-const formatting macro in constant functions
11-
--> $DIR/format.rs:11:22
11+
error[E0658]: mutable references are not allowed in constant functions
12+
--> $DIR/format.rs:2:5
1213
|
13-
LL | println!("{:?}", 0);
14-
| ^
14+
LL | panic!("{:?}", 0);
15+
| ^^^^^^^^^^^^^^^^^
1516
|
16-
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
17-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
17+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
18+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
19+
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1820

19-
error: `Arguments::<'a>::new_v1` is not yet stable as a const fn
20-
--> $DIR/format.rs:11:5
21+
error[E0658]: mutable references are not allowed in constant functions
22+
--> $DIR/format.rs:2:5
23+
|
24+
LL | panic!("{:?}", 0);
25+
| ^^^^^^^^^^^^^^^^^
26+
|
27+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
28+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
29+
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
30+
31+
error[E0658]: mutable references are not allowed in constant functions
32+
--> $DIR/format.rs:2:5
33+
|
34+
LL | panic!("{:?}", 0);
35+
| ^^^^^^^^^^^^^^^^^
36+
|
37+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
38+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
39+
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
40+
41+
error: `Arguments::<'a>::new` is not yet stable as a const fn
42+
--> $DIR/format.rs:10:5
2143
|
2244
LL | println!("{:?}", 0);
2345
| ^^^^^^^^^^^^^^^^^^^
@@ -26,7 +48,7 @@ LL | println!("{:?}", 0);
2648
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
2749

2850
error[E0015]: cannot call non-const fn `_print` in constant functions
29-
--> $DIR/format.rs:11:5
51+
--> $DIR/format.rs:10:5
3052
|
3153
LL | println!("{:?}", 0);
3254
| ^^^^^^^^^^^^^^^^^^^
@@ -35,84 +57,23 @@ LL | println!("{:?}", 0);
3557
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
3658

3759
error: erroneous constant used
38-
--> $DIR/format.rs:2:12
39-
|
40-
LL | panic!("{:?}", 0);
41-
| ^^^^^^ referenced constant has errors
42-
|
43-
= note: `#[deny(const_err)]` on by default
44-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
45-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
46-
47-
error: erroneous constant used
48-
--> $DIR/format.rs:2:20
49-
|
50-
LL | panic!("{:?}", 0);
51-
| ^ referenced constant has errors
52-
|
53-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
54-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
55-
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
56-
57-
error: erroneous constant used
58-
--> $DIR/format.rs:11:14
59-
|
60-
LL | println!("{:?}", 0);
61-
| ^^^^^^ referenced constant has errors
62-
|
63-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
64-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
65-
66-
error: erroneous constant used
67-
--> $DIR/format.rs:11:22
60+
--> $DIR/format.rs:10:22
6861
|
6962
LL | println!("{:?}", 0);
7063
| ^ referenced constant has errors
7164
|
65+
= note: `#[deny(const_err)]` on by default
7266
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7367
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
7468
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
7569

76-
error: aborting due to 8 previous errors
70+
error: aborting due to 7 previous errors
7771

78-
For more information about this error, try `rustc --explain E0015`.
72+
Some errors have detailed explanations: E0015, E0658.
73+
For more information about an error, try `rustc --explain E0015`.
7974
Future incompatibility report: Future breakage diagnostic:
8075
error: erroneous constant used
81-
--> $DIR/format.rs:2:12
82-
|
83-
LL | panic!("{:?}", 0);
84-
| ^^^^^^ referenced constant has errors
85-
|
86-
= note: `#[deny(const_err)]` on by default
87-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
89-
90-
Future breakage diagnostic:
91-
error: erroneous constant used
92-
--> $DIR/format.rs:2:20
93-
|
94-
LL | panic!("{:?}", 0);
95-
| ^ referenced constant has errors
96-
|
97-
= note: `#[deny(const_err)]` on by default
98-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
99-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
100-
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
101-
102-
Future breakage diagnostic:
103-
error: erroneous constant used
104-
--> $DIR/format.rs:11:14
105-
|
106-
LL | println!("{:?}", 0);
107-
| ^^^^^^ referenced constant has errors
108-
|
109-
= note: `#[deny(const_err)]` on by default
110-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
111-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
112-
113-
Future breakage diagnostic:
114-
error: erroneous constant used
115-
--> $DIR/format.rs:11:22
76+
--> $DIR/format.rs:10:22
11677
|
11778
LL | println!("{:?}", 0);
11879
| ^ referenced constant has errors

src/test/ui/fmt/ifmt-bad-arg.stderr

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,13 @@ LL | println!("{} {:.*} {}", 1, 3.2, 4);
303303
| ^^^
304304
| |
305305
| expected `usize`, found floating-point number
306-
| arguments to this function are incorrect
306+
| arguments to this enum variant are incorrect
307307
|
308-
= note: expected reference `&usize`
309-
found reference `&{float}`
310-
note: associated function defined here
311-
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
308+
note: tuple variant defined here
309+
--> $SRC_DIR/core/src/option.rs:LL:COL
312310
|
313-
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
314-
| ^^^^^^^^^^
311+
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
312+
| ^^^^
315313
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
316314

317315
error[E0308]: mismatched types
@@ -321,15 +319,13 @@ LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
321319
| ^^^
322320
| |
323321
| expected `usize`, found floating-point number
324-
| arguments to this function are incorrect
322+
| arguments to this enum variant are incorrect
325323
|
326-
= note: expected reference `&usize`
327-
found reference `&{float}`
328-
note: associated function defined here
329-
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
324+
note: tuple variant defined here
325+
--> $SRC_DIR/core/src/option.rs:LL:COL
330326
|
331-
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
332-
| ^^^^^^^^^^
327+
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
328+
| ^^^^
333329
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
334330

335331
error: aborting due to 38 previous errors

src/test/ui/fmt/ifmt-unimpl.stderr

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ LL | format!("{:X}", "3");
1515
NonZeroIsize
1616
and 21 others
1717
= note: required for `&str` to implement `UpperHex`
18-
note: required by a bound in `ArgumentV1::<'a>::new_upper_hex`
19-
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
20-
|
21-
LL | arg_new!(new_upper_hex, UpperHex);
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ArgumentV1::<'a>::new_upper_hex`
23-
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `arg_new` (in Nightly builds, run with -Z macro-backtrace for more info)
18+
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
2419

2520
error: aborting due to previous error
2621

src/test/ui/fmt/send-sync.stderr

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
1-
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
1+
error[E0277]: `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>` cannot be shared between threads safely
22
--> $DIR/send-sync.rs:8:10
33
|
44
LL | send(format_args!("{:?}", c));
5-
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `core::fmt::Opaque` cannot be shared between threads safely
5+
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>` cannot be shared between threads safely
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: within `[ArgumentV1<'_>]`, the trait `Sync` is not implemented for `core::fmt::Opaque`
10-
= note: required because it appears within the type `&core::fmt::Opaque`
11-
= note: required because it appears within the type `ArgumentV1<'_>`
12-
= note: required because it appears within the type `[ArgumentV1<'_>]`
13-
= note: required for `&[ArgumentV1<'_>]` to implement `Send`
9+
= help: the trait `Sync` is not implemented for `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>`
10+
= note: required for `&dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>` to implement `Send`
11+
= note: required because it appears within the type `core::fmt::Inner<'_>`
1412
= note: required because it appears within the type `Arguments<'_>`
1513
note: required by a bound in `send`
1614
--> $DIR/send-sync.rs:1:12
1715
|
1816
LL | fn send<T: Send>(_: T) {}
1917
| ^^^^ required by this bound in `send`
2018

21-
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
19+
error[E0277]: `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>` cannot be shared between threads safely
2220
--> $DIR/send-sync.rs:9:10
2321
|
2422
LL | sync(format_args!("{:?}", c));
25-
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `core::fmt::Opaque` cannot be shared between threads safely
23+
| ---- ^^^^^^^^^^^^^^^^^^^^^^^ `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>` cannot be shared between threads safely
2624
| |
2725
| required by a bound introduced by this call
2826
|
29-
= help: within `Arguments<'_>`, the trait `Sync` is not implemented for `core::fmt::Opaque`
30-
= note: required because it appears within the type `&core::fmt::Opaque`
31-
= note: required because it appears within the type `ArgumentV1<'_>`
32-
= note: required because it appears within the type `[ArgumentV1<'_>]`
33-
= note: required because it appears within the type `&[ArgumentV1<'_>]`
27+
= help: within `Arguments<'_>`, the trait `Sync` is not implemented for `dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>`
28+
= note: required because it appears within the type `&dyn for<'r, 's> Fn(&'r mut Formatter<'s>) -> Result<(), std::fmt::Error>`
29+
= note: required because it appears within the type `core::fmt::Inner<'_>`
3430
= note: required because it appears within the type `Arguments<'_>`
3531
note: required by a bound in `sync`
3632
--> $DIR/send-sync.rs:2:12

0 commit comments

Comments
 (0)