about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src
AgeCommit message (Collapse)AuthorLines
2021-12-27Clarify that repeat count must be positiveSmitty-1/+1
2021-12-21rustc_builtin_macros: make asm mod public for rustfmtCaleb Cartwright-3/+3
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-7/+7
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-18Support [x; n] expressions in concat_bytes!Smitty-40/+65
Contributes to #87555.
2021-12-18Rollup merge of #92016 - calebcartwright:expose-asm-args-parsing, r=AmanieuMatthias Krüger-29/+43
builtin_macros: allow external consumers for AsmArgs parsing As discussed in Zulip (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/parsing.20of.20AsmArgs.20for.20inline.20assembly), we need a function entry point that rustfmt can leverage from a pre-expansion context to get a more structured representation of the asm args without having to duplicate/maintain the token stream parsing r? ```@Amanieu``` and/or ```@joshtriplett```
2021-12-16builtin_macros: allow external consumers for AsmArgs parsingCaleb Cartwright-29/+43
2021-12-16Rollup merge of #91172 - Ethiraric:ethiraric/fix90979, r=petrochenkovMatthias Krüger-4/+39
Warn when a `#[test]`-like built-in attribute macro is present multiple times. Fixes #90979.
2021-12-15Add a lint for duplicated attributes.Ethiraric-4/+39
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-7/+7
2021-12-15Point at type when a `static` `#[global_allocator]` doesn't `impl` `GlobalAlloc`Esteban Kuber-10/+12
2021-12-15Rollup merge of #91881 - Patrick-Poitras:stabilize-iter-zip, r=scottmcmMatthias Krüger-1/+0
Stabilize `iter::zip` Hello all! As the tracking issue (#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue. As the pull request that introduced the feature (#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been used in many places across the rust compiler and standard library since March without any issues. For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-12-12Remove automatic rustfix of asm! to llvm_asm!Amanieu d'Antras-13/+0
This no longer works now that asm! needs an explicit import. Also, it's been over a year since asm! landed, everyone should have transitioned by now.
2021-12-10Rollup merge of #91625 - est31:remove_indexes, r=oli-obkMatthias Krüger-12/+12
Remove redundant [..]s
2021-12-10Rollup merge of #91575 - compiler-errors:issue-91556, r=cjgillotMatthias Krüger-2/+3
Fix ICE on format string of macro with secondary-label This generalizes the fix #86104 to also correctly skip `Span::from_inner` for the `secondary_label` of a format macro parsing error as well. We can alternatively skip the `span_label` diagnostic call for the secondary label as well, since that label probably only makes sense when the _proper_ span is computed. Fixes #91556
2021-12-09Fix span calculation on secondary_label as wellMichael Goulet-2/+3
2021-12-09Remove redundant [..]sest31-12/+12
2021-12-06Implement concat_bytes!Smitty-0/+169
The tracking issue for this is #87555.
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-88/+82
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-0/+2
2021-12-03Annotate `derive`d spans and move span suggestion codeEsteban Kuber-61/+74
* Annotate `derive`d spans from the user's code with the appropciate context * Add `Span::can_be_used_for_suggestion` to query if the underlying span at the users' code
2021-12-03Remove some unnecessarily verbose codeEsteban Kuber-20/+5
2021-12-03Keep spans for generics in `#[derive(_)]` desugaringEsteban Kuber-23/+19
Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-01Rollup merge of #91313 - petrochenkov:cratexp, r=Aaron1011Matthias Krüger-28/+35
expand: Turn `ast::Crate` into a first class expansion target And stop creating a fake `mod` item for the crate root when expanding a crate, thus addressing FIXMEs left in https://github.com/rust-lang/rust/pull/82238, and making a step towards a proper support for crate-level macro attributes (cc #54726). I haven't added token collection support for the whole crate in this PR, maybe later. r? `@Aaron1011`
2021-12-01Auto merge of #91324 - eggyal:avoid-uneccesary-clone-of-annotatable, r=Aaron1011bors-22/+30
Avoid uneccessary clone of Annotatable Addresses FIXME comment created in #82608 r? `@Aaron1011`
2021-11-29Rollup merge of #91327 - dtolnay:exact, r=michaelwoeristerMatthias Krüger-8/+4
Delete an unreachable codepath from format_args implementation
2021-11-28Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillotMatthias Krüger-1/+4
Fix a format_args span to be expansion I found this while exploring solutions for rust-lang/rust-clippy#7843. r? `@m-ou-se`
2021-11-28Delete an unreachable codepath from format_args implementationDavid Tolnay-8/+4
2021-11-28Avoid uneccessary clone of AnnotatableAlan Egerton-22/+30
2021-11-28expand: Turn `ast::Crate` into a first class expansion targetVadim Petrochenkov-28/+35
And stop creating a fake `mod` item for the crate root when expanding a crate.
2021-11-15Stabilize format_args_captureJosh Triplett-26/+10
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-10Add support for specifying multiple clobber_abi in `asm!`asquared31415-31/+61
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-09Auto merge of #90485 - camsteffen:fmt-args-less-bind, r=m-ou-sebors-21/+10
Don't destructure args tuple in format_args! This allows Clippy to parse the HIR more simply since `arg0` is changed to `_args.0`. (cc rust-lang/rust-clippy#7843). From rustc's perspective, I think this is something between a lateral move and a tiny improvement since there are fewer bindings. r? `@m-ou-se`
2021-11-07Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514bors-1/+1
more clippy fixes
2021-11-07more clippy fixesMatthias Krüger-1/+1
2021-11-07ast: Fix naming conventions in AST structuresVadim Petrochenkov-30/+30
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-06Factor out some VecsCameron Steffen-9/+6
2021-11-06Don't destructure args tuple in format_args!Cameron Steffen-14/+6
2021-10-29Fix a format_args span to be expansionCameron Steffen-1/+4
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-17rustc_span: `Ident::invalid` -> `Ident::empty`Vadim Petrochenkov-5/+5
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-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-08Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514Guillaume Gomez-1/+1
clippy::complexity fixes
2021-10-08clippy::complexity fixesMatthias Krüger-1/+1
2021-10-07Use correct edition for panic in [debug_]assert!() etc.Mara Bos-4/+21
2021-10-03Practice diagnostic message conventionHirochika Matsumoto-4/+4
2021-10-02Auto merge of #89341 - ↵bors-10/+40
audunhalland:derive-type-params-with-bound-generic-params, r=jackh726 Deriving: Include bound generic params in type parameters for where clause Fixes #89188. The `derive` macro ignored the `for<'s>` needed with the `Fn` trait in that code example. edit: I'm unsure if this might cause regressions. I'm not an experienced compiler developer so I'm not used to thinking about unwanted side effects code changes like this might have.
2021-09-29Fix truncate of 'bound params stack' by using the correct lengthAudun Halland-1/+1
2021-09-29Improve error message for `printf`-style format stringsFabian Wolff-26/+73