about summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2019-12-24x.py fmt after previous deignoreMark Rousskov-110/+183
2019-12-23Add span information to `ExprKind::Assign`varkor-2/+2
2019-12-23Add the full issue reference to equality constraints in `where` clausesvarkor-2/+8
2019-12-22Format the worldMark Rousskov-655/+666
2019-12-21Use Arena inside hir::Body.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::Mod.Camille GILLOT-1/+1
2019-12-21Use Arena inside hir::StructField.Camille GILLOT-3/+3
2019-12-21Use Arena inside hir::EnumDef.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::ImplItem.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::TraitItem.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::ForeignItem.Camille GILLOT-3/+3
2019-12-21Handle Attributes in arena.Camille GILLOT-1/+1
2019-12-21Use Arena inside hir::Item.Camille GILLOT-11/+11
2019-12-21Use Arena inside hir::Crate.Camille GILLOT-5/+5
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-4/+4
2. mir::Mutability -> ast::Mutability.
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-35/+130
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-13Use better name for local containing required feature gatesDylan MacKenzie-5/+5
2019-12-13Replace `Index` impl with `enabled` methodDylan MacKenzie-2/+2
2019-12-13Apply suggestions from reviewDylan MacKenzie-5/+5
2019-12-13Improve commentDylan MacKenzie-2/+2
2019-12-13Restructue HIR const-checker to handle features with multiple gatesDylan MacKenzie-19/+69
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-4/+4
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-3/+3
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-4/+4
2019-12-12Unify associated item visitor.Mazdak Farrokhzad-9/+9
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-2/+2
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-0/+16
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 GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-8/+2
2019-11-30move is_builtin_attr to syntax::attrMazdak Farrokhzad-2/+1
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-1/+3
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-2/+2
Various tweaks to diagnostic output
2019-11-25Tweak bad `continue` errorEsteban Küber-2/+2
2019-11-24Add raw address of expressions to the AST and HIRMatthew Jasper-1/+1
2019-11-23Auto merge of #66507 - ecstatic-morse:const-if-match, r=oli-obkbors-25/+73
Enable `if` and `match` in constants behind a feature flag This PR is an initial implementation of #49146. It introduces a `const_if_match` feature flag and does the following if it is enabled: - Allows `Downcast` projections, `SwitchInt` terminators and `FakeRead`s for matched places through the MIR const-checker. - Allows `if` and `match` expressions through the HIR const-checker. - Stops converting `&&` to `&` and `||` to `|` in `const` and `static` items. As a result, the following operations are now allowed in a const context behind the feature flag: - `if` and `match` - short circuiting logic operators (`&&` and `||`) - the `assert` and `debug_assert` macros (if the `const_panic` feature flag is also enabled) However, the following operations remain forbidden: - `while`, `loop` and `for` (see #52000) - the `?` operator (calls `From::from` on its error variant) - the `assert_eq` and `assert_ne` macros, along with their `debug` variants (calls `fmt::Debug`) This PR is possible now that we use dataflow for const qualification (see #64470 and #66385). r? @oli-obk cc @rust-lang/wg-const-eval @eddyb
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-21Suggest `const_if_match` on nightlyDylan MacKenzie-19/+70
2019-11-21Hold a `TyCtxt` in the HIR const-checkerDylan MacKenzie-10/+7
2019-11-21Add feature gate for const `if` and `match`Dylan MacKenzie-1/+1
2019-11-21reduce size of hir::ExprKindMazdak Farrokhzad-13/+17
2019-11-20Rollup merge of #66535 - estebank:issue-62480, r=matthewjasperMazdak Farrokhzad-3/+10
Avoid ICE when `break`ing to an unreachable label Fix #62480.
2019-11-18Avoid ICE when `break`ing to an unreachable labelEsteban Küber-3/+10
2019-11-18Reword help and add testEsteban Küber-6/+4