Skip to content

Commit 308bc32

Browse files
committed
---
yaml --- r: 271731 b: refs/heads/master c: b678600 h: refs/heads/master i: 271729: 5173085 271727: 284d825
1 parent df44d89 commit 308bc32

File tree

41 files changed

+329
-178
lines changed

Some content is hidden

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

41 files changed

+329
-178
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: 694d88394b824fecf90176c9d1a38631fd33d468
2+
refs/heads/master: b678600ac94ee9cf3e679bb6128cd77b169231cb
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
44
refs/heads/try: 49312a405e14a449b98fe0056b12a40ac128be4a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/mk/crates.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ TARGET_CRATES := libc std term \
5353
getopts collections test rand \
5454
core alloc \
5555
rustc_unicode rustc_bitflags \
56-
alloc_system alloc_jemalloc rustc_const_eval
56+
alloc_system alloc_jemalloc
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
60+
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
61+
rustc_const_eval
6162
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6263
flate arena graphviz rbml log serialize
6364
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -94,9 +95,9 @@ DEPS_syntax_ext := syntax fmt_macros
9495
DEPS_rustc_const_eval := std syntax
9596

9697
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
97-
log graphviz rustc_llvm rustc_back rustc_data_structures\
98+
log graphviz rustc_back rustc_data_structures\
9899
rustc_const_eval
99-
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
100+
DEPS_rustc_back := std syntax rustc_front flate log libc
100101
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
101102
DEPS_rustc_data_structures := std log serialize
102103
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
@@ -110,7 +111,7 @@ DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
110111
DEPS_rustc_passes := syntax rustc core rustc_front
111112
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
112113
DEPS_rustc_resolve := arena rustc rustc_front log syntax
113-
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
114+
DEPS_rustc_platform_intrinsics := std
114115
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
115116
DEPS_rustc_privacy := rustc rustc_front log syntax
116117
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \

