gcc/testsuite/rust/compile/issue-3045-2.rs
raw| 1 | #![feature(dropck_eyepatch)] |
| 2 | #[allow(dead_code)] |
| 3 | |
| 4 | #[lang = "sized"] |
| 5 | trait Sized {} |
| 6 | |
| 7 | |
| 8 | trait Action {} |
| 9 | |
| 10 | struct Inspector<'a>(&'a u8); |
| 11 | struct Inspector2<'a>(&'a u8); |
| 12 | |
| 13 | impl<#[may_dangle] 'a> Action for Inspector<'a> {} // { dg-error "use of 'may_dangle' is unsafe and requires unsafe impl" "" { target *-*-* } 0 } |
| 14 | |
| 15 | unsafe impl<#[may_dangle] 'a> Action for Inspector2<'a> {} |
| 16 | |
| 17 | |
| 18 | fn main() { |
| 19 | |
| 20 | } |