about summary refs log tree commit diff
path: root/compiler/rustc_passes
AgeCommit message (Collapse)AuthorLines
2022-10-26Convert all #[suggestion_*] attributes to #[suggestion(style = "...")]Xiretza-1/+1
Using the following command: find compiler/ -type f -name '*.rs' -exec perl -i -gpe \ 's/(#\[\w*suggestion)_(short|verbose|hidden)\(\s*(\S+,)?/\1(\3style = "\2",/g' \ '{}' +
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-17/+20
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-24Port `dead_code` lints to be translatable.Charles Lew-92/+163
2022-10-23Migrate all diagnosticsNilstrieb-207/+206
2022-10-19Allow #[unstable] impl for fn() -> UnstableType.Mara Bos-7/+19
(But not fn() -> !, which is stable.)
2022-10-19Allow #[unstable] impls for fn() with unstable abi.Mara Bos-3/+8
2022-10-15Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=ManishearthDylan DPC-0/+27
Add missing checks for `doc(cfg_hide(...))` Part of #43781. The `doc(cfg_hide(...))` attribute can only be used at the crate level and takes a list of attributes as argument. r? ```@Manishearth```
2022-10-14Add missing checks for `doc(cfg_hide(...))` attributeGuillaume Gomez-0/+27
2022-10-14more dupe word typosRageking8-14/+14
2022-10-12Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwcoDylan DPC-669/+1211
Migrate rustc_passes diagnostics Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870 I would like to do this collaboratively, as there is a lot of work! Here's the process: - Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access) - Indicate which file/task you would like to work on (so we don't duplicate work) from the list below - Do the work, push up a commit, comment that you're done with that file/task - Repeat until done 😄 ### Files to Migrate (in `compiler/rustc_passes/src/`) - [x] check_attr.rs ``@CleanCut`` - [x] check_const.rs ``@CleanCut`` - [x] dead.rs ``@CleanCut`` - [x] debugger_visualizer.rs ``@CleanCut`` - [x] diagnostic_items.rs ``@CleanCut`` - [x] entry.rs ``@CleanCut`` - [x] lang_items.rs ``@CleanCut`` - [x] layout_test.rs ``@CleanCut`` - [x] lib_features.rs ``@CleanCut`` - [x] ~liveness.rs~ ``@CleanCut`` Nothing to do - [x] loops.rs ``@CleanCut`` - [x] naked_functions.rs ``@CleanCut`` - [x] stability.rs ``@CleanCut`` - [x] weak_lang_items.rs ``@CleanCut`` ### Tasks - [x] Rebase on current `master` ``@CleanCut`` - [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut`` - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``
2022-10-10make up your mind, rustfmtNathan Stocks-5/+1
2022-10-10remove out-of-date fixmeNathan Stocks-2/+5
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-1/+1
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-4/+4
2022-10-07avoid string dispatch in fluentNathan Stocks-22/+67
2022-10-07avoid string dispatch in fluentNathan Stocks-12/+26
2022-10-07Remove code that was removed in master, and the corresponding diagnosticNathan Stocks-30/+1
2022-10-07First batch of review feedback changes from #102110Nathan Stocks-18/+11
2022-10-07migrate stability.rs to translateable diagnosticsNathan Stocks-84/+159
2022-10-07migrate the rest of check_attr.rs to translateable diagnosticsNathan Stocks-62/+74
2022-10-07migrate dead.rs to translateable diagnosticsNathan Stocks-12/+13
2022-10-07migrate lang_items.rs to translateable diagnosticsNathan Stocks-91/+153
2022-10-07migrate entry.rs to translateable diagnosticsNathan Stocks-92/+185
2022-10-07migrate naked_functions.rs to translateable diagnosticsNathan Stocks-59/+101
2022-10-07migrate loops.rs to translateable diagnosticsNathan Stocks-118/+164
2022-10-07migrate check_const.rs to translateable diagnosticsNathan Stocks-4/+47
2022-10-07migrate lib_features.rs to translateable diagnosticsNathan Stocks-20/+34
2022-10-07migrate layout_test.rs to translateable diagnosticsNathan Stocks-33/+94
2022-10-07migrate diagnostic_items.rs to translateable diagnosticsNathan Stocks-18/+38
2022-10-07use cherry-picked commit from #100754 to emit note without errorNathan Stocks-3/+8
2022-10-07migrate debugger_visualizer.rs to translateable diagnosticsNathan Stocks-7/+8
2022-10-07migrate the rest of weak_lang_items.rs to translateable diagnosticsNathan Stocks-17/+12
2022-10-07resolve merge conflict from cherry-picking ↵Diego de Oliveira-0/+7
6a47326a0452cc8d5cb57676508b5469d648c67f
2022-10-07use consistent namesNathan Stocks-6/+6
2022-10-07Migrate InvalidAttrAtCrateLevelrdvdev2-27/+40
Co-authored-by: Nathan Stocks <cleancut@github.com> Co-authored-by: rdvdev2 <rdvdev2@gmail.com>
2022-10-07Migrate derivable diagnostics in check_attr.rsrdvdev2-8/+17
2022-10-07Migrate derivable diagnostics in lang_items.rsrdvdev2-22/+29
2022-10-07Migrate weak_lang_items.rsrdvdev2-10/+22
2022-10-07Add lint for diagnostic migrationrdvdev2-0/+2
2022-10-04Merge the `~const` and `impl const` checks and add some explanatory notesOli Scherer-26/+0
2022-10-01Auto merge of #101986 - WaffleLapkin:move_lint_note_to_the_bottom, r=estebankbors-109/+104
Move lint level source explanation to the bottom So, uhhhhh r? `@estebank` ## User-facing change "note: `#[warn(...)]` on by default" and such are moved to the bottom of the diagnostic: ```diff - = note: `#[warn(unsupported_calling_conventions)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678> + = note: `#[warn(unsupported_calling_conventions)]` on by default ``` Why warning is enabled is the least important thing, so it shouldn't be the first note the user reads, IMO. ## Developer-facing change `struct_span_lint` and similar methods have a different signature. Before: `..., impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>)` After: `..., impl Into<DiagnosticMessage>, impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` The reason for this is that `struct_span_lint` needs to edit the diagnostic _after_ `decorate` closure is called. This also makes lint code a little bit nicer in my opinion. Another option is to use `impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>) -> DiagnosticBuilder<'a, ()>` altough I don't _really_ see reasons to do `let lint = lint.build(message)` everywhere. ## Subtle problem By moving the message outside of the closure (that may not be called if the lint is disabled) `format!(...)` is executed earlier, possibly formatting `Ty` which may call a query that trims paths that crashes the compiler if there were no warnings... I don't think it's that big of a deal, considering that we move from `format!(...)` to `fluent` (which is lazy by-default) anyway, however this required adding a workaround which is unfortunate. ## P.S. I'm sorry, I do not how to make this PR smaller/easier to review. Changes to the lint API affect SO MUCH 😢
2022-10-01Refactor rustc lint APIMaybe Waffle-109/+104
2022-09-30Rollup merge of #102361 - fee1-dead-contrib:fix-102156, r=eholkMatthias Krüger-1/+1
Fix ICE in const_trait check code This fixes #102156.
2022-09-30Use let chains instead of let elsefee1-dead-1/+1
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-8/+2
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-27Fix ICE in const_trait check codeDeadbeef-1/+1
This fixes #102156.
2022-09-27rustc_typeck to rustc_hir_analysislcnr-1/+1
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-26Rollup merge of #101851 - Xiretza:diagnostic-derive-cleanups, r=davidtwcofee1-dead-2/+2
Clean up (sub)diagnostic derives The biggest chunk of this is unifying the parsing of subdiagnostic attributes (`#[error]`, `#[suggestion(...)]`, `#[label(...)]`, etc) between `Subdiagnostic` and `Diagnostic` type attributes as well as `Diagnostic` field attributes. It also improves a number of proc macro diagnostics. Waiting for #101558.
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-56/+62
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`