summary refs log tree commit diff
path: root/compiler/rustc_ast/src
AgeCommit message (Collapse)AuthorLines
2021-11-24Account for incorrect `impl Foo<const N: ty> {}` syntaxEsteban Küber-0/+15
Fix #84946
2021-11-12Auto merge of #89316 - asquared31415:multiple-clobber-abi, r=Amanieubors-2/+2
Add support for specifying multiple clobber_abi in `asm!` r? `@Amanieu` cc #72016 `@rustbot` label: +A-inline-assembly +F-asm
2021-11-10Rollup merge of #90742 - est31:add_assign, r=davidtwcoMatthias Krüger-1/+1
Use AddAssign impl
2021-11-10Add support for specifying multiple clobber_abi in `asm!`asquared31415-2/+2
Allow multiple clobber_abi in asm Update docs Fix aarch64 test Combine abis Emit duplicate ABI error, empty ABI list error multiple clobber_abi
2021-11-09Use AddAssign implest31-1/+1
2021-11-08Rollup merge of #90657 - GuillaumeGomez:one-char-last-line-removed, r=jyn514Guillaume Gomez-1/+1
Fix bug with `#[doc]` string single-character last lines Fixes #90618. This is because `.iter().all(|c| c == '*')` returns `true` if there is no character checked. And in case the last line has only one character, it simply returns `true`, making the last line behind removed.
2021-11-07ast: Fix naming conventions in AST structuresVadim Petrochenkov-64/+134
TraitKind -> Trait TyAliasKind -> TyAlias ImplKind -> Impl FnKind -> Fn All `*Kind`s in AST are supposed to be enums. Tuple structs are converted to braced structs for the types above, and fields are reordered in syntactic order. Also, mutable AST visitor now correctly visit spans in defaultness, unsafety, impl polarity and constness.
2021-11-06Rollup merge of #90642 - matthiaskrgr:clippy_matches, r=cjgillotMatthias Krüger-4/+4
use matches!() macro in more places
2021-11-06Fix last doc code comment being removed if it only had one characterGuillaume Gomez-1/+1
2021-11-06Auto merge of #90559 - rusticstuff:optimize-bidi-detection, r=davidtwcobors-0/+37
Optimize bidi character detection. Should fix most of the performance regression of the bidi character detection (#90514), to be confirmed with a perf run.
2021-11-06use matches!() macro in more placesMatthias Krüger-4/+4
2021-11-05Use one match instead of a staggered match.Hans Kratz-11/+2
2021-11-04Optimize literal, doc comment lint as well, extract function.Hans Kratz-0/+46
2021-11-02docs(rustc_ast): update crate descriptionsCaleb Cartwright-1/+1
2021-10-25fix: inner attribute followed by outer attribute causing ICEEliseZeroTwo-6/+0
2021-10-22Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726Yuki Okushi-7/+5
rustc_ast: Turn `MutVisitor::token_visiting_enabled` into a constant It's a visitor property rather than something that needs to be determined at runtime
2021-10-18Rollup merge of #89990 - petrochenkov:idempty, r=wesleywiserMatthias Krüger-4/+4
rustc_span: `Ident::invalid` -> `Ident::empty` The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s as well.
2021-10-18rustc_ast: Turn `MutVisitor::token_visiting_enabled` into a constantVadim Petrochenkov-7/+5
It's a visitor property rather than something that needs to be determined at runtime
2021-10-17rustc_span: `Ident::invalid` -> `Ident::empty`Vadim Petrochenkov-4/+4
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-17Some "parenthesis" and "parentheses" fixesr00ster91-2/+2
2021-10-08remove unwrap_or! macroklensy-10/+0
2021-10-04Rollup merge of #89487 - FabianWolff:issue-89396, r=petrochenkovJubilee-0/+1
Try to recover from a `=>` -> `=` or `->` typo in a match arm Fixes #89396.
2021-10-04Use `TokenKind::similar_tokens()`Fabian Wolff-0/+1
2021-10-01Improve error message for missing angle brackets in `[_]::method`Fabian Wolff-0/+2
2021-09-15Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwcoManish Goregaokar-10/+0
Revert anon union parsing Revert PR #84571 and #85515, which implemented anonymous union parsing in a manner that broke the context-sensitivity for the `union` keyword and thus broke stable Rust code. Fix #88583.
2021-09-10Keep a parent LocalDefId in SpanData.Camille GILLOT-1/+1
2021-09-09Revert "Implement Anonymous{Struct, Union} in the AST"Felix S. Klock II-10/+0
This reverts commit 059b68dd677808e14e560802d235ad40beeba71e. Note that this was manually adjusted to retain some of the refactoring introduced by commit 059b68dd677808e14e560802d235ad40beeba71e, so that it could likewise retain the correction introduced in commit 5b4bc05fa57be19bb5962f4b7c0f165e194e3151
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-2/+0
2021-09-08Rollup merge of #88553 - theo-lw:issue-88276, r=estebankJack Huey-0/+7
Improve diagnostics for unary plus operators (#88276) This pull request improves the diagnostics emitted on parsing a unary plus operator. See #88276. Before: ``` error: expected expression, found `+` --> src/main.rs:2:13 | 2 | let x = +1; | ^ expected expression ``` After: ``` error: leading `+` is not supported --> main.rs:2:13 | 2 | let x = +1; | ^ | | | unexpected `+` | help: try removing the `+` ```
2021-09-04Fix formattingTheodore Luo Wang-1/+4
2021-09-04Use verbose suggestions and only match if the + is seen before a numeric literalTheodore Luo Wang-0/+4
2021-09-04Auto merge of #88598 - estebank:type-ascription-can-die-in-a-fire, r=wesleywiserbors-1/+9
Detect bare blocks with type ascription that were meant to be a `struct` literal Address part of #34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
2021-09-03Auto merge of #88597 - cjgillot:lower-global, r=petrochenkovbors-12/+3
Move global analyses from lowering to resolution Split off https://github.com/rust-lang/rust/pull/87234 r? `@petrochenkov`
2021-09-03Detect bare blocks with type ascription that were meant to be a `struct` literalEsteban Kuber-1/+9
Address part of #34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
2021-09-02expand: Treat more macro calls as statement macro callsVadim Petrochenkov-1/+11
2021-09-01Compute proc_macros in resolutions.Camille GILLOT-12/+3
2021-08-30Handle let-else initializer edge case errorsCameron Steffen-0/+27
2021-08-30Add let-else to ASTCameron Steffen-5/+46
2021-08-30allow unordered const/ty params if any cg feature is activelcnr-2/+2
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-1/+1
2021-08-27Introduce `~const`Deadbeef-3/+3
- [x] Removed `?const` and change uses of `?const` - [x] Added `~const` to the AST. It is gated behind const_trait_impl. - [x] Validate `~const` in ast_validation. - [ ] Add enum `BoundConstness` to the HIR. (With variants `NotConst` and `ConstIfConst` allowing future extensions) - [ ] Adjust trait selection and pre-existing code to use `BoundConstness`. - [ ] Optional steps (*for this PR, obviously*) - [ ] Fix #88155 - [ ] Do something with constness bounds in chalk
2021-08-26Auto merge of #88066 - LeSeulArtichaut:patterns-cleanups, r=nagisabors-15/+11
Use if-let guards in the codebase and various other pattern cleanups Dogfooding if-let guards as experimentation for the feature. Tracking issue #51114. Conflicts with #87937.
2021-08-25Various pattern cleanupsLéo Lanteri Thauvin-10/+4
2021-08-25Use if-let guards in the codebaseLéo Lanteri Thauvin-5/+7
2021-08-24Move `named_asm_labels` to a HIR lintasquared31415-3/+4
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-18Remove box syntax from rustc_astest31-2/+1
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-4/+6
2021-08-12Add support for clobber_abi to asm!Amanieu d'Antras-0/+1
2021-07-30Add warning when whitespace is not skipped after an escaped newline.Anton Golov-4/+20