From 3cf7d22b39b3b3207facfeac59d7be391407d3a0 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Tue, 18 Mar 2025 22:15:54 +0000 Subject: [PATCH 1/9] Use has_errors_excluding_lint_errors instead of tainted_by_errors on report_error When constant evaluation fails, the error is propagated to other places if report_error uses tainted_by_errors. Signed-off-by: Shunpoco --- compiler/rustc_hir_typeck/src/writeback.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_hir_typeck/src/writeback.rs b/compiler/rustc_hir_typeck/src/writeback.rs index 6a3417ae5d6fb..968e18a39eda5 100644 --- a/compiler/rustc_hir_typeck/src/writeback.rs +++ b/compiler/rustc_hir_typeck/src/writeback.rs @@ -779,7 +779,7 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> { } fn report_error(&self, p: impl Into>) -> ErrorGuaranteed { - if let Some(guar) = self.fcx.tainted_by_errors() { + if let Some(guar) = self.fcx.dcx().has_errors_excluding_lint_errors() { guar } else { self.fcx From db8040589bb35e7cfc7a260c42d2844513d3d0cf Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Tue, 18 Mar 2025 22:26:41 +0000 Subject: [PATCH 2/9] Add test for ICE-125323 Signed-off-by: Shunpoco --- ...ce-long-constant-evaluation-in-for-loop.rs | 6 +++++ ...ong-constant-evaluation-in-for-loop.stderr | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs create mode 100644 tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr diff --git a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs new file mode 100644 index 0000000000000..5bc530eaa2c00 --- /dev/null +++ b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs @@ -0,0 +1,6 @@ +// Issue-125323 +fn main() { + for _ in 0..0 { //~ ERROR type annotations needed [E0282] + [(); loop {}]; //~ ERROR constant evaluation is taking a long time + } +} diff --git a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr new file mode 100644 index 0000000000000..541d8fbb01b75 --- /dev/null +++ b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr @@ -0,0 +1,24 @@ +error: constant evaluation is taking a long time + --> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:4:14 + | +LL | [(); loop {}]; + | ^^^^^^^ + | + = 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/do-not-ice-long-constant-evaluation-in-for-loop.rs:4:14 + | +LL | [(); loop {}]; + | ^^^^^^^ + = note: `#[deny(long_running_const_eval)]` on by default + +error[E0282]: type annotations needed + --> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:3:14 + | +LL | for _ in 0..0 { + | ^^^^ cannot infer type for struct `std::ops::Range<{integer}>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0282`. From b54304408c8c87418a18bd2af6eba84ef2efd9a5 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Tue, 18 Mar 2025 22:32:38 +0000 Subject: [PATCH 3/9] Modify other tests to align the change Signed-off-by: Shunpoco --- .../do-not-ice-on-field-access-of-err-type.rs | 2 +- .../do-not-ice-on-field-access-of-err-type.stderr | 14 +++++++++++++- tests/ui/privacy/no-ice-on-inference-failure.rs | 1 + .../ui/privacy/no-ice-on-inference-failure.stderr | 9 ++++++++- ...-bindings-in-pattern-with-ty-err-doesnt-ice.rs | 1 - ...dings-in-pattern-with-ty-err-doesnt-ice.stderr | 15 ++------------- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs index a2e336b703e2c..fe1c7432a62ed 100644 --- a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs +++ b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs @@ -4,6 +4,6 @@ impl Foo for T {} fn main() { let array = [(); { loop {} }]; //~ ERROR constant evaluation is taking a long time - let tup = (7,); + let tup = (7,); //~ ERROR type annotations needed for `({integer},)` [E0282] let x: &dyn Foo = &tup.0; } diff --git a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr index 02b8904fbdedd..f7aaa321a5fc1 100644 --- a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr +++ b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr @@ -13,5 +13,17 @@ LL | let array = [(); { loop {} }]; | ^^^^^^^^^^^ = note: `#[deny(long_running_const_eval)]` on by default -error: aborting due to 1 previous error +error[E0282]: type annotations needed for `({integer},)` + --> $DIR/do-not-ice-on-field-access-of-err-type.rs:7:9 + | +LL | let tup = (7,); + | ^^^ + | +help: consider giving `tup` an explicit type, where the type for tuple `({integer},)` is specified + | +LL | let tup: ({integer},) = (7,); + | ++++++++++++++ + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/privacy/no-ice-on-inference-failure.rs b/tests/ui/privacy/no-ice-on-inference-failure.rs index e63b7bff9bc48..b4a8440a7fe32 100644 --- a/tests/ui/privacy/no-ice-on-inference-failure.rs +++ b/tests/ui/privacy/no-ice-on-inference-failure.rs @@ -10,6 +10,7 @@ fn main_ref() { }]; let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]]; + //~^ ERROR type annotations needed [E0282] } fn main() {} diff --git a/tests/ui/privacy/no-ice-on-inference-failure.stderr b/tests/ui/privacy/no-ice-on-inference-failure.stderr index 67476e6e21899..8c085bb2dd6ad 100644 --- a/tests/ui/privacy/no-ice-on-inference-failure.stderr +++ b/tests/ui/privacy/no-ice-on-inference-failure.stderr @@ -23,5 +23,12 @@ LL | | }]; | |_____^ = note: `#[deny(long_running_const_eval)]` on by default -error: aborting due to 1 previous error +error[E0282]: type annotations needed + --> $DIR/no-ice-on-inference-failure.rs:12:50 + | +LL | let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]]; + | ^^^^ cannot infer type for struct `std::ops::Range<{integer}>` + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs index d0bf5078165b7..196da30b86476 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs @@ -4,5 +4,4 @@ fn main() { //~| ERROR cannot find type `T` in this scope //~| ERROR const and type arguments are not allowed on builtin type `str` //~| ERROR expected unit struct, unit variant or constant, found associated function `str< -//~| ERROR type annotations needed } diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr index eec2f5b42fda9..18963d1c020d8 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr @@ -34,18 +34,7 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant -error[E0282]: type annotations needed - --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:31 - | -LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; - | ^^^^^^^^^^^^^^^^^^ - | -help: consider giving this pattern a type - | -LL | let str::<{fn str() { let str::T>>::as_bytes: /* Type */; }}, T>::as_bytes; - | ++++++++++++ - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0109, E0282, E0412, E0533. +Some errors have detailed explanations: E0109, E0412, E0533. For more information about an error, try `rustc --explain E0109`. From 6e4258995e983878b72332b055d71d4e190d8063 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Tue, 18 Mar 2025 23:04:50 +0000 Subject: [PATCH 4/9] Remove ty::Error on hanlde_filed_access This ty::Error was added in #123428, but the root cause is the same as #125323. After report_error is fixed, the arm isn't needed anymore. Signed-off-by: Shunpoco --- compiler/rustc_passes/src/dead.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index f77e1db42d4d2..d393208587fda 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -154,7 +154,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { self.insert_def_id(def.non_enum_variant().fields[index].did); } ty::Tuple(..) => {} - ty::Error(_) => {} kind => span_bug!(lhs.span, "named field access on non-ADT: {kind:?}"), } } From 37bebd68811fabadae81642a3a74760effce8faa Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Tue, 18 Mar 2025 23:42:50 +0000 Subject: [PATCH 5/9] Remove crashes/125323.rs Signed-off-by: Shunpoco --- tests/crashes/125323.rs | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tests/crashes/125323.rs diff --git a/tests/crashes/125323.rs b/tests/crashes/125323.rs deleted file mode 100644 index 180b7bbad097d..0000000000000 --- a/tests/crashes/125323.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: rust-lang/rust#125323 -fn main() { - for _ in 0..0 { - [(); loop {}]; - } -} From 4b4424dea692a7adf17fd62f8b7955fc4692d43b Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Fri, 21 Mar 2025 19:00:47 +0000 Subject: [PATCH 6/9] Revert "Use has_errors_excluding_lint_errors instead of tainted_by_errors on report_error" This reverts commit 3cf7d22b39b3b3207facfeac59d7be391407d3a0. --- compiler/rustc_hir_typeck/src/writeback.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_hir_typeck/src/writeback.rs b/compiler/rustc_hir_typeck/src/writeback.rs index 968e18a39eda5..6a3417ae5d6fb 100644 --- a/compiler/rustc_hir_typeck/src/writeback.rs +++ b/compiler/rustc_hir_typeck/src/writeback.rs @@ -779,7 +779,7 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> { } fn report_error(&self, p: impl Into>) -> ErrorGuaranteed { - if let Some(guar) = self.fcx.dcx().has_errors_excluding_lint_errors() { + if let Some(guar) = self.fcx.tainted_by_errors() { guar } else { self.fcx From 5963b83b2ac5d7f60508d54de232f0f71f88f01f Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Fri, 21 Mar 2025 19:01:01 +0000 Subject: [PATCH 7/9] Revert "Modify other tests to align the change" This reverts commit b54304408c8c87418a18bd2af6eba84ef2efd9a5. --- .../do-not-ice-on-field-access-of-err-type.rs | 2 +- .../do-not-ice-on-field-access-of-err-type.stderr | 14 +------------- tests/ui/privacy/no-ice-on-inference-failure.rs | 1 - .../ui/privacy/no-ice-on-inference-failure.stderr | 9 +-------- ...-bindings-in-pattern-with-ty-err-doesnt-ice.rs | 1 + ...dings-in-pattern-with-ty-err-doesnt-ice.stderr | 15 +++++++++++++-- 6 files changed, 17 insertions(+), 25 deletions(-) diff --git a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs index fe1c7432a62ed..a2e336b703e2c 100644 --- a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs +++ b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs @@ -4,6 +4,6 @@ impl Foo for T {} fn main() { let array = [(); { loop {} }]; //~ ERROR constant evaluation is taking a long time - let tup = (7,); //~ ERROR type annotations needed for `({integer},)` [E0282] + let tup = (7,); let x: &dyn Foo = &tup.0; } diff --git a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr index f7aaa321a5fc1..02b8904fbdedd 100644 --- a/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr +++ b/tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr @@ -13,17 +13,5 @@ LL | let array = [(); { loop {} }]; | ^^^^^^^^^^^ = note: `#[deny(long_running_const_eval)]` on by default -error[E0282]: type annotations needed for `({integer},)` - --> $DIR/do-not-ice-on-field-access-of-err-type.rs:7:9 - | -LL | let tup = (7,); - | ^^^ - | -help: consider giving `tup` an explicit type, where the type for tuple `({integer},)` is specified - | -LL | let tup: ({integer},) = (7,); - | ++++++++++++++ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/privacy/no-ice-on-inference-failure.rs b/tests/ui/privacy/no-ice-on-inference-failure.rs index b4a8440a7fe32..e63b7bff9bc48 100644 --- a/tests/ui/privacy/no-ice-on-inference-failure.rs +++ b/tests/ui/privacy/no-ice-on-inference-failure.rs @@ -10,7 +10,6 @@ fn main_ref() { }]; let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]]; - //~^ ERROR type annotations needed [E0282] } fn main() {} diff --git a/tests/ui/privacy/no-ice-on-inference-failure.stderr b/tests/ui/privacy/no-ice-on-inference-failure.stderr index 8c085bb2dd6ad..67476e6e21899 100644 --- a/tests/ui/privacy/no-ice-on-inference-failure.stderr +++ b/tests/ui/privacy/no-ice-on-inference-failure.stderr @@ -23,12 +23,5 @@ LL | | }]; | |_____^ = note: `#[deny(long_running_const_eval)]` on by default -error[E0282]: type annotations needed - --> $DIR/no-ice-on-inference-failure.rs:12:50 - | -LL | let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]]; - | ^^^^ cannot infer type for struct `std::ops::Range<{integer}>` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs index 196da30b86476..d0bf5078165b7 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs @@ -4,4 +4,5 @@ fn main() { //~| ERROR cannot find type `T` in this scope //~| ERROR const and type arguments are not allowed on builtin type `str` //~| ERROR expected unit struct, unit variant or constant, found associated function `str< +//~| ERROR type annotations needed } diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr index 18963d1c020d8..eec2f5b42fda9 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr @@ -34,7 +34,18 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant -error: aborting due to 4 previous errors +error[E0282]: type annotations needed + --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:31 + | +LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; + | ^^^^^^^^^^^^^^^^^^ + | +help: consider giving this pattern a type + | +LL | let str::<{fn str() { let str::T>>::as_bytes: /* Type */; }}, T>::as_bytes; + | ++++++++++++ + +error: aborting due to 5 previous errors -Some errors have detailed explanations: E0109, E0412, E0533. +Some errors have detailed explanations: E0109, E0282, E0412, E0533. For more information about an error, try `rustc --explain E0109`. From 07dca9697366d49ceba91bddd5d1fb12987df963 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Fri, 21 Mar 2025 19:01:11 +0000 Subject: [PATCH 8/9] Revert "Remove ty::Error on hanlde_filed_access" This reverts commit 6e4258995e983878b72332b055d71d4e190d8063. --- compiler/rustc_passes/src/dead.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index d393208587fda..f77e1db42d4d2 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -154,6 +154,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { self.insert_def_id(def.non_enum_variant().fields[index].did); } ty::Tuple(..) => {} + ty::Error(_) => {} kind => span_bug!(lhs.span, "named field access on non-ADT: {kind:?}"), } } From cd7a8f53dbb55537aef1b1ed8e28e0fbfa750908 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Fri, 21 Mar 2025 19:23:42 +0000 Subject: [PATCH 9/9] Fix: early return if typeck_results is tainted by errors --- compiler/rustc_lint/src/builtin.rs | 5 ++++- compiler/rustc_passes/src/dead.rs | 10 ++++++++-- .../do-not-ice-long-constant-evaluation-in-for-loop.rs | 2 +- ...not-ice-long-constant-evaluation-in-for-loop.stderr | 9 +-------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 9dccd4a0552c3..a7ae709f712ee 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -151,7 +151,10 @@ declare_lint_pass!(NonShorthandFieldPatterns => [NON_SHORTHAND_FIELD_PATTERNS]); impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns { fn check_pat(&mut self, cx: &LateContext<'_>, pat: &hir::Pat<'_>) { - if let PatKind::Struct(ref qpath, field_pats, _) = pat.kind { + // The result shouldn't be tainted, otherwise it will cause ICE. + if let PatKind::Struct(ref qpath, field_pats, _) = pat.kind + && cx.typeck_results().tainted_by_errors.is_none() + { let variant = cx .typeck_results() .pat_ty(pat) diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index f77e1db42d4d2..39b8d6a12643a 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -557,8 +557,14 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> { fn visit_nested_body(&mut self, body: hir::BodyId) { - let old_maybe_typeck_results = - self.maybe_typeck_results.replace(self.tcx.typeck_body(body)); + let typeck_results = self.tcx.typeck_body(body); + + // The result shouldn't be tainted, otherwise it will cause ICE. + if typeck_results.tainted_by_errors.is_some() { + return; + } + + let old_maybe_typeck_results = self.maybe_typeck_results.replace(typeck_results); let body = self.tcx.hir_body(body); self.visit_body(body); self.maybe_typeck_results = old_maybe_typeck_results; diff --git a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs index 5bc530eaa2c00..e5a45f032f285 100644 --- a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs +++ b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.rs @@ -1,6 +1,6 @@ // Issue-125323 fn main() { - for _ in 0..0 { //~ ERROR type annotations needed [E0282] + for _ in 0..0 { [(); loop {}]; //~ ERROR constant evaluation is taking a long time } } diff --git a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr index 541d8fbb01b75..dd4578b7f72a5 100644 --- a/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr +++ b/tests/ui/consts/do-not-ice-long-constant-evaluation-in-for-loop.stderr @@ -13,12 +13,5 @@ LL | [(); loop {}]; | ^^^^^^^ = note: `#[deny(long_running_const_eval)]` on by default -error[E0282]: type annotations needed - --> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:3:14 - | -LL | for _ in 0..0 { - | ^^^^ cannot infer type for struct `std::ops::Range<{integer}>` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0282`.