diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-22 19:57:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-22 19:57:41 +0100 |
| commit | 8cba0a9073f740791c5d18148d649c61aaf7d6c7 (patch) | |
| tree | 1906720783e10429ac031f9dab006757720840eb /src/test/debuginfo/enum-thinlto.rs | |
| parent | 083b5a0a1bb3b2ee0873697ebf37e88d85faa3e5 (diff) | |
| parent | 9a88364525a4660dbd6f6a371b3b25199f5bbe4a (diff) | |
| download | rust-8cba0a9073f740791c5d18148d649c61aaf7d6c7.tar.gz rust-8cba0a9073f740791c5d18148d649c61aaf7d6c7.zip | |
Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkov
*Syntactically* permit visibilities on trait items & enum variants
Fixes #65041
Suppose we have `$vis trait_item` or `$vis enum_variant` and `$vis` is a `:vis` macro fragment. Before this PR, this would fail to parse. This is now instead allowed as per language team consensus in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. (See added tests for elaboration.)
Moreover, we now also permit visibility modifiers on trait items & enum variants *syntactically* but reject them with semantic checks (in `ast_validation`):
```rust
#[cfg(FALSE)]
trait Foo { pub fn bar(); } // OK
#[cfg(FALSE)]
enum E { pub U } // OK
```
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions
