Skip to content

Commit f52c972

Browse files
committed
---
yaml --- r: 275448 b: refs/heads/auto c: 99c0547 h: refs/heads/master
1 parent 657a7bf commit f52c972

File tree

25 files changed

+157
-345
lines changed

25 files changed

+157
-345
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: eba80558d7223900549786207fad4791e1f01d88
11+
refs/heads/auto: 99c05478542c6624d537f587ce34f84d09fd0627
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/bootstrap/bootstrap.py

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import argparse
1212
import contextlib
13-
import hashlib
1413
import os
1514
import shutil
1615
import subprocess
@@ -19,29 +18,13 @@
1918

2019
def get(url, path, verbose=False):
2120
print("downloading " + url)
22-
sha_url = url + ".sha256"
23-
sha_path = path + ".sha256"
24-
for _url, _path in ((url, path), (sha_url, sha_path)):
25-
# see http://serverfault.com/questions/301128/how-to-download
26-
if sys.platform == 'win32':
27-
run(["PowerShell.exe", "/nologo", "-Command",
28-
"(New-Object System.Net.WebClient)"
29-
".DownloadFile('{}', '{}')".format(_url, _path)],
30-
verbose=verbose)
31-
else:
32-
run(["curl", "-o", _path, _url], verbose=verbose)
33-
print("verifying " + path)
34-
with open(path, "rb") as f:
35-
found = hashlib.sha256(f.read()).hexdigest()
36-
with open(sha_path, "r") as f:
37-
expected, _ = f.readline().split()
38-
if found != expected:
39-
err = ("invalid checksum:\n"
40-
" found: {}\n"
41-
" expected: {}".format(found, expected))
42-
if verbose:
43-
raise RuntimeError(err)
44-
sys.exit(err)
21+
# see http://serverfault.com/questions/301128/how-to-download
22+
if sys.platform == 'win32':
23+
run(["PowerShell.exe", "/nologo", "-Command",
24+
"(New-Object System.Net.WebClient).DownloadFile('" + url +
25+
"', '" + path + "')"], verbose=verbose)
26+
else:
27+
run(["curl", "-o", path, url], verbose=verbose)
4528

4629
def unpack(tarball, dst, verbose=False, match=None):
4730
print("extracting " + tarball)
@@ -74,10 +57,9 @@ def run(args, verbose=False):
7457
ret = subprocess.Popen(args)
7558
code = ret.wait()
7659
if code != 0:
77-
err = "failed to run: " + ' '.join(args)
78-
if verbose:
79-
raise RuntimeError(err)
80-
sys.exit(err)
60+
if not verbose:
61+
print("failed to run: " + ' '.join(args))
62+
raise RuntimeError("failed to run command")
8163

8264
class RustBuild:
8365
def download_rust_nightly(self):
@@ -228,10 +210,7 @@ def build_triple(self):
228210
if sys.platform == 'win32':
229211
return 'x86_64-pc-windows-msvc'
230212
else:
231-
err = "uname not found"
232-
if self.verbose:
233-
raise Exception(err)
234-
sys.exit(err)
213+
raise
235214

236215
# Darwin's `uname -s` lies and always returns i386. We have to use
237216
# sysctl instead.
@@ -274,10 +253,7 @@ def build_triple(self):
274253
cputype = 'x86_64'
275254
ostype = 'pc-windows-gnu'
276255
else:
277-
err = "unknown OS type: " + ostype
278-
if self.verbose:
279-
raise ValueError(err)
280-
sys.exit(err)
256+
raise ValueError("unknown OS type: " + ostype)
281257

282258
if cputype in {'i386', 'i486', 'i686', 'i786', 'x86'}:
283259
cputype = 'i686'
@@ -293,10 +269,7 @@ def build_triple(self):
293269
elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}:
294270
cputype = 'x86_64'
295271
else:
296-
err = "unknown cpu type: " + cputype
297-
if self.verbose:
298-
raise ValueError(err)
299-
sys.exit(err)
272+
raise ValueError("unknown cpu type: " + cputype)
300273

301274
return cputype + '-' + ostype
302275

