1 error: function is never used: `temporary_cstring`
2 --> $DIR/cstring.rs:4:1
4 4 | fn temporary_cstring() {
5 | ^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D dead-code` implied by `-D warnings`
9 error: you are getting the inner pointer of a temporary `CString`
10 --> $DIR/cstring.rs:7:5
12 7 | CString::new("foo").unwrap().as_ptr();
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 = note: `-D temporary-cstring-as-ptr` implied by `-D warnings`
16 = note: that pointer will be invalid outside this expression
17 help: assign the `CString` to a variable to extend its lifetime
18 --> $DIR/cstring.rs:7:5
20 7 | CString::new("foo").unwrap().as_ptr();
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^