Skip to content

Commit 0bafd15

Browse files
committed
---
yaml --- r: 233384 b: refs/heads/beta c: a264440 h: refs/heads/master v: v3
1 parent 94e54b8 commit 0bafd15

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 9c5cfea43da9b4e0372f240e01f58c977bd44d92
26+
refs/heads/beta: a264440ab0f498e1ab77b17d24c3d6988c721c27
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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)