about summary refs log tree commit diff
path: root/tests/ui/lint/dangling-pointers-from-temporaries/methods.rs
blob: 26019b376d3a48565eff0a2aa7b61e2c5e72c83a (plain)
1
2
3
4
5
6
7
8
#![deny(dangling_pointers_from_temporaries)]

fn main() {
    vec![0u8].as_ptr();
    //~^ ERROR a dangling pointer will be produced because the temporary `Vec<u8>` will be dropped
    vec![0u8].as_mut_ptr();
    //~^ ERROR a dangling pointer will be produced because the temporary `Vec<u8>` will be dropped
}