Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 33ec632

Browse files
committedMay 14, 2023
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

Lines changed: 15 additions & 0 deletions
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)
Please sign in to comment.