- Notifications
You must be signed in to change notification settings - Fork 13.8k
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-let_elseIssues related to let-else statements (RFC 3137)Issues related to let-else statements (RFC 3137)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
Code
#![feature(let_else)] fn main() { let Some(ref mut meow) = Some(()) else { return }; }
Meta
rustc --version --verbose
:
rustc 1.57.0-nightly (c1026539b 2021-10-15) binary: rustc commit-hash: c1026539bd22e9d070988deaa47b1360cbc76436 commit-date: 2021-10-15 host: x86_64-unknown-linux-gnu release: 1.57.0-nightly LLVM version: 13.0.0
Error output
warning: unused variable: `meow` --> x.rs:3:22 | 3 | let Some(ref mut meow) = Some(()) else { return }; | ^^^^ help: if this is intentional, prefix it with an underscore: `_meow` | = note: `#[warn(unused_variables)]` on by default
Backtrace
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs:53:62 stack backtrace: 0: rust_begin_unwind at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436/library/std/src/panicking.rs:517:5 1: core::panicking::panic_fmt at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436/library/core/src/panicking.rs:100:14 2: core::panicking::panic at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436/library/core/src/panicking.rs:50:5 3: rustc_borrowck::diagnostics::mutability_errors::<impl rustc_borrowck::MirBorrowckCtxt>::report_mutability_error 4: rustc_borrowck::MirBorrowckCtxt::access_place 5: <rustc_borrowck::MirBorrowckCtxt as rustc_mir_dataflow::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect 6: <rustc_mir_dataflow::framework::direction::Forward as rustc_mir_dataflow::framework::direction::Direction>::visit_results_in_block 7: rustc_borrowck::do_mir_borrowck 8: rustc_infer::infer::InferCtxtBuilder::enter 9: core::ops::function::FnOnce::call_once 10: rustc_query_system::query::plumbing::try_execute_query 11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck 12: rustc_data_structures::sync::par_for_each_in 13: rustc_session::utils::<impl rustc_session::session::Session>::time 14: rustc_interface::passes::analysis 15: rustc_query_system::query::plumbing::try_execute_query 16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis 17: rustc_interface::passes::QueryContext::enter 18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter 19: rustc_span::with_source_map 20: scoped_tls::ScopedKey<T>::set
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-let_elseIssues related to let-else statements (RFC 3137)Issues related to let-else statements (RFC 3137)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.