about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2022-12-14always use anonymize_bound_varsMichael Goulet-30/+0
2022-12-14Fix rustdocOli Scherer-1/+1
2022-12-14Auto traits in dyn are suggestableMichael Goulet-13/+2
2022-12-14Debug assertions hate this trickOli Scherer-3/+3
2022-12-14Fix some comments and only get the generics in debug modeOli Scherer-27/+23
2022-12-14Remove TraitRef::newOli Scherer-20/+6
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-8/+13
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-13/+16
2022-12-14Remove one more usage of `mk_substs_trait`Oli Scherer-1/+1
2022-12-14Remove many more cases of `mk_substs_trait` that can now use the iterator ↵Oli Scherer-1/+17
scheme`
2022-12-14Let `mk_fn_def` take an iterator instead to simplify some call sitesOli Scherer-5/+13
2022-12-14Rename to match similar methodsOli Scherer-3/+3
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-12/+22
2022-12-14Fix unsafetyck disabling for custom MIRJakob Degen-0/+5
2022-12-14some fixes/improvements to mir::visit moduleTshepang Mbambo-4/+4
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-152/+149
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Rollup merge of #105628 - spastorino:small-doc-fixes, r=compiler-errorsMatthias Krüger-1/+1
Small doc fixes r? `@compiler-errors`
2022-12-13Address nitsMichael Goulet-8/+3
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-12-13nit: docsMichael Goulet-3/+12
2022-12-13Combine identical alias armsMichael Goulet-45/+26
2022-12-13Combine projection and opaque into aliasMichael Goulet-71/+81
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-65/+59
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-42/+34
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-18/+24
2022-12-13make Opaque have one field: OpaqueTyMichael Goulet-1/+11
2022-12-13Auto merge of #105612 - oli-obk:bind_rustdoc, r=GuillaumeGomezbors-1/+12
use ty::Binder in rustdoc instead of `skip_binder` r? `@GuillaumeGomez` this is a preliminary cleanup required to be able to normalize correctly/conveniently in rustdoc
2022-12-13Make InternalSubsts rust docs a bit clearerSantiago Pastorino-1/+1
2022-12-13Remove instantiate_type_schemeMichael Goulet-3/+3
2022-12-13EarlyBinder nitsMichael Goulet-2/+9
2022-12-13Fast path some binder relationsMichael Goulet-5/+5
2022-12-12Rollup merge of #105593 - jruderman:patch-3, r=Dylan-DPCMatthias Krüger-1/+1
Fix typo in comment: length_limit
2022-12-12Avoid trying to normalize unnormalizable typesOli Scherer-1/+4
2022-12-12Round 3: require binders for substsOli Scherer-0/+1
2022-12-12Round 1: add some binders (fails due to losing bound vars and then rebinding ↵Oli Scherer-0/+7
them with `Binder::dummy`)
2022-12-11Fix typo in comment: length_limitJesse Ruderman-1/+1
2022-12-11bug! with a better error message for failing Instance::resolveMichael Goulet-1/+16
2022-12-11Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-deadMatthias Krüger-11/+0
compiler: remove unnecessary imports and qualified paths Some of these imports were necessary before Edition 2021, others were already in the prelude. I hope it's fine that this PR is so spread-out across files :/
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-17/+111
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-11/+0
2022-12-10Rollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwUMatthias Krüger-0/+9
Consider `parent_count` for const param defaults Fixes #105257
2022-12-10Rollup merge of #105234 - JakobDegen:unneeded-field, r=oli-obkMatthias Krüger-41/+10
Remove unneeded field from `SwitchTargets` This had a fixme already. The only change in behavior is that the mir dumps now no longer contains labels for the types of the integers on the edges of a switchint: Before: ![image](https://user-images.githubusercontent.com/51179609/205467622-34401a68-dca6-43eb-915e-b9fda1988860.png) After: ![image](https://user-images.githubusercontent.com/51179609/205467634-b5b2a259-9cb4-4843-845c-592c500f0f9c.png) I don't think that's a problem though. The information is still available to a user that really cares by checking the type of `_2`, so it honestly feels like a bit of an improvement to me. r? mir
2022-12-10Auto merge of #105525 - matthiaskrgr:rollup-ricyw5s, r=matthiaskrgrbors-0/+76
Rollup of 10 pull requests Successful merges: - #98391 (Reimplement std's thread parker on top of events on SGX) - #104019 (Compute generator sizes with `-Zprint_type_sizes`) - #104512 (Set `download-ci-llvm = "if-available"` by default when `channel = dev`) - #104901 (Implement masking in FileType comparison on Unix) - #105082 (Fix Async Generator ABI) - #105109 (Add LLVM KCFI support to the Rust compiler) - #105505 (Don't warn about unused parens when they are used by yeet expr) - #105514 (Introduce `Span::is_visible`) - #105516 (Update cargo) - #105522 (Remove wrong note for short circuiting operators) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-10Rollup merge of #104019 - compiler-errors:print-generator-sizes, r=wesleywiserMatthias Krüger-0/+76
Compute generator sizes with `-Zprint_type_sizes` Fixes #103887 r? `@pnkfelix`
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-33/+14
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-50/+33
2022-12-09Remove unneeded field from `SwitchTargets`Jakob Degen-41/+10
2022-12-09Help rust-analyzer normalize query return typesMaybe Waffle-1/+97
2022-12-09Rollup merge of #105455 - lcnr:correct-reveal-in-validate, r=jackh726Matthias Krüger-0/+8
use the correct `Reveal` during validation supersedes #105454. Deals with https://github.com/rust-lang/rust/issues/105009#issuecomment-1342395333, not closing #105009 as the ICE may leak into beta The issue was the following: - we optimize the mir, using `Reveal::All` - some optimization relies on the hidden type of an opaque type - we then validate using `Reveal::UserFacing` again which is not able to observe the hidden type r? `@jackh726`
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-2/+2
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-08Rollup merge of #105317 - RalfJung:retag-rework, r=oli-obkMatthias Krüger-1/+1
make retagging work even with 'unstable' places This is based on top of https://github.com/rust-lang/rust/pull/105301. Only the last two commits are new. While investigating https://github.com/rust-lang/unsafe-code-guidelines/issues/381 I realized that we would have caught this issue much earlier if the add_retag pass wouldn't bail out on assignments of the form `*ptr = ...`. So this PR changes our retag strategy: - When a new reference is created via `Rvalue::Ref` (or a raw ptr via `Rvalue::AddressOf`), we do the retagging as part of just executing that address-taking operation. - For everything else, we still insert retags -- these retags basically serve to ensure that references stored in local variables (and their fields) are always freshly tagged, so skipping this for assignments like `*ptr = ...` is less egregious. r? ```@oli-obk```