Skip to content

Commit c61e8fd

Browse files
committed
Auto merge of #29883 - Manishearth:rollup, r=Manishearth
- Successful merges: #29868, #29873, #29874, #29875, #29876, #29880, #29881 - Failed merges:
2 parents 1b26148 + e81c72e commit c61e8fd

File tree

11 files changed

+48
-24
lines changed

11 files changed

+48
-24
lines changed

mk/platform.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# would create a variable HOST_i686-darwin-macos with the value
1515
# i386.
1616
define DEF_HOST_VAR
17-
HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1))))
17+
HOST_$(1) = $(patsubst i%86,i386,$(word 1,$(subst -, ,$(1))))
1818
endef
1919
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
2020
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))

src/doc/nomicon/unbounded-lifetimes.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ Within a function, bounding lifetimes is more error-prone. The safest and easies
3232
way to bound a lifetime is to return it from a function with a bound lifetime.
3333
However if this is unacceptable, the reference can be placed in a location with
3434
a specific lifetime. Unfortunately it's impossible to name all lifetimes involved
35-
in a function. To get around this, you can in principle use `copy_lifetime`, though
36-
these are unstable due to their awkward nature and questionable utility.
35+
in a function.
3736

src/doc/trpl/ownership.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn change_truth(x: bool) -> bool {
187187
}
188188
```
189189

190-
If we would have used types that do not implement the `Copy` trait,
190+
If we had used types that do not implement the `Copy` trait,
191191
we would have gotten a compile error because we tried to use a moved value.
192192

193193
```text

src/doc/trpl/ufcs.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,28 @@ Here’s an example of using the longer form.
109109

110110
```rust
111111
trait Foo {
112-
fn clone(&self);
112+
fn foo() -> i32;
113113
}
114114

115-
#[derive(Clone)]
116115
struct Bar;
117116

118-
impl Foo for Bar {
119-
fn clone(&self) {
120-
println!("Making a clone of Bar");
117+
impl Bar {
118+
fn foo() -> i32 {
119+
20
120+
}
121+
}
121122

122-
<Bar as Clone>::clone(self);
123+
impl Foo for Bar {
124+
fn foo() -> i32 {
125+
10
123126
}
124127
}
128+
129+
fn main() {
130+
assert_eq!(10, <Bar as Foo>::foo());
131+
assert_eq!(20, Bar::foo());
132+
}
125133
```
126134

127-
This will call the `Clone` trait’s `clone()` method, rather than `Foo`’s.
135+
Using the angle bracket syntax lets you call the trait method instead of the
136+
inherent one.

src/libcore/clone.rs

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
use marker::Sized;
2525

2626
/// A common trait for cloning an object.
27+
///
28+
/// This trait can be used with `#[derive]`.
2729
#[stable(feature = "rust1", since = "1.0.0")]
2830
pub trait Clone : Sized {
2931
/// Returns a copy of the value.

src/libcore/cmp.rs

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ use option::Option::{self, Some};
4343
/// in terms of it by default. Any manual implementation of `ne` *must* respect
4444
/// the rule that `eq` is a strict inverse of `ne`; that is, `!(a == b)` if and
4545
/// only if `a != b`.
46+
///
47+
/// This trait can be used with `#[derive]`.
4648
#[lang = "eq"]
4749
#[stable(feature = "rust1", since = "1.0.0")]
4850
pub trait PartialEq<Rhs: ?Sized = Self> {
@@ -69,6 +71,8 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
6971
///
7072
/// This property cannot be checked by the compiler, and therefore `Eq` implies
7173
/// `PartialEq`, and has no extra methods.
74+
///
75+
/// This trait can be used with `#[derive]`.
7276
#[stable(feature = "rust1", since = "1.0.0")]
7377
pub trait Eq: PartialEq<Self> {
7478
// FIXME #13101: this method is used solely by #[deriving] to
@@ -171,6 +175,8 @@ impl Ordering {
171175
/// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
172176
///
173177
/// When this trait is `derive`d, it produces a lexicographic ordering.
178+
///
179+
/// This trait can be used with `#[derive]`.
174180
#[stable(feature = "rust1", since = "1.0.0")]
175181
pub trait Ord: Eq + PartialOrd<Self> {
176182
/// This method returns an `Ordering` between `self` and `other`.
@@ -227,6 +233,8 @@ impl PartialOrd for Ordering {
227233
/// However it remains possible to implement the others separately for types which do not have a
228234
/// total order. For example, for floating point numbers, `NaN < 0 == false` and `NaN >= 0 ==
229235
/// false` (cf. IEEE 754-2008 section 5.11).
236+
///
237+
/// This trait can be used with `#[derive]`.
230238
#[lang = "ord"]
231239
#[stable(feature = "rust1", since = "1.0.0")]
232240
pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {

src/libcore/fmt/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ impl<'a> Display for Arguments<'a> {
300300
///
301301
/// [module]: ../../std/fmt/index.html
302302
///
303+
/// This trait can be used with `#[derive]`.
304+
///
303305
/// # Examples
304306
///
305307
/// Deriving an implementation:

src/libcore/hash/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ mod sip;
9393
///
9494
/// In other words, if two keys are equal, their hashes should also be equal.
9595
/// `HashMap` and `HashSet` both rely on this behavior.
96+
///
97+
/// This trait can be used with `#[derive]`.
9698
#[stable(feature = "rust1", since = "1.0.0")]
9799
pub trait Hash {
98100
/// Feeds this value into the state given, updating the hasher as necessary.

src/libcore/marker.rs

+4
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ pub trait Unsize<T: ?Sized> {
165165
/// to consider though: if you think your type may _not_ be able to implement `Copy` in the future,
166166
/// then it might be prudent to not implement `Copy`. This is because removing `Copy` is a breaking
167167
/// change: that second example would fail to compile if we made `Foo` non-`Copy`.
168+
///
169+
/// # Derivable
170+
///
171+
/// This trait can be used with `#[derive]`.
168172
#[stable(feature = "rust1", since = "1.0.0")]
169173
#[lang = "copy"]
170174
pub trait Copy : Clone {

src/libstd/sys/unix/os.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,20 @@ impl StdError for JoinPathsError {
167167
#[cfg(target_os = "freebsd")]
168168
pub fn current_exe() -> io::Result<PathBuf> {
169169
unsafe {
170-
use libc::funcs::bsd44::*;
171-
use libc::consts::os::extra::*;
172-
let mut mib = [CTL_KERN as c_int,
173-
KERN_PROC as c_int,
174-
KERN_PROC_PATHNAME as c_int,
170+
let mut mib = [libc::CTL_KERN as c_int,
171+
libc::KERN_PROC as c_int,
172+
libc::KERN_PROC_PATHNAME as c_int,
175173
-1 as c_int];
176174
let mut sz: libc::size_t = 0;
177-
let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
178-
ptr::null_mut(), &mut sz, ptr::null_mut(),
179-
0 as libc::size_t);
175+
let err = libc::sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
176+
ptr::null_mut(), &mut sz, ptr::null_mut(),
177+
0 as libc::size_t);
180178
if err != 0 { return Err(io::Error::last_os_error()); }
181179
if sz == 0 { return Err(io::Error::last_os_error()); }
182180
let mut v: Vec<u8> = Vec::with_capacity(sz as usize);
183-
let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
184-
v.as_mut_ptr() as *mut libc::c_void, &mut sz,
185-
ptr::null_mut(), 0 as libc::size_t);
181+
let err = libc::sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
182+
v.as_mut_ptr() as *mut libc::c_void, &mut sz,
183+
ptr::null_mut(), 0 as libc::size_t);
186184
if err != 0 { return Err(io::Error::last_os_error()); }
187185
if sz == 0 { return Err(io::Error::last_os_error()); }
188186
v.set_len(sz as usize - 1); // chop off trailing NUL

src/test/run-pass/mir_raw_fat_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn compare_au8(a: *const [u8], b: *const [u8]) -> ComparisonResults {
7676
}
7777
}
7878

79-
#[rustc_mir(graphviz="comparefoo.gv")]
79+
#[rustc_mir]
8080
fn compare_foo<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> ComparisonResults {
8181
ComparisonResults {
8282
lt: a < b,
@@ -88,7 +88,7 @@ fn compare_foo<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> ComparisonResults
8888
}
8989
}
9090

91-
#[rustc_mir(graphviz="simpleeq.gv")]
91+
#[rustc_mir]
9292
fn simple_eq<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> bool {
9393
let result = a == b;
9494
result

0 commit comments

Comments
 (0)