Skip to content
Permalink
Browse files

Fix rebase issues

  • Loading branch information
varkor committed Dec 6, 2019
1 parent 4425148 commit f1db60ca9513c1693974f0b27c55d21a39f438b0
@@ -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;

0 comments on commit f1db60c

Please sign in to comment.
You can’t perform that action at this time.