Skip to content

Commit 3b24c70

Browse files
committed
Auto merge of #39384 - wesleywiser:fix_fixmes, r=alexcrichton
Resolve a bunch of fixmes Resolves 56 fixmes in test code related to `box` syntax.
2 parents 6abe648 + 94687aa commit 3b24c70

File tree

65 files changed

+16
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+16
-108
lines changed

src/libcoretest/hash/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ fn test_writer_hasher() {
6666
assert_eq!(hash(& s), 97 + 0xFF);
6767
let cs: &[u8] = &[1, 2, 3];
6868
assert_eq!(hash(& cs), 9);
69-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
7069
let cs: Box<[u8]> = Box::new([1, 2, 3]);
7170
assert_eq!(hash(& cs), 9);
7271

src/libcoretest/iter.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ fn test_collect() {
700700

701701
#[test]
702702
fn test_all() {
703-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
704703
let v: Box<[isize]> = Box::new([1, 2, 3, 4, 5]);
705704
assert!(v.iter().all(|&x| x < 10));
706705
assert!(!v.iter().all(|&x| x % 2 == 0));
@@ -710,7 +709,6 @@ fn test_all() {
710709

711710
#[test]
712711
fn test_any() {
713-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
714712
let v: Box<[isize]> = Box::new([1, 2, 3, 4, 5]);
715713
assert!(v.iter().any(|&x| x < 10));
716714
assert!(v.iter().any(|&x| x % 2 == 0));

src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ pub fn plugin_registrar(reg: &mut Registry) {
3636
reg.register_macro("identity", expand_identity);
3737
reg.register_syntax_extension(
3838
Symbol::intern("into_multi_foo"),
39-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4039
MultiModifier(Box::new(expand_into_foo_multi)));
4140
reg.register_syntax_extension(
4241
Symbol::intern("duplicate"),
43-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4442
MultiDecorator(Box::new(expand_duplicate)));
4543
}
4644

src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use std::collections::HashMap;
1717
fn main() {
1818
let tmp: Box<_>;
1919
let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
20-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2120
buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough
2221

2322
// but it is ok if we use a temporary

src/test/compile-fail/cross-borrow-trait.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ trait Trait { fn foo(&self) {} }
1616
impl Trait for Foo {}
1717

1818
pub fn main() {
19-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2019
let x: Box<Trait> = Box::new(Foo);
2120
let _y: &Trait = x; //~ ERROR mismatched types
2221
//~| expected type `&Trait`

src/test/compile-fail/dst-bad-assign-2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ impl ToBar for Bar1 {
4141
pub fn main() {
4242
// Assignment.
4343
let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
44-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4544
let z: Box<ToBar> = Box::new(Bar1 {f: 36});
4645
f5.ptr = *z;
4746
//~^ ERROR `ToBar: std::marker::Sized` is not satisfied

src/test/compile-fail/dst-bad-assign.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ impl ToBar for Bar1 {
4141
pub fn main() {
4242
// Assignment.
4343
let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
44-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4544
let z: Box<ToBar> = Box::new(Bar1 {f: 36});
4645
f5.ptr = Bar1 {f: 36};
4746
//~^ ERROR mismatched types

src/test/compile-fail/issue-10291.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
fn test<'x>(x: &'x isize) {
12-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1312
drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
1413
x //~ ERROR E0312
1514
}));

src/test/compile-fail/issue-11515.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ struct Test {
1515
}
1616

1717
fn main() {
18-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1918
let closure: Box<Fn()+'static> = Box::new(|| ());
2019
let test = box Test { func: closure }; //~ ERROR mismatched types
2120
}

src/test/compile-fail/issue-17441.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ fn main() {
1313
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
1414
//~^^ HELP consider using an implicit coercion to `&[usize]` instead
1515

16-
// FIXME (#22405): Replace `std::boxed::Box::new` with `box` here when/if possible.
1716
let _bar = Box::new(1_usize) as std::fmt::Debug;
1817
//~^ ERROR cast to unsized type: `std::boxed::Box<usize>` as `std::fmt::Debug`
1918
//~^^ HELP try casting to a `Box` instead

0 commit comments

Comments
 (0)