Graydon Hoare | d1affff | 2012-12-11 01:32:48 | [diff] [blame] | 1 | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT |
| 2 | // file at the top-level directory of this distribution and at |
| 3 | // http://rust-lang.org/COPYRIGHT. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
Michael Sullivan | 9a5e980 | 2011-08-05 00:27:51 | [diff] [blame] | 11 | // This should typecheck even though the type of e is not fully |
Patrick Walton | 90d3da9 | 2013-09-17 06:37:54 | [diff] [blame] | 12 | // resolved when we finish typechecking the &fn. |
Tim Chevalier | 6d4907a | 2013-01-26 06:46:32 | [diff] [blame] | 13 | |
| 14 | |
Patrick Walton | 82062a6 | 2013-02-23 00:08:16 | [diff] [blame] | 15 | struct Refs { refs: ~[int], n: int } |
Tim Chevalier | 6d4907a | 2013-01-26 06:46:32 | [diff] [blame] | 16 | |
Graydon Hoare | 89c8ef7 | 2013-02-02 03:43:17 | [diff] [blame] | 17 | pub fn main() { |
Patrick Walton | 82062a6 | 2013-02-23 00:08:16 | [diff] [blame] | 18 | let e = @mut Refs{refs: ~[], n: 0}; |
Patrick Walton | 90d3da9 | 2013-09-17 06:37:54 | [diff] [blame] | 19 | let _f: &fn() = || error!(e.n); |
Niko Matsakis | 3159335 | 2013-05-01 14:31:10 | [diff] [blame] | 20 | e.refs.push(1); |
Michael Sullivan | 9a5e980 | 2011-08-05 00:27:51 | [diff] [blame] | 21 | } |