Skip to content

Rollup of 9 pull requests #77301

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

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
01f65af
diag: improve closure/generic parameter mismatch
davidtwco Sep 14, 2020
8aae1ee
Move cell exterior test into library unit tests
poliorcetics Sep 7, 2020
f69c5aa
Move more tests using Cell to unit tests
poliorcetics Sep 7, 2020
af44a2a
move 'cell does not clone' test
poliorcetics Sep 8, 2020
fc152cd
move 'test zip ...' tests
poliorcetics Sep 8, 2020
85b2d9b
fmt
poliorcetics Sep 8, 2020
949c966
move format! interface tests
poliorcetics Sep 8, 2020
ed52c7b
Move deref-lval test
poliorcetics Sep 8, 2020
ac39deb
Move panic safety traits tests
poliorcetics Sep 10, 2020
8904921
Move array cycle test
poliorcetics Sep 10, 2020
275eed7
Move vec-slice-drop test
poliorcetics Sep 10, 2020
6bc0357
Move vec-cycle test
poliorcetics Sep 10, 2020
f6a4189
Move vec-cycle-wrapped test
poliorcetics Sep 11, 2020
5be843f
Move format-ref-cell test
poliorcetics Sep 13, 2020
1994cee
Add alias for iterator fold
pickfire Sep 25, 2020
ea0065a
Reposition iterator doc alias reduce before inline
pickfire Sep 25, 2020
a61b963
review: fix nits and move panic safety tests to the correct place
poliorcetics Sep 25, 2020
71bc62b
Add option to pass a custom codegen backend from a driver
bjorn3 Sep 8, 2020
8437d7b
Resolve `crate` properly across crates
jyn514 Sep 27, 2020
4065846
Use relative links instead of intra-doc links
jyn514 Sep 27, 2020
1ff1431
Add a feature gate for basic function pointer use in `const fn`
ecstatic-morse Sep 24, 2020
3cbd17f
Remove `rustc_allow_const_fn_ptr`
ecstatic-morse Sep 24, 2020
e2622b9
Update tests with new feature gate
ecstatic-morse Sep 24, 2020
54d3329
Bless tests
ecstatic-morse Sep 24, 2020
368502c
Mark `min_const_fn_fn_ptr` test as gate test
ecstatic-morse Sep 24, 2020
807260b
Remove feature gate test for `rustc_allow_const_fn_ptr`
ecstatic-morse Sep 27, 2020
e3319e7
liveness: Move body_owner field from IrMaps to Liveness
tmiasko Sep 27, 2020
e0db21d
liveness: Use upvars instead of FnKind to check for closures
tmiasko Sep 27, 2020
b629ffd
liveness: Use visit_param to add variables corresponding to params
tmiasko Sep 27, 2020
536b51a
liveness: Store upvars_mentioned inside Liveness struct
tmiasko Sep 27, 2020
33dde94
liveness: Inline visitor implementation for IrMaps
tmiasko Sep 27, 2020
063d5e9
liveness: Test interaction with automatically_derived attribute
tmiasko Sep 27, 2020
c22d896
Change `AllocRef::by_ref` to take `&self` instead of `&mut self`
TimDiekmann Sep 28, 2020
d477201
Prefer asm! in std - all in sgx module
tesuji Sep 15, 2020
4bb2369
Rollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matklad
Dylan-DPC Sep 28, 2020
ea274a3
Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
Dylan-DPC Sep 28, 2020
62ab064
Rollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank
Dylan-DPC Sep 28, 2020
a823d7a
Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk
Dylan-DPC Sep 28, 2020
62f7d56
Rollup merge of #77194 - pickfire:patch-7, r=withoutboats
Dylan-DPC Sep 28, 2020
275096e
Rollup merge of #77253 - jyn514:crate-link, r=Manishearth
Dylan-DPC Sep 28, 2020
c789c5e
Rollup merge of #77274 - tmiasko:liveness-cnd, r=lcnr
Dylan-DPC Sep 28, 2020
a063e5e
Rollup merge of #77289 - TimDiekmann:alloc-ref-by-ref, r=Amanieu
Dylan-DPC Sep 28, 2020
f150083
Rollup merge of #77292 - lzutao:std_asm, r=Amanieu
Dylan-DPC Sep 28, 2020
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
Prev Previous commit
Next Next commit
review: fix nits and move panic safety tests to the correct place
  • Loading branch information
poliorcetics committed Sep 25, 2020
commit a61b9638bbbb48f9c2fde0ccbbcf03e64494ea0f
3 changes: 1 addition & 2 deletions library/alloc/tests/boxed.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::cell::Cell;
use std::mem::MaybeUninit;
use std::ptr::NonNull;

Expand Down Expand Up @@ -52,8 +53,6 @@ fn box_clone_from_ptr_stability() {

#[test]
fn box_deref_lval() {
use std::cell::Cell;

let x = Box::new(Cell::new(5));
x.set(1000);
assert_eq!(x.get(), 1000);
Expand Down
21 changes: 10 additions & 11 deletions library/alloc/tests/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![deny(warnings)]
#![allow(unused_must_use)]

use std::cell::RefCell;
use std::fmt::{self, Write};
Expand Down Expand Up @@ -241,15 +240,15 @@ fn test_format_macro_interface() {
#[test]
fn test_write() {
let mut buf = String::new();
write!(&mut buf, "{}", 3);
let _ = write!(&mut buf, "{}", 3);
{
let w = &mut buf;
write!(w, "{foo}", foo = 4);
write!(w, "{}", "hello");
writeln!(w, "{}", "line");
writeln!(w, "{foo}", foo = "bar");
w.write_char('☃');
w.write_str("str");
let _ = write!(w, "{foo}", foo = 4);
let _ = write!(w, "{}", "hello");
let _ = writeln!(w, "{}", "line");
let _ = writeln!(w, "{foo}", foo = "bar");
let _ = w.write_char('☃');
let _ = w.write_str("str");
}

t!(buf, "34helloline\nbar\n☃str");
Expand All @@ -273,9 +272,9 @@ fn test_format_args() {
let mut buf = String::new();
{
let w = &mut buf;
write!(w, "{}", format_args!("{}", 1));
write!(w, "{}", format_args!("test"));
write!(w, "{}", format_args!("{test}", test = 3));
let _ = write!(w, "{}", format_args!("{}", 1));
let _ = write!(w, "{}", format_args!("test"));
let _ = write!(w, "{}", format_args!("{test}", test = 3));
}
let s = buf;
t!(s, "1test3");
Expand Down
3 changes: 2 additions & 1 deletion library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2238,5 +2238,6 @@ impl<T: ?Sized + Debug> Debug for UnsafeCell<T> {
}
}

// If you expected tests to be here, look instead at the ui/ifmt.rs test,
// If you expected tests to be here, look instead at the core/tests/fmt.rs file,
// it's a lot easier than creating all of the rt::Piece structures here.
// There are also tests in the alloc crate, for those that need allocations.
1 change: 0 additions & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ mod nonzero;
mod num;
mod ops;
mod option;
mod panic_safe;
mod pattern;
mod ptr;
mod result;
Expand Down
3 changes: 1 addition & 2 deletions library/core/tests/option.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::cell::Cell;
use core::clone::Clone;
use core::mem;
use core::ops::DerefMut;
Expand Down Expand Up @@ -375,8 +376,6 @@ fn option_const() {

#[test]
fn test_unwrap_drop() {
use std::cell::Cell;

struct Dtor<'a> {
x: &'a Cell<isize>,
}
Expand Down
3 changes: 1 addition & 2 deletions library/core/tests/slice.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::cell::Cell;
use core::result::Result::{Err, Ok};

#[test]
Expand Down Expand Up @@ -1983,8 +1984,6 @@ fn test_is_sorted() {

#[test]
fn test_slice_run_destructors() {
use core::cell::Cell;

// Make sure that destructors get run on slice literals
struct Foo<'a> {
x: &'a Cell<isize>,
Expand Down
3 changes: 3 additions & 0 deletions library/std/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,6 @@ pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
pub fn resume_unwind(payload: Box<dyn Any + Send>) -> ! {
panicking::rust_panic_without_hook(payload)
}

#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![allow(dead_code)]

use std::cell::RefCell;
use std::panic::{AssertUnwindSafe, UnwindSafe};
use std::rc::Rc;
use std::sync::{Arc, Mutex, RwLock};
use crate::cell::RefCell;
use crate::panic::{AssertUnwindSafe, UnwindSafe};
use crate::rc::Rc;
use crate::sync::{Arc, Mutex, RwLock};

struct Foo {
a: i32,
Expand All @@ -12,7 +12,7 @@ struct Foo {
fn assert<T: UnwindSafe + ?Sized>() {}

#[test]
fn test_panic_safety_traits() {
fn panic_safety_traits() {
assert::<i32>();
assert::<&i32>();
assert::<*mut i32>();
Expand Down