mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-29 16:13:40 +00:00
new tests for things we'll have to fix eventually
This commit is contained in:
parent
5a3875e998
commit
79cbdba037
23
src/test/compile-fail/regions-nested-fns.rs
Normal file
23
src/test/compile-fail/regions-nested-fns.rs
Normal file
@ -0,0 +1,23 @@
|
||||
// xfail-test
|
||||
|
||||
fn ignore<T>(t: T) {}
|
||||
|
||||
fn nested(x: &x.int) {
|
||||
let y = 3;
|
||||
let mut ay = &y;
|
||||
|
||||
ignore(fn&(z: &z.int) {
|
||||
ay = x;
|
||||
ay = &y;
|
||||
ay = z; //! ERROR foo
|
||||
});
|
||||
|
||||
ignore(fn&(z: &z.int) -> &z.int {
|
||||
if false { ret x; } //! ERROR bar
|
||||
if false { ret &y; } //! ERROR bar
|
||||
if false { ret ay; } //! ERROR bar
|
||||
ret z;
|
||||
});
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user