summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-0/+18
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14Revert "Stabilize the `never_type`, written `!`."Niko Matsakis-0/+18
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-62/+63
functions with a `const` modifier
2019-12-09Rollup merge of #67113 - Centril:enum-vis-pretty-fix, r=davidtwcoTyler Mandry-0/+1
Print the visibility in `print_variant`. r? @davidtwco cc @dtolnay for `syn` awareness.
2019-12-07Make `ForeignItem` an alias of `Item`.Mazdak Farrokhzad-13/+4
2019-12-07Print the visibility in `print_variant`.Mazdak Farrokhzad-0/+1
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-2/+3
2019-12-03Deduplicate CrateConfigMark Rousskov-4/+1
2019-12-03Move ParseSess to librustc_sessionMark Rousskov-173/+1
2019-12-03Move BufferedEarlyLint to librustc_sessionMark Rousskov-58/+2
2019-12-03Move early lint declarations to librustc_sessionMark Rousskov-9/+27
2019-12-02Address review commentsVadim Petrochenkov-9/+13
2019-12-02syntax: Optimize conversion `AttrItem` -> `MetaItem` by avoiding `outer_tokens`.Vadim Petrochenkov-29/+44
2019-12-02syntax: Use `ast::MacArgs` for macro definitionsVadim Petrochenkov-11/+5
2019-12-02syntax: Use `ast::MacArgs` for attributesVadim Petrochenkov-34/+59
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-11/+25
Also remove a couple of redundant `visit_mac` asserts
2019-12-02syntax: Introduce a struct `MacArgs` for macro argumentsVadim Petrochenkov-31/+102
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-1758/+49
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30derive(Default) for FeaturesMazdak Farrokhzad-1/+1
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-49/+14
2019-11-30check.rs: inline a constantMazdak Farrokhzad-4/+4
2019-11-30move UnstableFeatures -> rustc_featureMazdak Farrokhzad-41/+5
2019-11-30inline two explanation constantsMazdak Farrokhzad-7/+0
2019-11-30builtin_attrs.rs -> rustc_featureMazdak Farrokhzad-607/+4
2019-11-30move is_builtin_attr to syntax::attrMazdak Farrokhzad-10/+9
2019-11-30builtin_attrs: inline some stringsMazdak Farrokhzad-8/+5
2019-11-30simplify gated cfgs logicMazdak Farrokhzad-38/+24
2019-11-30move AttributeTemplate to builtin_attrsMazdak Farrokhzad-27/+17
2019-11-30move Stability to rustc_featureMazdak Farrokhzad-11/+3
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-1013/+21
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-4/+2
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-3/+2
Various tweaks to diagnostic output
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-25Tweak removed feature errorEsteban Küber-3/+2
2019-11-25Auto merge of #66279 - cjgillot:hashstable, r=Zoxcbors-10/+48
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-25Auto merge of #66671 - matthewjasper:ast-address-of, r=Centrilbors-23/+45
Ast address-of This is the parts of #64588 that don't affect MIR. If an address-of expression makes it to MIR lowering we error and lower to the best currently expressible approximation to limit further errors. r? @Centril
2019-11-24Store ptr_width as u32 on ConfigMark Rousskov-0/+24
This removes the dependency on IntTy, UintTy from Session.
2019-11-24Parse and feature gate raw address of expressionsMatthew Jasper-1/+5
2019-11-24Add raw address of expressions to the AST and HIRMatthew Jasper-22/+40
2019-11-23Rollup merge of #61351 - GuillaumeGomez:stabilize-cfg-rustdoc, r=QuietMisdreavusMazdak Farrokhzad-1/+0
Stabilize cfg(doc) cc #43781.
2019-11-23Derive HashStable for TokenKind.Camille GILLOT-13/+11
2019-11-23Use proc-macro for TokenTree.Camille GILLOT-21/+2
2019-11-23Rename StableHashingContextLike to HashStableContext.Camille GILLOT-4/+4
2019-11-23Auto merge of #66507 - ecstatic-morse:const-if-match, r=oli-obkbors-0/+3
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-22Fix rebase fallout.Camille GILLOT-0/+1
2019-11-22Derives for ast.Camille GILLOT-4/+4
2019-11-22Invert implementations for TokenKind.Camille GILLOT-3/+46
Also export a bunch of Token-related impls.
2019-11-22Export HashStable for DelimSpan, Lit and Path.Camille GILLOT-3/+13
2019-11-22Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkovMazdak Farrokhzad-43/+56
*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 ```