Skip to content

Rollup of 8 pull requests #31777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Gareth Daniel Smith <[email protected]> Gareth Smith <garethdanielsmit
Georges Dubus <[email protected]> <[email protected]>
Graham Fawcett <[email protected]> Graham Fawcett <[email protected]>
Graydon Hoare <[email protected]> Graydon Hoare <[email protected]>
Guillaume Gomez <[email protected]>
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
Heather <[email protected]> <[email protected]>
Heather <[email protected]> <[email protected]>
Herman J. Radtke III <[email protected]> Herman J. Radtke III <[email protected]>
Expand Down
10 changes: 5 additions & 5 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ extern {}
// explicitly request it), and on Android we explicitly request it as
// unprefixing cause segfaults (mismatches in allocators).
extern {
#[cfg_attr(any(target_os = "macos", target_os = "android"),
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
link_name = "je_mallocx")]
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
#[cfg_attr(any(target_os = "macos", target_os = "android"),
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
link_name = "je_rallocx")]
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
#[cfg_attr(any(target_os = "macos", target_os = "android"),
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
link_name = "je_xallocx")]
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
#[cfg_attr(any(target_os = "macos", target_os = "android"),
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
link_name = "je_sdallocx")]
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
#[cfg_attr(any(target_os = "macos", target_os = "android"),
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
link_name = "je_nallocx")]
fn nallocx(size: size_t, flags: c_int) -> size_t;
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc/front/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl<'a, 'v> Visitor<'v> for CheckAttrVisitor<'a> {
for attr in &item.attrs {
self.check_attribute(attr, target);
}
visit::walk_item(self, item);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_privacy/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ let f = Bar::Foo{ a: 0, b: 0 }; // error: field `b` of struct `Bar::Foo`
// is private
```

To fix this error, please ensure that all the fields of the struct, or
implement a function for easy instantiation. Examples:
To fix this error, please ensure that all the fields of the struct are public,
or implement a function for easy instantiation. Examples:

```
mod Bar {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
NamedField(name) => format!("field `{}` of {} is private",
name, struct_desc),
UnnamedField(idx) => format!("field #{} of {} is private",
idx + 1, struct_desc),
idx, struct_desc),
};
span_err!(self.tcx.sess, span, E0451,
"{}", &msg[..]);
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,13 @@ pub struct ArgsOs { inner: os_imp::Args }
/// via the command line).
///
/// The first element is traditionally the path to the executable, but it can be
/// set to arbitrary text, and it may not even exist, so this property should
/// set to arbitrary text, and may not even exist. This means this property should
/// not be relied upon for security purposes.
///
/// # Panics
///
/// The returned iterator will panic during iteration if any argument to the
/// process is not valid unicode. If this is not desired it is recommended to
/// process is not valid unicode. If this is not desired,
/// use the `args_os` function instead.
///
/// # Examples
Expand Down Expand Up @@ -603,7 +603,7 @@ impl ExactSizeIterator for ArgsOs {
/// Constants associated with the current target
#[stable(feature = "env", since = "1.0.0")]
pub mod consts {
/// A string describing the architecture of the CPU that this is currently
/// A string describing the architecture of the CPU that is currently
/// in use.
///
/// Some possible values:
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/os/netbsd/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pub struct stat {
#[stable(feature = "raw_ext", since = "1.1.0")]
pub st_nlink: u32,
#[stable(feature = "raw_ext", since = "1.1.0")]
pub st_uid: u32,
pub st_uid: uid_t,
#[stable(feature = "raw_ext", since = "1.1.0")]
pub st_gid: u32,
pub st_gid: gid_t,
#[stable(feature = "raw_ext", since = "1.1.0")]
pub st_rdev: u64,
#[stable(feature = "raw_ext", since = "1.1.0")]
Expand Down
14 changes: 14 additions & 0 deletions src/test/compile-fail/issue-31769.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
#[inline] struct Foo; //~ ERROR attribute should be applied to function
#[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct or enum
}
36 changes: 18 additions & 18 deletions src/test/compile-fail/privacy5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ fn this_crate() {
let c = a::C(2, 3); //~ ERROR: cannot invoke tuple struct constructor
let d = a::D(4);

let a::A(()) = a; //~ ERROR: field #1 of struct `a::A` is private
let a::A(()) = a; //~ ERROR: field #0 of struct `a::A` is private
let a::A(_) = a;
match a { a::A(()) => {} } //~ ERROR: field #1 of struct `a::A` is private
match a { a::A(()) => {} } //~ ERROR: field #0 of struct `a::A` is private
match a { a::A(_) => {} }

let a::B(_) = b;
let a::B(_b) = b; //~ ERROR: field #1 of struct `a::B` is private
let a::B(_b) = b; //~ ERROR: field #0 of struct `a::B` is private
match b { a::B(_) => {} }
match b { a::B(_b) => {} } //~ ERROR: field #1 of struct `a::B` is private
match b { a::B(1) => {} a::B(_) => {} } //~ ERROR: field #1 of struct `a::B` is private
match b { a::B(_b) => {} } //~ ERROR: field #0 of struct `a::B` is private
match b { a::B(1) => {} a::B(_) => {} } //~ ERROR: field #0 of struct `a::B` is private

let a::C(_, _) = c;
let a::C(_a, _) = c;
let a::C(_, _b) = c; //~ ERROR: field #2 of struct `a::C` is private
let a::C(_a, _b) = c; //~ ERROR: field #2 of struct `a::C` is private
let a::C(_, _b) = c; //~ ERROR: field #1 of struct `a::C` is private
let a::C(_a, _b) = c; //~ ERROR: field #1 of struct `a::C` is private
match c { a::C(_, _) => {} }
match c { a::C(_a, _) => {} }
match c { a::C(_, _b) => {} } //~ ERROR: field #2 of struct `a::C` is private
match c { a::C(_a, _b) => {} } //~ ERROR: field #2 of struct `a::C` is private
match c { a::C(_, _b) => {} } //~ ERROR: field #1 of struct `a::C` is private
match c { a::C(_a, _b) => {} } //~ ERROR: field #1 of struct `a::C` is private

let a::D(_) = d;
let a::D(_d) = d;
Expand All @@ -101,30 +101,30 @@ fn xcrate() {
let c = other::C(2, 3); //~ ERROR: cannot invoke tuple struct constructor
let d = other::D(4);

let other::A(()) = a; //~ ERROR: field #1 of struct `other::A` is private
let other::A(()) = a; //~ ERROR: field #0 of struct `other::A` is private
let other::A(_) = a;
match a { other::A(()) => {} }
//~^ ERROR: field #1 of struct `other::A` is private
//~^ ERROR: field #0 of struct `other::A` is private
match a { other::A(_) => {} }

let other::B(_) = b;
let other::B(_b) = b; //~ ERROR: field #1 of struct `other::B` is private
let other::B(_b) = b; //~ ERROR: field #0 of struct `other::B` is private
match b { other::B(_) => {} }
match b { other::B(_b) => {} }
//~^ ERROR: field #1 of struct `other::B` is private
//~^ ERROR: field #0 of struct `other::B` is private
match b { other::B(1) => {} other::B(_) => {} }
//~^ ERROR: field #1 of struct `other::B` is private
//~^ ERROR: field #0 of struct `other::B` is private

let other::C(_, _) = c;
let other::C(_a, _) = c;
let other::C(_, _b) = c; //~ ERROR: field #2 of struct `other::C` is private
let other::C(_a, _b) = c; //~ ERROR: field #2 of struct `other::C` is private
let other::C(_, _b) = c; //~ ERROR: field #1 of struct `other::C` is private
let other::C(_a, _b) = c; //~ ERROR: field #1 of struct `other::C` is private
match c { other::C(_, _) => {} }
match c { other::C(_a, _) => {} }
match c { other::C(_, _b) => {} }
//~^ ERROR: field #2 of struct `other::C` is private
//~^ ERROR: field #1 of struct `other::C` is private
match c { other::C(_a, _b) => {} }
//~^ ERROR: field #2 of struct `other::C` is private
//~^ ERROR: field #1 of struct `other::C` is private

let other::D(_) = d;
let other::D(_d) = d;
Expand Down