Skip to content

Commit ad3053d

Browse files
committed
---
yaml --- r: 274154 b: refs/heads/stable c: 5cd9ca9 h: refs/heads/master
1 parent 0bbc613 commit ad3053d

Some content is hidden

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

48 files changed

+405
-626
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: cded89a3d167a1b736669223ee1ddc1c0744d8d9
32+
refs/heads/stable: 5cd9ca90c58db5e211c5b9c5e605be5870925133
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/Makefile.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,12 @@ endif
220220
# The test suite
221221
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
222222
$(findstring test,$(MAKECMDGOALS)) \
223-
$(findstring perf,$(MAKECMDGOALS)) \
224223
$(findstring tidy,$(MAKECMDGOALS))),)
225224
CFG_INFO := $(info cfg: including test rules)
226225
include $(CFG_SRC_DIR)mk/tests.mk
227226
include $(CFG_SRC_DIR)mk/grammar.mk
228227
endif
229228

230-
# Performance and benchmarking
231-
ifneq ($(findstring perf,$(MAKECMDGOALS)),)
232-
CFG_INFO := $(info cfg: including perf rules)
233-
include $(CFG_SRC_DIR)mk/perf.mk
234-
endif
235-
236229
# Copy all the distributables to another directory for binary install
237230
ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
238231
$(findstring dist,$(MAKECMDGOALS)) \

branches/stable/configure

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,22 +1361,16 @@ for h in $CFG_HOST
13611361
do
13621362
for t in $CFG_TARGET
13631363
do
1364-
# host bin dir stage0
1365-
make_dir $h/stage0/bin
1366-
13671364
# host lib dir stage0
13681365
make_dir $h/stage0/lib
13691366

1370-
# host test dir stage0
1371-
make_dir $h/stage0/test
1372-
13731367
# target bin dir stage0
13741368
make_dir $h/stage0/lib/rustlib/$t/bin
13751369

13761370
# target lib dir stage0
13771371
make_dir $h/stage0/lib/rustlib/$t/lib
13781372

1379-
for i in 1 2 3
1373+
for i in 0 1 2 3
13801374
do
13811375
# host bin dir
13821376
make_dir $h/stage$i/bin

branches/stable/mk/main.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,6 @@ STAGE$(1)_T_$(2)_H_$(3) := \
522522
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
523523
$$(RUSTC_FLAGS_$(2))
524524

525-
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
526-
$$(Q)$$(call CFG_RUN_TARG_$(3),$(1), \
527-
$$(CFG_PERF_TOOL) \
528-
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
529-
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
530-
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
531-
$$(RUSTC_FLAGS_$(2))
532-
533525
endef
534526

535527
$(foreach build,$(CFG_HOST), \

branches/stable/mk/perf.mk

Lines changed: 0 additions & 25 deletions
This file was deleted.

branches/stable/mk/platform.mk

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,6 @@ define DEF_GOOD_VALGRIND
7777
endef
7878
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_GOOD_VALGRIND,$(t))))
7979

80-
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
81-
ifdef CFG_PERF
82-
ifneq ($(CFG_PERF_WITH_LOGFD),)
83-
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
84-
else
85-
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
86-
endif
87-
else
88-
ifdef CFG_VALGRIND
89-
CFG_PERF_TOOL := \
90-
$(CFG_VALGRIND) --tool=cachegrind --cache-sim=yes --branch-sim=yes
91-
else
92-
CFG_PERF_TOOL := /usr/bin/time --verbose
93-
endif
94-
endif
95-
endif
96-
9780
AR := ar
9881

9982
define SET_FROM_CFG

branches/stable/mk/tests.mk

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ ifdef CFG_VALGRIND
5050
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
5151
endif
5252

53-
# Arguments to the perf tests
54-
ifdef CFG_PERF_TOOL
55-
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
56-
endif
57-
5853
CTEST_TESTARGS := $(TESTARGS)
5954

6055
# --bench is only relevant for crate tests, not for the compile tests
@@ -70,12 +65,6 @@ endif
7065
# This prevents tests from failing with some locales (fixes #17423).
7166
export LC_ALL=C
7267

73-
# If we're running perf then set this environment variable
74-
# to put the benchmarks into 'hard mode'
75-
ifeq ($(MAKECMDGOALS),perf)
76-
export RUST_BENCH=1
77-
endif
78-
7968
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
8069
TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
8170

