Skip to content

Commit

Permalink
Auto merge of #45674 - kennytm:rollup, r=kennytm
Browse files Browse the repository at this point in the history
Rollup of 14 pull requests

- Successful merges: #45450, #45579, #45602, #45619, #45624, #45644, #45646, #45648, #45649, #45650, #45652, #45660, #45664, #45671
- Failed merges:
  • Loading branch information
bors committed Nov 1, 2017
2 parents 31bbe57 + 0284550 commit 7402866
Show file tree
Hide file tree
Showing 21 changed files with 221 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def default_build_triple():
raise ValueError('unknown byteorder: {}'.format(sys.byteorder))
# only the n64 ABI is supported, indicate it
ostype += 'abi64'
elif cputype == 'sparcv9':
elif cputype == 'sparcv9' or cputype == 'sparc64':
pass
else:
err = "unknown cpu type: {}".format(cputype)
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ impl Step for Openssl {
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
"x86_64-unknown-freebsd" => "BSD-x86_64",
"x86_64-unknown-dragonfly" => "BSD-x86_64",
"x86_64-unknown-linux-gnu" => "linux-x86_64",
"x86_64-unknown-linux-musl" => "linux-x86_64",
"x86_64-unknown-netbsd" => "BSD-x86_64",
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 36 files
+12 −3 .travis.yml
+22 −22 Cargo.lock
+1 −1 Cargo.toml
+0 −15 ci/android-accept-licenses.sh
+15 −12 ci/android-install-sdk.sh
+2 −2 ci/docker/aarch64-linux-android/Dockerfile
+2 −2 ci/docker/arm-linux-androideabi/Dockerfile
+2 −2 ci/docker/i686-linux-android/Dockerfile
+11 −0 ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
+11 −0 ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
+14 −0 ci/docker/sparc64-unknown-linux-gnu/Dockerfile
+5 −0 ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
+8 −1 ci/run.sh
+1 −1 libc-test/Cargo.toml
+7 −7 src/unix/bsd/netbsdlike/netbsd/mod.rs
+28 −0 src/unix/mod.rs
+366 −366 src/unix/notbsd/linux/mips/mips32.rs
+326 −326 src/unix/notbsd/linux/mips/mips64.rs
+3 −0 src/unix/notbsd/linux/mips/mod.rs
+25 −14 src/unix/notbsd/linux/mod.rs
+350 −350 src/unix/notbsd/linux/musl/b32/arm.rs
+358 −358 src/unix/notbsd/linux/musl/b32/mips.rs
+264 −264 src/unix/notbsd/linux/musl/b64/aarch64.rs
+3 −0 src/unix/notbsd/linux/musl/mod.rs
+352 −352 src/unix/notbsd/linux/other/b32/arm.rs
+6 −0 src/unix/notbsd/linux/other/b32/mod.rs
+369 −369 src/unix/notbsd/linux/other/b32/powerpc.rs
+268 −266 src/unix/notbsd/linux/other/b64/aarch64.rs
+14 −6 src/unix/notbsd/linux/other/b64/mod.rs
+326 −0 src/unix/notbsd/linux/other/b64/not_x32.rs
+361 −359 src/unix/notbsd/linux/other/b64/powerpc64.rs
+2 −0 src/unix/notbsd/linux/other/b64/sparc64.rs
+329 −0 src/unix/notbsd/linux/other/b64/x32.rs
+13 −331 src/unix/notbsd/linux/other/b64/x86_64.rs
+8 −6 src/unix/notbsd/linux/other/mod.rs
+325 −322 src/unix/notbsd/linux/s390x.rs
4 changes: 3 additions & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,9 @@ pub enum Expr_ {
/// A function call
///
/// The first field resolves to the function itself (usually an `ExprPath`),
/// and the second field is the list of arguments
/// and the second field is the list of arguments.
/// This also represents calling the constructor of
/// tuple-like ADTs such as tuple structs and enum variants.
ExprCall(P<Expr>, HirVec<Expr>),
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
///
Expand Down
11 changes: 6 additions & 5 deletions src/librustc/ich/hcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,18 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for Span {
// If this is not an empty or invalid span, we want to hash the last
// position that belongs to it, as opposed to hashing the first
// position past it.
let span_hi = if self.hi() > self.lo() {
let span = self.data();
let span_hi = if span.hi > span.lo {
// We might end up in the middle of a multibyte character here,
// but that's OK, since we are not trying to decode anything at
// this position.
self.hi() - ::syntax_pos::BytePos(1)
span.hi - ::syntax_pos::BytePos(1)
} else {
self.hi()
span.hi
};

{
let loc1 = hcx.codemap().byte_pos_to_line_and_col(self.lo());
let loc1 = hcx.codemap().byte_pos_to_line_and_col(span.lo);
let loc1 = loc1.as_ref()
.map(|&(ref fm, line, col)| (&fm.name[..], line, col.to_usize()))
.unwrap_or(("???", 0, 0));
Expand Down Expand Up @@ -414,7 +415,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for Span {
}
}

if self.ctxt() == SyntaxContext::empty() {
if span.ctxt == SyntaxContext::empty() {
0u8.hash_stable(hcx, hasher);
} else {
1u8.hash_stable(hcx, hasher);
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct MarkSymbolVisitor<'a, 'tcx: 'a> {
tables: &'a ty::TypeckTables<'tcx>,
live_symbols: Box<FxHashSet<ast::NodeId>>,
struct_has_extern_repr: bool,
ignore_non_const_paths: bool,
in_pat: bool,
inherited_pub_visibility: bool,
ignore_variant_stack: Vec<DefId>,
}
Expand All @@ -75,10 +75,10 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {

fn handle_definition(&mut self, def: Def) {
match def {
Def::Const(_) | Def::AssociatedConst(..) => {
Def::Const(_) | Def::AssociatedConst(..) | Def::TyAlias(_) => {
self.check_def_id(def.def_id());
}
_ if self.ignore_non_const_paths => (),
_ if self.in_pat => (),
Def::PrimTy(..) | Def::SelfTy(..) |
Def::Local(..) | Def::Upvar(..) => {}
Def::Variant(variant_id) | Def::VariantCtor(variant_id, ..) => {
Expand Down Expand Up @@ -289,9 +289,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
_ => ()
}

self.ignore_non_const_paths = true;
self.in_pat = true;
intravisit::walk_pat(self, pat);
self.ignore_non_const_paths = false;
self.in_pat = false;
}

fn visit_path(&mut self, path: &'tcx hir::Path, _: ast::NodeId) {
Expand Down Expand Up @@ -429,7 +429,7 @@ fn find_live<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
tables: &ty::TypeckTables::empty(None),
live_symbols: box FxHashSet(),
struct_has_extern_repr: false,
ignore_non_const_paths: false,
in_pat: false,
inherited_pub_visibility: false,
ignore_variant_stack: vec![],
};
Expand Down
26 changes: 23 additions & 3 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3606,12 +3606,12 @@ impl<'a> Resolver<'a> {
}
}

fn report_conflict(&mut self,
fn report_conflict<'b>(&mut self,
parent: Module,
ident: Ident,
ns: Namespace,
new_binding: &NameBinding,
old_binding: &NameBinding) {
new_binding: &NameBinding<'b>,
old_binding: &NameBinding<'b>) {
// Error on the second of two conflicting names
if old_binding.span.lo() > new_binding.span.lo() {
return self.report_conflict(parent, ident, ns, old_binding, new_binding);
Expand Down Expand Up @@ -3683,6 +3683,26 @@ impl<'a> Resolver<'a> {
old_noun, old_kind, name));
}

// See https://github.com/rust-lang/rust/issues/32354
if old_binding.is_import() || new_binding.is_import() {
let binding = if new_binding.is_import() {
new_binding
} else {
old_binding
};

let cm = self.session.codemap();
let rename_msg = "You can use `as` to change the binding name of the import";

if let Ok(snippet) = cm.span_to_snippet(binding.span) {
err.span_suggestion(binding.span,
rename_msg,
format!("{} as Other{}", snippet, name));
} else {
err.span_label(binding.span, rename_msg);
}
}

err.emit();
self.name_already_seen.insert(name, span);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ impl<'a> Linker for EmLinker<'a> {
fn exported_symbols(tcx: TyCtxt, crate_type: CrateType) -> Vec<String> {
let mut symbols = Vec::new();

let export_threshold = symbol_export::threshold(tcx);
let export_threshold = symbol_export::crates_export_threshold(&[crate_type]);
for &(ref name, _, level) in tcx.exported_symbols(LOCAL_CRATE).iter() {
if level.is_below_threshold(export_threshold) {
symbols.push(name.clone());
Expand Down
12 changes: 11 additions & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ a {
.content .search-results td:first-child { padding-right: 0; }
.content .search-results td:first-child a { padding-right: 10px; }

tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black;
tr.result span.primitive::after {
content: ' (primitive type)'; font-style: italic; color: black;
}

body.blur > :not(#help) {
Expand Down Expand Up @@ -761,6 +762,15 @@ span.since {
margin-top: 5px;
}

.docblock > .section-header:first-child {
margin-left: 15px;
margin-top: 0;
}

.docblock > .section-header:first-child:hover > a:before {
left: -10px;
}

.enum > .collapsed, .struct > .collapsed {
margin-bottom: 25px;
}
Expand Down
13 changes: 9 additions & 4 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,10 @@ pub trait Read {

/// Transforms this `Read` instance to an [`Iterator`] over its bytes.
///
/// The returned type implements [`Iterator`] where the `Item` is [`Result`]`<`[`u8`]`,
/// R::Err>`. The yielded item is [`Ok`] if a byte was successfully read and
/// [`Err`] otherwise for I/O errors. EOF is mapped to returning [`None`] from
/// this iterator.
/// The returned type implements [`Iterator`] where the `Item` is
/// [`Result`]`<`[`u8`]`, `[`io::Error`]>`.
/// The yielded item is [`Ok`] if a byte was successfully read and [`Err`]
/// otherwise. EOF is mapped to returning [`None`] from this iterator.
///
/// # Examples
///
Expand All @@ -748,6 +748,7 @@ pub trait Read {
/// [file]: ../fs/struct.File.html
/// [`Iterator`]: ../../std/iter/trait.Iterator.html
/// [`Result`]: ../../std/result/enum.Result.html
/// [`io::Error``]: ../../std/io/struct.Error.html
/// [`u8`]: ../../std/primitive.u8.html
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
Expand Down Expand Up @@ -1410,6 +1411,8 @@ pub trait BufRead: Read {
///
/// If successful, this function will return the total number of bytes read.
///
/// An empty buffer returned indicates that the stream has reached EOF.
///
/// # Errors
///
/// This function will ignore all instances of [`ErrorKind::Interrupted`] and
Expand Down Expand Up @@ -1470,6 +1473,8 @@ pub trait BufRead: Read {
///
/// If successful, this function will return the total number of bytes read.
///
/// An empty buffer returned indicates that the stream has reached EOF.
///
/// # Errors
///
/// This function has the same error semantics as [`read_until`] and will
Expand Down
10 changes: 8 additions & 2 deletions src/libstd/sys/unix/ext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@

//! Experimental extensions to `std` for Unix platforms.
//!
//! For now, this module is limited to extracting file descriptors,
//! but its functionality will grow over time.
//! Provides access to platform-level information on Unix platforms, and
//! exposes Unix-specific functions that would otherwise be inappropriate as
//! part of the core `std` library.
//!
//! It exposes more ways to deal with platform-specific strings (`OsStr`,
//! `OsString`), allows to set permissions more granularly, extract low-level
//! file descriptors from files and sockets, and has platform-specific helpers
//! for spawning processes.
//!
//! # Examples
//!
Expand Down
4 changes: 3 additions & 1 deletion src/libstd/sys/unix/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ mod imp {
target_arch = "powerpc64",
target_arch = "s390x")))]
fn getrandom(buf: &mut [u8]) -> libc::c_long {
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
const NR_GETRANDOM: libc::c_long = 0x40000000 + 318;
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
const NR_GETRANDOM: libc::c_long = 318;
#[cfg(target_arch = "x86")]
const NR_GETRANDOM: libc::c_long = 355;
Expand Down
4 changes: 3 additions & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,9 @@ pub enum ExprKind {
/// A function call
///
/// The first field resolves to the function itself,
/// and the second field is the list of arguments
/// and the second field is the list of arguments.
/// This also represents calling the constructor of
/// tuple-like ADTs such as tuple structs and enum variants.
Call(P<Expr>, Vec<P<Expr>>),
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
///
Expand Down
9 changes: 4 additions & 5 deletions src/libsyntax/parse/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ impl<'a> Parser<'a> {
let span = self.span;
self.diagnostic()
.struct_span_err(span, reason)
.note("inner attributes and doc comments, like `#![no_std]` or \
`//! My crate`, annotate the item enclosing them, and are \
usually found at the beginning of source files. Outer \
attributes and doc comments, like `#[test]` and
`/// My function`, annotate the item following them.")
.note("inner attributes, like `#![no_std]`, annotate the item \
enclosing them, and are usually found at the beginning of \
source files. Outer attributes, like `#[test]`, annotate the \
item following them.")
.emit()
}
ast::AttrStyle::Inner
Expand Down
Loading

0 comments on commit 7402866

Please sign in to comment.