branches/auto/src/bootstrap/build/check.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fs;
12-
1311
use build::{Build, Compiler};
1412

1513
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
@@ -31,16 +29,9 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
3129
let sep = if cfg!(windows) { ";" } else {":" };
3230
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
3331

34-
// Note that this is a short, cryptic, and not scoped directory name. This
35-
// is currently to minimize the length of path on Windows where we otherwise
36-
// quickly run into path name limit constraints.
37-
let out_dir = build.out.join("ct");
38-
t!(fs::create_dir_all(&out_dir));
39-
4032
build.run(build.tool_cmd(compiler, "cargotest")
41-
.env("PATH", newpath)
42-
.arg(&build.cargo)
43-
.arg(&out_dir));
33+
.env("PATH", newpath)
34+
.arg(&build.cargo));
4435
}
4536

4637
pub fn tidy(build: &Build, stage: u32, host: &str) {

branches/auto/src/bootstrap/build/step.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ impl<'a> Step<'a> {
318318
vec![self.tool_linkchecker(stage), self.doc(stage)]
319319
}
320320
Source::CheckCargoTest { stage } => {
321-
vec![self.tool_cargotest(stage),
322-
self.librustc(self.compiler(stage))]
321+
vec![self.tool_cargotest(stage)]
323322
}
324323
Source::CheckTidy { stage } => {
325324
vec![self.tool_tidy(stage)]
@@ -334,7 +333,7 @@ impl<'a> Step<'a> {
334333
vec![self.librustc(self.compiler(stage))]
335334
}
336335
Source::ToolCargoTest { stage } => {
337-
vec![self.libstd(self.compiler(stage))]
336+
vec![self.librustc(self.compiler(stage))]
338337
}
339338

340339
Source::DistDocs { stage } => vec![self.doc(stage)],

branches/auto/src/doc/book/closures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,12 @@ fn factory() -> Box<Fn(i32) -> i32> {
492492

493493
Box::new(move |x| x + num)
494494
}
495-
fn main() {
495+
# fn main() {
496496
let f = factory();
497497

498498
let answer = f(1);
499499
assert_eq!(6, answer);
500-
}
500+
# }
501501
```
502502

503503
By making the inner closure a `move Fn`, we create a new stack frame for our

branches/auto/src/doc/book/getting-started.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,8 @@ look something like this:
575575
name = "hello_world"
576576
version = "0.1.0"
577577
authors = ["Your Name <you@example.com>"]
578-
579-
[dependencies]
580578
```
581579

582-
Do not worry about the `[dependencies]` line, we will come back to it later.
583-
584580
Cargo has populated *Cargo.toml* with reasonable defaults based on the arguments
585581
you gave it and your `git` global configuration. You may notice that Cargo has
586582
also initialized the `hello_world` directory as a `git` repository.

branches/auto/src/liballoc_system/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ mod imp {
9696
libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
9797
} else {
9898
let new_ptr = allocate(size, align);
99-
ptr::copy(ptr, new_ptr, cmp::min(size, old_size));
100-
deallocate(ptr, old_size, align);
99+
if !new_ptr.is_null() {
100+
ptr::copy(ptr, new_ptr, cmp::min(size, old_size));
101+
deallocate(ptr, old_size, align);
102+
}
101103
new_ptr
102104
}
103105
}

branches/auto/src/librustc/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ E0072: r##"
292292
When defining a recursive struct or enum, any use of the type being defined
293293
from inside the definition must occur behind a pointer (like `Box` or `&`).
294294
This is because structs and enums must have a well-defined size, and without
295-
the pointer, the size of the type would need to be unbounded.
295+
the pointer the size of the type would need to be unbounded.
296296
297297
Consider the following erroneous definition of a type for a list of bytes:
298298

branches/auto/src/librustc/middle/lang_items.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,13 @@ impl<'a, 'tcx> LanguageItemCollector<'a, 'tcx> {
189189
match self.items.items[item_index] {
190190
Some(original_def_id) if original_def_id != item_def_id => {
191191
let cstore = &self.session.cstore;
192-
let name = LanguageItems::item_name(item_index);
193-
let mut err = match self.ast_map.span_if_local(item_def_id) {
194-
Some(span) => struct_span_err!(
195-
self.session,
196-
span,
197-
E0152,
198-
"duplicate lang item found: `{}`.",
199-
name),
200-
None => self.session.struct_err(&format!(
201-
"duplicate lang item in crate `{}`: `{}`.",
202-
cstore.crate_name(item_def_id.krate),
203-
name)),
204-
};
192+
let span = self.ast_map.span_if_local(item_def_id)
193+
.expect("we should have found local duplicate earlier");
194+
let mut err = struct_span_err!(self.session,
195+
span,
196+
E0152,
197+
"duplicate lang item found: `{}`.",
198+
LanguageItems::item_name(item_index));
205199
if let Some(span) = self.ast_map.span_if_local(original_def_id) {
206200
span_note!(&mut err, span,
207201
"first defined here.");

branches/auto/src/librustc_trans/callee.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,19 +582,15 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
582582
debug!("get_fn: not casting pointer!");
583583

584584
attributes::from_fn_attrs(ccx, attrs, llfn);
585-
if local_item.is_some() {
585+
if let Some(id) = local_item {
586586
// FIXME(eddyb) Doubt all extern fn should allow unwinding.
587587
attributes::unwind(llfn, true);
588+
ccx.item_symbols().borrow_mut().insert(id, sym);
588589
}
589590

590591
llfn
591592
};
592593

593-
// Always insert into item_symbols, in case this item is exported.
594-
if let Some(id) = local_item {
595-
ccx.item_symbols().borrow_mut().insert(id, sym);
596-
}
597-
598594
ccx.instances().borrow_mut().insert(instance, llfn);
599595

600596
immediate_rvalue(llfn, fn_ptr_ty)

branches/auto/src/librustdoc/html/render.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
24892489
}
24902490

24912491
fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item,
2492-
link: AssocItemLink, render_static: bool, is_default_item: bool,
2492+
link: AssocItemLink, render_static: bool,
24932493
outer_version: Option<&str>) -> fmt::Result {
24942494
let shortty = shortty(item);
24952495
let name = item.name.as_ref().unwrap();
@@ -2540,16 +2540,17 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25402540
_ => panic!("can't make docs for trait item with name {:?}", item.name)
25412541
}
25422542

2543-
if !is_default_item && (!is_static || render_static) {
2544-
document(w, cx, item)
2545-
} else {
2546-
Ok(())
2543+
match link {
2544+
AssocItemLink::Anchor if !is_static || render_static => {
2545+
document(w, cx, item)
2546+
},
2547+
_ => Ok(()),
25472548
}
25482549
}
25492550

25502551
write!(w, "<div class='impl-items'>")?;
25512552
for trait_item in &i.impl_.items {
2552-
doctraititem(w, cx, trait_item, link, render_header, false, outer_version)?;
2553+
doctraititem(w, cx, trait_item, link, render_header, outer_version)?;
25532554
}
25542555

25552556
fn render_default_items(w: &mut fmt::Formatter,
@@ -2566,7 +2567,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25662567
let did = i.trait_.as_ref().unwrap().def_id().unwrap();
25672568
let assoc_link = AssocItemLink::GotoSource(did, &i.provided_trait_methods);
25682569

2569-
doctraititem(w, cx, trait_item, assoc_link, render_static, true,
2570+
doctraititem(w, cx, trait_item, assoc_link, render_static,
25702571
outer_version)?;
25712572
}
25722573
Ok(())

branches/auto/src/libsyntax/ext/expand.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,6 @@ pub fn expand_item_mac(it: P<ast::Item>,
504504

505505
/// Expand a stmt
506506
fn expand_stmt(stmt: Stmt, fld: &mut MacroExpander) -> SmallVector<Stmt> {
507-
// perform all pending renames
508-
let stmt = {
509-
let pending_renames = &mut fld.cx.syntax_env.info().pending_renames;
510-
let mut rename_fld = IdentRenamer{renames:pending_renames};
511-
rename_fld.fold_stmt(stmt).expect_one("rename_fold didn't return one value")
512-
};
513-
514507
let (mac, style, attrs) = match stmt.node {
515508
StmtKind::Mac(mac, style, attrs) => (mac, style, attrs),
516509
_ => return expand_non_macro_stmt(stmt, fld)
@@ -724,8 +717,14 @@ pub fn expand_block(blk: P<Block>, fld: &mut MacroExpander) -> P<Block> {
724717
pub fn expand_block_elts(b: P<Block>, fld: &mut MacroExpander) -> P<Block> {
725718
b.map(|Block {id, stmts, expr, rules, span}| {
726719
let new_stmts = stmts.into_iter().flat_map(|x| {
727-
// perform pending renames and expand macros in the statement
728-
fld.fold_stmt(x).into_iter()
720+
// perform all pending renames
721+
let renamed_stmt = {
722+
let pending_renames = &mut fld.cx.syntax_env.info().pending_renames;
723+
let mut rename_fld = IdentRenamer{renames:pending_renames};
724+
rename_fld.fold_stmt(x).expect_one("rename_fold didn't return one value")
725+
};
726+
// expand macros in the statement
727+
fld.fold_stmt(renamed_stmt).into_iter()
729728
}).collect();
730729
let new_expr = expr.map(|x| {
731730
let expr = {

branches/auto/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,6 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
10141014
match *tok {
10151015
OpenDelim(token::DelimToken::Brace) | OpenDelim(token::DelimToken::Bracket) |
10161016
Comma | FatArrow | Colon | Eq | Gt | Semi | BinOp(token::Or) => Ok(true),
1017-
MatchNt(_, ref frag, _, _) if frag.name.as_str() == "block" => Ok(true),
10181017
Ident(i, _) if (i.name.as_str() == "as" ||
10191018
i.name.as_str() == "where") => Ok(true),
10201019
_ => Ok(false)

branches/auto/src/libsyntax/feature_gate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use std::cmp;
4545
// The version numbers here correspond to the version in which the current status
4646
// was set. This is most important for knowing when a particular feature became
4747
// stable (active).
48-
// NB: The tidy tool parses this information directly out of the source so take
49-
// care when modifying it.
48+
// NB: The featureck.py script parses this information directly out of the source
49+
// so take care when modifying it.
5050
const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status)] = &[
5151
("globs", "1.0.0", None, Accepted),
5252
("macro_rules", "1.0.0", None, Accepted),

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,8 +1532,9 @@ impl<'a> Parser<'a> {
15321532
} else {
15331533
let span = self.last_span;
15341534
self.span_err(span,
1535-
"expected mut or const in raw pointer type (use \
1536-
`*mut T` or `*const T` as appropriate)");
1535+
"bare raw pointers are no longer allowed, you should \
1536+
likely use `*mut T`, but otherwise `*T` is now \
1537+
known as `*const T`");
15371538
Mutability::Immutable
15381539
};
15391540
let t = self.parse_ty()?;

branches/auto/src/test/auxiliary/foreign_lib.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![crate_name="foreign_lib"]
12-
1312
#![feature(libc)]
1413

1514
pub mod rustrt {
@@ -20,29 +19,3 @@ pub mod rustrt {
2019
pub fn rust_get_test_int() -> libc::intptr_t;
2120
}
2221
}
23-
24-
pub mod rustrt2 {
25-
extern crate libc;
26-
27-
extern {
28-
pub fn rust_get_test_int() -> libc::intptr_t;
29-
}
30-
}
31-
32-
pub mod rustrt3 {
33-
// Different type, but same ABI (on all supported platforms).
34-
// Ensures that we don't ICE or trigger LLVM asserts when
35-
// importing the same symbol under different types.
36-
// See https://github.com/rust-lang/rust/issues/32740.
37-
extern {
38-
pub fn rust_get_test_int() -> *const u8;
39-
}
40-
}
41-
42-
pub fn local_uses() {
43-
unsafe {
44-
let x = rustrt::rust_get_test_int();
45-
assert_eq!(x, rustrt2::rust_get_test_int());
46-
assert_eq!(x as *const _, rustrt3::rust_get_test_int());
47-
}
48-
}

0 commit comments

Comments
 (0)