Skip to content

Commit d682cff

Browse files
committed
---
yaml --- r: 156503 b: refs/heads/master c: 370c9c5 h: refs/heads/master i: 156501: ee9b75c 156499: 323dee2 156495: 0d54a89 v: v3
1 parent 3b9982a commit d682cff

Some content is hidden

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

51 files changed

+896
-1586
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: 1d647564b1e575b3ca1e56aee33e3376a8e43772
2+
refs/heads/master: 370c9c54c2e9b9a308b4fa2a48460e0d54794729
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
55
refs/heads/try: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75

trunk/mk/main.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,6 @@ 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-
167160
# platform-specific auto-configuration
168161
include $(CFG_SRC_DIR)mk/platform.mk
169162

trunk/mk/tests.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,6 @@ 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
635631

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

trunk/src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,7 +4326,7 @@ The most common consumer is `collect()`. This code doesn't quite compile,
43264326
but it shows the intention:
43274327

43284328
```{rust,ignore}
4329-
let one_to_one_hundred = range(1i, 101i).collect();
4329+
let one_to_one_hundred = range(0i, 100i).collect();
43304330
```
43314331

43324332
As you can see, we call `collect()` on our iterator. `collect()` takes
@@ -4336,7 +4336,7 @@ type of things you want to collect, and so you need to let it know.
43364336
Here's the version that does compile:
43374337

43384338
```{rust}
4339-
let one_to_one_hundred = range(1i, 101i).collect::<Vec<int>>();
4339+
let one_to_one_hundred = range(0i, 100i).collect::<Vec<int>>();
43404340
```
43414341

43424342
If you remember, the `::<>` syntax allows us to give a type hint,

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/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<T> Option<T> {
245245
/// ```
246246
/// let mut x = Some(2u);
247247
/// match x.as_mut() {
248-
/// Some(v) => *v = 42,
248+
/// Some(&ref mut v) => *v = 42,
249249
/// None => {},
250250
/// }
251251
/// assert_eq!(x, Some(42u));

trunk/src/librustc/driver/config.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -780,20 +780,7 @@ 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-
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-
783+
let cg = build_codegen_options(matches);
797784

798785
if !cg.remark.is_empty() && debuginfo == NoDebugInfo {
799786
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/coherence.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pub fn impl_is_local(tcx: &ty::ctxt,
6767
return true;
6868
}
6969

70-
// Otherwise, at least one of the input types must be local to the
71-
// crate.
72-
trait_ref.input_types().iter().any(|&t| ty_is_local(tcx, t))
70+
// Otherwise, self type must be local to the crate.
71+
let self_ty = ty::lookup_item_type(tcx, impl_def_id).ty;
72+
return ty_is_local(tcx, self_ty);
7373
}
7474

7575
pub fn ty_is_local(tcx: &ty::ctxt,

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)