rust/tests/ui/borrowck/unmatched-arg-and-hir-arg-issue-126385.rs
Nicholas Nethercote bd32c4c21e Convert a span_bug to a span_delayed_bug.
PR #121208 converted this from a `span_delayed_bug` to a `span_bug`
because nothing in the test suite caused execution to hit this path. But
now fuzzing has found a test case that does hit it. So this commit
converts it back to `span_delayed_bug` and adds the relevant test.

Fixes #126385.
2024-06-17 15:21:07 +10:00

15 lines
401 B
Rust

// This test was triggering a `span_bug` crash, which was then fixed by
// downgrading it to a `span_delayed_bug`.
pub struct MyStruct<'field> {
field: &'field [u32],
}
impl MyStruct<'_> {
pub fn f(field: &[u32]) -> Self<u32> { //~ ERROR type arguments are not allowed on self type
Self { field } //~ ERROR lifetime may not live long enough
}
}
fn main() {}