about summary refs log tree commit diff
path: root/src/librustc_passes/ast_validation.rs
AgeCommit message (Collapse)AuthorLines
2020-01-11ast_validation -> new crate rustc_ast_passesMazdak Farrokhzad-1038/+0
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-4/+5
2020-01-11canonicalize rustc::session importMazdak Farrokhzad-1/+1
2020-01-11Rollup merge of #68050 - Centril:canon-error, r=Mark-SimulacrumYuki Okushi-3/+3
Canonicalize rustc_error imports r? @Mark-Simulacrum
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-3/+3
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-2/+6
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-09Make `bound_context` more like neighboring functionsDylan MacKenzie-21/+18
2020-01-09Call all visit methods on trait definitionsDylan MacKenzie-0/+3
2020-01-09Check for `?const` in invalid contexts during AST validationDylan MacKenzie-0/+74
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-7/+26
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-24Handle more specific case E0222Esteban Küber-0/+1
2019-12-24x.py fmt after previous deignoreMark Rousskov-110/+183
2019-12-23Add the full issue reference to equality constraints in `where` clausesvarkor-2/+8
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-2/+2
2. mir::Mutability -> ast::Mutability.
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-4/+4
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-1/+1
2019-12-12More c-variadic errors as semantic restrictions.Mazdak Farrokhzad-2/+21
2019-12-12`ast_validation`: move trait item logic to proper place.Mazdak Farrokhzad-20/+23
2019-12-12Move `allow_c_varadic` logic to `ast_validation`.Mazdak Farrokhzad-0/+26
2019-12-12Unify assoc item visitors more.Mazdak Farrokhzad-2/+2
2019-12-12Unify associated item visitor.Mazdak Farrokhzad-7/+7
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-2/+2
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-0/+15
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-11/+20
2019-12-12Use `Option` in `ImplItemKind::Const`.Mazdak Farrokhzad-6/+20
2019-12-12Alias `TraitItem` & `ImplItem`.Mazdak Farrokhzad-0/+9
Allow defaultness on trait items syntactically.
2019-12-07Simplify `check_decl_no_pat`.Mazdak Farrokhzad-5/+5
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-8/+0
Also remove a couple of redundant `visit_mac` asserts
2019-11-30move is_builtin_attr to syntax::attrMazdak Farrokhzad-2/+1
2019-11-22Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkovMazdak Farrokhzad-0/+6
*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-18Reword help and add testEsteban Küber-6/+4
2019-11-18Add more context to `async fn` trait error. Suggest `async-trait`.Agustin Fernandez-1/+6
2019-11-15Rollup merge of #66197 - Centril:transparent-ast, r=varkorTyler Mandry-9/+1
Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions. This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported. r? @varkor
2019-11-14TAIT: remove redundant check from ast_validationMazdak Farrokhzad-9/+1
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-11syntactically allow visibility on trait item & enum variantMazdak Farrokhzad-0/+6
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-2/+2
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-09move attr meta grammar to parse::validate_atr + ast_validationMazdak Farrokhzad-0/+5
2019-11-08Rollup merge of #66188 - Centril:fnsig, r=davidtwcoMazdak Farrokhzad-4/+4
`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn` In both AST & HIR, rename `MethodSig` to `FnSig` and then proceed to use it in `ItemKind::Fn` so that the overall structure is more regular. r? @davidtwco
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-112/+19
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-08ast::ItemKind::Fn: use ast::FnSigMazdak Farrokhzad-4/+4
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-1/+1
`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-06nested_impl_trait -> errorMazdak Farrokhzad-107/+19
2019-11-06legacy_directory_ownership -> errorMazdak Farrokhzad-5/+0
2019-11-03Migrate resolver over to internal lint bufferMark Rousskov-9/+12
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1