Skip to content

Commit 7f8942c

Browse files
committed
Correct nits from @nrc
1 parent 401a243 commit 7f8942c

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/librustc/middle/outlives.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ pub enum Component<'tcx> {
5454
// the future without breaking backwards compat.
5555
EscapingProjection(Vec<Component<'tcx>>),
5656

57+
// This is a temporary marker indicating "outlives components"
58+
// that are due to the new rules introduced by RFC 1214. For the
59+
// time being, violations of these requirements generally induce
60+
// warnings, not errors.
5761
RFC1214(Vec<Component<'tcx>>),
5862
}
5963

@@ -64,7 +68,7 @@ pub fn components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
6468
-> Vec<Component<'tcx>> {
6569
let mut components = vec![];
6670
compute_components(infcx, ty0, &mut components);
67-
debug!("outlives({:?}) = {:?}", ty0, components);
71+
debug!("components({:?}) = {:?}", ty0, components);
6872
components
6973
}
7074

src/librustc/middle/wf.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ pub enum ImpliedBound<'tcx> {
122122
RegionSubProjection(ty::Region, ty::ProjectionTy<'tcx>),
123123
}
124124

125-
/// This routine computes the full set of well-formedness constraints
126-
/// that must hold for the type `ty` to appear in a context with
127-
/// lifetime `outer_region`.
125+
/// Compute the implied bounds that a callee/impl can assume based on
126+
/// the fact that caller/projector has ensured that `ty` is WF. See
127+
/// the `ImpliedBound` type for more details.
128128
pub fn implied_bounds<'a,'tcx>(
129129
infcx: &'a InferCtxt<'a,'tcx>,
130130
body_id: ast::NodeId,

src/librustc_typeck/check/regionck.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1732,11 +1732,6 @@ fn projection_bound<'a, 'tcx>(rcx: &Rcx<'a, 'tcx>,
17321732

17331733
// see the extensive comment in projection_must_outlive
17341734

1735-
// this routine is not invoked in this case
1736-
assert!(
1737-
!projection_ty.trait_ref.substs.types.iter().any(|t| t.needs_infer()) &&
1738-
!projection_ty.trait_ref.substs.regions().iter().any(|r| r.needs_infer()));
1739-
17401735
let ty = rcx.tcx().mk_projection(projection_ty.trait_ref, projection_ty.item_name);
17411736
let recursive_bound = recursive_type_bound(rcx, span, ty);
17421737

0 commit comments

Comments
 (0)