about summary refs log tree commit diff
path: root/compiler/rustc_macros
AgeCommit message (Collapse)AuthorLines
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-23/+43
2023-05-26Fix diagnostics with errorsclubby789-13/+6
2023-05-26Validate fluent variable references with `debug_assertions`clubby789-4/+64
2023-05-18Merge query property modules into oneJohn Kåre Alsaker-3/+3
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-3/+3
2023-05-09Rollup merge of #111120 - chenyukang:yukang-suggest-let, r=NilstriebDylan DPC-1/+1
Suggest let for possible binding with ty Origin from https://github.com/rust-lang/rust/pull/109128#discussion_r1179866137 r? `@Nilstrieb`
2023-05-08Make spans a bit betterMichael Goulet-13/+23
2023-05-08Diagnostic args are still args if they're documentedMichael Goulet-8/+7
2023-05-08Suggest let for possible binding with tyyukang-1/+1
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-396/+0
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-16Rollup merge of #109665 - fee1-dead-contrib:rm-remap-queries, r=oli-obkfee1-dead-8/+0
Remove `remap_env_constness` in queries This removes some of the complexities with const traits. #88119 used to be caused by this but was fixed by `param_env = param_env.without_const()`.
2023-04-11Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errorsbors-2/+4
Migrate most of `rustc_builtin_macros` to diagnostic impls cc #100717 This is a couple of days work, but I decided to stop for now before the PR becomes too big. There's around 50 unresolved failures when `rustc::untranslatable_diagnostic` is denied, which I'll finish addressing once this PR goes thtough A couple of outputs have changed, but in all instances I think the changes are an improvement/are more consistent with other diagnostics (although I'm happy to revert any which seem worse)
2023-04-10Migrate most of `rustc_builtin_macros` to diagnostic implsclubby789-2/+4
Co-authored-by: Joe ST <joe@fbstj.net> Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-09Inline format_argsNilstrieb-1/+1
Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-09Fix some clippy::complexityNilstrieb-2/+2
2023-04-09Some simple `clippy::perf` fixesNilstrieb-1/+1
2023-04-08Remove `remap_env_constness` in queriesDeadbeef-8/+0
2023-04-06address commentsDeadbeef-45/+50
2023-04-06fix errorsDeadbeef-1/+2
2023-04-06fix and bless ui tests 1/2Deadbeef-1/+19
2023-04-06migrate rustc_macros to syn 2.0Deadbeef-338/+257
2023-03-31Don't emit the OS error in a noteest31-3/+6
This makes it possible to make the normalization of the error message more precise, allowing us to not normalize all notes away.
2023-03-31Use std::fs::read_to_file in fluent_messages macroest31-11/+3
2023-03-29Check for escape sequences in Fluent resourcesclubby789-0/+12
2023-02-27Allow using `bool` for optional diagnosticsclubby789-5/+18
2023-02-25Emit the enum discriminant separately for the Encodable macroJohn Kåre Alsaker-17/+30
2023-02-22Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obkbors-6/+6
Remove type-traversal trait aliases #107924 moved the type traversal (folding and visiting) traits into the type library, but created trait aliases in `rustc_middle` to minimise both the API churn for trait consumers and the arising boilerplate. As mentioned in that PR, an alternative approach of defining subtraits with blanket implementations of the respective supertraits was also considered at that time but was ruled out as not adding much value. Unfortunately, it has since emerged that rust-analyzer has difficulty with these trait aliases at present, resulting in a degraded contributor experience (see the recent [r-a has become useless](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/r-a.20has.20become.20useless) topic on the #t-compiler/help Zulip stream). This PR removes the trait aliases, and accordingly the underlying type library traits are now used directly; they are parameterised by `TyCtxt<'tcx>` rather than just the `'tcx` lifetime, and imports have been updated to reflect the fact that the trait aliases' explicitly named traits are no longer automatically brought into scope. These changes also roll-back the (no-longer required) workarounds to #107747 that were made in b409329c624b9e3bbd7d8e07697e2e9f861a45b6. Since this PR is just a find+replace together with the changes necessary for compilation & tidy to pass, it's currently just one mega-commit. Let me know if you'd like it broken up. r? `@oli-obk`
2023-02-22Remove type-traversal trait aliasesAlan Egerton-6/+6
2023-02-22errors: generate typed identifiers in each crateDavid Wood-241/+230
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-14Use derive attributes for uninteresting traversalsAlan Egerton-7/+64
2023-02-13Make folding traits generic over the InternerAlan Egerton-1/+1
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-4/+4
2023-02-01Forbid #[suggestion_*(...)] on VecsXiretza-43/+66
It is ambiguous whether this should produce several `.span_suggestions()` calls or one `.multipart_suggestions()` call.
2023-01-27Detect references to non-existant messages in Fluent resourcesclubby789-2/+32
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-1/+1
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-11Support eager subdiagnostics againmejrs-4/+21
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-24/+19
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04Simplify some iterator combinatorsMichael Goulet-2/+1
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-102/+53
Improve syntax of `newtype_index` This makes it more like proper Rust and also makes the implementation a lot simpler. Mostly just turns weird flags in the body into proper attributes. It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-25/+13
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-45/+21
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.
2022-12-18Make `#[max]` an attribute in `newtype_index`Nilstrieb-10/+11
2022-12-18Make `#[no_ord_impl]` an attribute in `newtype_index`Nilstrieb-8/+4
2022-12-18Make `#[custom_encodable]` an attribute for `newtype_index`Nilstrieb-10/+12
Makes the syntax a little more rusty.
2022-12-18Use `#[derive]` instead of custom syntax in all `newtype_index`Nilstrieb-12/+0
2022-12-18use &str / String literals instead of format!()Matthias Krüger-8/+4
2022-12-15more clippy::complexity fixesMatthias Krüger-1/+1