Skip to content

Commit df9ec2b

Browse files
committed
---
yaml --- r: 226971 b: refs/heads/master c: ad700ab h: refs/heads/master i: 226969: b7028b4 226967: 7c973b1 v: v3
1 parent 39df072 commit df9ec2b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fda9b8396057426e86409fd75c69d896b05c372e
2+
refs/heads/master: ad700abea4c6718628a4ceccccdad6a633f1dd9c
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc/middle/ty.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6233,13 +6233,18 @@ impl<'tcx> ctxt<'tcx> {
62336233
/// themselves. This should really be a unique type; `FreshTy(0)` is a
62346234
/// popular choice.
62356235
///
6236+
/// NB: in some cases, particularly around higher-ranked bounds,
6237+
/// this function returns a kind of conservative approximation.
6238+
/// That is, all regions returned by this function are definitely
6239+
/// required, but there may be other region bounds that are not
6240+
/// returned, as well as requirements like `for<'a> T: 'a`.
6241+
///
62366242
/// Requires that trait definitions have been processed so that we can
62376243
/// elaborate predicates and walk supertraits.
62386244
pub fn required_region_bounds(&self,
62396245
erased_self_ty: Ty<'tcx>,
62406246
predicates: Vec<ty::Predicate<'tcx>>)
6241-
-> Vec<ty::Region>
6242-
{
6247+
-> Vec<ty::Region> {
62436248
debug!("required_region_bounds(erased_self_ty={:?}, predicates={:?})",
62446249
erased_self_ty,
62456250
predicates);
@@ -6268,11 +6273,7 @@ impl<'tcx> ctxt<'tcx> {
62686273
// construct such an object, but this seems
62696274
// correct even if that code changes).
62706275
if t == erased_self_ty && !r.has_escaping_regions() {
6271-
if r.has_escaping_regions() {
6272-
Some(ty::ReStatic)
6273-
} else {
6274-
Some(r)
6275-
}
6276+
Some(r)
62766277
} else {
62776278
None
62786279
}

0 commit comments

Comments
 (0)