Skip to content

Commit 0916916

Browse files
committed
---
yaml --- r: 228471 b: refs/heads/try c: e58601a h: refs/heads/master i: 228469: 89a333b 228467: 1cf3687 228463: 0d57750 v: v3
1 parent 494e31b commit 0916916

File tree

102 files changed

+496
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+496
-839
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: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: b0ee1ebef4d2b2f0e396438a3db259c981dc2754
4+
refs/heads/try: e58601ab085591c71a27ae82137fc313222c2270
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/doc/trpl/testing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,10 @@ that our tests are entirely left out of a normal build.
250250

251251
The second change is the `use` declaration. Because we're in an inner module,
252252
we need to bring our test function into scope. This can be annoying if you have
253-
a large module, and so this is a common use of the `glob` feature. Let's change
254-
our `src/lib.rs` to make use of it:
253+
a large module, and so this is a common use of globs. Let's change our
254+
`src/lib.rs` to make use of it:
255255

256256
```rust,ignore
257-
258257
pub fn add_two(a: i32) -> i32 {
259258
a + 2
260259
}

branches/try/src/libcollections/vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ impl<T> Vec<T> {
209209
///
210210
/// * `ptr` needs to have been previously allocated via `String`/`Vec<T>`
211211
/// (at least, it's highly likely to be incorrect if it wasn't).
212+
/// * `length` needs to be the length that less than or equal to `capacity`.
212213
/// * `capacity` needs to be the capacity that the pointer was allocated with.
213214
///
214215
/// Violating these may cause problems like corrupting the allocator's

branches/try/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ impl<T> VecDeque<T> {
921921
/// let mut buf = VecDeque::new();
922922
/// buf.push_back(10);
923923
/// buf.push_back(12);
924-
/// buf.insert(1,11);
924+
/// buf.insert(1, 11);
925925
/// assert_eq!(Some(&11), buf.get(1));
926926
/// ```
927927
pub fn insert(&mut self, i: usize, t: T) {

branches/try/src/librustc/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,8 @@ pub mod diagnostics;
9999

100100
pub mod back {
101101
pub use rustc_back::abi;
102-
pub use rustc_back::arm;
103-
pub use rustc_back::mips;
104-
pub use rustc_back::mipsel;
105102
pub use rustc_back::rpath;
106103
pub use rustc_back::svh;
107-
pub use rustc_back::target_strs;
108-
pub use rustc_back::x86;
109-
pub use rustc_back::x86_64;
110104
}
111105

112106
pub mod ast_map;

branches/try/src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -887,16 +887,9 @@ fn parse_existential_bounds_<'a,'tcx, F>(st: &mut PState<'a,'tcx>,
887887
}
888888
}
889889

890-
let region_bound_will_change = match next(st) {
891-
'y' => true,
892-
'n' => false,
893-
c => panic!("parse_ty: expected y/n not '{}'", c)
894-
};
895-
896890
return ty::ExistentialBounds { region_bound: region_bound,
897891
builtin_bounds: builtin_bounds,
898-
projection_bounds: projection_bounds,
899-
region_bound_will_change: region_bound_will_change };
892+
projection_bounds: projection_bounds };
900893
}
901894

902895
fn parse_builtin_bounds<F>(st: &mut PState, mut _conv: F) -> ty::BuiltinBounds where

branches/try/src/librustc/metadata/tyencode.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ pub fn enc_existential_bounds<'a,'tcx>(w: &mut Encoder,
390390
}
391391

392392
mywrite!(w, ".");
393-
394-
mywrite!(w, "{}", if bs.region_bound_will_change {'y'} else {'n'});
395393
}
396394

