rust/src/libsyntax
Mazdak Farrokhzad 8cba0a9073
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
```
2019-11-22 19:57:41 +01:00
..
ast libsyntax: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
attr Remove extern crate. 2019-11-17 22:37:16 +01:00
diagnostics Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
expand Review feedback: Remove more stuff! Simplify simplify simplify! 2019-11-05 14:59:29 +01:00
feature_gate Gate fallback via #![feature(never_type_fallback)]. 2019-11-21 14:55:33 +01:00
print Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkov 2019-11-22 19:57:41 +01:00
util move syntax::parse -> librustc_parse 2019-11-10 03:57:18 +01:00
ast.rs Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkov 2019-11-22 19:57:41 +01:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml Use proc_macro for HashStable derive in libsyntax. 2019-11-17 22:37:08 +01:00
early_buffered_lints.rs Warn if include macro fails to include entire file 2019-10-07 19:47:53 -04:00
entry.rs Rename Item.node to Item.kind 2019-09-26 18:21:48 +01:00
lib.rs Remove extern crate. 2019-11-17 22:37:16 +01:00
mut_visit.rs Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkov 2019-11-22 19:57:41 +01:00
ptr.rs Remove many unnecessary trait derivations. 2019-10-21 20:59:18 +11:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
sess.rs Delete ProcessCfgMod 2019-11-20 14:07:57 -05:00
show_span.rs Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
token.rs Remove extern crate. 2019-11-17 22:37:16 +01:00
tokenstream.rs Tiny cleanup to size assertions 2019-11-11 22:23:25 +03:00
visit.rs Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkov 2019-11-22 19:57:41 +01:00

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.

For more information about how these things work in rustc, see the rustc guide: