Add test.
This commit is contained in:
parent
343819d33f
commit
33ec632381
15
tests/ui/self/self-ctor-nongeneric.rs
Normal file
15
tests/ui/self/self-ctor-nongeneric.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// `Self` as a constructor is currently allowed when the outer item is not generic.
|
||||
// check-pass
|
||||
|
||||
struct S0(usize);
|
||||
|
||||
impl S0 {
|
||||
fn foo() {
|
||||
const C: S0 = Self(0);
|
||||
fn bar() -> S0 {
|
||||
Self(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user