-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE due to mapping f32
to same ident with const
and let
#108683
Comments
I can only repro this on the playground, not on a local build or nightly, or godbolt for that matter. Are there special repro instructions? |
Ran this through icemaker and it says you need the |
It happened locally on WSL with the latest nightly on a not-minimized version before I tried it on the playground |
f32
to same ident with const
and let
f32
to same ident with const
and let
Minimized to fn example(var: i32) {
|| {
let 0 = var;
};
} (still requires Rust 2021. Error message is different but ICE looks the same)
Artifacts for these has expired - 87688 touches patterns in MIR building so could be the issue Enabling this block rust/compiler/rustc_hir_typeck/src/upvar.rs Lines 234 to 252 in 13471d3
regardless of edition prevents the ICE. @rustbot claim |
While technically this could shouldn't compile, it shouldn't ICE
Code
Meta
Happens on playground on currrent nightly (1.69.0)
Error output
Backtrace
Compiling playground v0.0.1 (/playground) warning: floating-point types cannot be used in patterns --> src/main.rs:8:13 | 8 | let EPS = planarity_epsilon; | ^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, [see issue #41620 ](https://github.com//issues/41620) = note: `#[warn(illegal_floating_point_literal_pattern)]` on by defaulterror[E0005]: refutable pattern in local binding
--> src/main.rs:8:13
|
7 | const EPS: f32 = 3e-2;
| -------------- constant defined here
8 | let EPS = planarity_epsilon;
| ^^^
| |
| pattern
_
not covered| missing patterns are not covered because
eps
is interpreted as a constant pattern, not a new variable| help: introduce a variable instead:
eps_var
|
= note: the matched value is of type
f32
thread 'rustc' panicked at 'called
Option::unwrap()
on aNone
value', compiler/rustc_mir_build/src/build/expr/as_place.rs:258:31stack backtrace:
0: rust_begin_unwind
at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/std/src/panicking.rs:579:5
1: core::panicking::panic_fmt
at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/core/src/panicking.rs:64:14
2: core::panicking::panic
at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/core/src/panicking.rs:114:5
3: <rustc_mir_build::build::expr::as_place::PlaceBuilder>::to_place
4: <rustc_mir_build::build::Builder>::match_simplified_candidates
5: <rustc_mir_build::build::Builder>::match_candidates
6: <rustc_mir_build::build::Builder>::lower_match_tree
7: <rustc_mir_build::build::Builder>::place_into_pattern
8: <rustc_mir_build::build::Builder>::ast_block_stmts
9: <rustc_mir_build::build::Builder>::ast_block
10: <rustc_mir_build::build::Builder>::expr_into_dest
11: <rustc_mir_build::build::Builder>::as_temp_inner
12: <rustc_mir_build::build::Builder>::expr_into_dest
13: <rustc_mir_build::build::Builder>::expr_into_dest
14: <rustc_mir_build::build::Builder>::expr_into_dest
15: rustc_mir_build::build::mir_built
16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_built, rustc_query_impl::plumbing::QueryCtxt>
17: rustc_mir_transform::check_unsafety::unsafety_check_result
18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::unsafety_check_result, rustc_query_impl::plumbing::QueryCtxt>
19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::unsafety_check_result
20: rustc_mir_transform::check_unsafety::unsafety_check_result
21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::unsafety_check_result, rustc_query_impl::plumbing::QueryCtxt>
22: rustc_mir_transform::mir_const
23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_const, rustc_query_impl::plumbing::QueryCtxt>
24: rustc_mir_transform::mir_promoted
25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>
26: rustc_borrowck::mir_borrowck
27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
28: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
29: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
30: rustc_interface::passes::analysis
31: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
32: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
33: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
34: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.69.0-nightly (f77bfb7 2023-03-01) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [mir_built] building MIR for
example::{closure#0}
#1 [unsafety_check_result] unsafety-checking
example::{closure#0}
#2 [unsafety_check_result] unsafety-checking
example
#3 [mir_const] preparing
example
for borrow checking#4 [mir_promoted] processing MIR for
example
#5 [mir_borrowck] borrow-checking
example
#6 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try
rustc --explain E0005
.warning:
playground
(bin "playground") generated 1 warningerror: could not compile
playground
due to previous error; 1 warning emitted``` ```
The text was updated successfully, but these errors were encountered: