Skip to content

Commit 94687aa

Browse files
committed
Removes FIXMEs related to #22405
1 parent 8e9e055 commit 94687aa

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

-1
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

-2
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

-2
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

-1
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

-1
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

-1
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

-1
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

-1
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

-1
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

-1
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

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

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// and rejected.
1313

1414
fn main() {
15-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1615
(|| Box::new(*(&[0][..])))();
1716
//~^ ERROR `[{integer}]: std::marker::Sized` is not satisfied
1817
}

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

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
use std::cell::RefCell;
1212

13-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
14-
1513
fn main() {
1614
let mut y = 1;
1715
let c = RefCell::new(vec![]);

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

-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ fn main() {
2525
let _woohoo = (&my_struct).priv_field;
2626
//~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
2727

28-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2928
let _woohoo = (Box::new(my_struct)).priv_field;
3029
//~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
3130

3231
(&my_struct).happyfun(); //~ ERROR method `happyfun` is private
3332

34-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
3533
(Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private
3634
let nope = my_struct.priv_field;
3735
//~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private

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

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
fn id<T>(t: T) -> T { t }
1414

1515
fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
16-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1716
id(Box::new(|| *v))
1817
//~^ ERROR E0373
1918
//~| NOTE `v` is borrowed here

src/test/compile-fail/map-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ impl<K, V> Map<K, V> for HashMap<K, V> {}
2424
fn main() {
2525
let x: Box<HashMap<isize, isize>> = box HashMap::new();
2626
let x: Box<Map<isize, isize>> = x;
27-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2827
let y: Box<Map<usize, isize>> = Box::new(x);
2928
//~^ ERROR `std::boxed::Box<Map<isize, isize>>: Map<usize, isize>` is not satisfied
3029
}

src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ fn innocent_looking_victim() {
3838
}
3939

4040
fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) {
41-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4241
let mut r = R {c: Box::new(f)};
4342
f(&mut r, false) //~ ERROR use of moved value
4443
}

src/test/compile-fail/region-object-lifetime-in-coercion.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
trait Foo {}
1515
impl<'a> Foo for &'a [u8] {}
1616

17-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
18-
1917
fn a(v: &[u8]) -> Box<Foo + 'static> {
2018
let x: Box<Foo + 'static> = Box::new(v);
2119
//~^ ERROR cannot infer an appropriate lifetime due to conflicting

src/test/compile-fail/regions-close-associated-type-into-object.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#![feature(box_syntax)]
1212

13-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
14-
1513
trait X {}
1614

1715
trait Iter {

src/test/compile-fail/regions-close-param-into-object.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
12-
1311
trait X { fn foo(&self) {} }
1412

1513
fn p1<T>(v: T) -> Box<X+'static>

src/test/compile-fail/regions-nested-fns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
12-
1311
fn ignore<T>(t: T) {}
1412

1513
fn nested<'x>(x: &'x isize) {

src/test/compile-fail/regions-proc-bound-capture.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
12-
1311
fn borrowed_proc<'a>(x: &'a isize) -> Box<FnMut()->(isize) + 'a> {
1412
// This is legal, because the region bound on `proc`
1513
// states that it captures `x`.

src/test/compile-fail/regions-steal-closure.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn box_it<'r>(x: Box<FnMut() + 'r>) -> closure_box<'r> {
2121
fn main() {
2222
let mut cl_box = {
2323
let mut i = 3;
24-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2524
box_it(Box::new(|| i += 1)) //~ ERROR `i` does not live long enough
2625
};
2726
cl_box.cl.call_mut(());

src/test/compile-fail/trait-coercion-generic-bad.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ impl Trait<&'static str> for Struct {
2323
}
2424

2525
fn main() {
26-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2726
let s: Box<Trait<isize>> = Box::new(Struct { person: "Fred" });
2827
//~^ ERROR `Struct: Trait<isize>` is not satisfied
2928
s.f(1);

src/test/compile-fail/trait-coercion-generic-regions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ impl Trait<&'static str> for Struct {
2525
fn main() {
2626
let person = "Fred".to_string();
2727
let person: &str = &person; //~ ERROR `person` does not live long enough
28-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2928
let s: Box<Trait<&'static str>> = Box::new(Struct { person: person });
3029
}

src/test/compile-fail/unboxed-closure-illegal-move.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ fn to_fn<A,F:Fn<A>>(f: F) -> F { f }
1818
fn to_fn_mut<A,F:FnMut<A>>(f: F) -> F { f }
1919
fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
2020

21-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
22-
2321
fn main() {
2422
// By-ref cases
2523
{

src/test/compile-fail/unique-pinned-nocopy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ impl Drop for r {
1818
}
1919

2020
fn main() {
21-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2221
let i = Box::new(r { b: true });
2322
let _j = i.clone(); //~ ERROR no method named `clone` found
2423
println!("{:?}", i);

src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs

-3
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ pub fn plugin_registrar(reg: &mut Registry) {
3838
reg.register_macro("identity", expand_identity);
3939
reg.register_syntax_extension(
4040
Symbol::intern("into_multi_foo"),
41-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4241
MultiModifier(Box::new(expand_into_foo_multi)));
4342
reg.register_syntax_extension(
4443
Symbol::intern("duplicate"),
45-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4644
MultiDecorator(Box::new(expand_duplicate)));
4745
reg.register_syntax_extension(
4846
Symbol::intern("caller"),
49-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
5047
MultiDecorator(Box::new(expand_caller)));
5148
}
5249

src/test/run-pass-fulldeps/auxiliary/plugin_args.rs

-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@ impl TTMacroExpander for Expander {
4848
pub fn plugin_registrar(reg: &mut Registry) {
4949
let args = reg.args().to_owned();
5050
reg.register_syntax_extension(Symbol::intern("plugin_args"),
51-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
5251
NormalTT(Box::new(Expander { args: args, }), None, false));
5352
}

src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct A {
2424
}
2525

2626
fn main() {
27-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2827
let obj = A { foo: Box::new([true, false]) };
2928
let s = json::encode(&obj).unwrap();
3029
let obj2: A = json::decode(&s).unwrap();

src/test/run-pass-valgrind/dst-dtor-1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct Fat<T: ?Sized> {
2828

2929
pub fn main() {
3030
{
31-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
3231
let _x: Box<Fat<Trait>> = Box::<Fat<Foo>>::new(Fat { f: Foo });
3332
}
3433
unsafe {

src/test/run-pass-valgrind/dst-dtor-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct Fat<T: ?Sized> {
2525

2626
pub fn main() {
2727
{
28-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2928
let _x: Box<Fat<[Foo]>> = Box::<Fat<[Foo; 3]>>::new(Fat { f: [Foo, Foo, Foo] });
3029
}
3130
unsafe {

src/test/run-pass/associated-types-doubleendediterator-object.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ fn pairwise_sub(mut t: Box<DoubleEndedIterator<Item=isize>>) -> isize {
2626

2727
fn main() {
2828
let v = vec![1, 2, 3, 4, 5, 6];
29-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
3029
let r = pairwise_sub(Box::new(v.into_iter()));
3130
assert_eq!(r, 9);
3231
}

src/test/run-pass/coerce-expect-unsized.rs

-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ use std::rc::Rc;
1919
// rvalue expressions to be unsized. See #20169 for more information.
2020

2121
pub fn main() {
22-
// FIXME #22405: We cannot infer the type `Box<[isize; k]>` for
23-
// the r-value expression from the context `Box<[isize]>`, and
24-
// therefore the `box EXPR` desugaring breaks down.
25-
//
26-
// One could reasonably claim that the `box EXPR` desugaring is
27-
// effectively regressing half of Issue #20169. Hopefully we will
28-
// eventually fix that, at which point the `Box::new` calls below
29-
// should be replaced wth uses of `box`.
30-
3122
let _: Box<[isize]> = Box::new({ [1, 2, 3] });
3223
let _: Box<[isize]> = Box::new(if true { [1, 2, 3] } else { [1, 3, 4] });
3324
let _: Box<[isize]> = Box::new(match true { true => [1, 2, 3], false => [1, 3, 4] });

src/test/run-pass/deriving-default-box.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct A {
2121

2222
pub fn main() {
2323
let a: A = Default::default();
24-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2524
let b: Box<[_]> = Box::<[bool; 0]>::new([]);
2625
assert_eq!(a.foo, b);
2726
}

src/test/run-pass/deriving-eq-ord-boxed-slice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
struct Foo(Box<[u8]>);
1313

1414
pub fn main() {
15-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1615
let a = Foo(Box::new([0, 1, 2]));
1716
let b = Foo(Box::new([0, 1, 2]));
1817
assert_eq!(a, b);

src/test/run-pass/dst-deref-mut.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ pub fn foo(arr: &mut Arr) {
3939
}
4040

4141
fn main() {
42-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
4342
let mut a = Arr { ptr: Box::new([1, 2, 3]) };
4443
foo(&mut a);
4544
}

src/test/run-pass/dst-deref.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pub fn foo(arr: &Arr) {
3434
}
3535

3636
fn main() {
37-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
3837
let a = Arr { ptr: Box::new([1, 2, 3]) };
3938
foo(&a);
4039
}

src/test/run-pass/dst-struct.rs

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ pub fn main() {
127127
let f2 : Box<Fat<[isize]>> = f1;
128128
foo(&*f2);
129129

130-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
131130
let f3 : Box<Fat<[isize]>> =
132131
Box::<Fat<[_; 3]>>::new(Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] });
133132
foo(&*f3);

src/test/run-pass/dst-trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub fn main() {
9797

9898
// &*
9999
//
100-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
101100
let f7: Box<ToBar> = Box::new(Bar1 {f :42});
102101
bar(&*f7);
103102

src/test/run-pass/empty-allocation-non-null.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
12-
13-
1411
pub fn main() {
1512
assert!(Some(Box::new(())).is_some());
1613

src/test/run-pass/hashmap-memory.rs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ mod map_reduce {
6262
}
6363

6464
let ctrl_clone = ctrl.clone();
65-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
6665
::map(input, Box::new(|a,b| emit(&mut intermediates, ctrl.clone(), a, b)));
6766
ctrl_clone.send(ctrl_proto::mapper_done).unwrap();
6867
}

src/test/run-pass/hrtb-precedence-of-plus.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
// cause a compilation error. Issue #18772.
1818

1919
fn adder(y: isize) -> Box<Fn(isize) -> isize + 'static> {
20-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
2120
Box::new(move |x| y + x)
2221
}
2322

src/test/run-pass/issue-11205.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
#![allow(dead_code)]
1414

15-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
16-
1715
trait Foo { fn dummy(&self) { } }
1816
impl Foo for isize {}
1917
fn foo(_: [&Foo; 2]) {}

src/test/run-pass/issue-11677.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ impl X<isize> for F {
2727
}
2828

2929
fn main() {
30-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
3130
S {f: Box::new(F), g: Box::new(F) };
3231
}

0 commit comments

Comments
 (0)