Skip to content
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

Rollup of 15 pull requests #53216

Merged
merged 63 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c744158
Fix doc link (again)
felixrabe Aug 5, 2018
c70eb4b
Automatically expand section if url id point to one of its component
GuillaumeGomez Aug 5, 2018
621d064
atomic ordering docs
RalfJung Aug 6, 2018
e8bb7bf
Account for --remap-path-prefix in save-analysis
Xanewok Aug 6, 2018
b011b09
NetBSD: fix signedess of char
jakllsch Aug 5, 2018
44d32d4
Avoid unnecessary pattern matching against Option and Result
ljedrz Jul 27, 2018
e9a86a2
fix link label; use more https
RalfJung Aug 7, 2018
110bcc9
forgot to add comment for some atomic types
RalfJung Aug 7, 2018
1733bd3
list possible orderings for load and store
RalfJung Aug 7, 2018
6a018a0
document mode possibilities for all RMW operations
RalfJung Aug 7, 2018
5ce865e
Add wasm32 simd128 target feature
gnzlbg Aug 7, 2018
020b073
add wasm_target_feature feature gate
gnzlbg Aug 7, 2018
2cdaf3b
add feature-gate test
gnzlbg Aug 8, 2018
f4039af
Suggest comma when missing in macro call
estebank Aug 8, 2018
c92db36
update target-feature-gate.stderr output
gnzlbg Aug 8, 2018
c5b557f
librustc_metadata: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
72ae246
librustc_lint: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
f8367a3
librustc_borrowck: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
98d9422
libgraphviz: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
1c3d20e
liballoc_system: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
fa1bdd6
liballoc_jemalloc: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
ce7f0c4
liballoc: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
c7646d5
Refactor expand_preparsed_format_args
ljedrz Aug 8, 2018
aab063a
Use Cow<str> in describe_num_args
ljedrz Aug 9, 2018
d2e0c78
[nll] libarena: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
742a951
[nll] librustc_asan: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
80e8e97
[nll] librustc_errors: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
95b6418
[nll] librustc_passes: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
a6b7163
[nll] librustc_plugin: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
87fb6fc
[nll] librustc_privacy: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
03a5694
[nll] librustc_resolve: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
9fcc6da
[nll] librustc_save_analysis: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
cb49252
[nll] librustc_traits: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
034a96a
[nll] librustc_tsan: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
c6f55bc
Rollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakis
kennytm Aug 9, 2018
dad5b6c
Rollup merge of #53094 - GuillaumeGomez:automatic-expand, r=nrc
kennytm Aug 9, 2018
c24ba7e
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
kennytm Aug 9, 2018
23601d0
Rollup merge of #53116 - jakllsch:netbsd-unsigned-char, r=alexcrichton
kennytm Aug 9, 2018
b78201a
inline some short functions
strake Aug 9, 2018
3ed965a
[nll] libfmt_macros: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
04bd614
[nll] libpanic_abort: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
7e78e75
[nll] libpanic_unwind: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
b340f56
[nll] librustc_apfloat: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
c6be555
[nll] librustc_cratesio_shim: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
fd4b1a7
[nll] librustc_driver: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
a37360c
[nll] librustc_incremental: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
f331401
[nll] librustc_target: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
01c598a
[nll] libsyntax_pos: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
58836e8
[nll] libterm: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
d25dbc5
[nll] libunwind: enable feature(nll) for bootstrap
memoryruins Aug 9, 2018
25a58af
A few cleanups for rustc_target
ljedrz Aug 9, 2018
cc2503a
Add individual docs for rotate_{left, right}
llogiq Aug 8, 2018
7f886cf
Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichton
kennytm Aug 9, 2018
8188f12
Rollup merge of #53183 - estebank:println-comma, r=oli-obk
kennytm Aug 9, 2018
db74946
Rollup merge of #53106 - RalfJung:ordering, r=stjepang
kennytm Aug 9, 2018
410f63d
Rollup merge of #53217 - strake:inline, r=nagisa
kennytm Aug 9, 2018
746abc3
Rollup merge of #53082 - felixrabe:fix-doc-link-again, r=GuillaumeGomez
kennytm Aug 9, 2018
bb0151c
Rollup merge of #53211 - memoryruins:nll_bootstrap, r=nikomatsakis
kennytm Aug 9, 2018
62d70c9
Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis
kennytm Aug 9, 2018
e2d0e3f
Rollup merge of #53219 - memoryruins:nll_bootstrap_3, r=nikomatsakis
kennytm Aug 9, 2018
762855d
Rollup merge of #53215 - ljedrz:refactor_format, r=estebank
kennytm Aug 9, 2018
f067f3a
Rollup merge of #53222 - ljedrz:cleanup_rustc_target, r=Mark-Simulacrum
kennytm Aug 9, 2018
9f55705
Rollup merge of #53207 - llogiq:num-rotate-docs, r=QuietMisdreavus
kennytm Aug 9, 2018
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
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

