Skip to content

Commit bbaf45d

Browse files
committed
Enforce #![deny(bare_trait_objects)] in src/librustc_data_structures tests
1 parent ff65bbe commit bbaf45d

File tree

1 file changed

+14
-14
lines changed
  • src/librustc_data_structures/owning_ref

1 file changed

+14
-14
lines changed

src/librustc_data_structures/owning_ref/mod.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -1443,8 +1443,8 @@ mod tests {
14431443
let c: OwningRef<Rc<Vec<u8>>, [u8]> = unsafe {a.map_owner(Rc::new)};
14441444
let d: OwningRef<Rc<Box<[u8]>>, [u8]> = unsafe {b.map_owner(Rc::new)};
14451445

1446-
let e: OwningRef<Rc<Erased>, [u8]> = c.erase_owner();
1447-
let f: OwningRef<Rc<Erased>, [u8]> = d.erase_owner();
1446+
let e: OwningRef<Rc<dyn Erased>, [u8]> = c.erase_owner();
1447+
let f: OwningRef<Rc<dyn Erased>, [u8]> = d.erase_owner();
14481448

14491449
let _g = e.clone();
14501450
let _h = f.clone();
@@ -1460,16 +1460,16 @@ mod tests {
14601460
let c: OwningRef<Box<Vec<u8>>, [u8]> = a.map_owner_box();
14611461
let d: OwningRef<Box<Box<[u8]>>, [u8]> = b.map_owner_box();
14621462

1463-
let _e: OwningRef<Box<Erased>, [u8]> = c.erase_owner();
1464-
let _f: OwningRef<Box<Erased>, [u8]> = d.erase_owner();
1463+
let _e: OwningRef<Box<dyn Erased>, [u8]> = c.erase_owner();
1464+
let _f: OwningRef<Box<dyn Erased>, [u8]> = d.erase_owner();
14651465
}
14661466

14671467
#[test]
14681468
fn try_map1() {
14691469
use std::any::Any;
14701470

14711471
let x = Box::new(123_i32);
1472-
let y: Box<Any> = x;
1472+
let y: Box<dyn Any> = x;
14731473

14741474
OwningRef::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_ok();
14751475
}
@@ -1479,7 +1479,7 @@ mod tests {
14791479
use std::any::Any;
14801480

14811481
let x = Box::new(123_i32);
1482-
let y: Box<Any> = x;
1482+
let y: Box<dyn Any> = x;
14831483

14841484
OwningRef::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_err();
14851485
}
@@ -1843,8 +1843,8 @@ mod tests {
18431843
let c: OwningRefMut<Box<Vec<u8>>, [u8]> = unsafe {a.map_owner(Box::new)};
18441844
let d: OwningRefMut<Box<Box<[u8]>>, [u8]> = unsafe {b.map_owner(Box::new)};
18451845

1846-
let _e: OwningRefMut<Box<Erased>, [u8]> = c.erase_owner();
1847-
let _f: OwningRefMut<Box<Erased>, [u8]> = d.erase_owner();
1846+
let _e: OwningRefMut<Box<dyn Erased>, [u8]> = c.erase_owner();
1847+
let _f: OwningRefMut<Box<dyn Erased>, [u8]> = d.erase_owner();
18481848
}
18491849

18501850
#[test]
@@ -1857,16 +1857,16 @@ mod tests {
18571857
let c: OwningRefMut<Box<Vec<u8>>, [u8]> = a.map_owner_box();
18581858
let d: OwningRefMut<Box<Box<[u8]>>, [u8]> = b.map_owner_box();
18591859

1860-
let _e: OwningRefMut<Box<Erased>, [u8]> = c.erase_owner();
1861-
let _f: OwningRefMut<Box<Erased>, [u8]> = d.erase_owner();
1860+
let _e: OwningRefMut<Box<dyn Erased>, [u8]> = c.erase_owner();
1861+
let _f: OwningRefMut<Box<dyn Erased>, [u8]> = d.erase_owner();
18621862
}
18631863

18641864
#[test]
18651865
fn try_map1() {
18661866
use std::any::Any;
18671867

18681868
let x = Box::new(123_i32);
1869-
let y: Box<Any> = x;
1869+
let y: Box<dyn Any> = x;
18701870

18711871
OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::<i32>().ok_or(())).is_ok();
18721872
}
@@ -1876,7 +1876,7 @@ mod tests {
18761876
use std::any::Any;
18771877

18781878
let x = Box::new(123_i32);
1879-
let y: Box<Any> = x;
1879+
let y: Box<dyn Any> = x;
18801880

18811881
OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::<i32>().ok_or(())).is_err();
18821882
}
@@ -1886,7 +1886,7 @@ mod tests {
18861886
use std::any::Any;
18871887

18881888
let x = Box::new(123_i32);
1889-
let y: Box<Any> = x;
1889+
let y: Box<dyn Any> = x;
18901890

18911891
OwningRefMut::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_ok();
18921892
}
@@ -1896,7 +1896,7 @@ mod tests {
18961896
use std::any::Any;
18971897

18981898
let x = Box::new(123_i32);
1899-
let y: Box<Any> = x;
1899+
let y: Box<dyn Any> = x;
19001900

19011901
OwningRefMut::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_err();
19021902
}

0 commit comments

Comments
 (0)