trunk/src/etc/platform-intrinsics/generator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,11 @@ def open(self, platform):
759759
760760
use {{Intrinsic, Type}};
761761
use IntrinsicDef::Named;
762-
use rustc::middle::ty::TyCtxt;
763762
764763
// The default inlining settings trigger a pathological behaviour in
765764
// LLVM, which causes makes compilation very slow. See #28273.
766765
#[inline(never)]
767-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
766+
pub fn find(name: &str) -> Option<Intrinsic> {{
768767
if !name.starts_with("{0}") {{ return None }}
769768
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
770769

trunk/src/libcollections/binary_heap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -980,13 +980,13 @@ impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
980980

981981
#[stable(feature = "rust1", since = "1.0.0")]
982982
impl<T: Ord> Extend<T> for BinaryHeap<T> {
983-
fn extend<I: IntoIterator<Item = T>>(&mut self, iterable: I) {
984-
let iter = iterable.into_iter();
985-
let (lower, _) = iter.size_hint();
983+
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
984+
let iterator = iter.into_iter();
985+
let (lower, _) = iterator.size_hint();
986986

987987
self.reserve(lower);
988988

989-
for elem in iter {
989+
for elem in iterator {
990990
self.push(elem);
991991
}
992992
}

trunk/src/libcollections/string.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,35 +1388,35 @@ impl Clone for String {
13881388

13891389
#[stable(feature = "rust1", since = "1.0.0")]
13901390
impl FromIterator<char> for String {
1391-
fn from_iter<I: IntoIterator<Item = char>>(iterable: I) -> String {
1391+
fn from_iter<I: IntoIterator<Item = char>>(iter: I) -> String {
13921392
let mut buf = String::new();
1393-
buf.extend(iterable);
1393+
buf.extend(iter);
13941394
buf
13951395
}
13961396
}
13971397

13981398
#[stable(feature = "rust1", since = "1.0.0")]
13991399
impl<'a> FromIterator<&'a str> for String {
1400-
fn from_iter<I: IntoIterator<Item = &'a str>>(iterable: I) -> String {
1400+
fn from_iter<I: IntoIterator<Item = &'a str>>(iter: I) -> String {
14011401
let mut buf = String::new();
1402-
buf.extend(iterable);
1402+
buf.extend(iter);
14031403
buf
14041404
}
14051405
}
14061406

14071407
#[stable(feature = "extend_string", since = "1.4.0")]
14081408
impl FromIterator<String> for String {
1409-
fn from_iter<I: IntoIterator<Item = String>>(iterable: I) -> String {
1409+
fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> String {
14101410
let mut buf = String::new();
1411-
buf.extend(iterable);
1411+
buf.extend(iter);
14121412
buf
14131413
}
14141414
}
14151415

14161416
#[stable(feature = "rust1", since = "1.0.0")]
14171417
impl Extend<char> for String {
1418-
fn extend<I: IntoIterator<Item = char>>(&mut self, iterable: I) {
1419-
let iterator = iterable.into_iter();
1418+
fn extend<I: IntoIterator<Item = char>>(&mut self, iter: I) {
1419+
let iterator = iter.into_iter();
14201420
let (lower_bound, _) = iterator.size_hint();
14211421
self.reserve(lower_bound);
14221422
for ch in iterator {
@@ -1427,24 +1427,24 @@ impl Extend<char> for String {
14271427

14281428
#[stable(feature = "extend_ref", since = "1.2.0")]
14291429
impl<'a> Extend<&'a char> for String {
1430-
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iterable: I) {
1431-
self.extend(iterable.into_iter().cloned());
1430+
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iter: I) {
1431+
self.extend(iter.into_iter().cloned());
14321432
}
14331433
}
14341434

14351435
#[stable(feature = "rust1", since = "1.0.0")]
14361436
impl<'a> Extend<&'a str> for String {
1437-
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iterable: I) {
1438-
for s in iterable {
1437+
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iter: I) {
1438+
for s in iter {
14391439
self.push_str(s)
14401440
}
14411441
}
14421442
}
14431443

14441444
#[stable(feature = "extend_string", since = "1.4.0")]
14451445
impl Extend<String> for String {
1446-
fn extend<I: IntoIterator<Item = String>>(&mut self, iterable: I) {
1447-
for s in iterable {
1446+
fn extend<I: IntoIterator<Item = String>>(&mut self, iter: I) {
1447+
for s in iter {
14481448
self.push_str(&s)
14491449
}
14501450
}

trunk/src/libcollections/vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,13 +1302,13 @@ impl<T> ops::DerefMut for Vec<T> {
13021302
#[stable(feature = "rust1", since = "1.0.0")]
13031303
impl<T> FromIterator<T> for Vec<T> {
13041304
#[inline]
1305-
fn from_iter<I: IntoIterator<Item = T>>(iterable: I) -> Vec<T> {
1305+
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Vec<T> {
13061306
// Unroll the first iteration, as the vector is going to be
13071307
// expanded on this iteration in every case when the iterable is not
13081308
// empty, but the loop in extend_desugared() is not going to see the
13091309
// vector being full in the few subsequent loop iterations.
13101310
// So we get better branch prediction.
1311-
let mut iterator = iterable.into_iter();
1311+
let mut iterator = iter.into_iter();
13121312
let mut vector = match iterator.next() {
13131313
None => return Vec::new(),
13141314
Some(element) => {
@@ -1389,8 +1389,8 @@ impl<'a, T> IntoIterator for &'a mut Vec<T> {
13891389
#[stable(feature = "rust1", since = "1.0.0")]
13901390
impl<T> Extend<T> for Vec<T> {
13911391
#[inline]
1392-
fn extend<I: IntoIterator<Item = T>>(&mut self, iterable: I) {
1393-
self.extend_desugared(iterable.into_iter())
1392+
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
1393+
self.extend_desugared(iter.into_iter())
13941394
}
13951395
}
13961396

trunk/src/libcollections/vec_deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,8 +2057,8 @@ impl<A> IndexMut<usize> for VecDeque<A> {
20572057

20582058
#[stable(feature = "rust1", since = "1.0.0")]
20592059
impl<A> FromIterator<A> for VecDeque<A> {
2060-
fn from_iter<T: IntoIterator<Item = A>>(iterable: T) -> VecDeque<A> {
2061-
let iterator = iterable.into_iter();
2060+
fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> VecDeque<A> {
2061+
let iterator = iter.into_iter();
20622062
let (lower, _) = iterator.size_hint();
20632063
let mut deq = VecDeque::with_capacity(lower);
20642064
deq.extend(iterator);

trunk/src/libcore/hash/sip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use super::Hasher;
1717

1818
/// An implementation of SipHash 2-4.
1919
///
20-
/// See: http://131002.net/siphash/
20+
/// See: https://131002.net/siphash/
2121
///
2222
/// This is currently the default hashing function used by standard library
2323
/// (eg. `collections::HashMap` uses it by default).

trunk/src/libcore/iter.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,10 +2458,10 @@ impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I {
24582458
///
24592459
/// // and we'll implement FromIterator
24602460
/// impl FromIterator<i32> for MyCollection {
2461-
/// fn from_iter<I: IntoIterator<Item=i32>>(iterator: I) -> Self {
2461+
/// fn from_iter<I: IntoIterator<Item=i32>>(iter: I) -> Self {
24622462
/// let mut c = MyCollection::new();
24632463
///
2464-
/// for i in iterator {
2464+
/// for i in iter {
24652465
/// c.add(i);
24662466
/// }
24672467
///
@@ -2508,7 +2508,7 @@ pub trait FromIterator<A>: Sized {
25082508
/// assert_eq!(v, vec![5, 5, 5, 5, 5]);
25092509
/// ```
25102510
#[stable(feature = "rust1", since = "1.0.0")]
2511-
fn from_iter<T: IntoIterator<Item=A>>(iterator: T) -> Self;
2511+
fn from_iter<T: IntoIterator<Item=A>>(iter: T) -> Self;
25122512
}
25132513

25142514
/// Conversion into an `Iterator`.
@@ -2683,11 +2683,11 @@ impl<I: Iterator> IntoIterator for I {
26832683
/// // This is a bit simpler with the concrete type signature: we can call
26842684
/// // extend on anything which can be turned into an Iterator which gives
26852685
/// // us i32s. Because we need i32s to put into MyCollection.
2686-
/// fn extend<T: IntoIterator<Item=i32>>(&mut self, iterable: T) {
2686+
/// fn extend<T: IntoIterator<Item=i32>>(&mut self, iter: T) {
26872687
///
26882688
/// // The implementation is very straightforward: loop through the
26892689
/// // iterator, and add() each element to ourselves.
2690-
/// for elem in iterable {
2690+
/// for elem in iter {
26912691
/// self.add(elem);
26922692
/// }
26932693
/// }
@@ -2727,7 +2727,7 @@ pub trait Extend<A> {
27272727
/// assert_eq!("abcdef", &message);
27282728
/// ```
27292729
#[stable(feature = "rust1", since = "1.0.0")]
2730-
fn extend<T: IntoIterator<Item=A>>(&mut self, iterable: T);
2730+
fn extend<T: IntoIterator<Item=A>>(&mut self, iter: T);
27312731
}
27322732

27332733
/// An iterator able to yield elements from both ends.

trunk/src/librustc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ rustc_bitflags = { path = "../librustc_bitflags" }
2121
rustc_const_eval = { path = "../librustc_const_eval" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
2323
rustc_front = { path = "../librustc_front" }
24-
rustc_llvm = { path = "../librustc_llvm" }
2524
serialize = { path = "../libserialize" }
2625
syntax = { path = "../libsyntax" }

trunk/src/librustc/infer/mod.rs

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -386,33 +386,6 @@ pub fn normalizing_infer_ctxt<'a, 'tcx>(tcx: &'a TyCtxt<'tcx>,
386386
infcx
387387
}
388388

389-
/// Computes the least upper-bound of `a` and `b`. If this is not possible, reports an error and
390-
/// returns ty::err.
391-
pub fn common_supertype<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
392-
origin: TypeOrigin,
393-
a_is_expected: bool,
394-
a: Ty<'tcx>,
395-
b: Ty<'tcx>)
396-
-> Ty<'tcx>
397-
{
398-
debug!("common_supertype({:?}, {:?})",
399-
a, b);
400-
401-
let trace = TypeTrace {
402-
origin: origin,
403-
values: Types(expected_found(a_is_expected, a, b))
404-
};
405-
406-
let result = cx.commit_if_ok(|_| cx.lub(a_is_expected, trace.clone()).relate(&a, &b));
407-
match result {
408-
Ok(t) => t,
409-
Err(ref err) => {
410-
cx.report_and_explain_type_error(trace, err).emit();
411-
cx.tcx.types.err
412-
}
413-
}
414-
}
415-
416389
pub fn mk_subty<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
417390
a_is_expected: bool,
418391
origin: TypeOrigin,
@@ -434,7 +407,7 @@ pub fn can_mk_subty<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
434407
origin: TypeOrigin::Misc(codemap::DUMMY_SP),
435408
values: Types(expected_found(true, a, b))
436409
};
437-
cx.sub(true, trace).relate(&a, &b).map(|_| ())
410+
cx.sub(true, trace, &a, &b).map(|_| ())
438411
})
439412
}
440413

@@ -695,32 +668,32 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
695668
cause: None}
696669
}
697670

698-
// public so that it can be used from the rustc_driver unit tests
699-
pub fn equate(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
700-
-> equate::Equate<'a, 'tcx>
671+
pub fn equate<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
672+
-> RelateResult<'tcx, T>
673+
where T: Relate<'a, 'tcx>
701674
{
702-
self.combine_fields(a_is_expected, trace).equate()
675+
self.combine_fields(a_is_expected, trace).equate().relate(a, b)
703676
}
704677

705-
// public so that it can be used from the rustc_driver unit tests
706-
pub fn sub(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
707-
-> sub::Sub<'a, 'tcx>
678+
pub fn sub<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
679+
-> RelateResult<'tcx, T>
680+
where T: Relate<'a, 'tcx>
708681
{
709-
self.combine_fields(a_is_expected, trace).sub()
682+
self.combine_fields(a_is_expected, trace).sub().relate(a, b)
710683
}
711684

712-
// public so that it can be used from the rustc_driver unit tests
713-
pub fn lub(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
714-
-> lub::Lub<'a, 'tcx>
685+
pub fn lub<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
686+
-> RelateResult<'tcx, T>
687+
where T: Relate<'a, 'tcx>
715688
{
716-
self.combine_fields(a_is_expected, trace).lub()
689+
self.combine_fields(a_is_expected, trace).lub().relate(a, b)
717690
}
718691

719-
// public so that it can be used from the rustc_driver unit tests
720-
pub fn glb(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
721-
-> glb::Glb<'a, 'tcx>
692+
pub fn glb<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
693+
-> RelateResult<'tcx, T>
694+
where T: Relate<'a, 'tcx>
722695
{
723-
self.combine_fields(a_is_expected, trace).glb()
696+
self.combine_fields(a_is_expected, trace).glb().relate(a, b)
724697
}
725698

726699
fn start_snapshot(&self) -> CombinedSnapshot {
@@ -861,7 +834,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
861834
debug!("sub_types({:?} <: {:?})", a, b);
862835
self.commit_if_ok(|_| {
863836
let trace = TypeTrace::types(origin, a_is_expected, a, b);
864-
self.sub(a_is_expected, trace).relate(&a, &b).map(|_| ())
837+
self.sub(a_is_expected, trace, &a, &b).map(|_| ())
865838
})
866839
}
867840

@@ -874,7 +847,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
874847
{
875848
self.commit_if_ok(|_| {
876849
let trace = TypeTrace::types(origin, a_is_expected, a, b);
877-
self.equate(a_is_expected, trace).relate(&a, &b).map(|_| ())
850+
self.equate(a_is_expected, trace, &a, &b).map(|_| ())
878851
})
879852
}
880853

@@ -893,7 +866,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
893866
origin: origin,
894867
values: TraitRefs(expected_found(a_is_expected, a.clone(), b.clone()))
895868
};
896-
self.equate(a_is_expected, trace).relate(&a, &b).map(|_| ())
869+
self.equate(a_is_expected, trace, &a, &b).map(|_| ())
897870
})
898871
}
899872

@@ -912,7 +885,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
912885
origin: origin,
913886
values: PolyTraitRefs(expected_found(a_is_expected, a.clone(), b.clone()))
914887
};
915-
self.sub(a_is_expected, trace).relate(&a, &b).map(|_| ())
888+
self.sub(a_is_expected, trace, &a, &b).map(|_| ())
916889
})
917890
}
918891

@@ -1461,7 +1434,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14611434
origin: TypeOrigin::Misc(codemap::DUMMY_SP),
14621435
values: Types(expected_found(true, e, e))
14631436
};
1464-
self.equate(true, trace).relate(a, b)
1437+
self.equate(true, trace, a, b)
14651438
}).map(|_| ())
14661439
}
14671440

0 commit comments

Comments
 (0)