rust/tests/ui/mir/gvn-nonsensical-sized-str.rs
2025-07-02 10:51:40 +00:00

17 lines
373 B
Rust

//! Verify that we do not ICE when optimizing bodies with nonsensical bounds.
//@ compile-flags: -Copt-level=1
//@ edition: 2021
//@ build-pass
#![feature(trivial_bounds)]
async fn return_str() -> str
where
str: Sized,
//~^ WARN trait bound str: Sized does not depend on any type or lifetime parameters
{
*"Sized".to_string().into_boxed_str()
}
fn main() {}