please the tidy

This commit is contained in:
Ralf Jung 2017-07-22 01:04:16 -07:00
parent 23cd90ed41
commit b6816b2b56
5 changed files with 12 additions and 7 deletions

View file

@ -243,7 +243,8 @@ for mir::StatementKind<'tcx> {
}
}
impl<'a, 'gcx, 'tcx, T> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for mir::ValidationOperand<'tcx, T>
impl<'a, 'gcx, 'tcx, T> HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
for mir::ValidationOperand<'tcx, T>
where T: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
{
fn hash_stable<W: StableHasherResult>(&self,

View file

@ -1596,7 +1596,8 @@ impl<'tcx> TypeFoldable<'tcx> for Statement<'tcx> {
// trait with a `fn visit_extent`.
EndRegion(ref _extent) => false,
Validate(ref _op, ref lvalues) => lvalues.iter().any(|ty_and_lvalue| ty_and_lvalue.visit_with(visitor)),
Validate(ref _op, ref lvalues) =>
lvalues.iter().any(|ty_and_lvalue| ty_and_lvalue.visit_with(visitor)),
Nop => false,
}

View file

@ -89,7 +89,7 @@ impl MirPass for AddValidation {
return;
}
let local_decls = mir.local_decls.clone(); // TODO: Find a way to get rid of this clone.
let local_decls = mir.local_decls.clone(); // FIXME: Find a way to get rid of this clone.
/// Convert an lvalue to a validation operand.
let lval_to_operand = |lval: Lvalue<'tcx>| -> ValidationOperand<'tcx, Lvalue<'tcx>> {
@ -104,7 +104,7 @@ impl MirPass for AddValidation {
let acquire_stmt = Statement {
source_info: SourceInfo {
scope: ARGUMENT_VISIBILITY_SCOPE,
span: mir.span, // TODO: Consider using just the span covering the function
span: mir.span, // FIXME: Consider using just the span covering the function
// argument declaration.
},
kind: StatementKind::Validate(ValidationOp::Acquire,

View file

@ -43,7 +43,10 @@ impl MirPass for CleanEndRegions {
_tcx: TyCtxt<'a, 'tcx, 'tcx>,
_source: MirSource,
mir: &mut Mir<'tcx>) {
let mut gather = GatherBorrowedRegions { seen_regions: FxHashSet(), in_validation_statement: false };
let mut gather = GatherBorrowedRegions {
seen_regions: FxHashSet(),
in_validation_statement: false
};
gather.visit_mir(mir);
let mut delete = DeleteTrivialEndRegions { seen_regions: &mut gather.seen_regions };

View file

@ -11,8 +11,8 @@
//! This pass erases all early-bound regions from the types occuring in the MIR.
//! We want to do this once just before trans, so trans does not have to take
//! care erasing regions all over the place.
//! NOTE: We do NOT erase regions of statements that are relevant for "types-as-contracts"-validation,
//! namely, AcquireValid, ReleaseValid, and EndRegion.
//! NOTE: We do NOT erase regions of statements that are relevant for
//! "types-as-contracts"-validation, namely, AcquireValid, ReleaseValid, and EndRegion.
use rustc::ty::subst::Substs;
use rustc::ty::{Ty, TyCtxt, ClosureSubsts};