about summary refs log tree commit diff
path: root/compiler/rustc_passes
AgeCommit message (Collapse)AuthorLines
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-2/+2
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-31rustc: Replace `HirId`s with `LocalDefId`s in `AccessLevels` tablesVadim Petrochenkov-103/+96
and passes using them - primarily privacy checking, stability checking and dead code checking. WIP
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-29Add feature gates for `for` and `?` in constsJonas Schievink-4/+5
2021-07-25clippy::useless_formatMatthias Krüger-2/+2
2021-07-25Only check macro attributes when checking the crate root.Camille GILLOT-2/+2
2021-07-25Introduce OwnerNode::Crate.Camille GILLOT-3/+3
2021-07-25Merge the BTreeMap in hir::Crate.Camille GILLOT-1/+1
2021-07-21Allow some temporarily dead code.Felix S. Klock II-0/+2
I expect these two methods to come back very soon; noise of removing them to satisfy lint seems wrong.
2021-07-21Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.Felix S. Klock II-6/+0
Revert "Add missing brace" This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655. Revert "Simplify base_expr" This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c. Revert "Warn write-only fields" This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.
2021-07-14Warn about useless assignments of variables/fields to themselvesFabian Wolff-0/+54
2021-07-13Auto merge of #86857 - fee1-dead:add-attr, r=oli-obkbors-18/+52
Add #[default_method_body_is_const] `@rustbot` label F-const_trait_impl
2021-07-12Auto merge of #86320 - hi-rustin:rustin-patch-fix-span, r=estebankbors-1/+2
shrinking the deprecated span ref: https://github.com/rust-lang/rust/pull/85617#issuecomment-854947988 part of #85403 r? `@estebank` The reason is that if we use method_span directly, it will cause the in_derive_expansion judgment to fail.
2021-07-11Auto merge of #85941 - cjgillot:qresolve, r=Aaron1011bors-24/+27
Reduce the amount of untracked state in TyCtxt -- Take 2 Main part of #85153 The offending line (https://github.com/rust-lang/rust/pull/85153#discussion_r642866298) is replaced by a FIXME until the possible bug and the perf concern are both resolved. r? `@Aaron1011`
2021-07-10Check if the attribute is applied correctlyDeadbeef-0/+26
2021-07-10Applied suggestionsDeadbeef-11/+6
2021-07-10Add #[default_method_body_is_const]Deadbeef-18/+31
2021-07-08Rollup merge of #86838 - lambinoo:I-69630-rust_const_unstable_check_const, ↵Guillaume Gomez-1/+60
r=oli-obk Checking that function is const if marked with rustc_const_unstable Fixes #69630 This one is still missing tests to check the behavior but I checked by hand and it seemed to work. I would not mind some direction for writing those unit tests!
2021-07-08Rollup merge of #86726 - ↵Guillaume Gomez-3/+0
sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis Use diagnostic items instead of lang items for rfc2229 migrations This PR removes the `Send`, `UnwindSafe` and `RefUnwindSafe` lang items introduced in https://github.com/rust-lang/rust/pull/84730, and uses diagnostic items instead to check for `Send`, `UnwindSafe` and `RefUnwindSafe` traits for RFC2229 migrations. r? ```@nikomatsakis```
2021-07-08fn must be const if marked with stability attributLamb-1/+60
remove trailing newline fix: test with attribute but missing const Update compiler/rustc_passes/src/stability.rs Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com> Add test for extern functions fix: using span_help instead of span_suggestion add test for some ABIs + fmt fix Update compiler/rustc_passes/src/stability.rs Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com> Refractor and add test for `impl const` Add test to make sure no output + cleanup condition ----------------------------- remove stdcall test, failing CI test C abi is already tested in this, so it is not that useful to test another one. The tested code is blind to which specific ABI for now, as long as it's not an intrinsic one
2021-07-06Make resolutions a query.Camille GILLOT-24/+27
2021-07-03Auto merge of #86571 - fee1-dead:const-trait-impl-fix, r=jackh726bors-0/+63
deny using default function in impl const Trait Fixes #79450. I don't know if my implementation is correct: - The check is in `rustc_passes::check_const`, should I put it somewhere else instead? - Is my approach (to checking the impl) optimal? It works for the current tests, but it might have some issues or there might be a better way of doing this.
2021-07-01Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkovbors-4/+4
Rename all_crate_nums query to crates and remove useless wrapper Split out of https://github.com/rust-lang/rust/pull/86105 r? `@petrochenkov`
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-4/+4
2021-07-01Auto merge of #86190 - asquared31415:extern-main-86110-fix, r=varkorbors-1/+15
Fix ICE when `main` is declared in an `extern` block Changes in #84401 to implement `imported_main` changed how the crate entry point is found, and a declared `main` in an `extern` block was detected erroneously. This was causing the ICE described in #86110. This PR adds a check for this case and emits an error instead. Previously a `main` declaration in an `extern` block was not detected as an entry point at all, so emitting an error shouldn't break anything that worked previously. In 1.52.1 stable this is demonstrated, with a `` `main` function not found`` error. Fixes #86110
2021-07-01Auto merge of #86617 - joshtriplett:prune-dependencies, r=Mark-Simulacrumbors-1/+0
Remove unused dependencies from compiler crates Various compiler crates have dependencies that they don't appear to use. I used some scripting to detect such dependencies, filtered them based on some manual review, and removed those that do indeed appear to be entirely unused.
2021-07-01Do the check even when the feature is not enabledDeadbeef-3/+6
2021-06-29Remove lang items Send, UnwindSafe and RefUnwindSafeRoxane Fruytier-3/+0
2021-06-25Check that `#[cmse_nonsecure_entry]` is applied to a function definitionFabian Wolff-0/+20
2021-06-25rustc_passes: Remove unused dependency rustc_trait_selectionJosh Triplett-1/+0
Unused since commit 6a32e794c2180a514ad80d3a481300b9afe0b536 ("stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union'").
2021-06-23deny using default function in impl const TraitDeadbeef-0/+60
2021-06-17Fix ICE when using `#[doc(keyword = "...")]` on non-itemsFabian Wolff-2/+5
2021-06-15Fix ICE when doc aliases were put on function paramsRyan Levick-0/+2
2021-06-15Use last segmenthi-rustin-4/+1
2021-06-15shrinking the deprecated method spanhi-rustin-1/+5
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-1/+1
2021-06-09Fix ICE when `main` is declared in an `extern` blockasquared31415-1/+15
2021-06-06Rollup merge of #86047 - jyn514:doc-attrs, r=petrochenkovYuki Okushi-1/+1
Don't fire `invalid_doc_attributes` on `extern crate` items Fixes https://github.com/rust-lang/rust/issues/86046.
2021-06-05Don't fire `invalid_doc_attributes` on `extern crate` itemsJoshua Nelson-1/+1
2021-06-05Auto merge of #86001 - richkadel:revert-85617-rustin-patch-fix, ↵bors-5/+1
r=Mark-Simulacrum Revert "shrinking the deprecated method span" Reverts rust-lang/rust#85617 Fixes: #86000 r? `@Mark-Simulacrum`
2021-06-04Revert "shrinking the deprecated method span"Rich Kadel-5/+1
2021-06-04Remove `doc(include)`Joshua Nelson-2/+25
2021-06-04Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514Yuki Okushi-2/+0
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-03Auto merge of #85617 - hi-rustin:rustin-patch-fix, r=estebankbors-1/+5
shrinking the deprecated method span part of https://github.com/rust-lang/rust/issues/85403 r? `@estebank`
2021-06-02Address commenthi-rustin-4/+3
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-16/+13
2021-05-31Remove unused feature gatesbjorn3-2/+0
2021-05-30Make resolutions a query.Camille GILLOT-13/+16
2021-05-26Specialize implementationsJacob Pratt-0/+2
Implementations in stdlib are now optimized as they were before.
2021-05-25Address commenthi-rustin-4/+1