Skip to content

Commit ae814ad

Browse files
committed
---
yaml --- r: 136572 b: refs/heads/dist-snap c: 9fcfcaa h: refs/heads/master v: v3
1 parent 4b3b043 commit ae814ad

25 files changed

+172
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: b11c5722f84879db3539e84d8d21c4c758165163
9+
refs/heads/dist-snap: 9fcfcaa347ffcace8503601bdc09bf3612e8585f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/make-win-dist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ def make_win_dist(dist_root, target_triple):
5858
for src in rustc_dlls:
5959
shutil.copy(src, dist_bin_dir)
6060

61-
# Copy platform tools (and another copy of runtime dlls) to platform-spcific bin directory
62-
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "bin")
61+
# Copy platform tools to platform-specific bin directory
62+
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "bin")
6363
if not os.path.exists(target_bin_dir):
6464
os.makedirs(target_bin_dir)
6565
for src in target_tools:
6666
shutil.copy(src, target_bin_dir)
6767

6868
# Copy platform libs to platform-spcific lib directory
69-
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "lib")
69+
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "lib")
7070
if not os.path.exists(target_lib_dir):
7171
os.makedirs(target_lib_dir)
7272
for src in target_libs:

branches/dist-snap/src/librustc/driver/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ debugging_opts!(
180180
GC,
181181
PRINT_LINK_ARGS,
182182
PRINT_LLVM_PASSES,
183-
LTO,
184183
AST_JSON,
185184
AST_JSON_NOEXPAND,
186185
LS,
@@ -219,7 +218,6 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
219218
("print-llvm-passes",
220219
"Prints the llvm optimization passes being run",
221220
PRINT_LLVM_PASSES),
222-
("lto", "Perform LLVM link-time optimizations", LTO),
223221
("ast-json", "Print the AST as JSON and halt", AST_JSON),
224222
("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
225223
("ls", "List the symbols defined by a library crate", LS),
@@ -353,6 +351,8 @@ cgoptions!(
353351
"system linker to link outputs with"),
354352
link_args: Vec<String> = (Vec::new(), parse_list,
355353
"extra arguments to pass to the linker (space separated)"),
354+
lto: bool = (false, parse_bool,
355+
"perform LLVM link-time optimizations"),
356356
target_cpu: String = ("generic".to_string(), parse_string,
357357
"select target processor (llc -mcpu=help for details)"),
358358
target_feature: String = ("".to_string(), parse_string,

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ pub fn phase_6_link_output(sess: &Session,
560560
trans: &CrateTranslation,
561561
outputs: &OutputFilenames) {
562562
let old_path = os::getenv("PATH").unwrap_or_else(||String::new());
563-
let mut new_path = os::split_paths(old_path.as_slice());
564-
new_path.push_all_move(sess.host_filesearch().get_tools_search_paths());
563+
let mut new_path = sess.host_filesearch().get_tools_search_paths();
564+
new_path.push_all_move(os::split_paths(old_path.as_slice()));
565565
os::setenv("PATH", os::join_paths(new_path.as_slice()).unwrap());
566566

567567
time(sess.time_passes(), "linking", (), |_|

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Session {
168168
self.debugging_opt(config::PRINT_LLVM_PASSES)
169169
}
170170
pub fn lto(&self) -> bool {
171-
self.debugging_opt(config::LTO)
171+
self.opts.cg.lto
172172
}
173173
pub fn no_landing_pads(&self) -> bool {
174174
self.debugging_opt(config::NO_LANDING_PADS)

branches/dist-snap/src/librustc/metadata/filesearch.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ impl<'a> FileSearch<'a> {
150150
p.push(find_libdir(self.sysroot));
151151
p.push(rustlibdir());
152152
p.push(self.triple);
153-
p.push("bin");
154-
vec![p]
153+
let mut p1 = p.clone();
154+
p1.push("bin");
155+
let mut p2 = p.clone();
156+
p2.push("gcc");
157+
p2.push("bin");
158+
vec![p1, p2]
155159
}
156160
}
157161

branches/dist-snap/src/librustc/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,7 @@ impl<'a> Resolver<'a> {
29282928
Some(span) => {
29292929
self.session
29302930
.span_note(span,
2931-
"note conflicting value here");
2931+
"conflicting value here");
29322932
}
29332933
}
29342934
}
@@ -2951,7 +2951,7 @@ impl<'a> Resolver<'a> {
29512951
Some(span) => {
29522952
self.session
29532953
.span_note(span,
2954-
"note conflicting type here")
2954+
"conflicting type here")
29552955
}
29562956
}
29572957
}

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,22 +3480,32 @@ impl<'a> Parser<'a> {
34803480
})
34813481
}
34823482

