Skip to content

Commit

Permalink
Fix style in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Sep 13, 2019
1 parent 07a706e commit 98edaea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/librustc_mir/borrow_check/nll/type_check/mod.rs
Expand Up @@ -488,16 +488,16 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
substs: tcx.mk_substs_trait(place_ty.ty, &[]),
};

// In order to have a Copy operand, the type T of the
// value must be Copy. Note that we prove that T: Copy,
// To have a `Copy` operand, the type `T` of the
// value must be `Copy`. Note that we prove that `T: Copy`,
// rather than using the `is_copy_modulo_regions`
// test. This is important because
// `is_copy_modulo_regions` ignores the resulting region
// obligations and assumes they pass. This can result in
// bounds from Copy impls being unsoundly ignored (e.g.,
// #29149). Note that we decide to use Copy before knowing
// bounds from `Copy` impls being unsoundly ignored (e.g.,
// #29149). Note that we decide to use `Copy` before knowing
// whether the bounds fully apply: in effect, the rule is
// that if a value of some type could implement Copy, then
// that if a value of some type could implement `Copy`, then
// it must.
self.cx.prove_trait_ref(
trait_ref,
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_mir/borrow_check/prefixes.rs
Expand Up @@ -118,28 +118,28 @@ impl<'cx, 'tcx> Iterator for Prefixes<'cx, 'tcx> {

match self.kind {
PrefixSet::Shallow => {
// shallow prefixes are found by stripping away
// Shallow prefixes are found by stripping away
// fields, but stop at *any* dereference.
// So we can just stop the traversal now.
self.next = None;
return Some(cursor);
}
PrefixSet::All => {
// all prefixes: just blindly enqueue the base
// of the projection
// All prefixes: just blindly enqueue the base
// of the projection.
self.next = Some(PlaceRef {
base: cursor.base,
projection: proj_base,
});
return Some(cursor);
}
PrefixSet::Supporting => {
// fall through!
// Fall through!
}
}

assert_eq!(self.kind, PrefixSet::Supporting);
// supporting prefixes: strip away fields and
// Supporting prefixes: strip away fields and
// derefs, except we stop at the deref of a shared
// reference.

Expand Down

0 comments on commit 98edaea

Please sign in to comment.