]> git.lizzy.rs Git - rust.git/blob - src/test/auxiliary/nested_item.rs
Auto merge of #22517 - brson:relnotes, r=Gankro
[rust.git] / src / test / auxiliary / nested_item.rs
1 // Copyright 2013 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
11 // original problem
12 pub fn foo<T>() -> int {
13     {
14         static foo: int = 2;
15         foo
16     }
17 }
18
19 // issue 8134
20 struct Foo;
21 impl Foo {
22     pub fn foo<T>(&self) {
23         static X: uint = 1;
24     }
25 }
26
27 // issue 8134
28 pub struct Parser<T>;
29 impl<T: std::iter::Iterator<Item=char>> Parser<T> {
30     fn in_doctype(&mut self) {
31         static DOCTYPEPattern: [char; 6] = ['O', 'C', 'T', 'Y', 'P', 'E'];
32     }
33 }
34
35 struct Bar;
36 impl Foo {
37     pub fn bar<T>(&self) {
38         static X: uint = 1;
39     }
40 }