about summary refs log tree commit diff
path: root/compiler/rustc_macros/src
AgeCommit message (Collapse)AuthorLines
2023-12-19Remove unnecessary `use` items in derived `IntoDiagnostic` impls.Nicholas Nethercote-3/+0
Presumably these are a hangover from an earlier time when they were necessary.
2023-12-18Rename many `DiagCtxt` and `EarlyDiagCtxt` locals.Nicholas Nethercote-2/+2
2023-12-18Rename `__diagnostic_handler_sess` as `_sess`.Nicholas Nethercote-4/+5
2023-12-18Rename `DiagnosticDeriveKind::Diagnostic::handler` as ↵Nicholas Nethercote-10/+10
`DiagnosticDeriveKind::Diagnostic::dcx`.
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-1/+1
2023-12-16Simplify lint decorator derive tooMichael Goulet-2/+2
2023-12-10remove redundant importssurechen-3/+3
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-11-21Unify HashStable implementationsMichael Goulet-64/+49
2023-11-21Add HashStable_NoContext to simplify HashStable implementations in rustc_type_irMichael Goulet-0/+51
2023-11-18Begin nightly-ifying rustc_type_irMichael Goulet-334/+0
2023-11-15Re-format code with new rustfmtMark Rousskov-1/+3
2023-11-10Factor out some duplicated code.Nicholas Nethercote-42/+31
2023-11-10Update instructions in a comment.Nicholas Nethercote-10/+3
And avoid duplication.
2023-11-10Minor cleanups.Nicholas Nethercote-11/+14
- Reduce some function exposure. - Fix some comment formatting.
2023-11-10Simplify the `current_rustc_version` macro.Nicholas Nethercote-29/+11
It currently has the syntax `current_rustc_version!(env!("CFG_RELEASE"))` where the `env!("CFG_RELEASE")` part looks like a normal expression but it is actually parsed and processed by the `current_rustc_version` macro. The documented rationale for this is that you'll find it if you grep for `env!("CFG_RELEASE")`. But I think that's of very little use -- I would personally grep for just "CFG_RELEASE" -- and it complicates the macro, requiring the use of `syn`. This commit simplifies the macro.
2023-11-04Derive TyEncodable/TyDecodable implementations that are parameterized over ↵Michael Goulet-10/+20
interner
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-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-12Re-format let-else per rustfmt updateMark Rousskov-7/+17
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-392/+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()`.