Skip to content

Commit 33ec632

Browse files
committed
Add test.
1 parent 343819d commit 33ec632

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ui/self/self-ctor-nongeneric.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// `Self` as a constructor is currently allowed when the outer item is not generic.
2+
// check-pass
3+
4+
struct S0(usize);
5+
6+
impl S0 {
7+
fn foo() {
8+
const C: S0 = Self(0);
9+
fn bar() -> S0 {
10+
Self(0)
11+
}
12+
}
13+
}
14+
15+
fn main() {}

0 commit comments

Comments
 (0)