about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-05-13Add bound_fn_sigJack Huey-6/+30
2022-05-13Add bound_type_ofJack Huey-26/+32
2022-05-13Rustc changes for permissive provenancecarbotaniuman-5/+8
2022-05-13change for_each_module's parameter to FnMutMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13update rustdoc code to use new method nameMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13rename visit item-like methodsMiguel Guarniz-8/+11
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-3/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13add module_itemsMiguel Guarniz-0/+4
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13Avoid invoking the full `eq` infrastructure when all we want is to check a ↵Oli Scherer-1/+3
discriminant
2022-05-13Do not cache item_attrs.Camille GILLOT-1/+0
2022-05-13Cache more queries on disk.Camille GILLOT-39/+72
2022-05-13Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwcoMatthias Krüger-6/+2
Be more precise than DefPathData::Misc. This variant was used for two unrelated things. Let's make this cleaner.
2022-05-12Correct comment.Camille GILLOT-6/+2
2022-05-12Auto merge of #95562 - lcnr:attr-no-encode, r=davidtwcobors-27/+43
don't encode only locally used attrs Part of https://github.com/rust-lang/compiler-team/issues/505. We now filter builtin attributes before encoding them in the crate metadata in case they should only be used in the local crate. To prevent accidental misuse `get_attrs` now requires the caller to state which attribute they are interested in. For places where that isn't trivially possible, I've added a method `fn get_attrs_unchecked` which I intend to remove in a followup PR. After this pull request landed, we can then slowly move all attributes to only be used in the local crate while being certain that we don't accidentally try to access them from extern crates. cc https://github.com/rust-lang/rust/pull/94963#issuecomment-1082924289
2022-05-12Give the inliner some hintsOli Scherer-0/+2
2022-05-12Auto merge of #96889 - Aaron1011:place-ref-remove, r=compiler-errorsbors-1/+8
Remove `PartialOrd`/`Ord` impl for `PlaceRef` This is a new attempt at #93315. It removes one usage of the `Ord` impl for `DefId`, which should make it easier to eventually remove that impl.
2022-05-12Auto merge of #96150 - est31:unused_macro_rules, r=petrochenkovbors-0/+3
Implement a lint to warn about unused macro rules This implements a new lint to warn about unused macro rules (arms/matchers), similar to the `unused_macros` lint added by #41907 that warns about entire macros. ```rust macro_rules! unused_empty { (hello) => { println!("Hello, world!") }; () => { println!("empty") }; //~ ERROR: 1st rule of macro `unused_empty` is never used } fn main() { unused_empty!(hello); } ``` Builds upon #96149 and #96156. Fixes #73576
2022-05-12Prevent unwinding when `-C panic=abort` is used regardless declared ABIGary Guo-0/+8
2022-05-11Auto merge of #96806 - cjgillot:codegen-fulfill-nice, r=oli-obkbors-1/+19
Gracefully fail to resolve associated items instead of `delay_span_bug`. `codegen_fulfill_obligation` is used during instance resolution for trait items. In case of insufficient normalization issues during MIR inlining, it caused ICEs. It's better to gracefully refuse to resolve the associated item, and let the caller decide what to do with this. Split from https://github.com/rust-lang/rust/pull/91743 Closes #69121 Closes #73021 Closes #88599 Closes #93008 Closes #93248 Closes #94680 Closes #96170 r? `@oli-obk`
2022-05-11Remove `PartialOrd`/`Ord` impl for `PlaceRef`Aaron Hill-1/+8
This is a new attempt at #93315. It removes one usage of the `Ord` impl for `DefId`, which should make it easier to eventually remove that impl.
2022-05-11Gracefully fail to resolve associated items instead of `delay_span_bug`.Camille GILLOT-1/+19
2022-05-10Introduce EarlyBinderJack Huey-44/+109
2022-05-10Use lifetimes on type-alias-impl-trait used in function signatures to infer ↵Oli Scherer-1/+1
output type lifetimes
2022-05-10Use InternedObligationCauseCode everywhereOli Scherer-28/+20
2022-05-10Make `FunctionArgumentObligation` also use the "no allocation for misc" trickOli Scherer-6/+16
2022-05-10Don't allocate misc obligation parents of derived obligationsOli Scherer-6/+7
2022-05-10Make the derived obligation cause parent privateOli Scherer-1/+9
2022-05-10Add a helper function for a common piece of codeOli Scherer-13/+15
2022-05-10Auto merge of #94799 - lcnr:list-ty-perf, r=petrochenkovbors-7/+5
update `hash_stable` for `List<Ty<'tcx>>` cc https://github.com/rust-lang/rust/pull/93505#issuecomment-1047538798 this is the hottest part changed since the pre-merge perf run
2022-05-10Remove `clone_code` methodOli Scherer-7/+0
2022-05-10Remove another use of clone_codeOli Scherer-1/+1
2022-05-10update clippylcnr-1/+1
2022-05-10only_local: always check for misuselcnr-31/+37
2022-05-10Move an extension trait method onto the type directly and reuse itOli Scherer-0/+24
2022-05-10Remove some unnecessary clonesOli Scherer-4/+10
2022-05-10update coherence docs, fix opaque type + generator icelcnr-0/+3
2022-05-10Rollup merge of #96872 - RalfJung:layout-sanity, r=eddybDylan DPC-9/+127
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks `@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution! I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones. Cc `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/96221
2022-05-10add check and don't encode `#[inline]`lcnr-0/+3
2022-05-10fix commentlcnr-3/+3
2022-05-10don't encode only locally used attrslcnr-0/+7
2022-05-09Auto merge of #96838 - tmiasko:lazy-switch-sources, r=oli-obkbors-7/+7
Optimize switch sources representation and usage * Avoid constructing switch sources unless necessary - switch sources are used by backward analysis with a custom switch int edge effects, but are otherwise unnecessarily computed. * Use sparse representation of switch sources to avoid quadratic space overhead.
2022-05-09Auto merge of #96473 - lcnr:querify-codegen-fn-attrs, r=cjgillotbors-23/+50
store `codegen_fn_attrs` in crate metadata extracted from #95562 because the change isn't trivial.
2022-05-09also sanity-check Abi::Vector, and slight refactoringRalf Jung-26/+43
2022-05-09Rollup merge of #96854 - jackh726:subst-cleanup, r=compiler-errorsMatthias Krüger-38/+10
Some subst cleanup Two separate things here. Both changes are useful for some refactoring I'm doing to add an "EarlyBinder" newtype. (Part of chalkification). 1) Remove `subst_spanned` and just use `subst`. It wasn't used much anyways. In practice, I think we can probably get most of the info just from the actual error message. If not, outputting logs should do the trick. (The specific line probably wouldn't help much anyways). 2) Call `.subst()` before `replace_bound_vars_with_fresh_vars` and `erase_late_bound_regions` in three places that do the opposite. I think there might have been some time in the past that the order here matter for something, but this shouldn't be the case anymore. Conceptually, it makes more sense to the of the *early bound* vars on `fn`s as "outside" the late bound vars.
2022-05-09reviewlcnr-38/+24
2022-05-09only compute `codegen_fn_attrs` where neededlcnr-2/+41
2022-05-09make sure ScalarPair enums have ScalarPair variants; add some layout sanity ↵Ralf Jung-11/+112
checks
2022-05-09only cache `codegen_fn_attrs` on disk if its locallcnr-1/+1
2022-05-09move `panic-in-drop=abort` check for `drop_in_place`lcnr-20/+21
Whether `drop_in_place` can abort does depend on the `panic-in-drop` option while compiling the current crate, not `core`
2022-05-09store `codegen_fn_attrs` in crate metadatalcnr-0/+1