Closed
Description
I tried this code:
struct Foo;
impl Default for Foo
where
[(); {
impl Foo {
pub const X: Self = Self;
}
0
}]:
{
fn default() -> Self {
Self::X
}
}
I expected the code to compile
Instead, the compiler errored with this message:
error[E0449]: unnecessary visibility qualifier
--> src/main.rs:7:13
|
7 | pub const X: Self = Self;
| ^^^ `pub` not permitted here because it's implied
Meta
rustc --version --verbose
:
rustc 1.57.0-nightly (98c861950 2021-09-27)
binary: rustc
commit-hash: 98c8619502093f34ca82f8f26ccf32e753924440
commit-date: 2021-09-27
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0