test: Add a simple test for dangling pointers
This commit is contained in:
parent
7c27ec72d1
commit
8bef2716fe
1 changed files with 9 additions and 0 deletions
9
src/test/compile-fail/regions-ret.rs
Normal file
9
src/test/compile-fail/regions-ret.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// error-pattern: mismatched types
|
||||
|
||||
fn f(x : &a.int) -> &a.int {
|
||||
ret &3;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue