Skip to content

Commit dfe5b97

Browse files
committed
test: unresolved lifetime segfault
gcc/testsuite/ChangeLog: * rust/compile/invalid-lifetime-in-generic-arg.rs: New test. Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
1 parent 964dfb7 commit dfe5b97

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
4+
// Test for segfault when processing enum variant with reference to type
5+
// with unresolved lifetime in generic arguments.
6+
// The compiler should report an error gracefully instead of crashing.
7+
8+
enum ast<'a> {
9+
num(usize),
10+
add(&'a ast<'result>) // { dg-error "failed to resolve type path segment" }
11+
// { dg-error "unresolved lifetime" "" { target *-*-* } .-1 }
12+
}
13+
14+
pub fn main() {}

0 commit comments

Comments
 (0)