warning: calling `foo` can unsafe --> $DIR/dont_panic.rs:68:5 | 68 | x.push(""); | ^^^^^^^^^^ this can unsafe | note: `std::vec::Vec::<&str>::push` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:1880:13 | 1876 | pub fn push(&mut self, value: T) { | -------------------------------- ... 1880 | self.buf.reserve_for_push(self.len); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `alloc::raw_vec::RawVec::<&str>::reserve_for_push` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:302:24 | 301 | pub fn reserve_for_push(&mut self, len: usize) { | ---------------------------------------------- 302 | handle_reserve(self.grow_amortized(len, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `alloc::raw_vec::RawVec::<&str>::grow_amortized` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:404:19 | 383 | fn grow_amortized(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> { | ------------------------------------------------------------------------------------------ ... 404 | let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `alloc::raw_vec::finish_grow::` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:482:13 | 464 | / fn finish_grow( 465 | | new_layout: Result, 466 | | current_memory: Option<(NonNull, Layout)>, 467 | | alloc: &mut A, 468 | | ) -> Result, TryReserveError> 469 | | where 470 | | A: Allocator, | |_________________- ... 482 | alloc.grow(ptr, old_layout, new_layout) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 485 | alloc.allocate(new_layout) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(redpen::call_unsafe)]` on by default warning: calling `foo` can unsafe --> $DIR/dont_panic.rs:72:1 | 72 | } | ^ this can unsafe | note: `std::ptr::drop_in_place::>` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:497:1 | 497 | pub unsafe fn drop_in_place(to_drop: *mut T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: calling `main` can unsafe --> $DIR/dont_panic.rs:85:5 | 85 | foo(); | ^^^^^ this can unsafe | note: `foo` can unsafe here --> $DIR/dont_panic.rs:68:5 | 53 | fn foo() { | -------- ... 68 | x.push(""); | ^^^^^^^^^^ ... 72 | } | ^ warning: calling `main` can unsafe --> $DIR/dont_panic.rs:86:5 | 86 | bar(); | ^^^^^ this can unsafe | note: `bar` can unsafe here --> $DIR/dont_panic.rs:75:5 | 74 | fn bar() { | -------- 75 | foo(); | ^^^^^ note: `foo` can unsafe here --> $DIR/dont_panic.rs:68:5 | 53 | fn foo() { | -------- ... 68 | x.push(""); | ^^^^^^^^^^ ... 72 | } | ^ warning: calling `main` can unsafe --> $DIR/dont_panic.rs:88:18 | 88 | trait_object(Box::new(S)); | ^^^^^^^^^^^ this can unsafe | note: `std::boxed::Box::::new` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:217:9 | 215 | pub fn new(x: T) -> Self { | ------------------------ 216 | #[rustc_box] 217 | Box::new(x) | ^^^^^^^^^^^ note: `alloc::alloc::exchange_malloc` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:241:9 | 241 | self.alloc_impl(layout, false) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 328 | unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { | --------------------------------------------------------------- note: `std::alloc::Global::alloc_impl` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:98:9 | 98 | __rust_alloc(layout.size(), layout.align()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 170 | unsafe { __rust_alloc_zeroed(layout.size(), layout.align()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 176 | fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result, AllocError> { | --------------------------------------------------------------------------------------- warning: calling `main` can unsafe --> $DIR/dont_panic.rs:88:5 | 88 | trait_object(Box::new(S)); | ^^^^^^^^^^^^^^^^^^^^^^^^^ this can unsafe | note: `trait_object` can unsafe here --> $DIR/dont_panic.rs:51:1 | 48 | fn trait_object(x: Box) { | ------------------------------ ... 51 | } | ^ warning: calling `main` can unsafe --> $DIR/dont_panic.rs:89:18 | 89 | trait_object(Box::new(X)); | ^^^^^^^^^^^ this can unsafe | note: `std::boxed::Box::::new` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:217:9 | 215 | pub fn new(x: T) -> Self { | ------------------------ 216 | #[rustc_box] 217 | Box::new(x) | ^^^^^^^^^^^ note: `alloc::alloc::exchange_malloc` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:241:9 | 241 | self.alloc_impl(layout, false) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 328 | unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { | --------------------------------------------------------------- note: `std::alloc::Global::alloc_impl` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:98:9 | 98 | __rust_alloc(layout.size(), layout.align()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 170 | unsafe { __rust_alloc_zeroed(layout.size(), layout.align()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 176 | fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result, AllocError> { | --------------------------------------------------------------------------------------- warning: calling `main` can unsafe --> $DIR/dont_panic.rs:89:5 | 89 | trait_object(Box::new(X)); | ^^^^^^^^^^^^^^^^^^^^^^^^^ this can unsafe | note: `trait_object` can unsafe here --> $DIR/dont_panic.rs:51:1 | 48 | fn trait_object(x: Box) { | ------------------------------ ... 51 | } | ^ warning: calling `main` can unsafe --> $DIR/dont_panic.rs:90:5 | 90 | trait_object(boxed()); | ^^^^^^^^^^^^^^^^^^^^^ this can unsafe | note: `trait_object` can unsafe here --> $DIR/dont_panic.rs:51:1 | 48 | fn trait_object(x: Box) { | ------------------------------ ... 51 | } | ^ warning: calling `trait_object` can unsafe --> $DIR/dont_panic.rs:51:1 | 51 | } | ^ this can unsafe | note: `std::ptr::drop_in_place::>` can unsafe here --> /home/gh-estebank/.rustup/toolchains/nightly-2024-05-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:497:1 | 497 | pub unsafe fn drop_in_place(to_drop: *mut T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: calling `bar` can unsafe --> $DIR/dont_panic.rs:75:5 | 75 | foo(); | ^^^^^ this can unsafe | note: `foo` can unsafe here --> $DIR/dont_panic.rs:68:5 | 53 | fn foo() { | -------- ... 68 | x.push(""); | ^^^^^^^^^^ ... 72 | } | ^ warning: 11 warnings emitted