rust/tests/ui/str/str-static-literal.rs
2025-05-31 19:49:19 +05:00

9 lines
170 B
Rust

//! Check that a bare string literal is typed as a `&'static str` and is usable.
//@ run-pass
pub fn main() {
let x: &'static str = "foo";
println!("{}", x);
}