Skip to content

Commit 04eac48

Browse files
committed
---
yaml --- r: 156541 b: refs/heads/auto c: aeba2cc h: refs/heads/master i: 156539: 8055bc0 v: v3
1 parent be58acf commit 04eac48

File tree

9 files changed

+47
-78
lines changed

9 files changed

+47
-78
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 7088c45ef4078e0be54d4353b2c11146e25b2906
16+
refs/heads/auto: aeba2ccf3082522f56e9aaefc0a961e2ed737f53
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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

branches/auto/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)) \

branches/auto/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");

branches/auto/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, 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);
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))
7373
}
7474

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

branches/auto/src/libsyntax/parse/mod.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ pub fn integer_lit(s: &str, sd: &SpanHandler, sp: Span) -> ast::Lit_ {
721721
mod test {
722722
use super::*;
723723
use serialize::json;
724-
use codemap::{Span, BytePos, Pos, Spanned, NO_EXPANSION};
724+
use codemap::{Span, BytePos, Spanned, NO_EXPANSION};
725725
use owned_slice::OwnedSlice;
726726
use ast;
727727
use abi;
@@ -1121,46 +1121,6 @@ mod test {
11211121
span: sp(0,21)})));
11221122
}
11231123

1124-
fn get_spans_of_pat_idents(src: &str) -> Vec<Span> {
1125-
let item = string_to_item(src.to_string()).unwrap();
1126-
1127-
struct PatIdentVisitor {
1128-
spans: Vec<Span>
1129-
}
1130-
impl<'v> ::visit::Visitor<'v> for PatIdentVisitor {
1131-
fn visit_pat(&mut self, p: &'v ast::Pat) {
1132-
match p.node {
1133-
ast::PatIdent(_ , ref spannedident, _) => {
1134-
self.spans.push(spannedident.span.clone());
1135-
}
1136-
_ => {
1137-
::visit::walk_pat(self, p);
1138-
}
1139-
}
1140-
}
1141-
}
1142-
let mut v = PatIdentVisitor { spans: Vec::new() };
1143-
::visit::walk_item(&mut v, &*item);
1144-
return v.spans;
1145-
}
1146-
1147-
#[test] fn span_of_self_arg_pat_idents_are_correct() {
1148-
1149-
let srcs = ["impl z { fn a (&self, &myarg: int) {} }",
1150-
"impl z { fn a (&mut self, &myarg: int) {} }",
1151-
"impl z { fn a (&'a self, &myarg: int) {} }",
1152-
"impl z { fn a (self, &myarg: int) {} }",
1153-
"impl z { fn a (self: Foo, &myarg: int) {} }",
1154-
];
1155-
1156-
for &src in srcs.iter() {
1157-
let spans = get_spans_of_pat_idents(src);
1158-
let Span{lo:lo,hi:hi,..} = spans[0];
1159-
assert!("self" == src.slice(lo.to_uint(), hi.to_uint()),
1160-
"\"{}\" != \"self\". src=\"{}\"",
1161-
src.slice(lo.to_uint(), hi.to_uint()), src)
1162-
}
1163-
}
11641124

11651125
#[test] fn parse_exprs () {
11661126
// just make sure that they parse....

branches/auto/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,16 +4165,10 @@ impl<'a> Parser<'a> {
41654165
// A bit of complexity and lookahead is needed here in order to be
41664166
// backwards compatible.
41674167
let lo = self.span.lo;
4168-
let mut self_ident_lo = self.span.lo;
4169-
let mut self_ident_hi = self.span.hi;
4170-
41714168
let mut mutbl_self = MutImmutable;
41724169
let explicit_self = match self.token {
41734170
token::BINOP(token::AND) => {
4174-
let eself = maybe_parse_borrowed_explicit_self(self);
4175-
self_ident_lo = self.last_span.lo;
4176-
self_ident_hi = self.last_span.hi;
4177-
eself
4171+
maybe_parse_borrowed_explicit_self(self)
41784172
}
41794173
token::TILDE => {
41804174
// We need to make sure it isn't a type
@@ -4246,7 +4240,7 @@ impl<'a> Parser<'a> {
42464240
_ => SelfStatic,
42474241
};
42484242

4249-
let explicit_self_sp = mk_sp(self_ident_lo, self_ident_hi);
4243+
let explicit_self_sp = mk_sp(lo, self.span.hi);
42504244

42514245
// shared fall-through for the three cases below. borrowing prevents simply
42524246
// writing this as a closure
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub trait TheTrait<T> {
12+
fn the_fn(&self);
13+
}
14+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:coherence-orphan-lib.rs
12+
13+
extern crate "coherence-orphan-lib" as lib;
14+
15+
use lib::TheTrait;
16+
17+
struct TheType;
18+
19+
impl TheTrait<uint> for int { } //~ ERROR E0117
20+
21+
impl TheTrait<TheType> for int { }
22+
23+
impl TheTrait<int> for TheType { }
24+
25+
fn main() { }

0 commit comments

Comments
 (0)