Fix rebase issues
This commit is contained in:
parent
442514884d
commit
f1db60ca95
4 changed files with 4 additions and 4 deletions
|
@ -242,7 +242,7 @@ impl<'tcx> Body<'tcx> {
|
|||
pub fn vars_iter<'a>(&'a self) -> impl Iterator<Item = Local> + 'a {
|
||||
(self.arg_count + 1..self.local_decls.len()).filter_map(move |index| {
|
||||
let local = Local::new(index);
|
||||
self.local_decls[local].is_user_variable().to_option(local)
|
||||
self.local_decls[local].is_user_variable().then_some(local)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
|
|||
#![feature(associated_type_bounds)]
|
||||
#![feature(range_is_empty)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![feature(bool_to_option)]
|
||||
#![feature(trait_alias)]
|
||||
#![feature(matches_macro)]
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ fn get_switched_on_type<'tcx>(
|
|||
// Only bother checking blocks which terminate by switching on a local.
|
||||
if let Some(local) = get_discriminant_local(&terminator.kind) {
|
||||
let stmt_before_term = (block_data.statements.len() > 0)
|
||||
.then_with(|| &block_data.statements[block_data.statements.len() - 1].kind);
|
||||
.then(|| &block_data.statements[block_data.statements.len() - 1].kind);
|
||||
|
||||
if let Some(StatementKind::Assign(box (l, Rvalue::Discriminant(place)))) = stmt_before_term
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ fn variant_discriminants<'tcx>(
|
|||
.iter_enumerated()
|
||||
.filter_map(|(idx, layout)| {
|
||||
(layout.abi != Abi::Uninhabited)
|
||||
.then_with(|| ty.discriminant_for_variant(tcx, idx).unwrap().val)
|
||||
.then(|| ty.discriminant_for_variant(tcx, idx).unwrap().val)
|
||||
})
|
||||
.collect(),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
//! The main parser interface.
|
||||
|
||||
#![feature(bool_to_option)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
|
||||
use syntax::ast;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue