about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2023-09-14differentiate root and nested goalslcnr-10/+19
2023-09-14Auto merge of #115764 - RalfJung:const-by-ref-alloc-id, r=oli-obkbors-71/+109
some ConstValue refactoring In particular, use AllocId instead of Allocation in ConstValue::ByRef. This helps avoid redundant AllocIds when a `ByRef` constant gets put back into the interpreter. r? `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/105536
2023-09-14fix clippy (and MIR printing) handling of ConstValue::Indirect slicesRalf Jung-26/+62
2023-09-14don't force all slice-typed ConstValue to be ConstValue::SliceRalf Jung-18/+7
2023-09-14inspect: explicitly store added goalslcnr-0/+2
2023-09-14order `added_goals_evaluation` and `nested_probes`lcnr-7/+12
2023-09-14`GoalCandidate` to `Probe`lcnr-11/+14
2023-09-14treat host effect params as erased generics in codegenDeadbeef-11/+21
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-09-14found another place where we can eval() a const, and go through valtreesRalf Jung-6/+5
2023-09-14always evaluate ConstantKind::Ty through valtreesRalf Jung-16/+12
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-11/+12
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-9/+15
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-11/+17
2023-09-14Auto merge of #115751 - lcnr:inspect-cleanup, r=compiler-errorsbors-80/+149
some inspect improvements split from #114810 because I still want to experiment a bunch with that PR and these changes are self-contained. r? `@compiler-errors`
2023-09-14Properly consider binder vars in HasTypeFlagsVisitorMichael Goulet-15/+45
2023-09-14Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obkbors-1/+1
Rework `no_coverage` to `coverage(off)` As discussed at the tail of https://github.com/rust-lang/rust/issues/84605 this replaces the `no_coverage` attribute with a `coverage` attribute that takes sub-parameters (currently `off` and `on`) to control the coverage instrumentation. Allows future-proofing for things like `coverage(off, reason="Tested live", issue="#12345")` or similar.
2023-09-13rustc_middle: add `Scalar::from_i8` and `Scalar::from_i16` and use them in MiriEduardo Sánchez Muñoz-0/+10
2023-09-13Rollup merge of #115736 - Zoxc:time-cleanup, r=wesleywiserMatthias Krüger-0/+37
Remove `verbose_generic_activity_with_arg` This removes `verbose_generic_activity_with_arg` and changes users to `generic_activity_with_arg`. This keeps the output of `-Z time` readable while these repeated events are still available with the self profiling mechanism.
2023-09-13Auto merge of #115803 - RalfJung:const-eval, r=oli-obkbors-249/+191
make the eval() functions on our const types return the resulting value This is a part of https://github.com/rust-lang/rust/pull/115748 that's hopefully perf-neutral, and that does not depend on https://github.com/rust-lang/rust/pull/115764.
2023-09-13Generate MIR pass names for profiling on the fly and pass the body DefId as ↵John Kåre Alsaker-0/+37
argument
2023-09-13restore the old logic adjusting ty::UnevaluatedConst before evaluationRalf Jung-29/+41
2023-09-13Auto merge of #115810 - nnethercote:folding-comments, r=WaffleLapkinbors-8/+8
Folding comments r? `@WaffleLapkin`
2023-09-13Comments to clarify the working of `HasTypeFlagsVisitor`.Nicholas Nethercote-8/+8
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-150/+116
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-161/+125
2023-09-12`#[diagnostic::on_unimplemented]` without filtersGeorg Semmler-0/+16
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
2023-09-12Auto merge of #115699 - RalfJung:interpret-abi-compat, r=oli-obkbors-8/+15
interpret: change ABI-compat test to be type-based This makes the test consistent across targets. Otherwise the chances are very high that ABI mismatches get accepted on x86_64 but still fail on many other targets with more complicated ABIs. This implements (most of) the rules described in https://github.com/rust-lang/rust/pull/115476.
2023-09-11Rollup merge of #115743 - compiler-errors:no-impls, r=davidtwcoMatthias Krüger-0/+4
Point out if a local trait has no implementations Slightly helps with #115741
2023-09-11Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obkMatthias Krüger-24/+117
Implement fallback for effect param r? `@oli-obk` or `@lcnr` tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11dedup `GoalEvaluationStep` and `GoalCandidate`lcnr-14/+19
also handle 2 panics when dumping proof trees for the whole test suite - need to actually tell the proof tree builder about overflow - need to handle a recursion_limit of 0 :<
2023-09-11add `is_host_effect` to `GenericParamDefKind::Const` and address reviewDeadbeef-4/+3
2023-09-11inspect: strongly typed CandidateKindlcnr-18/+89
2023-09-11Auto merge of #115656 - cjgillot:default-relative-spans, r=davidtwcobors-1/+1
Enable incremental-relative-spans by default. This was enabled on nightly in https://github.com/rust-lang/rust/pull/84762. It has been a while, without obvious bugs. It's time to enable it by default for incremental runs.
2023-09-11revision -> iteration for added_goals_evaluationlcnr-3/+3
2023-09-11split GoalEvaluation and CanonicalGoalEvaluationlcnr-50/+43
the unnormalized goal is in the callers inference context, while anything inside of the `CanonicalGoalEvaluation` is inside of a new one.
2023-09-11Disentangle `Debug` and `Display` for `Ty`.Nicholas Nethercote-15/+51
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This is surprising and annoying. In particular, it means `Debug` doesn't show as much information as `Debug` for `TyKind` does. And `Debug` is used in some user-facing error messages, which seems bad. This commit changes the `Debug` impl for `Ty` to call the `Debug` impl for `TyKind`. It also does a number of follow-up changes to preserve existing output, many of which involve inserting `with_no_trimmed_paths!` calls. It also adds `Display` impls for `UserType` and `Canonical`. Some tests have changes to expected output: - Those that use the `rustc_abi(debug)` attribute. - Those that use the `EMIT_MIR` annotation. In each case the output is slightly uglier than before. This isn't ideal, but it's pretty weird (particularly for the attribute) that the output is using `Debug` in the first place. They're fairly obscure attributes (I hadn't heard of them) so I'm not worried by this. For `async-is-unwindsafe.stderr`, there is one line that now lacks a full path. This is a consistency improvement, because all the other mentions of `Context` in this test lack a path.
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+4
2023-09-10Implement fallback for effect paramDeadbeef-21/+115
2023-09-10Cache reachable_set on diskTomasz Miąsko-0/+1
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-5/+3
2023-09-09fix ptr_metadata_ty for DynStar typeRalf Jung-1/+3
2023-09-09give extra context to ABI mismatch errorsRalf Jung-7/+12
2023-09-09Auto merge of #115657 - Zoxc:source-span-avoid-query, r=cjgillotbors-1/+1
Avoid a `source_span` query when encoding Spans into query results This avoids a `source_span` query when encoding `Span`s into query results. It's not sound to execute queries here as the query caches can be locked and the dep graph is no longer writable. r? `@cjgillot`
2023-09-08Auto merge of #115418 - Zoxc:freeze-source, r=oli-obkbors-1/+1
Use `Freeze` for `SourceFile` This uses the `Freeze` type in `SourceFile` to let accessing `external_src` and `lines` be lock-free. Behavior of `add_external_src` is changed to set `ExternalSourceKind::AbsentErr` on a hash mismatch which matches the documentation. `ExternalSourceKind::Unneeded` was removed as it's unused. Based on https://github.com/rust-lang/rust/pull/115401.
2023-09-08Auto merge of #115612 - cjgillot:const-prop-int, r=oli-obkbors-1/+13
Improvements to dataflow const-prop Partially cherry-picked from https://github.com/rust-lang/rust/pull/110719 r? `@oli-obk` cc `@jachris`
2023-09-08Rework no_coverage to coverage(off)Andy Caldwell-1/+1
2023-09-08Rollup merge of #115629 - compiler-errors:sugg-deref-unsize, r=oli-obkMatthias Krüger-11/+8
Don't suggest dereferencing to unsized type Rudimentary check that the self type is Sized. I don't really like any of this diagnostics code -- it's really messy and also really prone to false positives and negatives, but oh well. Fixes #115569
2023-09-08Rollup merge of #115624 - compiler-errors:rtn-path, r=WaffleLapkinMatthias Krüger-0/+11
Print the path of a return-position impl trait in trait when `return_type_notation` is enabled When we're printing a return-position impl trait in trait, we usually just print it like an opaque. This is *usually* fine, but can be confusing when using `return_type_notation`. Print the path of the method from where the RPITIT originates when this feature gate is enabled.
2023-09-08Avoid a `source_span` query when encoding Spans into query resultsJohn Kåre Alsaker-1/+1
2023-09-07Enable incremental-relative-spans by default.Camille GILLOT-1/+1