397395
pub fn enc_region_bounds<'a, 'tcx>(w: &mut Encoder,

branches/try/src/librustc/middle/infer/bivariate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Bivariate<'a, 'tcx> {
4949

5050
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
5151

52-
fn will_change(&mut self, _: bool, _: bool) -> bool {
53-
// since we are not comparing regions, we don't care
54-
false
55-
}
56-
5752
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
5853
variance: ty::Variance,
5954
a: &T,

branches/try/src/librustc/middle/infer/equate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ impl<'a, 'tcx> TypeRelation<'a,'tcx> for Equate<'a, 'tcx> {
3434

3535
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
3636

37-
fn will_change(&mut self, a: bool, b: bool) -> bool {
38-
// if either side changed from what it was, that could cause equality to fail
39-
a || b
40-
}
41-
4237
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
4338
_: ty::Variance,
4439
a: &T,

branches/try/src/librustc/middle/infer/error_reporting.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
593593
sub: Region,
594594
sup: Region) {
595595
match origin {
596-
infer::Subtype(trace) |
597-
infer::DefaultExistentialBound(trace) => {
596+
infer::Subtype(trace) => {
598597
let terr = TypeError::RegionsDoesNotOutlive(sup, sub);
599598
self.report_and_explain_type_error(trace, &terr);
600599
}
@@ -1570,8 +1569,7 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
15701569

15711570
fn note_region_origin(&self, origin: &SubregionOrigin<'tcx>) {
15721571
match *origin {
1573-
infer::Subtype(ref trace) |
1574-
infer::DefaultExistentialBound(ref trace) => {
1572+
infer::Subtype(ref trace) => {
15751573
let desc = match trace.origin {
15761574
infer::Misc(_) => {
15771575
"types are compatible"

branches/try/src/librustc/middle/infer/glb.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Glb<'a, 'tcx> {
3535

3636
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
3737

38-
fn will_change(&mut self, a: bool, b: bool) -> bool {
39-
// Hmm, so the result of GLB will still be a LB if one or both
40-
// sides change to 'static, but it may no longer be the GLB.
41-
// I'm going to go with `a || b` here to be conservative,
42-
// since the result of this operation may be affected, though
43-
// I think it would mostly be more accepting than before (since the result
44-
// would be a bigger region).
45-
a || b
46-
}
47-
4838
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
4939
variance: ty::Variance,
5040
a: &T,

branches/try/src/librustc/middle/infer/lub.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Lub<'a, 'tcx> {
3535

3636
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
3737

38-
fn will_change(&mut self, a: bool, b: bool) -> bool {
39-
// result will be 'static if a || b
40-
a || b
41-
}
42-
4338
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
4439
variance: ty::Variance,
4540
a: &T,

branches/try/src/librustc/middle/infer/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@ pub enum SubregionOrigin<'tcx> {
191191
// Arose from a subtyping relation
192192
Subtype(TypeTrace<'tcx>),
193193

194-
// Arose from a subtyping relation
195-
DefaultExistentialBound(TypeTrace<'tcx>),
196-
197194
// Stack-allocated closures cannot outlive innermost loop
198195
// or function so as to ensure we only require finite stack
199196
InfStackClosure(Span),
@@ -1466,7 +1463,6 @@ impl<'tcx> SubregionOrigin<'tcx> {
14661463
pub fn span(&self) -> Span {
14671464
match *self {
14681465
Subtype(ref a) => a.span(),
1469-
DefaultExistentialBound(ref a) => a.span(),
14701466
InfStackClosure(a) => a,
14711467
InvokeClosure(a) => a,
14721468
DerefPointer(a) => a,

branches/try/src/librustc/middle/infer/region_inference/mod.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,56 +1357,9 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
13571357
}
13581358
}
13591359

1360-
// Check for future hostile edges tied to a bad default
1361-
self.report_future_hostility(&graph);
1362-
13631360
(0..self.num_vars() as usize).map(|idx| var_data[idx].value).collect()
13641361
}
13651362

1366-
fn report_future_hostility(&self, graph: &RegionGraph) {
1367-
let constraints = self.constraints.borrow();
1368-
for edge in graph.all_edges() {
1369-
match constraints[&edge.data] {
1370-
SubregionOrigin::DefaultExistentialBound(_) => {
1371-
// this will become 'static in the future
1372-
}
1373-
_ => { continue; }
1374-
}
1375-
1376-
// this constraint will become a 'static constraint in the
1377-
// future, so walk outward and see if we have any hard
1378-
// bounds that could not be inferred to 'static
1379-
for nid in graph.depth_traverse(edge.target()) {
1380-
for (_, succ) in graph.outgoing_edges(nid) {
1381-
match succ.data {
1382-
ConstrainVarSubReg(_, r) => {
1383-
match r {
1384-
ty::ReStatic | ty::ReInfer(_) => {
1385-
/* OK */
1386-
}
1387-
ty::ReFree(_) | ty::ReScope(_) | ty::ReEmpty => {
1388-
span_warn!(
1389-
self.tcx.sess,
1390-
constraints[&edge.data].span(),
1391-
E0398,
1392-
"this code may fail to compile in Rust 1.3 due to \
1393-
the proposed change in object lifetime bound defaults");
1394-
return; // only issue the warning once per fn
1395-
}
1396-
ty::ReEarlyBound(..) | ty::ReLateBound(..) => {
1397-
self.tcx.sess.span_bug(
1398-
constraints[&succ.data].span(),
1399-
"relation to bound region");
1400-
}
1401-
}
1402-
}
1403-
_ => { }
1404-
}
1405-
}
1406-
}
1407-
}
1408-
}
1409-
14101363
fn construct_graph(&self) -> RegionGraph {
14111364
let num_vars = self.num_vars();
14121365

branches/try/src/librustc/middle/infer/sub.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx> {
4545
r
4646
}
4747

48-
fn will_change(&mut self, a: bool, b: bool) -> bool {
49-
// if we have (Foo+'a) <: (Foo+'b), this requires that 'a:'b.
50-
// So if 'a becomes 'static, no additional errors can occur.
51-
// OTOH, if 'a stays the same, but 'b becomes 'static, we
52-
// could have a problem.
53-
!a && b
54-
}
55-
5648
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
5749
variance: ty::Variance,
5850
a: &T,
@@ -106,12 +98,10 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx> {
10698
fn regions(&mut self, a: ty::Region, b: ty::Region) -> RelateResult<'tcx, ty::Region> {
10799
debug!("{}.regions({:?}, {:?}) self.cause={:?}",
108100
self.tag(), a, b, self.fields.cause);
109-
let origin = match self.fields.cause {
110-
Some(Cause::ExistentialRegionBound(true)) =>
111-
SubregionOrigin::DefaultExistentialBound(self.fields.trace.clone()),
112-
_ =>
113-
SubregionOrigin::Subtype(self.fields.trace.clone()),
114-
};
101+
// FIXME -- we have more fine-grained information available
102+
// from the "cause" field, we could perhaps give more tailored
103+
// error messages.
104+
let origin = SubregionOrigin::Subtype(self.fields.trace.clone());
115105
self.fields.infcx.region_vars.make_subregion(origin, a, b);
116106
Ok(a)
117107
}

branches/try/src/librustc/middle/traits/select.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
24622462
region_bound: data_b.bounds.region_bound,
24632463
builtin_bounds: data_b.bounds.builtin_bounds,
24642464
projection_bounds: data_a.bounds.projection_bounds.clone(),
2465-
region_bound_will_change: data_b.bounds.region_bound_will_change,
24662465
};
24672466

24682467
let new_trait = tcx.mk_trait(data_a.principal.clone(), bounds);

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,11 +1989,6 @@ pub struct ExistentialBounds<'tcx> {
19891989
pub region_bound: ty::Region,
19901990
pub builtin_bounds: BuiltinBounds,
19911991
pub projection_bounds: Vec<PolyProjectionPredicate<'tcx>>,
1992-
1993-
// If true, this TyTrait used a "default bound" in the surface
1994-
// syntax. This makes no difference to the type system but is
1995-
// handy for error reporting.
1996-
pub region_bound_will_change: bool,
19971992
}
19981993

19991994
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ pub fn super_fold_existential_bounds<'tcx, T: TypeFolder<'tcx>>(
700700
region_bound: bounds.region_bound.fold_with(this),
701701
builtin_bounds: bounds.builtin_bounds,
702702
projection_bounds: bounds.projection_bounds.fold_with(this),
703-
region_bound_will_change: bounds.region_bound_will_change,
704703
}
705704
}
706705

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Match<'a, 'tcx> {
4242
fn tcx(&self) -> &'a ty::ctxt<'tcx> { self.tcx }
4343
fn a_is_expected(&self) -> bool { true } // irrelevant
4444

45-
fn will_change(&mut self, _: bool, _: bool) -> bool {
46-
// we're ignoring regions in this code
47-
false
48-
}
49-
5045
fn relate_with_variance<T:Relate<'a,'tcx>>(&mut self,
5146
_: ty::Variance,
5247
a: &T,

branches/try/src/librustc/middle/ty_relate/mod.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub type RelateResult<'tcx, T> = Result<T, ty::TypeError<'tcx>>;
2424

2525
#[derive(Clone, Debug)]
2626
pub enum Cause {
27-
ExistentialRegionBound(bool), // if true, this is a default, else explicit
27+
ExistentialRegionBound, // relating an existential region bound
2828
}
2929

3030
pub trait TypeRelation<'a,'tcx> : Sized {
@@ -43,13 +43,6 @@ pub trait TypeRelation<'a,'tcx> : Sized {
4343
f(self)
4444
}
4545

46-
/// Hack for deciding whether the lifetime bound defaults change
47-
/// will be a breaking change or not. The bools indicate whether
48-
/// `a`/`b` have a default that will change to `'static`; the
49-
/// result is true if this will potentially affect the affect of
50-
/// relating `a` and `b`.
51-
fn will_change(&mut self, a: bool, b: bool) -> bool;
52-
5346
/// Generic relation routine suitable for most anything.
5447
fn relate<T:Relate<'a,'tcx>>(&mut self, a: &T, b: &T) -> RelateResult<'tcx, T> {
5548
Relate::relate(self, a, b)
@@ -384,21 +377,17 @@ impl<'a,'tcx:'a> Relate<'a,'tcx> for ty::ExistentialBounds<'tcx> {
384377
-> RelateResult<'tcx, ty::ExistentialBounds<'tcx>>
385378
where R: TypeRelation<'a,'tcx>
386379
{
387-
let will_change = relation.will_change(a.region_bound_will_change,
388-
b.region_bound_will_change);
389-
390380
let r =
391381
try!(relation.with_cause(
392-
Cause::ExistentialRegionBound(will_change),
382+
Cause::ExistentialRegionBound,
393383
|relation| relation.relate_with_variance(ty::Contravariant,
394384
&a.region_bound,
395385
&b.region_bound)));
396386
let nb = try!(relation.relate(&a.builtin_bounds, &b.builtin_bounds));
397387
let pb = try!(relation.relate(&a.projection_bounds, &b.projection_bounds));
398388
Ok(ty::ExistentialBounds { region_bound: r,
399389
builtin_bounds: nb,
400-
projection_bounds: pb,
401-
region_bound_will_change: will_change })
390+
projection_bounds: pb })
402391
}
403392
}
404393

branches/try/src/librustc/util/ppaux.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,6 @@ impl<'tcx> fmt::Display for ty::TraitTy<'tcx> {
300300
try!(write!(f, " + {}", bound));
301301
}
302302

303-
if bounds.region_bound_will_change && verbose() {
304-
try!(write!(f, " [WILL-CHANGE]"));
305-
}
306-
307303
Ok(())
308304
}
309305
}

0 commit comments

Comments
 (0)