about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
AgeCommit message (Collapse)AuthorLines
2022-12-17Ensure param-env is const before calling eval_to_valtreeMichael Goulet-2/+4
2022-12-15simplify alignment_check_failed a bitRalf Jung-14/+5
2022-12-15Reuse the ctfe error emitting logic for the future incompat lintOli Scherer-17/+22
2022-12-15Factor decorate closure out into a methodOli Scherer-70/+65
2022-12-15Move alignment failure error reporting to machineOli Scherer-42/+47
2022-12-15Make alignment checks a future incompat lintOli Scherer-47/+110
2022-12-15Always pass alignment and handle checking lazilyOli Scherer-9/+17
2022-12-15always check alignment during CTFERalf Jung-1/+1
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-2/+2
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-16/+10
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 #105659 - JakobDegen:storage-live-borrow, r=davidtwcoMatthias Krüger-2/+2
Don't require owned data in `MaybeStorageLive` Small improvement that avoids a clone. I don't expect this to have any noticeable perf effects, but better to have it than not to. r? ``@tmiasko``
2022-12-13Combine identical alias armsMichael Goulet-14/+8
2022-12-13Combine projection and opaque into aliasMichael Goulet-12/+12
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-4/+4
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-1/+1
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-3/+3
2022-12-13Rename `assert_uninit_valid` intrinsicNilstrieb-2/+4
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
2022-12-13Don't require owned data in `MaybeStorageLive`Jakob Degen-2/+2
2022-12-13Clarify what "this" meansOli Scherer-15/+3
2022-12-12interpret: add read_machine_[ui]size convenience methodsRalf Jung-6/+17
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-10compiler: remove unnecessary imports and qualified pathsKaDiWa-11/+0
2022-12-09Remove unneeded field from `SwitchTargets`Jakob Degen-13/+3
2022-12-09Auto merge of #105486 - matthiaskrgr:rollup-o7c4l1c, r=matthiaskrgrbors-1/+5
Rollup of 10 pull requests Successful merges: - #105216 (Remove unused GUI test) - #105245 (attempt to clarify align_to docs) - #105387 (Improve Rustdoc scrape-examples UI) - #105389 (Enable profiler in dist-powerpc64le-linux) - #105427 (Dont silently ignore rustdoc errors) - #105442 (rustdoc: clean up docblock table CSS) - #105443 (Move some queries and methods) - #105455 (use the correct `Reveal` during validation) - #105470 (Clippy: backport ICE fix before beta branch) - #105474 (lib docs: fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-09Rollup merge of #105455 - lcnr:correct-reveal-in-validate, r=jackh726Matthias Krüger-1/+5
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-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-18/+6
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-08validate: use the correct reveal during optslcnr-1/+5
2022-12-06Change CTFE backtraces to use `note` instead of `label` to preserve their orderOli Scherer-3/+3
labels are reordered within the file in which they are reported, which can mess up the stack trace
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-15/+3
2022-12-06make retagging work even with 'unstable' placesRalf Jung-6/+49
2022-12-06Rollup merge of #105289 - Rageking8:fix-dupe-word-typos, r=cjgillotYuki Okushi-1/+1
Fix dupe word typos
2022-12-06Rollup merge of #105207 - RalfJung:interpret-clobber-return, r=oli-obkYuki Okushi-0/+4
interpret: clobber return place when calling function Makes sure the callee cannot observe the previous contents of the return place, and the caller cannot read any of the old return place contents even if the function unwinds. I don't think we can test for this though, that would require some strange hand-written MIR. r? `````@oli-obk`````
2022-12-05fix dupe word typosRageking8-1/+1
2022-12-03interpret: clobber return place when calling functionRalf Jung-0/+4
2022-12-02Rollup merge of #105136 - RalfJung:deref-promotion-comment, r=oli-obkMatthias Krüger-4/+4
clarify comment on Deref promotion r? `@oli-obk`
2022-12-01clarify comment on Deref promotionRalf Jung-4/+4
2022-11-30Close accidental promotion check holeOli Scherer-8/+6
2022-11-30Auto merge of #104905 - compiler-errors:normalization-changes, r=spastorinobors-4/+3
Some initial normalization method changes 1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`) 2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`) 3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize` 4. Remove some unused other normalization fns in `Inherited` and `FnCtxt` Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic. Stacked on top of #104835 for convenience. r? types
2022-11-28Make ObligationCtxt::normalize take cause by borrowMichael Goulet-4/+3
2022-11-28Rollup merge of #104982 - RalfJung:norun, r=oli-obkMatthias Krüger-6/+1
interpret: get rid of run() function Miri needs its own loop anyway, so there's not much of a point in trying to share this code.
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-15/+16
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Rollup merge of #104931 - Swatinem:async-pretty, r=eholkMatthias Krüger-1/+1
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-27interpret: get rid of run() functionRalf Jung-6/+1
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-15/+16
2022-11-27Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnrbors-17/+10
Various cleanups around scalar layout restrictions Pulled out of https://github.com/rust-lang/rust/pull/103724
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-1/+1
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-0/+2
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25add FIXME'sBoxy-0/+1
2022-11-25Add empty ConstKind::Abstractkadmin-0/+1
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Move a comment to the right placeOli Scherer-3/+3