You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk
Suppress "erroneous constant used" for constants tainted by errors
When constant evaluation fails because its MIR is tainted by errors,
suppress note indicating that erroneous constant was used, since those
errors have to be fixed regardless of the constant being used or not.
Fixes#110891.
Copy file name to clipboardExpand all lines: tests/ui/consts/const-eval/format.stderr
-56
Original file line number
Diff line number
Diff line change
@@ -43,62 +43,6 @@ LL | println!("{:?}", 0);
43
43
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
44
44
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
45
45
46
-
note: erroneous constant used
47
-
--> $DIR/format.rs:2:12
48
-
|
49
-
LL | panic!("{:?}", 0);
50
-
| ^^^^^^
51
-
52
-
note: erroneous constant used
53
-
--> $DIR/format.rs:2:12
54
-
|
55
-
LL | panic!("{:?}", 0);
56
-
| ^^^^^^
57
-
58
-
note: erroneous constant used
59
-
--> $DIR/format.rs:2:20
60
-
|
61
-
LL | panic!("{:?}", 0);
62
-
| ^
63
-
|
64
-
= note: this note 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)
65
-
66
-
note: erroneous constant used
67
-
--> $DIR/format.rs:2:20
68
-
|
69
-
LL | panic!("{:?}", 0);
70
-
| ^
71
-
|
72
-
= note: this note 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)
73
-
74
-
note: erroneous constant used
75
-
--> $DIR/format.rs:8:14
76
-
|
77
-
LL | println!("{:?}", 0);
78
-
| ^^^^^^
79
-
80
-
note: erroneous constant used
81
-
--> $DIR/format.rs:8:14
82
-
|
83
-
LL | println!("{:?}", 0);
84
-
| ^^^^^^
85
-
86
-
note: erroneous constant used
87
-
--> $DIR/format.rs:8:22
88
-
|
89
-
LL | println!("{:?}", 0);
90
-
| ^
91
-
|
92
-
= note: this note 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)
93
-
94
-
note: erroneous constant used
95
-
--> $DIR/format.rs:8:22
96
-
|
97
-
LL | println!("{:?}", 0);
98
-
| ^
99
-
|
100
-
= note: this note 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)
101
-
102
46
error: aborting due to 5 previous errors
103
47
104
48
For more information about this error, try `rustc --explain E0015`.
0 commit comments