Skip to content

Commit ebdfbf1

Browse files
committed
---
yaml --- r: 209819 b: refs/heads/try c: be26031 h: refs/heads/master i: 209817: 3373705 209815: af6ea43 v: v3
1 parent 79b04c7 commit ebdfbf1

36 files changed

+120
-67
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 99fd7f213183bcf421ac881663ef2913ac4466b4
5+
refs/heads/try: be260316725f55ad0e4236204b8ec2d6a7792272
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/tests.mk

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -753,20 +753,22 @@ PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
753753
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
754754
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
755755
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
756-
# The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
757-
# external crates.
758-
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
759-
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
760-
PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
761-
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
762-
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
763756
PRETTY_DIRNAME_pretty-rpass = run-pass
764757
PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
765758
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
766759
PRETTY_DIRNAME_pretty-rfail = run-fail
767760
PRETTY_DIRNAME_pretty-bench = bench
768761
PRETTY_DIRNAME_pretty-pretty = pretty
769762

763+
define DEF_PRETTY_FULLDEPS
764+
PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rpass-full = $$(CSREQ$(1)_T_$(3)_H_$(3))
765+
endef
766+
767+
$(foreach host,$(CFG_HOST), \
768+
$(foreach target,$(CFG_TARGET), \
769+
$(foreach stage,$(STAGES), \
770+
$(eval $(call DEF_PRETTY_FULLDEPS,$(stage),$(target),$(host))))))
771+
770772
define DEF_RUN_PRETTY_TEST
771773

772774
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
@@ -780,7 +782,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
780782
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
781783
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
782784
$$(PRETTY_DEPS_$(4)) \
783-
$$(PRETTY_DEPS$(1)_H_$(3)_$(4))
785+
$$(PRETTY_DEPS$(1)_T_$(2)_H_$(3)_$(4))
784786
@$$(call E, run pretty-rpass [$(2)]: $$<)
785787
$$(Q)touch $$@.start_time
786788
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> PathBuf {
14651465
fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14661466
let f = output_base_name(config, testfile);
14671467
let mut fname = f.file_name().unwrap().to_os_string();
1468-
fname.push("libaux");
1468+
fname.push(&format!(".{}.libaux", config.mode));
14691469
f.with_file_name(&fname)
14701470
}
14711471

branches/try/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl<T> fmt::Pointer for Arc<T> {
675675
}
676676

677677
#[stable(feature = "rust1", since = "1.0.0")]
678-
impl<T: Default + Sync + Send> Default for Arc<T> {
678+
impl<T: Default> Default for Arc<T> {
679679
#[stable(feature = "rust1", since = "1.0.0")]
680680
fn default() -> Arc<T> { Arc::new(Default::default()) }
681681
}

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

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
532532
obligation.repr(self.tcx()));
533533

