Skip to content

Commit 9e2f3e7

Browse files
spernsteinerpcwalton
authored andcommitted
---
yaml --- r: 138411 b: refs/heads/master c: c245c5b h: refs/heads/master i: 138409: 50503bd 138407: e37c816 v: v3
1 parent 908caa0 commit 9e2f3e7

Some content is hidden

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

43 files changed

+899
-1467
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: 3d2cf60631502567007ea652f8ef299d907ee2c3
2+
refs/heads/master: c245c5bbad10923b47c9f66d5f0da2913ef11a38
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5

trunk/mk/main.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ RUSTFLAGS_STAGE1 += -C prefer-dynamic
157157
# by not emitting them.
158158
RUSTFLAGS_STAGE0 += -Z no-landing-pads
159159

160+
# Go fast for stage0, and also for stage1/stage2 if optimization is off.
161+
RUSTFLAGS_STAGE0 += -C codegen-units=4
162+
ifdef CFG_DISABLE_OPTIMIZE
163+
RUSTFLAGS_STAGE1 += -C codegen-units=4
164+
RUSTFLAGS_STAGE2 += -C codegen-units=4
165+
endif
166+
160167
# platform-specific auto-configuration
161168
include $(CFG_SRC_DIR)mk/platform.mk
162169

trunk/mk/tests.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,10 @@ CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
628628
ifndef CFG_DISABLE_OPTIMIZE_TESTS
629629
CTEST_RUSTC_FLAGS += -O
630630
endif
631+
# Force codegen-units=1 for compiletest tests. compiletest does its own
632+
# parallelization internally, so rustc's default codegen-units=2 will actually
633+
# slow things down.
634+
CTEST_RUSTC_FLAGS += -C codegen-units=1
631635

632636
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
633637
--compile-lib-path $$(HLIB$(1)_H_$(3)) \

trunk/src/libcore/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ macro_rules! checkeddiv_int_impl(
13741374
if *v == 0 || (*self == $min && *v == -1) {
13751375
None
13761376
} else {
1377-
Some(*self / *v)
1377+
Some(self / *v)
13781378
}
13791379
}
13801380
}
@@ -1395,7 +1395,7 @@ macro_rules! checkeddiv_uint_impl(
13951395
if *v == 0 {
13961396
None
13971397
} else {
1398-
Some(*self / *v)
1398+
Some(self / *v)
13991399
}
14001400
}
14011401
}

