about summary refs log tree commit diff
path: root/compiler/rustc_macros
AgeCommit message (Collapse)AuthorLines
2023-11-04Derive TyEncodable/TyDecodable implementations that are parameterized over ↵Michael Goulet-10/+20
interner
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-2/+4
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
2023-10-28Rollup merge of #117256 - dtolnay:currentversion, r=compiler-errorsJubilee-0/+65
Parse rustc version at compile time This PR eliminates a couple awkward codepaths where it was not clear how the compiler should proceed if its own version number is incomprehensible. https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs#L385 https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/compiler/rustc_attr/src/builtin.rs#L630 We can guarantee that every compiled rustc comes with a working version number, so the ICE codepaths above shouldn't need to be written.
2023-10-27Rollup merge of #117241 - compiler-errors:auto-trait-leak-cycle, r=oli-obkMatthias Krüger-0/+8
Stash and cancel cycle errors for auto trait leakage in opaques We don't need to emit a traditional cycle error when we have a selection error that explains what's going on but in more detail. We may want to augment this error to actually point out the cycle, now that the cycle error is not being emitted. We could do that by storing the set of opaques that was in the `CyclePlaceholder` that gets returned from `type_of_opaque`. r? `@oli-obk` cc `@estebank` #117235
2023-10-26Parse rustc version at compile timeDavid Tolnay-0/+65
2023-10-26Stash and cancel cycle errors for auto trait leakage in opaquesMichael Goulet-0/+8
2023-10-26Fix symbols::tests::test_symbolsDavid Tolnay-1/+9
---- symbols::tests::test_symbols stdout ---- thread 'symbols::tests::test_symbols' panicked at library/proc_macro/src/bridge/client.rs:311:17: procedural macro API is used outside of a procedural macro
2023-10-26Improve span of env-related errorsDavid Tolnay-7/+7
2023-10-26Continue generating other symbols if an expr is not supportedDavid Tolnay-9/+14
2023-10-26Support environment variable for interned Symbol valueDavid Tolnay-4/+58
2023-10-26Move symbols macro map into a structDavid Tolnay-20/+32
2023-10-26Delete counter from symbols proc macro in favor of hashmap as source of truthDavid Tolnay-18/+24
2023-10-26Add a Parse impl for symbol ValueDavid Tolnay-2/+8
2023-10-26Represent symbol value as enum to prepare for supporting env varsDavid Tolnay-4/+10
2023-10-26Touch up syn parsing in symbols macroDavid Tolnay-4/+2
2023-10-23Allow `ensure` queries to return `Result<(), ErrorGuaranteed>`Oli Scherer-0/+10
2023-10-18Use v0.0.0 in compiler cratesMichael Goulet-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-19/+23
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1
2023-08-18Make enum decoding errors more informative.Nicholas Nethercote-2/+2
By printing the actual value, as long as the expected range. I found this helpful when I encountered one of these errors.
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-1/+1
2023-07-26Bump syn now that it doesn't affect diagnostics anymoreOli Scherer-2/+1
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-7/+17
2023-07-02Downgrade tracing and synNilstrieb-1/+2
There's currently a deadlock with tracing when RUSTC_LOG is enabled. Downgrade tracing-core for now to avoid blocking the other updates. syns upgrades cause some nontrivial changes in the diagnostics derive tests, which are best dealt with in another PR.
2023-06-28Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwcobors-4/+57
Validate fluent variable references in tests Closes #101109 Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
2023-06-23avoid `&format` in error message codeTakayuki Maeda-8/+6
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.