blob: d55150e448e81a12d137a7172d8ee79711ce6168 [file] [log] [blame]
Graydon Hoared1affff2012-12-11 01:32:481// 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 Sullivan9a5e9802011-08-05 00:27:5111// This should typecheck even though the type of e is not fully
Patrick Walton90d3da92013-09-17 06:37:5412// resolved when we finish typechecking the &fn.
Tim Chevalier6d4907a2013-01-26 06:46:3213
14
Patrick Walton82062a62013-02-23 00:08:1615struct Refs { refs: ~[int], n: int }
Tim Chevalier6d4907a2013-01-26 06:46:3216
Graydon Hoare89c8ef72013-02-02 03:43:1717pub fn main() {
Patrick Walton82062a62013-02-23 00:08:1618 let e = @mut Refs{refs: ~[], n: 0};
Patrick Walton90d3da92013-09-17 06:37:5419 let _f: &fn() = || error!(e.n);
Niko Matsakis31593352013-05-01 14:31:1020 e.refs.push(1);
Michael Sullivan9a5e9802011-08-05 00:27:5121}