#![cfg_attr(not(test), feature(fn_traits))]
#![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(not(stage0), feature(nll))]
#![cfg_attr(test, feature(test))]

#![feature(allocator_api)]
Expand Down
1 change: 1 addition & 0 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#![feature(core_intrinsics)]
#![feature(libc)]
#![feature(linkage)]
#![cfg_attr(not(stage0), feature(nll))]
#![feature(staged_api)]
#![feature(rustc_attrs)]
#![cfg_attr(dummy_jemalloc, allow(dead_code, unused_extern_crates))]
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
reason = "this library is unlikely to be stabilized in its current \
form or name",
issue = "32838")]

#![feature(allocator_api)]
#![feature(core_intrinsics)]
#![cfg_attr(not(stage0), feature(nll))]
#![feature(staged_api)]
#![feature(rustc_attrs)]
#![cfg_attr(any(unix, target_os = "cloudabi", target_os = "redox"), feature(libc))]
Expand Down
1 change: 1 addition & 0 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
#![cfg_attr(not(stage0), feature(nll))]
#![feature(raw_vec_internals)]
#![cfg_attr(test, feature(test))]

Expand Down
2 changes: 2 additions & 0 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
/// assert_eq!(2, 2.max(2));
/// ```
#[stable(feature = "ord_max_min", since = "1.21.0")]
#[inline]
fn max(self, other: Self) -> Self
where Self: Sized {
if other >= self { other } else { self }
Expand All @@ -485,6 +486,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
/// assert_eq!(2, 2.min(2));
/// ```
#[stable(feature = "ord_max_min", since = "1.21.0")]
#[inline]
fn min(self, other: Self) -> Self
where Self: Sized {
if self <= other { self } else { other }
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<T: ?Sized> !Send for *mut T { }
message="the size for values of type `{Self}` cannot be known at compilation time",
label="doesn't have a size known at compile-time",
note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
ch19-04-advanced-types.html#dynamically-sized-types-and-sized>",
ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>",
)]
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
pub trait Sized {
Expand Down
228 changes: 115 additions & 113 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ mod wrapping;
// `Int` + `SignedInt` implemented for signed integers
macro_rules! int_impl {
($SelfT:ty, $ActualT:ident, $UnsignedT:ty, $BITS:expr, $Min:expr, $Max:expr, $Feature:expr,
$EndFeature:expr) => {
$EndFeature:expr, $rot:expr, $rot_op:expr, $rot_result:expr) => {
doc_comment! {
concat!("Returns the smallest value that can be represented by this integer type.

Expand Down Expand Up @@ -334,55 +334,52 @@ $EndFeature, "
}
}

/// Shifts the bits to the left by a specified amount, `n`,
/// wrapping the truncated bits to the end of the resulting integer.
///
/// Please note this isn't the same operation as `<<`!
///
/// # Examples
///
/// Please note that this example is shared between integer types.
/// Which explains why `i64` is used here.
///
/// Basic usage:
///
/// ```
/// let n = 0x0123456789ABCDEFi64;
/// let m = -0x76543210FEDCBA99i64;
///
/// assert_eq!(n.rotate_left(32), m);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_left(self, n: u32) -> Self {
(self as $UnsignedT).rotate_left(n) as Self
}
doc_comment! {
concat!("Shifts the bits to the left by a specified amount, `n`,
wrapping the truncated bits to the end of the resulting integer.

/// Shifts the bits to the right by a specified amount, `n`,
/// wrapping the truncated bits to the beginning of the resulting
/// integer.
///
/// Please note this isn't the same operation as `>>`!
///
/// # Examples
///
/// Please note that this example is shared between integer types.
/// Which explains why `i64` is used here.
///
/// Basic usage:
///
/// ```
/// let n = 0x0123456789ABCDEFi64;
/// let m = -0xFEDCBA987654322i64;
///
/// assert_eq!(n.rotate_right(4), m);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_right(self, n: u32) -> Self {
(self as $UnsignedT).rotate_right(n) as Self
Please note this isn't the same operation as `<<`!

# Examples

Basic usage:

```
let n = ", $rot_op, stringify!($SelfT), ";
let m = ", $rot_result, ";

assert_eq!(n.rotate_left(", $rot, "), m);
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_left(self, n: u32) -> Self {
(self as $UnsignedT).rotate_left(n) as Self
}
}

doc_comment! {
concat!("Shifts the bits to the right by a specified amount, `n`,
wrapping the truncated bits to the beginning of the resulting
integer.

Please note this isn't the same operation as `>>`!

# Examples

Basic usage:

```
let n = ", $rot_result, stringify!($SelfT), ";
let m = ", $rot_op, ";

assert_eq!(n.rotate_right(", $rot, "), m);
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_right(self, n: u32) -> Self {
(self as $UnsignedT).rotate_right(n) as Self
}
}
/// Reverses the byte order of the integer.
///
/// # Examples
Expand Down Expand Up @@ -2012,46 +2009,50 @@ $EndFeature, "

#[lang = "i8"]
impl i8 {
int_impl! { i8, i8, u8, 8, -128, 127, "", "" }
int_impl! { i8, i8, u8, 8, -128, 127, "", "", 2, "-0x7e", "0xa" }
}

#[lang = "i16"]
impl i16 {
int_impl! { i16, i16, u16, 16, -32768, 32767, "", "" }
int_impl! { i16, i16, u16, 16, -32768, 32767, "", "", 4, "-0x5ffd", "0x3a" }
}

#[lang = "i32"]
impl i32 {
int_impl! { i32, i32, u32, 32, -2147483648, 2147483647, "", "" }
int_impl! { i32, i32, u32, 32, -2147483648, 2147483647, "", "", 8, "0x10000b3", "0xb301" }
}

#[lang = "i64"]
impl i64 {
int_impl! { i64, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "" }
int_impl! { i64, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "", 12,
"0xaa00000000006e1", "0x6e10aa" }
}

#[lang = "i128"]
impl i128 {
int_impl! { i128, i128, u128, 128, -170141183460469231731687303715884105728,
170141183460469231731687303715884105727, "", "" }
170141183460469231731687303715884105727, "", "", 16,
"0x13f40000000000000000000000004f76", "0x4f7613f4"
}
}

#[cfg(target_pointer_width = "16")]
#[lang = "isize"]
impl isize {
int_impl! { isize, i16, u16, 16, -32768, 32767, "", "" }
int_impl! { isize, i16, u16, 16, -32768, 32767, "", "", 4, "-0x5ffd", "0x3a" }
}

#[cfg(target_pointer_width = "32")]
#[lang = "isize"]
impl isize {
int_impl! { isize, i32, u32, 32, -2147483648, 2147483647, "", "" }
int_impl! { isize, i32, u32, 32, -2147483648, 2147483647, "", "", 8, "0x10000b3", "0xb301" }
}

#[cfg(target_pointer_width = "64")]
#[lang = "isize"]
impl isize {
int_impl! { isize, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "" }
int_impl! { isize, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "",
12, "0xaa00000000006e1", "0x6e10aa" }
}

// Emits the correct `cttz` call, depending on the size of the type.
Expand All @@ -2069,7 +2070,8 @@ macro_rules! uint_cttz_call {

// `Int` + `UnsignedInt` implemented for unsigned integers
macro_rules! uint_impl {
($SelfT:ty, $ActualT:ty, $BITS:expr, $MaxV:expr, $Feature:expr, $EndFeature:expr) => {
($SelfT:ty, $ActualT:ty, $BITS:expr, $MaxV:expr, $Feature:expr, $EndFeature:expr,
$rot:expr, $rot_op:expr, $rot_result:expr) => {
doc_comment! {
concat!("Returns the smallest value that can be represented by this integer type.

Expand Down Expand Up @@ -2210,57 +2212,55 @@ assert_eq!(n.trailing_zeros(), 3);", $EndFeature, "
}
}

/// Shifts the bits to the left by a specified amount, `n`,
/// wrapping the truncated bits to the end of the resulting integer.
///
/// Please note this isn't the same operation as `<<`!
///
/// # Examples
///
/// Basic usage:
///
/// Please note that this example is shared between integer types.
/// Which explains why `u64` is used here.
///
/// ```
/// let n = 0x0123456789ABCDEFu64;
/// let m = 0x3456789ABCDEF012u64;
///
/// assert_eq!(n.rotate_left(12), m);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_left(self, n: u32) -> Self {
// Protect against undefined behaviour for over-long bit shifts
let n = n % $BITS;
(self << n) | (self >> (($BITS - n) % $BITS))
doc_comment! {
concat!("Shifts the bits to the left by a specified amount, `n`,
wrapping the truncated bits to the end of the resulting integer.

Please note this isn't the same operation as `<<`!

# Examples

Basic usage:

```
let n = ", $rot_op, stringify!($SelfT), ";
let m = ", $rot_result, ";

assert_eq!(n.rotate_left(", $rot, "), m);
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_left(self, n: u32) -> Self {
// Protect against undefined behaviour for over-long bit shifts
let n = n % $BITS;
(self << n) | (self >> (($BITS - n) % $BITS))
}
}

/// Shifts the bits to the right by a specified amount, `n`,
/// wrapping the truncated bits to the beginning of the resulting
/// integer.
///
/// Please note this isn't the same operation as `>>`!
///
/// # Examples
///
/// Basic usage:
///
/// Please note that this example is shared between integer types.
/// Which explains why `u64` is used here.
///
/// ```
/// let n = 0x0123456789ABCDEFu64;
/// let m = 0xDEF0123456789ABCu64;
///
/// assert_eq!(n.rotate_right(12), m);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_right(self, n: u32) -> Self {
// Protect against undefined behaviour for over-long bit shifts
let n = n % $BITS;
(self >> n) | (self << (($BITS - n) % $BITS))
doc_comment! {
concat!("Shifts the bits to the right by a specified amount, `n`,
wrapping the truncated bits to the beginning of the resulting
integer.

Please note this isn't the same operation as `>>`!

# Examples

Basic usage:

```
let n = ", $rot_result, stringify!($SelfT), ";
let m = ", $rot_op, ";

assert_eq!(n.rotate_right(", $rot, "), m);
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rotate_right(self, n: u32) -> Self {
// Protect against undefined behaviour for over-long bit shifts
let n = n % $BITS;
(self >> n) | (self << (($BITS - n) % $BITS))
}
}

/// Reverses the byte order of the integer.
Expand Down Expand Up @@ -3621,7 +3621,7 @@ $EndFeature, "

#[lang = "u8"]
impl u8 {
uint_impl! { u8, u8, 8, 255, "", "" }
uint_impl! { u8, u8, 8, 255, "", "", 2, "0x82", "0xa" }


/// Checks if the value is within the ASCII range.
Expand Down Expand Up @@ -4147,39 +4147,41 @@ impl u8 {

#[lang = "u16"]
impl u16 {
uint_impl! { u16, u16, 16, 65535, "", "" }
uint_impl! { u16, u16, 16, 65535, "", "", 4, "0xa003", "0x3a" }
}

#[lang = "u32"]
impl u32 {
uint_impl! { u32, u32, 32, 4294967295, "", "" }
uint_impl! { u32, u32, 32, 4294967295, "", "", 8, "0x10000b3", "0xb301" }
}

#[lang = "u64"]
impl u64 {
uint_impl! { u64, u64, 64, 18446744073709551615, "", "" }
uint_impl! { u64, u64, 64, 18446744073709551615, "", "", 12, "0xaa00000000006e1", "0x6e10aa" }
}

#[lang = "u128"]
impl u128 {
uint_impl! { u128, u128, 128, 340282366920938463463374607431768211455, "", "" }
uint_impl! { u128, u128, 128, 340282366920938463463374607431768211455, "", "", 16,
"0x13f40000000000000000000000004f76", "0x4f7613f4" }
}

#[cfg(target_pointer_width = "16")]
#[lang = "usize"]
impl usize {
uint_impl! { usize, u16, 16, 65536, "", "" }
uint_impl! { usize, u16, 16, 65536, "", "", 4, "0xa003", "0x3a" }
}
#[cfg(target_pointer_width = "32")]
#[lang = "usize"]
impl usize {
uint_impl! { usize, u32, 32, 4294967295, "", "" }
uint_impl! { usize, u32, 32, 4294967295, "", "", 8, "0x10000b3", "0xb301" }
}

#[cfg(target_pointer_width = "64")]
#[lang = "usize"]
impl usize {
uint_impl! { usize, u64, 64, 18446744073709551615, "", "" }
uint_impl! { usize, u64, 64, 18446744073709551615, "", "", 12, "0xaa00000000006e1",
"0x6e10aa" }
}

/// A classification of floating point numbers.
Expand Down
Loading