Skip to content

Commit c889506

Browse files
committed
---
yaml --- r: 232385 b: refs/heads/try c: a264440 h: refs/heads/master i: 232383: 3ef442d v: v3
1 parent aef54e0 commit c889506

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 9c5cfea43da9b4e0372f240e01f58c977bd44d92
4+
refs/heads/try: a264440ab0f498e1ab77b17d24c3d6988c721c27
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/middle/outlives.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,28 @@ fn compute_components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
161161
compute_components(infcx, ty, out);
162162
}
163163
}
164-
_ => {
165-
// for all other types, just constrain the regions and
166-
// keep walking to find any other types.
164+
165+
// Most types do not introduce any region binders, nor
166+
// involve any other subtle cases, and so the WF relation
167+
// simply constraints any regions referenced directly by
168+
// the type and then visits the types that are lexically
169+
// contained within. (The comments refer to relevant rules
170+
// from RFC1214.)
171+
ty::TyBool(..) | // OutlivesScalar
172+
ty::TyChar(..) | // OutlivesScalar
173+
ty::TyInt(..) | // OutlivesScalar
174+
ty::TyUint(..) | // OutlivesScalar
175+
ty::TyFloat(..) | // OutlivesScalar
176+
ty::TyEnum(..) | // OutlivesNominalType
177+
ty::TyStruct(..) | // OutlivesNominalType
178+
ty::TyBox(..) | // OutlivesNominalType (ish)
179+
ty::TyStr(..) | // OutlivesScalar (ish)
180+
ty::TyArray(..) | // ...
181+
ty::TySlice(..) | // ...
182+
ty::TyRawPtr(..) | // ...
183+
ty::TyRef(..) | // OutlivesReference
184+
ty::TyTuple(..) | // ...
185+
ty::TyError(..) => {
167186
push_region_constraints(out, ty.regions());
168187
}
169188
}
@@ -188,4 +207,3 @@ fn push_region_constraints<'tcx>(out: &mut Vec<Component<'tcx>>, regions: Vec<ty
188207
}
189208
}
190209
}
191-

0 commit comments

Comments
 (0)