@@ -486,10 +475,6 @@ CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
486475
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
487476
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
488477

489-
# perf tests are the same as bench tests only they run under
490-
# a performance monitor.
491-
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
492-
493478
RPASS_TESTS := $(RPASS_RS)
494479
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
495480
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
@@ -499,7 +484,6 @@ RFAIL_TESTS := $(RFAIL_RS)
499484
CFAIL_TESTS := $(CFAIL_RS)
500485
PFAIL_TESTS := $(PFAIL_RS)
501486
BENCH_TESTS := $(BENCH_RS)
502-
PERF_TESTS := $(PERF_RS)
503487
PRETTY_TESTS := $(PRETTY_RS)
504488
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
505489
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
@@ -551,11 +535,6 @@ CTEST_BUILD_BASE_bench = bench
551535
CTEST_MODE_bench = run-pass
552536
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
553537

554-
CTEST_SRC_BASE_perf = bench
555-
CTEST_BUILD_BASE_perf = perf
556-
CTEST_MODE_perf = run-pass
557-
CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
558-
559538
CTEST_SRC_BASE_debuginfo-gdb = debuginfo
560539
CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
561540
CTEST_MODE_debuginfo-gdb = debuginfo-gdb
@@ -625,7 +604,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
625604
$$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
626605
$$(SREQ$(1)_T_$(2)_H_$(3))
627606

628-
# Rules for the cfail/rfail/rpass/bench/perf test runner
607+
# Rules for the cfail/rfail/rpass/bench test runner
629608

630609
# The tests select when to use debug configuration on their own;
631610
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
@@ -689,7 +668,6 @@ CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
689668
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
690669
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
691670
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
692-
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
693671
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
694672
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
695673
$(S)src/etc/lldb_batchmode.py \
@@ -761,7 +739,7 @@ endif
761739
endef
762740

763741
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
764-
bench perf debuginfo-gdb debuginfo-lldb codegen rustdocck
742+
bench debuginfo-gdb debuginfo-lldb codegen rustdocck
765743

766744
$(foreach host,$(CFG_HOST), \
767745
$(eval $(foreach target,$(CFG_TARGET), \
@@ -934,7 +912,6 @@ TEST_GROUPS = \
934912
cfail \
935913
pfail \
936914
bench \
937-
perf \
938915
rmake \
939916
rustdocck \
940917
debuginfo-gdb \

branches/stable/src/libcore/cmp.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
use self::Ordering::*;
2121

22+
use mem;
2223
use marker::Sized;
2324
use option::Option::{self, Some};
2425

@@ -118,6 +119,10 @@ pub enum Ordering {
118119
}
119120

120121
impl Ordering {
122+
unsafe fn from_i8_unchecked(v: i8) -> Ordering {
123+
mem::transmute(v)
124+
}
125+
121126
/// Reverse the `Ordering`.
122127
///
123128
/// * `Less` becomes `Greater`.
@@ -150,10 +155,14 @@ impl Ordering {
150155
#[inline]
151156
#[stable(feature = "rust1", since = "1.0.0")]
152157
pub fn reverse(self) -> Ordering {
153-
match self {
154-
Less => Greater,
155-
Equal => Equal,
156-
Greater => Less,
158+
unsafe {
159+
// this compiles really nicely (to a single instruction);
160+
// an explicit match has a pile of branches and
161+
// comparisons.
162+
//
163+
// NB. it is safe because of the explicit discriminants
164+
// given above.
165+
Ordering::from_i8_unchecked(-(self as i8))
157166
}
158167
}
159168
}

branches/stable/src/libcore/slice.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -294,23 +294,22 @@ impl<T> SliceExt for [T] {
294294
fn binary_search_by<F>(&self, mut f: F) -> Result<usize, usize> where
295295
F: FnMut(&T) -> Ordering
296296
{
297-
let mut base = 0usize;
298-
let mut s = self;
297+
let mut base : usize = 0;
298+
let mut lim : usize = self.len();
299299

300-
loop {
301-
let (head, tail) = s.split_at(s.len() >> 1);
302-
if tail.is_empty() {
303-
return Err(base)
304-
}
305-
match f(&tail[0]) {
300+
while lim != 0 {
301+
let ix = base + (lim >> 1);
302+
match f(&self[ix]) {
303+
Equal => return Ok(ix),
306304
Less => {
307-
base += head.len() + 1;
308-
s = &tail[1..];
305+
base = ix + 1;
306+
lim -= 1;
309307
}
310-
Greater => s = head,
311-
Equal => return Ok(base + head.len()),
308+
Greater => ()
312309
}
310+
lim >>= 1;
313311
}
312+
Err(base)
314313
}
315314

316315
#[inline]

branches/stable/src/libcoretest/slice.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,24 @@
1111
use core::result::Result::{Ok, Err};
1212

1313
#[test]
14-
fn test_binary_search() {
14+
fn binary_search_not_found() {
1515
let b = [1, 2, 4, 6, 8, 9];
1616
assert!(b.binary_search_by(|v| v.cmp(&6)) == Ok(3));
17+
let b = [1, 2, 4, 6, 8, 9];
1718
assert!(b.binary_search_by(|v| v.cmp(&5)) == Err(3));
1819
let b = [1, 2, 4, 6, 7, 8, 9];
1920
assert!(b.binary_search_by(|v| v.cmp(&6)) == Ok(3));
21+
let b = [1, 2, 4, 6, 7, 8, 9];
2022
assert!(b.binary_search_by(|v| v.cmp(&5)) == Err(3));
2123
let b = [1, 2, 4, 6, 8, 9];
2224
assert!(b.binary_search_by(|v| v.cmp(&8)) == Ok(4));
25+
let b = [1, 2, 4, 6, 8, 9];
2326
assert!(b.binary_search_by(|v| v.cmp(&7)) == Err(4));
2427
let b = [1, 2, 4, 6, 7, 8, 9];
2528
assert!(b.binary_search_by(|v| v.cmp(&8)) == Ok(5));
2629
let b = [1, 2, 4, 5, 6, 8, 9];
2730
assert!(b.binary_search_by(|v| v.cmp(&7)) == Err(5));
31+
let b = [1, 2, 4, 5, 6, 8, 9];
2832
assert!(b.binary_search_by(|v| v.cmp(&0)) == Err(0));
2933
let b = [1, 2, 4, 5, 6, 8];
3034
assert!(b.binary_search_by(|v| v.cmp(&9)) == Err(6));

branches/stable/src/liblibc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit af77843345ec6fc7e51113bfd692138d89024bc0
1+
Subproject commit 9aa6600bd8f4e4f370a7d2fb76c4b3efc669cadf

branches/stable/src/librustc/dep_graph/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use self::thread::{DepGraphThreadData, DepMessage};
1212
use middle::def_id::DefId;
1313
use middle::ty;
14+
use middle::ty::fast_reject::SimplifiedType;
1415
use rustc_front::hir;
1516
use rustc_front::intravisit::Visitor;
1617
use std::rc::Rc;
@@ -101,7 +102,7 @@ pub enum DepNode {
101102
// which would yield an overly conservative dep-graph.
102103
TraitItems(DefId),
103104
ReprHints(DefId),
104-
TraitSelect(DefId),
105+
TraitSelect(DefId, Option<SimplifiedType>),
105106
}
106107

107108
#[derive(Clone)]

branches/stable/src/librustc/middle/const_eval.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,11 +1233,20 @@ fn resolve_trait_associated_const<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
12331233
rcvr_substs: subst::Substs<'tcx>)
12341234
-> Option<&'tcx Expr>
12351235
{
1236-
let trait_ref = ty::Binder(
1237-
rcvr_substs.erase_regions().to_trait_ref(tcx, trait_id)
1238-
);
1239-
debug!("resolve_trait_associated_const: trait_ref={:?}",
1240-
trait_ref);
1236+
let subst::SeparateVecsPerParamSpace {
1237+
types: rcvr_type,
1238+
selfs: rcvr_self,
1239+
fns: _,
1240+
} = rcvr_substs.types.split();
1241+
let trait_substs =
1242+
subst::Substs::erased(subst::VecPerParamSpace::new(rcvr_type,
1243+
rcvr_self,
1244+
Vec::new()));
1245+
let trait_substs = tcx.mk_substs(trait_substs);
1246+
debug!("resolve_trait_associated_const: trait_substs={:?}",
1247+
trait_substs);
1248+
let trait_ref = ty::Binder(ty::TraitRef { def_id: trait_id,
1249+
substs: trait_substs });
12411250

12421251
tcx.populate_implementations_for_trait_if_necessary(trait_ref.def_id());
12431252
let infcx = infer::new_infer_ctxt(tcx, &tcx.tables, None);

0 commit comments

Comments
 (0)