about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-2/+1
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-10/+4
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-2/+2
2019-12-12Unify associated function parsing.Mazdak Farrokhzad-0/+1
2019-12-12Unify `{Impl,Trait}Item` as `AssocItem`.Mazdak Farrokhzad-17/+24
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-1/+1
2019-12-12`TraitItemKind::Type` -> `TraitItemKind::TyAlias`.Mazdak Farrokhzad-1/+1
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-1/+1
2019-12-12Use `Option` in `ImplItemKind::Const`.Mazdak Farrokhzad-2/+2
2019-12-12Alias `TraitItem` & `ImplItem`.Mazdak Farrokhzad-17/+5
Allow defaultness on trait items syntactically.
2019-12-07Make `ForeignItem` an alias of `Item`.Mazdak Farrokhzad-12/+3
2019-12-03Deduplicate CrateConfigMark Rousskov-4/+1
2019-12-03Move BufferedEarlyLint to librustc_sessionMark Rousskov-41/+2
2019-12-02Address review commentsVadim Petrochenkov-9/+13
2019-12-02syntax: Use `ast::MacArgs` for macro definitionsVadim Petrochenkov-7/+1
2019-12-02syntax: Use `ast::MacArgs` for attributesVadim Petrochenkov-4/+4
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-7/+14
Also remove a couple of redundant `visit_mac` asserts
2019-12-02syntax: Introduce a struct `MacArgs` for macro argumentsVadim Petrochenkov-15/+69
2019-11-26Rollup merge of #66719 - Mark-Simulacrum:int-normalization, r=CentrilTyler Mandry-0/+24
Store pointer width as u32 on Config This removes the dependency on IntTy, UintTy from Session. It's not obviously a win, but it seems a bit odd to store the AST IntTy/UintTy in Session, rather we store the pointer width as an integer and add normalization methods to IntTy and UintTy.
2019-11-25Auto merge of #66279 - cjgillot:hashstable, r=Zoxcbors-6/+16
Use proc-macro to derive HashStable everywhere Hello, A second proc-macro is added to derive HashStable for crates librustc depends on. This proc-macro `HashStable_Generic` (to bikeshed) allows to decouple code and strip much of librustc's boilerplate. Still, two implementations `Span` and `TokenKind` require to be placed in librustc. The latter only depends on the `bug` macro. Advise welcome on how to sever that link. A trait `StableHasingContextLike` has been introduced at each crate root, in order to handle those implementations which require librustc's very `StableHashingContext`. This overall effort allowed to remove the `impl_stable_hash_for` macro. Each commit passes the `x.py check`. I still have to double check there was no change in the implementation.
2019-11-24Store ptr_width as u32 on ConfigMark Rousskov-0/+24
This removes the dependency on IntTy, UintTy from Session.
2019-11-24Add raw address of expressions to the AST and HIRMatthew Jasper-3/+18
2019-11-22Derives for ast.Camille GILLOT-4/+4
2019-11-22Invert implementations for TokenKind.Camille GILLOT-1/+1
Also export a bunch of Token-related impls.
2019-11-22Export HashStable for DelimSpan, Lit and Path.Camille GILLOT-1/+11
2019-11-22Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkovMazdak Farrokhzad-21/+29
*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-17Remove extern crate.Camille GILLOT-0/+1
2019-11-17HashStable in libsyntax.Camille GILLOT-4/+3
2019-11-17Further HashStable_Generic derives.Camille GILLOT-1/+1
2019-11-17Use proc_macro for HashStable derive in libsyntax.Camille GILLOT-15/+18
2019-11-17Address review commentsVadim Petrochenkov-4/+1
2019-11-16ast: Keep string literals in ABIs preciselyVadim Petrochenkov-12/+30
2019-11-16ast: Keep `extern` qualifiers in functions more preciselyVadim Petrochenkov-11/+16
2019-11-14TAIT: use hack in ->HIR to avoid more changesMazdak Farrokhzad-0/+9
2019-11-14TAIT: remove `OpaqueTy` in AST.Mazdak Farrokhzad-6/+0
2019-11-11Tiny cleanup to size assertionsVadim Petrochenkov-4/+1
2019-11-11Auto merge of #66252 - cjgillot:trees, r=oli-obkbors-15/+53
Merge repeated definitions Step forward on #66149 I may need further context to understand the need for a separate crate. Also, please tell me if you think of other definitions to merge.
2019-11-11syntactically allow visibility on trait item & enum variantMazdak Farrokhzad-21/+29
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-2/+6
2019-11-10Merge hir::Unsafety into ast::Unsafety.Camille GILLOT-13/+23
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-0/+24
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-3/+3
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-08ast::ItemKind::Fn: use ast::FnSigMazdak Farrokhzad-1/+1
2019-11-08ast::MethodSig -> ast::FnSigMazdak Farrokhzad-5/+5
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-1/+1
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-40/+51
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-07parser: don't hardcode ABIs into grammarMazdak Farrokhzad-2/+22
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-3/+16
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-06Remove unnecessary `Deref` impl for `Attribute`.Nicholas Nethercote-6/+0
This kind of thing just makes the code harder to read.
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-1/+1
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.