trunk/src/libcore/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
638638
* ```
639639
*/
640640
#[lang="index"]
641-
pub trait Index<Index, Sized? Result> {
641+
pub trait Index<Index, Result> {
642642
/// The method for the indexing (`Foo[Bar]`) operation
643643
fn index<'a>(&'a self, index: &Index) -> &'a Result;
644644
}

trunk/src/librustc/driver/config.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,20 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
780780
early_warn("the --crate-file-name argument has been renamed to \
781781
--print-file-name");
782782
}
783-
let cg = build_codegen_options(matches);
783+
784+
let mut cg = build_codegen_options(matches);
785+
786+
if cg.codegen_units == 0 {
787+
match opt_level {
788+
// `-C lto` doesn't work with multiple codegen units.
789+
_ if cg.lto => cg.codegen_units = 1,
790+
791+
No | Less => cg.codegen_units = 2,
792+
Default | Aggressive => cg.codegen_units = 1,
793+
}
794+
}
795+
let cg = cg;
796+
784797

785798
if !cg.remark.is_empty() && debuginfo == NoDebugInfo {
786799
early_warn("-C remark will not show source locations without --debuginfo");

trunk/src/librustc/middle/borrowck/graphviz.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ impl<'a, 'tcx> dot::Labeller<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 't
142142
}
143143

144144
impl<'a, 'tcx> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 'tcx> {
145-
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> { self.inner.nodes() }
146-
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> { self.inner.edges() }
147-
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> { self.inner.source(edge) }
148-
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> { self.inner.target(edge) }
145+
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> { self.inner.nodes() }
146+
fn edges(&self) -> dot::Edges<'a, Edge<'a>> { self.inner.edges() }
147+
fn source(&self, edge: &Edge<'a>) -> Node<'a> { self.inner.source(edge) }
148+
fn target(&self, edge: &Edge<'a>) -> Node<'a> { self.inner.target(edge) }
149149
}

trunk/src/librustc/middle/cfg/graphviz.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,29 @@ impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> {
9191
}
9292

9393
impl<'a> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for &'a cfg::CFG {
94-
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> {
94+
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> {
9595
let mut v = Vec::new();
9696
self.graph.each_node(|i, nd| { v.push((i, nd)); true });
9797
dot::maybe_owned_vec::Growable(v)
9898
}
99-
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> {
99+
fn edges(&self) -> dot::Edges<'a, Edge<'a>> {
100100
self.graph.all_edges().iter().collect()
101101
}
102-
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> {
102+
fn source(&self, edge: &Edge<'a>) -> Node<'a> {
103103
let i = edge.source();
104104
(i, self.graph.node(i))
105105
}
106-
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> {
106+
fn target(&self, edge: &Edge<'a>) -> Node<'a> {
107107
let i = edge.target();
108108
(i, self.graph.node(i))
109109
}
110110
}
111111

112112
impl<'a, 'ast> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast>
113113
{
114-
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> { self.cfg.nodes() }
115-
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> { self.cfg.edges() }
116-
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> { self.cfg.source(edge) }
117-
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> { self.cfg.target(edge) }
114+
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> { self.cfg.nodes() }
115+
fn edges(&self) -> dot::Edges<'a, Edge<'a>> { self.cfg.edges() }
116+
fn source(&self, edge: &Edge<'a>) -> Node<'a> { self.cfg.source(edge) }
117+
fn target(&self, edge: &Edge<'a>) -> Node<'a> { self.cfg.target(edge) }
118118
}
119119

trunk/src/librustc/middle/traits/doc.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,4 @@ nested obligation `int : Bar<U>` to find out that `U=uint`.
272272
It would be good to only do *just as much* nested resolution as
273273
necessary. Currently, though, we just do a full resolution.
274274
275-
## Method matching
276-
277-
Method dispach follows a slightly different path than normal trait
278-
selection. This is because it must account for the transformed self
279-
type of the receiver and various other complications. The procedure is
280-
described in `select.rs` in the "METHOD MATCHING" section.
281-
282275
*/

trunk/src/librustc/middle/traits/mod.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ use syntax::codemap::{Span, DUMMY_SP};
2424
pub use self::fulfill::FulfillmentContext;
2525
pub use self::select::SelectionContext;
2626
pub use self::select::SelectionCache;
27-
pub use self::select::{MethodMatchResult, MethodMatched, MethodAmbiguous, MethodDidNotMatch};
28-
pub use self::select::{MethodMatchedData}; // intentionally don't export variants
2927
pub use self::util::supertraits;
3028
pub use self::util::transitive_bounds;
3129
pub use self::util::Supertraits;
@@ -221,6 +219,22 @@ pub struct VtableParamData {
221219
pub bound: Rc<ty::TraitRef>,
222220
}
223221

222+
pub fn evaluate_obligation<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
223+
param_env: &ty::ParameterEnvironment,
224+
obligation: &Obligation,
225+
typer: &Typer<'tcx>)
226+
-> bool
227+
{
228+
/*!
229+
* Attempts to resolve the obligation given. Returns `None` if
230+
* we are unable to resolve, either because of ambiguity or
231+
* due to insufficient inference.
232+
*/
233+
234+
let mut selcx = select::SelectionContext::new(infcx, param_env, typer);
235+
selcx.evaluate_obligation(obligation)
236+
}
237+
224238
pub fn select_inherent_impl<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
225239
param_env: &ty::ParameterEnvironment,
226240
typer: &Typer<'tcx>,

0 commit comments

Comments
 (0)