Skip to content

Commit c536a23

Browse files
committed
---
yaml --- r: 275850 b: refs/heads/auto c: 923001e h: refs/heads/master
1 parent d00e03a commit c536a23

File tree

5 files changed

+118
-1
lines changed

5 files changed

+118
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 8dbab5121e214a08690eefdaa3ee45bb2d1bbd5e
11+
refs/heads/auto: 923001ebb7980ec425e6df561575bccaf5f90240
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2016 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+
// Check that qualified paths with type parameters
12+
// fail during type checking and not during parsing
13+
14+
struct S;
15+
16+
trait Tr {
17+
type A;
18+
}
19+
20+
impl Tr for S {
21+
type A = S;
22+
}
23+
24+
impl S {
25+
fn f<T>() {}
26+
}
27+
28+
type A = <S as Tr>::A::f<u8>; //~ ERROR type parameters are not allowed on this type
29+
//~^ ERROR ambiguous associated type; specify the type using the syntax `<<S as Tr>::A as Trait>::f`
30+
31+
fn main() {}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2016 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+
// Check that qualified paths with type parameters
12+
// fail during type checking and not during parsing
13+
14+
struct S;
15+
16+
trait Tr {
17+
type A;
18+
}
19+
20+
impl Tr for S {
21+
type A = S;
22+
}
23+
24+
impl S {
25+
fn f<T>() {}
26+
}
27+
28+
fn main() {
29+
match 10 {
30+
<S as Tr>::A::f::<u8> => {} //~ ERROR `f` is not an associated const
31+
0 ... <S as Tr>::A::f::<u8> => {} //~ ERROR only char and numeric types are allowed in range
32+
}
33+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 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+
// Check that imports with nakes super and self don't fail during parsing
12+
// FIXME: this shouldn't fail during name resolution either
13+
14+
mod a {
15+
mod b {
16+
use self as A; //~ ERROR `self` imports are only allowed within a { } list
17+
//~^ ERROR unresolved import `self`. There is no `self` in the crate root
18+
use super as B; //~ ERROR unresolved import `super`. There is no `super` in the crate root
19+
use super::{self as C}; //~ERROR unresolved import `super`. There is no `super` in the crate
20+
}
21+
}
22+
23+
fn main() {}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2016 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+
pub struct A;
12+
13+
mod test {
14+
pub use super :: A;
15+
16+
pub use self :: A as B;
17+
}
18+
19+
impl A {
20+
fn f() {}
21+
fn g() {
22+
Self :: f()
23+
}
24+
}
25+
26+
fn main() {
27+
let a: A = test::A;
28+
let b: A = test::B;
29+
let c: () = A::g();
30+
}

0 commit comments

Comments
 (0)