534534
self.infcx.probe(|snapshot| {
535-
let (skol_obligation_trait_ref, skol_map) =
536-
self.infcx().skolemize_late_bound_regions(&obligation.predicate, snapshot);
537-
match self.match_impl(impl_def_id, obligation, snapshot,
538-
&skol_map, skol_obligation_trait_ref.trait_ref.clone()) {
539-
Ok(substs) => {
535+
match self.match_impl(impl_def_id, obligation, snapshot) {
536+
Ok((substs, skol_map)) => {
540537
let vtable_impl = self.vtable_impl(impl_def_id,
541538
substs,
542539
obligation.cause.clone(),
@@ -1160,10 +1157,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11601157
let all_impls = self.all_impls(def_id);
11611158
for &impl_def_id in &all_impls {
11621159
self.infcx.probe(|snapshot| {
1163-
let (skol_obligation_trait_pred, skol_map) =
1164-
self.infcx().skolemize_late_bound_regions(&obligation.predicate, snapshot);
1165-
match self.match_impl(impl_def_id, obligation, snapshot,
1166-
&skol_map, skol_obligation_trait_pred.trait_ref.clone()) {
1160+
match self.match_impl(impl_def_id, obligation, snapshot) {
11671161
Ok(_) => {
11681162
candidates.vec.push(ImplCandidate(impl_def_id));
11691163
}
@@ -2115,11 +2109,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
21152109
// First, create the substitutions by matching the impl again,
21162110
// this time not in a probe.
21172111
self.infcx.commit_if_ok(|snapshot| {
2118-
let (skol_obligation_trait_ref, skol_map) =
2119-
self.infcx().skolemize_late_bound_regions(&obligation.predicate, snapshot);
2120-
let substs =
2112+
let (substs, skol_map) =
21212113
self.rematch_impl(impl_def_id, obligation,
2122-
snapshot, &skol_map, skol_obligation_trait_ref.trait_ref);
2114+
snapshot);
21232115
debug!("confirm_impl_candidate substs={}", substs.repr(self.tcx()));
21242116
Ok(self.vtable_impl(impl_def_id, substs, obligation.cause.clone(),
21252117
obligation.recursion_depth + 1, skol_map, snapshot))
@@ -2306,14 +2298,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23062298
fn rematch_impl(&mut self,
23072299
impl_def_id: ast::DefId,
23082300
obligation: &TraitObligation<'tcx>,
2309-
snapshot: &infer::CombinedSnapshot,
2310-
skol_map: &infer::SkolemizationMap,
2311-
skol_obligation_trait_ref: Rc<ty::TraitRef<'tcx>>)
2312-
-> Normalized<'tcx, Substs<'tcx>>
2301+
snapshot: &infer::CombinedSnapshot)
2302+
-> (Normalized<'tcx, Substs<'tcx>>, infer::SkolemizationMap)
23132303
{
2314-
match self.match_impl(impl_def_id, obligation, snapshot,
2315-
skol_map, skol_obligation_trait_ref) {
2316-
Ok(substs) => substs,
2304+
match self.match_impl(impl_def_id, obligation, snapshot) {
2305+
Ok((substs, skol_map)) => (substs, skol_map),
23172306
Err(()) => {
23182307
self.tcx().sess.bug(
23192308
&format!("Impl {} was matchable against {} but now is not",
@@ -2326,10 +2315,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23262315
fn match_impl(&mut self,
23272316
impl_def_id: ast::DefId,
23282317
obligation: &TraitObligation<'tcx>,
2329-
snapshot: &infer::CombinedSnapshot,
2330-
skol_map: &infer::SkolemizationMap,
2331-
skol_obligation_trait_ref: Rc<ty::TraitRef<'tcx>>)
2332-
-> Result<Normalized<'tcx, Substs<'tcx>>, ()>
2318+
snapshot: &infer::CombinedSnapshot)
2319+
-> Result<(Normalized<'tcx, Substs<'tcx>>,
2320+
infer::SkolemizationMap), ()>
23332321
{
23342322
let impl_trait_ref = ty::impl_trait_ref(self.tcx(), impl_def_id).unwrap();
23352323

@@ -2340,6 +2328,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23402328
return Err(());
23412329
}
23422330

2331+
let (skol_obligation, skol_map) = self.infcx().skolemize_late_bound_regions(
2332+
&obligation.predicate,
2333+
snapshot);
2334+
let skol_obligation_trait_ref = skol_obligation.trait_ref;
2335+
23432336
let impl_substs = util::fresh_type_vars_for_impl(self.infcx,
23442337
obligation.cause.span,
23452338
impl_def_id);
@@ -2370,17 +2363,17 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23702363
return Err(());
23712364
}
23722365

2373-
if let Err(e) = self.infcx.leak_check(skol_map, snapshot) {
2366+
if let Err(e) = self.infcx.leak_check(&skol_map, snapshot) {
23742367
debug!("match_impl: failed leak check due to `{}`",
23752368
ty::type_err_to_str(self.tcx(), &e));
23762369
return Err(());
23772370
}
23782371

23792372
debug!("match_impl: success impl_substs={}", impl_substs.repr(self.tcx()));
2380-
Ok(Normalized {
2373+
Ok((Normalized {
23812374
value: impl_substs,
23822375
obligations: impl_trait_ref.obligations
2383-
})
2376+
}, skol_map))
23842377
}
23852378

23862379
fn fast_reject_trait_refs(&mut self,

branches/try/src/libstd/sync/mpsc/mod.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ pub struct Iter<'a, T: 'a> {
306306
rx: &'a Receiver<T>
307307
}
308308

309+
/// An owning iterator over messages on a receiver, this iterator will block
310+
/// whenever `next` is called, waiting for a new message, and `None` will be
311+
/// returned when the corresponding channel has hung up.
312+
#[stable(feature = "receiver_into_iter", since = "1.1.0")]
313+
pub struct IntoIter<T> {
314+
rx: Receiver<T>
315+
}
316+
309317
/// The sending-half of Rust's asynchronous channel type. This half can only be
310318
/// owned by one task, but it can be cloned to send to other tasks.
311319
#[stable(feature = "rust1", since = "1.0.0")]
@@ -899,6 +907,29 @@ impl<'a, T> Iterator for Iter<'a, T> {
899907
fn next(&mut self) -> Option<T> { self.rx.recv().ok() }
900908
}
901909

910+
#[stable(feature = "receiver_into_iter", since = "1.1.0")]
911+
impl<'a, T> IntoIterator for &'a Receiver<T> {
912+
type Item = T;
913+
type IntoIter = Iter<'a, T>;
914+
915+
fn into_iter(self) -> Iter<'a, T> { self.iter() }
916+
}
917+
918+
impl<T> Iterator for IntoIter<T> {
919+
type Item = T;
920+
fn next(&mut self) -> Option<T> { self.rx.recv().ok() }
921+
}
922+
923+
#[stable(feature = "receiver_into_iter", since = "1.1.0")]
924+
impl <T> IntoIterator for Receiver<T> {
925+
type Item = T;
926+
type IntoIter = IntoIter<T>;
927+
928+
fn into_iter(self) -> IntoIter<T> {
929+
IntoIter { rx: self }
930+
}
931+
}
932+
902933
#[unsafe_destructor]
903934
#[stable(feature = "rust1", since = "1.0.0")]
904935
impl<T> Drop for Receiver<T> {
@@ -1507,6 +1538,32 @@ mod test {
15071538
assert_eq!(count_rx.recv().unwrap(), 4);
15081539
}
15091540

1541+
#[test]
1542+
fn test_recv_into_iter_owned() {
1543+
let mut iter = {
1544+
let (tx, rx) = channel::<i32>();
1545+
tx.send(1).unwrap();
1546+
tx.send(2).unwrap();
1547+
1548+
rx.into_iter()
1549+
};
1550+
assert_eq!(iter.next().unwrap(), 1);
1551+
assert_eq!(iter.next().unwrap(), 2);
1552+
assert_eq!(iter.next().is_none(), true);
1553+
}
1554+
1555+
#[test]
1556+
fn test_recv_into_iter_borrowed() {
1557+
let (tx, rx) = channel::<i32>();
1558+
tx.send(1).unwrap();
1559+
tx.send(2).unwrap();
1560+
drop(tx);
1561+
let mut iter = (&rx).into_iter();
1562+
assert_eq!(iter.next().unwrap(), 1);
1563+
assert_eq!(iter.next().unwrap(), 2);
1564+
assert_eq!(iter.next().is_none(), true);
1565+
}
1566+
15101567
#[test]
15111568
fn try_recv_states() {
15121569
let (tx1, rx1) = channel::<i32>();

branches/try/src/test/compile-fail-fulldeps/macro-crate-rlib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// aux-build:rlib_crate_test.rs
1212
// ignore-stage1
1313
// ignore-tidy-linelength
14-
// ignore-android
1514
// ignore-cross-compile gives a different error message
1615

1716
#![feature(plugin)]

branches/try/src/test/run-make/simd-ffi/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ define MK_TARGETS
2727
# on some platforms, but LLVM just prints a warning so that's fine for
2828
# now.
2929
$(1): simd.rs
30-
$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs -C target-feature='+neon,+sse2'
30+
$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs \
31+
-C target-feature='+neon,+sse2' -C extra-filename=-$(1)
3132
endef
3233

3334
$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))

branches/try/src/test/run-pass-fulldeps/compiler-calls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Test that the CompilerCalls interface to the compiler works.
1212

13-
// ignore-android
13+
// ignore-cross-compile
1414

1515
#![feature(rustc_private, path)]
1616
#![feature(core)]

branches/try/src/test/run-pass-fulldeps/create-dir-all-bare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-android
11+
// ignore-cross-compile
1212

1313
#![feature(rustc_private)]
1414

branches/try/src/test/run-pass-fulldeps/issue-15149.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// no-prefer-dynamic
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
#![feature(rustc_private)]
1515

branches/try/src/test/run-pass-fulldeps/issue-16992.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-pretty
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
#![feature(quote, rustc_private)]
1515

branches/try/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-android
11+
// ignore-cross-compile
1212
// ignore-pretty: does not work well with `--test`
1313

1414
#![feature(quote, rustc_private)]

branches/try/src/test/run-pass-fulldeps/qquote.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-cross-compile
1112
// ignore-pretty
1213
// ignore-test
1314

branches/try/src/test/run-pass-fulldeps/quote-tokens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-android
11+
// ignore-cross-compile
1212
// ignore-pretty: does not work well with `--test`
1313

1414
#![feature(quote, rustc_private)]

branches/try/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-android
11+
// ignore-cross-compile
1212
// ignore-pretty: does not work well with `--test`
1313

1414
#![feature(quote, rustc_private)]

branches/try/src/test/run-pass-fulldeps/rename-directory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// This test can't be a unit test in std,
1212
// because it needs TempDir, which is in extra
1313

14-
// ignore-android
14+
// ignore-cross-compile
1515

1616
#![feature(rustc_private, path_ext)]
1717

branches/try/src/test/rustdoc/default-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:rustdoc-default-impl.rs
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
extern crate rustdoc_default_impl as foo;
1515

branches/try/src/test/rustdoc/extern-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:rustdoc-extern-default-method.rs
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
extern crate rustdoc_extern_default_method as ext;
1515

branches/try/src/test/rustdoc/extern-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:rustdoc-extern-method.rs
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
#![feature(unboxed_closures)]
1515

branches/try/src/test/rustdoc/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:rustdoc-ffi.rs
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
extern crate rustdoc_ffi as lib;
1515

branches/try/src/test/rustdoc/inline-default-methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:inline-default-methods.rs
12-
// ignore-android
12+
// ignore-cross-compile
1313

1414
extern crate inline_default_methods;
1515

0 commit comments

Comments
 (0)