3483+
/// Get an expected item after attributes error message.
3484+
fn expected_item_err(attrs: &[Attribute]) -> &'static str {
3485+
match attrs.last() {
3486+
Some(&Attribute { node: ast::Attribute_ { is_sugared_doc: true, .. }, .. }) => {
3487+
"expected item after doc comment"
3488+
}
3489+
_ => "expected item after attributes",
3490+
}
3491+
}
3492+
34833493
/// Parse a statement. may include decl.
34843494
/// Precondition: any attributes are parsed already
34853495
pub fn parse_stmt(&mut self, item_attrs: Vec<Attribute>) -> P<Stmt> {
34863496
maybe_whole!(self, NtStmt);
34873497

3488-
fn check_expected_item(p: &mut Parser, found_attrs: bool) {
3498+
fn check_expected_item(p: &mut Parser, attrs: &[Attribute]) {
34893499
// If we have attributes then we should have an item
3490-
if found_attrs {
3500+
if !attrs.is_empty() {
34913501
let last_span = p.last_span;
3492-
p.span_err(last_span, "expected item after attributes");
3502+
p.span_err(last_span, Parser::expected_item_err(attrs));
34933503
}
34943504
}
34953505

34963506
let lo = self.span.lo;
34973507
if self.is_keyword(keywords::Let) {
3498-
check_expected_item(self, !item_attrs.is_empty());
3508+
check_expected_item(self, item_attrs.as_slice());
34993509
self.expect_keyword(keywords::Let);
35003510
let decl = self.parse_let();
35013511
P(spanned(lo, decl.span.hi, StmtDecl(decl, ast::DUMMY_NODE_ID)))
@@ -3504,7 +3514,7 @@ impl<'a> Parser<'a> {
35043514
&& self.look_ahead(1, |t| *t == token::NOT) {
35053515
// it's a macro invocation:
35063516

3507-
check_expected_item(self, !item_attrs.is_empty());
3517+
check_expected_item(self, item_attrs.as_slice());
35083518

35093519
// Potential trouble: if we allow macros with paths instead of
35103520
// idents, we'd need to look ahead past the whole path here...
@@ -3561,6 +3571,7 @@ impl<'a> Parser<'a> {
35613571

35623572
} else {
35633573
let found_attrs = !item_attrs.is_empty();
3574+
let item_err = Parser::expected_item_err(item_attrs.as_slice());
35643575
match self.parse_item_or_view_item(item_attrs, false) {
35653576
IoviItem(i) => {
35663577
let hi = i.span.hi;
@@ -3575,7 +3586,10 @@ impl<'a> Parser<'a> {
35753586
self.fatal("foreign items are not allowed here");
35763587
}
35773588
IoviNone(_) => {
3578-
check_expected_item(self, found_attrs);
3589+
if found_attrs {
3590+
let last_span = self.last_span;
3591+
self.span_err(last_span, item_err);
3592+
}
35793593

35803594
// Remainder are line-expr stmts.
35813595
let e = self.parse_expr_res(RestrictionStmtExpr);
@@ -3653,7 +3667,8 @@ impl<'a> Parser<'a> {
36533667
token::SEMI => {
36543668
if !attributes_box.is_empty() {
36553669
let last_span = self.last_span;
3656-
self.span_err(last_span, "expected item after attributes");
3670+
self.span_err(last_span,
3671+
Parser::expected_item_err(attributes_box.as_slice()));
36573672
attributes_box = Vec::new();
36583673
}
36593674
self.bump(); // empty
@@ -3739,7 +3754,8 @@ impl<'a> Parser<'a> {
37393754

37403755
if !attributes_box.is_empty() {
37413756
let last_span = self.last_span;
3742-
self.span_err(last_span, "expected item after attributes");
3757+
self.span_err(last_span,
3758+
Parser::expected_item_err(attributes_box.as_slice()));
37433759
}
37443760

37453761
let hi = self.span.hi;
@@ -4685,7 +4701,8 @@ impl<'a> Parser<'a> {
46854701
if first && attrs_remaining_len > 0u {
46864702
// We parsed attributes for the first item but didn't find it
46874703
let last_span = self.last_span;
4688-
self.span_err(last_span, "expected item after attributes");
4704+
self.span_err(last_span,
4705+
Parser::expected_item_err(attrs_remaining.as_slice()));
46894706
}
46904707

46914708
ast::Mod {
@@ -4919,10 +4936,10 @@ impl<'a> Parser<'a> {
49194936
items: _,
49204937
foreign_items: foreign_items
49214938
} = self.parse_foreign_items(first_item_attrs, true);
4922-
if ! attrs_remaining.is_empty() {
4939+
if !attrs_remaining.is_empty() {
49234940
let last_span = self.last_span;
49244941
self.span_err(last_span,
4925-
"expected item after attributes");
4942+
Parser::expected_item_err(attrs_remaining.as_slice()));
49264943
}
49274944
assert!(self.token == token::RBRACE);
49284945
ast::ForeignMod {
@@ -5052,7 +5069,7 @@ impl<'a> Parser<'a> {
50525069
fn parse_enum_def(&mut self, _generics: &ast::Generics) -> EnumDef {
50535070
let mut variants = Vec::new();
50545071
let mut all_nullary = true;
5055-
let mut have_disr = false;
5072+
let mut any_disr = None;
50565073
while self.token != token::RBRACE {
50575074
let variant_attrs = self.parse_outer_attributes();
50585075
let vlo = self.span.lo;
@@ -5084,8 +5101,8 @@ impl<'a> Parser<'a> {
50845101
}
50855102
kind = TupleVariantKind(args);
50865103
} else if self.eat(&token::EQ) {
5087-
have_disr = true;
50885104
disr_expr = Some(self.parse_expr());
5105+
any_disr = disr_expr.as_ref().map(|expr| expr.span);
50895106
kind = TupleVariantKind(args);
50905107
} else {
50915108
kind = TupleVariantKind(Vec::new());
@@ -5104,9 +5121,11 @@ impl<'a> Parser<'a> {
51045121
if !self.eat(&token::COMMA) { break; }
51055122
}
51065123
self.expect(&token::RBRACE);
5107-
if have_disr && !all_nullary {
5108-
self.fatal("discriminator values can only be used with a c-like \
5109-
enum");
5124+
match any_disr {
5125+
Some(disr_span) if !all_nullary =>
5126+
self.span_err(disr_span,
5127+
"discriminator values can only be used with a c-like enum"),
5128+
_ => ()
51105129
}
51115130

51125131
ast::EnumDef { variants: variants }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2012 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+
#[deriving(Show)] //~ERROR expected item after attributes
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2012 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+
/// hi
12+
#[deriving(Show)] //~ERROR expected item after attributes
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2012 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+
/// hi //~ERROR expected item after doc comment
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2012 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+
extern {
12+
/// hi
13+
}
14+
//~^^ ERROR expected item after doc comment
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012 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+
fn main() {
12+
/// hi
13+
println!("hi");
14+
//~^^ ERROR expected item after doc comment
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2012 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+
fn main() {
12+
println!("Hi"); /// hi
13+
//~^ ERROR expected item after doc comment
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012 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+
fn main() {
12+
/// hi
13+
;
14+
//~^^ ERROR expected item after doc comment
15+
}

branches/dist-snap/src/test/compile-fail/issue-11154.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-
// compile-flags: -Z lto -C prefer-dynamic
11+
// compile-flags: -C lto -C prefer-dynamic
1212

1313
// error-pattern: cannot prefer dynamic linking
1414

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
enum X {
12+
A =
13+
b'a' //~ ERROR discriminator values can only be used with a c-like enum
14+
,
15+
B(int)
16+
}
17+
18+
fn main() {}

branches/dist-snap/src/test/debuginfo/cross-crate-type-uniquing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
extern crate cross_crate_debuginfo_type_uniquing;
1515

1616
// no-prefer-dynamic
17-
// compile-flags:-g -Zlto
17+
// compile-flags:-g -C lto
1818

1919
pub struct C;
2020
pub fn p() -> C {

branches/dist-snap/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// older versions of GDB too. A more extensive test can be found in
1313
// gdb-pretty-struct-and-enums.rs
1414

15+
// ignore-windows failing on win32 bot
1516
// ignore-tidy-linelength
1617
// ignore-lldb
1718
// ignore-android: FIXME(#10381)

0 commit comments

Comments
 (0)