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 8 pull requests #64354

Merged
merged 17 commits into from
Sep 10, 2019
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
39260d9
make abs, wrapping_abs, and overflowing_abs const functions
tspiteri Aug 21, 2019
adee559
test const abs, wrapping_abs, and overflowing_abs
tspiteri Aug 21, 2019
925a766
Add Yaah to clippy toolstain notification list
yaahc Aug 29, 2019
625a9d6
lldb: avoid mixing "Hit breakpoint" message with other output.
eddyb Sep 9, 2019
6eb7b69
Clarify E0507 to note Fn/FnMut relationship to borrowing
Mark-Simulacrum Sep 10, 2019
2f6e73c
test/c-variadic: Fix patterns on powerpc64
smaeul Sep 3, 2019
79263af
Changed instant is earlier to instant is later
hman523 Sep 10, 2019
63fad69
lowering: extend temporary lifetimes around await
davidtwco Sep 8, 2019
1e7faef
rustc_mir: buffer -Zdump-mir output instead of pestering the kernel c…
eddyb Sep 10, 2019
13726cc
Rollup merge of #63786 - tspiteri:const-abs, r=alexcrichton
Centril Sep 10, 2019
9eecb4a
Rollup merge of #63989 - yaahc:master, r=Manishearth
Centril Sep 10, 2019
347b5c8
Rollup merge of #64256 - smaeul:patch/powerpc64-tests, r=alexcrichton
Centril Sep 10, 2019
a1755df
Rollup merge of #64292 - davidtwco:issue-63832-await-temporary-lifeti…
Centril Sep 10, 2019
ce3e824
Rollup merge of #64311 - eddyb:lldb-python3, r=michaelwoerister
Centril Sep 10, 2019
35c24b4
Rollup merge of #64330 - Mark-Simulacrum:clarify-E0507, r=GuillaumeGomez
Centril Sep 10, 2019
26a4af9
Rollup merge of #64331 - hman523:fix-64322, r=varkor
Centril Sep 10, 2019
8d2ef19
Rollup merge of #64344 - eddyb:mir-opt-stop-shouting-at-the-kernel, r…
Centril Sep 10, 2019
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
5 changes: 4 additions & 1 deletion src/etc/lldb_batchmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def normalize_whitespace(s):

def breakpoint_callback(frame, bp_loc, dict):
"""This callback is registered with every breakpoint and makes sure that the
frame containing the breakpoint location is selected"""
frame containing the breakpoint location is selected """

# HACK(eddyb) print a newline to avoid continuing an unfinished line.
print("")
print("Hit breakpoint " + str(bp_loc))

# Select the frame and the thread containing it
Expand Down
30 changes: 9 additions & 21 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,12 +1401,8 @@ $EndFeature, "
```"),
#[stable(feature = "no_panic_abs", since = "1.13.0")]
#[inline]
pub fn wrapping_abs(self) -> Self {
if self.is_negative() {
self.wrapping_neg()
} else {
self
}
pub const fn wrapping_abs(self) -> Self {
(self ^ (self >> ($BITS - 1))).wrapping_sub(self >> ($BITS - 1))
}
}

Expand Down Expand Up @@ -1764,12 +1760,8 @@ $EndFeature, "
```"),
#[stable(feature = "no_panic_abs", since = "1.13.0")]
#[inline]
pub fn overflowing_abs(self) -> (Self, bool) {
if self.is_negative() {
self.overflowing_neg()
} else {
(self, false)
}
pub const fn overflowing_abs(self) -> (Self, bool) {
(self ^ (self >> ($BITS - 1))).overflowing_sub(self >> ($BITS - 1))
}
}

Expand Down Expand Up @@ -1973,15 +1965,11 @@ $EndFeature, "
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[rustc_inherit_overflow_checks]
pub fn abs(self) -> Self {
if self.is_negative() {
// Note that the #[inline] above means that the overflow
// semantics of this negation depend on the crate we're being
// inlined into.
-self
} else {
self
}
pub const fn abs(self) -> Self {
// Note that the #[inline] above means that the overflow
// semantics of the subtraction depend on the crate we're being
// inlined into.
(self ^ (self >> ($BITS - 1))) - (self >> ($BITS - 1))
}
}

Expand Down
35 changes: 15 additions & 20 deletions src/librustc/hir/lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,13 @@ impl LoweringContext<'_> {

/// Desugar `<expr>.await` into:
/// ```rust
/// {
/// let mut pinned = <expr>;
/// loop {
/// match <expr> {
/// mut pinned => loop {
/// match ::std::future::poll_with_tls_context(unsafe {
/// ::std::pin::Pin::new_unchecked(&mut pinned)
/// <::std::pin::Pin>::new_unchecked(&mut pinned)
/// }) {
/// ::std::task::Poll::Ready(result) => break result,
/// ::std::task::Poll::Pending => {},
/// ::std::task::Poll::Pending => {}
/// }
/// yield ();
/// }
Expand Down Expand Up @@ -549,21 +548,12 @@ impl LoweringContext<'_> {
self.allow_gen_future.clone(),
);

// let mut pinned = <expr>;
let expr = P(self.lower_expr(expr));
let pinned_ident = Ident::with_dummy_span(sym::pinned);
let (pinned_pat, pinned_pat_hid) = self.pat_ident_binding_mode(
span,
pinned_ident,
hir::BindingAnnotation::Mutable,
);
let pinned_let = self.stmt_let_pat(
ThinVec::new(),
span,
Some(expr),
pinned_pat,
hir::LocalSource::AwaitDesugar,
);

// ::std::future::poll_with_tls_context(unsafe {
// ::std::pin::Pin::new_unchecked(&mut pinned)
Expand Down Expand Up @@ -621,7 +611,7 @@ impl LoweringContext<'_> {
self.arm(hir_vec![pending_pat], empty_block)
};

let match_stmt = {
let inner_match_stmt = {
let match_expr = self.expr_match(
span,
poll_expr,
Expand All @@ -643,10 +633,11 @@ impl LoweringContext<'_> {

let loop_block = P(self.block_all(
span,
hir_vec![match_stmt, yield_stmt],
hir_vec![inner_match_stmt, yield_stmt],
None,
));

// loop { .. }
let loop_expr = P(hir::Expr {
hir_id: loop_hir_id,
node: hir::ExprKind::Loop(
Expand All @@ -658,10 +649,14 @@ impl LoweringContext<'_> {
attrs: ThinVec::new(),
});

hir::ExprKind::Block(
P(self.block_all(span, hir_vec![pinned_let], Some(loop_expr))),
None,
)
// mut pinned => loop { ... }
let pinned_arm = self.arm(hir_vec![pinned_pat], loop_expr);

// match <expr> {
// mut pinned => loop { .. }
// }
let expr = P(self.lower_expr(expr));
hir::ExprKind::Match(expr, hir_vec![pinned_arm], hir::MatchSource::AwaitDesugar)
}

fn lower_expr_closure(
Expand Down
9 changes: 8 additions & 1 deletion src/librustc_mir/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,14 @@ fn print_fancy_ref(fancy_ref: &FancyNum){
"##,

E0507: r##"
You tried to move out of a value which was borrowed. Erroneous code example:
You tried to move out of a value which was borrowed.

This can also happen when using a type implementing `Fn` or `FnMut`, as neither
allows moving out of them (they usually represent closures which can be called
more than once). Much of the text following applies equally well to non-`FnOnce`
closure bodies.

Erroneous code example:

```compile_fail,E0507
use std::cell::RefCell;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ pub(crate) fn create_dump_file(
pass_name: &str,
disambiguator: &dyn Display,
source: MirSource<'tcx>,
) -> io::Result<fs::File> {
) -> io::Result<io::BufWriter<fs::File>> {
let file_path = dump_path(tcx, extension, pass_num, pass_name, disambiguator, source);
if let Some(parent) = file_path.parent() {
fs::create_dir_all(parent)?;
}
fs::File::create(&file_path)
Ok(io::BufWriter::new(fs::File::create(&file_path)?))
}

/// Write out a human-readable textual representation for the given MIR.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Instant {
}

/// Returns the amount of time elapsed from another instant to this one,
/// or None if that instant is earlier than this one.
/// or None if that instant is later than this one.
///
/// # Examples
///
Expand Down
23 changes: 12 additions & 11 deletions src/test/codegen/c-variadic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength

#![crate_type = "lib"]
#![feature(c_variadic)]
Expand All @@ -14,13 +15,13 @@ extern "C" {
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_0() {
// Ensure that we correctly call foreign C-variadic functions.
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0)
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM:i32( signext)?]] 0)
foreign_c_variadic_0(0);
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42)
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42)
foreign_c_variadic_0(0, 42i32);
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024)
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024)
foreign_c_variadic_0(0, 42i32, 1024i32);
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0)
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024, [[PARAM]] 0)
foreign_c_variadic_0(0, 42i32, 1024i32, 0i32);
}

Expand All @@ -34,18 +35,18 @@ pub unsafe extern "C" fn use_foreign_c_variadic_1_0(ap: VaList) {

#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_1(ap: VaList) {
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 42)
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 42)
foreign_c_variadic_1(ap, 42i32);
}
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_2(ap: VaList) {
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42)
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 2, [[PARAM]] 42)
foreign_c_variadic_1(ap, 2i32, 42i32);
}

#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_3(ap: VaList) {
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42, i32 0)
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 2, [[PARAM]] 42, [[PARAM]] 0)
foreign_c_variadic_1(ap, 2i32, 42i32, 0i32);
}

Expand All @@ -64,12 +65,12 @@ pub unsafe extern "C" fn c_variadic(n: i32, mut ap: ...) -> i32 {
// Ensure that we generate the correct `call` signature when calling a Rust
// defined C-variadic.
pub unsafe fn test_c_variadic_call() {
// CHECK: call i32 (i32, ...) @c_variadic(i32 0)
// CHECK: call [[RET:(signext )?i32]] (i32, ...) @c_variadic([[PARAM]] 0)
c_variadic(0);
// CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42)
// CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42)
c_variadic(0, 42i32);
// CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42, i32 1024)
// CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024)
c_variadic(0, 42i32, 1024i32);
// CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42, i32 1024, i32 0)
// CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024, [[PARAM]] 0)
c_variadic(0, 42i32, 1024i32, 0i32);
}
24 changes: 12 additions & 12 deletions src/test/ui/async-await/async-fn-nonsend.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ LL | assert_send(local_dropped_before_await());
|
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `impl std::fmt::Debug`
= note: required because it appears within the type `{impl std::fmt::Debug, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:21:39: 26:2 {impl std::fmt::Debug, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:21:39: 26:2 {impl std::fmt::Debug, impl std::future::Future, ()}]>`
= note: required because it appears within the type `{impl std::fmt::Debug, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:21:39: 26:2 {impl std::fmt::Debug, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:21:39: 26:2 {impl std::fmt::Debug, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]>`
= note: required because it appears within the type `impl std::future::Future`
= note: required because it appears within the type `impl std::future::Future`

Expand All @@ -26,9 +26,9 @@ LL | assert_send(non_send_temporary_in_match());
|
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `impl std::fmt::Debug`
= note: required because it appears within the type `{fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:28:40: 37:2 {fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:28:40: 37:2 {fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, impl std::future::Future, ()}]>`
= note: required because it appears within the type `{fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:28:40: 37:2 {fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:28:40: 37:2 {fn(impl std::fmt::Debug) -> std::option::Option<impl std::fmt::Debug> {std::option::Option::<impl std::fmt::Debug>::Some}, fn() -> impl std::fmt::Debug {non_send}, impl std::fmt::Debug, std::option::Option<impl std::fmt::Debug>, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]>`
= note: required because it appears within the type `impl std::future::Future`
= note: required because it appears within the type `impl std::future::Future`

Expand All @@ -45,9 +45,9 @@ LL | assert_send(non_sync_with_method_call());
= note: required because of the requirements on the impl of `std::marker::Send` for `&mut dyn std::fmt::Write`
= note: required because it appears within the type `std::fmt::Formatter<'_>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&mut std::fmt::Formatter<'_>`
= note: required because it appears within the type `for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}]>`
= note: required because it appears within the type `for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]>`
= note: required because it appears within the type `impl std::future::Future`
= note: required because it appears within the type `impl std::future::Future`

Expand All @@ -68,9 +68,9 @@ LL | assert_send(non_sync_with_method_call());
= note: required because of the requirements on the impl of `std::marker::Send` for `std::slice::Iter<'_, std::fmt::ArgumentV1<'_>>`
= note: required because it appears within the type `std::fmt::Formatter<'_>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&mut std::fmt::Formatter<'_>`
= note: required because it appears within the type `for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, impl std::future::Future, ()}]>`
= note: required because it appears within the type `for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}`
= note: required because it appears within the type `[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@$DIR/async-fn-nonsend.rs:39:38: 45:2 for<'r, 's> {&'r mut std::fmt::Formatter<'s>, bool, fn() -> impl std::future::Future {fut}, impl std::future::Future, ()}]>`
= note: required because it appears within the type `impl std::future::Future`
= note: required because it appears within the type `impl std::future::Future`

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// check-pass
// edition:2018

struct Test(String);

impl Test {
async fn borrow_async(&self) {}

fn with(&mut self, s: &str) -> &mut Self {
self.0 = s.into();
self
}
}

async fn test() {
Test("".to_string()).with("123").borrow_async().await;
}

fn main() { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// check-pass
// edition:2018

async fn foo(x: &[Vec<u32>]) -> u32 {
0
}

async fn bar() {
foo(&[vec![123]]).await;
}

fn main() { }
8 changes: 8 additions & 0 deletions src/test/ui/consts/const-int-overflowing-rpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132);
const NEG_A: (u32, bool) = 0u32.overflowing_neg();
const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg();

const ABS_POS: (i32, bool) = 10i32.overflowing_abs();
const ABS_NEG: (i32, bool) = (-10i32).overflowing_abs();
const ABS_MIN: (i32, bool) = i32::min_value().overflowing_abs();

fn main() {
assert_eq!(ADD_A, (7, false));
assert_eq!(ADD_B, (0, true));
Expand All @@ -36,4 +40,8 @@ fn main() {

assert_eq!(NEG_A, (0, false));
assert_eq!(NEG_B, (1, true));

assert_eq!(ABS_POS, (10, false));
assert_eq!(ABS_NEG, (10, false));
assert_eq!(ABS_MIN, (i32::min_value(), true));
}
6 changes: 6 additions & 0 deletions src/test/ui/consts/const-int-sign-rpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const SIGNUM_POS: i32 = 10i32.signum();
const SIGNUM_NIL: i32 = 0i32.signum();
const SIGNUM_NEG: i32 = (-42i32).signum();

const ABS_A: i32 = 10i32.abs();
const ABS_B: i32 = (-10i32).abs();

fn main() {
assert!(NEGATIVE_A);
assert!(!NEGATIVE_B);
Expand All @@ -20,4 +23,7 @@ fn main() {
assert_eq!(SIGNUM_POS, 1);
assert_eq!(SIGNUM_NIL, 0);
assert_eq!(SIGNUM_NEG, -1);

assert_eq!(ABS_A, 10);
assert_eq!(ABS_B, 10);
}
8 changes: 8 additions & 0 deletions src/test/ui/consts/const-int-wrapping-rpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const SHR_B: u32 = 128u32.wrapping_shr(128);
const NEG_A: u32 = 5u32.wrapping_neg();
const NEG_B: u32 = 1234567890u32.wrapping_neg();

const ABS_POS: i32 = 10i32.wrapping_abs();
const ABS_NEG: i32 = (-10i32).wrapping_abs();
const ABS_MIN: i32 = i32::min_value().wrapping_abs();

fn main() {
assert_eq!(ADD_A, 255);
assert_eq!(ADD_B, 199);
Expand All @@ -36,4 +40,8 @@ fn main() {

assert_eq!(NEG_A, 4294967291);
assert_eq!(NEG_B, 3060399406);

assert_eq!(ABS_POS, 10);
assert_eq!(ABS_NEG, 10);
assert_eq!(ABS_MIN, i32::min_value());
}
2 changes: 1 addition & 1 deletion src/tools/publish_toolstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# List of people to ping when the status of a tool or a book changed.
MAINTAINERS = {
'miri': '@oli-obk @RalfJung @eddyb',
'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995',
'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995 @yaahc',
'rls': '@Xanewok',
'rustfmt': '@topecongiro',
'book': '@carols10cents @steveklabnik',
Expand Down