about summary refs log tree commit diff
path: root/tests/ui/mir/gvn-nonsensical-sized-str.rs
blob: 29a82f8ce2a16b15ae0ea45302245f2d4ceada70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! 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() {}