4225a1e186
`Diagnostic::keys`, which is used for hashing and equating diagnostics, has a surprising behaviour: it ignores children, but only for lints. This was added in #88493 to fix some duplicated diagnostics, but it doesn't seem necessary any more. This commit removes the special case and only four tests have changed output, with additional errors. And those additional errors aren't exact duplicates, they're just similar. For example, in src/tools/clippy/tests/ui/same_name_method.rs we currently have this error: ``` error: method's name is the same as an existing method in a trait --> $DIR/same_name_method.rs:75:13 | LL | fn foo() {} | ^^^^^^^^^^^ | note: existing `foo` defined here --> $DIR/same_name_method.rs:79:9 | LL | impl T1 for S {} | ^^^^^^^^^^^^^^^^ ``` and with this change we also get this error: ``` error: method's name is the same as an existing method in a trait --> $DIR/same_name_method.rs:75:13 | LL | fn foo() {} | ^^^^^^^^^^^ | note: existing `foo` defined here --> $DIR/same_name_method.rs:81:9 | LL | impl T2 for S {} | ^^^^^^^^^^^^^^^^ ``` I think printing this second argument is reasonable, possibly even preferable to hiding it. And the other cases are similar.
63 lines
1.6 KiB
Plaintext
63 lines
1.6 KiB
Plaintext
warning: constant evaluation is taking a long time
|
|
--> $DIR/ctfe-simple-loop.rs:9:5
|
|
|
|
|
LL | / while index < n {
|
|
LL | |
|
|
LL | |
|
|
LL | |
|
|
LL | | index = index + 1;
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
|
|
If your compilation actually takes a long time, you can safely allow the lint.
|
|
help: the constant being evaluated
|
|
--> $DIR/ctfe-simple-loop.rs:18:1
|
|
|
|
|
LL | const X: u32 = simple_loop(19);
|
|
| ^^^^^^^^^^^^
|
|
note: the lint level is defined here
|
|
--> $DIR/ctfe-simple-loop.rs:3:24
|
|
|
|
|
LL | #![cfg_attr(warn, warn(long_running_const_eval))]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: constant evaluation is taking a long time
|
|
--> $DIR/ctfe-simple-loop.rs:9:5
|
|
|
|
|
LL | / while index < n {
|
|
LL | |
|
|
LL | |
|
|
LL | |
|
|
LL | | index = index + 1;
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
|
|
If your compilation actually takes a long time, you can safely allow the lint.
|
|
help: the constant being evaluated
|
|
--> $DIR/ctfe-simple-loop.rs:19:1
|
|
|
|
|
LL | const Y: u32 = simple_loop(35);
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: constant evaluation is taking a long time
|
|
--> $DIR/ctfe-simple-loop.rs:9:5
|
|
|
|
|
LL | / while index < n {
|
|
LL | |
|
|
LL | |
|
|
LL | |
|
|
LL | | index = index + 1;
|
|
LL | | }
|
|
| |_____^ the const evaluator is currently interpreting this expression
|
|
|
|
|
help: the constant being evaluated
|
|
--> $DIR/ctfe-simple-loop.rs:19:1
|
|
|
|
|
LL | const Y: u32 = simple_loop(35);
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: 3 warnings emitted
|
|
|