about summary refs log tree commit diff
path: root/compiler/rustc_passes
AgeCommit message (Collapse)AuthorLines
2022-07-13remove untagged_union feature gateRalf Jung-66/+2
2022-07-13also allow arrays of allowed typesRalf Jung-0/+5
2022-07-13allow unions with mutable references and tuples of allowed typesRalf Jung-5/+22
2022-07-13factor 'is this type allowed as union field on stable' into separate functionRalf Jung-3/+11
2022-07-13Rollup merge of #99011 - oli-obk:UnsoundCell, r=eddybDylan DPC-19/+2
`UnsafeCell` blocks niches inside its nested type from being available outside fixes #87341 This implements the plan by `@eddyb` in https://github.com/rust-lang/rust/issues/87341#issuecomment-886083646 Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): #94527
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-2/+11
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-11move else block into the `Local` structDing Xiang Fei-10/+10
2022-07-11lower let-else in MIR insteadDing Xiang Fei-13/+48
2022-07-08fixes post rebaseJane Losare-Lusby-1/+1
2022-07-08add opt in attribute for stable-in-unstable itemsJane Lusby-2/+20
2022-07-08clarify commentJane Lusby-2/+2
2022-07-08update commentJane Lusby-1/+4
2022-07-08Support unstable moves via stable in unstable itemsJane Lusby-2/+27
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-8/+8
2022-07-07`UnsafeCell` now has no niches, ever.Oli Scherer-19/+2
2022-07-07Auto merge of #98841 - Kobzol:hir-validator-bitset, r=cjgillotbors-19/+22
Use a bitset instead of a hash map in HIR ID validator The hashset insertion was slightly hot in incr patched runs, but it seems unnecessary to use a hashset here, as it just checks that a dense set of N integers was seen. I'm not sure if it's possible to know the amount of items beforehand to preallocate the bitset? I suppose not.
2022-07-05Rollup merge of #98624 - davidtwco:translation-on-lints, r=compiler-errorsDylan DPC-1/+1
lints: mostly translatable diagnostics As lints are created slightly differently than other diagnostics, intended to try make them translatable first and then look into the applicability of diagnostic structs but ended up just making most of the diagnostics in the crate translatable (which will still be useful if I do make a lot of them structs later anyway). r? ``@compiler-errors``
2022-07-04Only validate HIR with `debug_assertions` onJakub Beránek-19/+22
2022-07-04Use a bitset instead of a hash map in HIR ID validatorJakub Beránek-4/+4
2022-07-04Rollup merge of #98501 - Enselic:err_if_attr_found, r=compiler-errorsMatthias Krüger-12/+14
rustc_passes/src/entry.rs: De-duplicate more code with `fn throw_attr_err()` So we can more easily re-use the code for other attributes later. More specifically [`#[unix_sigpipe]`](https://github.com/rust-lang/rust/pull/97802). This refactoring is covered by this test: https://github.com/rust-lang/rust/blob/8aab472d52ba7314dc193c73abcd384e2586123c/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs#L120 (Well, only `#[start]`, but the code for `#[rustc_main]` is identical.)
2022-07-01Auto merge of #98402 - cjgillot:undead, r=michaelwoeristerbors-279/+150
Rewrite dead-code pass to avoid fetching HIR. This allows to get a more uniform handling of spans, and to simplify the grouping of diagnostics for variants and fields.
2022-06-30middle: translation in `LintDiagnosticBuilder`David Wood-1/+1
Accept `DiagnosticMessage` in `LintDiagnosticBuilder::build` so that lints can be built with translatable diagnostic messages. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-29avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`Takayuki Maeda-5/+2
2022-06-25rustc_passes: De-duplicate more code with `fn throw_attr_err()`Martin Nordholts-12/+14
So we can re-use the code for other attributes later.
2022-06-24Rollup merge of #98394 - Enselic:fixup-rustc_main-renames, r=petrochenkovYuki Okushi-5/+5
Fixup missing renames from `#[main]` to `#[rustc_main]` In #84217 `#[main]` was removed and replaced with `#[rustc_main]`. In some places the rename was forgotten, which makes the current code confusing, because at first glance it seems that `#[main]` is still around. Perform the renames also in these places. I noticed this (after first being confused by it) when working on #97802. r? `@petrochenkov` (since you reviewed the other PR)
2022-06-24Rollup merge of #98214 - petrochenkov:islike, r=compiler-errorsYuki Okushi-1/+1
rustc_target: Remove some redundant target properties `is_like_emscripten` is equivalent to `os == "emscripten"`, so it's removed. `is_like_fuchsia` is equivalent to `os == "fuchsia"`, so it's removed. `is_like_osx` also falls into the same category and is equivalent to `vendor == "apple"`, but it's commonly used so I kept it as is for now. `is_like_(solaris,windows,wasm)` are combinations of different operating systems or architectures (see compiler/rustc_target/src/spec/tests/tests_impl.rs) so they are also kept as is. I think `is_like_wasm` (and maybe `is_like_osx`) are sufficiently closed sets, so we can remove these fields as well and replace them with methods like `fn is_like_wasm() { arch == "wasm32" || arch == "wasm64" }`. On other hand, `is_like_solaris` and `is_like_windows` are sufficiently open and I can imagine custom targets introducing other values for `os`. This is kind of a gray area.
2022-06-22Rewrite dead-code pass to avoid fetching HIR.Camille GILLOT-168/+89
2022-06-22Uniform spans in dead code lint.Camille GILLOT-96/+52
2022-06-22Simplify match.Camille GILLOT-5/+3
2022-06-22Mark inherent impls as using the type during liveness collection.Camille GILLOT-25/+21
2022-06-22Fixup missing renames from `#[main]` to `#[rustc_main]`Martin Nordholts-5/+5
In fc357039f9 `#[main]` was removed and replaced with `#[rustc_main]`. In some place the rename was forgotten, which makes the current code confusing, because at first glance it seems that `#[main]` is still around. Perform the renames also in these places.
2022-06-22Auto merge of #97853 - TaKO8Ki:emit-only-one-note-per-unused-struct-field, ↵bors-73/+200
r=estebank Collapse multiple dead code warnings into a single diagnostic closes #97643
2022-06-21Remove `#[doc(hidden)]` logic from `unused_attributes` lintLeón Orell Valerian Liehr-74/+2
2022-06-19collapse dead code warnings into a single diagnosticTakayuki Maeda-70/+182
add comments in `store_dead_field_or_variant` support multiple log level add a item ident label fix ui tests fix a ui test fix a rustdoc ui test use let chain refactor: remove `store_dead_field_or_variant` fix a tiny bug
2022-06-19emit only one note per unused struct fieldTakayuki Maeda-36/+51
2022-06-18Auto merge of #98153 - nnethercote:fix-MissingDoc-quadratic-behaviour, ↵bors-2/+2
r=cjgillot Fix `MissingDoc` quadratic behaviour Best reviewed one commit at a time. r? `@cjgillot`
2022-06-18rustc_target: Remove some redundant target propertiesVadim Petrochenkov-1/+1
2022-06-18Remove a possible unnecessary assignmentYuki Okushi-2/+0
The reference issue has been closed (the feature has been stabilized) and things work fine without fine, it seems. Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-1/+40
Improve the tuple and unit trait docs * Reduce duplicate impls; show only the `(T,)` and include a sentence saying that there exists ones up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. Here's the new version: * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html> * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.unit.html>
2022-06-16Remove unused `hir_id` arg from `visit_attribute`.Nicholas Nethercote-2/+2
2022-06-15Rollup merge of #98115 - jhpratt:remove-rustc_deprecated, r=compiler-errorsYuki Okushi-3/+1
Remove `rustc_deprecated` diagnostics Follow-up on #95960. The diagnostics will remain until the next bootstrap, at which point people will have had six weeks to adjust. ``@rustbot`` label +A-diagnostics r? ``@compiler-errors``
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-12/+12
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-15Rollup merge of #98067 - klensy:compiler-deps2, r=Dylan-DPCYuki Okushi-1/+0
compiler: remove unused deps Removed unused dependencies in compiler crates and moves few `libc` under `target.cfg(unix)` .
2022-06-14Remove `rustc_deprecated` diagnosticsJacob Pratt-3/+1
2022-06-14Rollup merge of #97948 - davidtwco:diagnostic-translation-lints, r=oli-obkDylan DPC-6/+23
lint: add diagnostic translation migration lints Introduce allow-by-default lints for checking whether diagnostics are written in `SessionDiagnostic` or `AddSubdiagnostic` impls and whether diagnostics are translatable. These lints can be denied for modules once they are fully migrated to impls and translation. These lints are intended to be temporary - once all diagnostics have been changed then we can just change the APIs we have and that will enforce these constraints thereafter. r? `````@oli-obk`````
2022-06-13remove currently unused depsklensy-1/+0
2022-06-13rustdoc: add missing articleMichael Howell-1/+1
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-9/+9
2022-06-12rustdoc: change error message for invalid `#[doc(tuple_variadic)]`Michael Howell-1/+1
Add test case.
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-12/+12