| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
Remove `SymbolStr`
This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences.
Best reviewed one commit at a time.
r? `@oli-obk`
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #90939 (Tweak errors coming from `for`-loop, `?` and `.await` desugaring)
- #91859 (Iterator::cycle() — document empty iterator special case)
- #91868 (Use `OutputFilenames` to generate output file for `-Zllvm-time-trace`)
- #91870 (Revert setting a default for the MACOSX_DEPLOYMENT_TARGET env var for linking)
- #91881 (Stabilize `iter::zip`)
- #91882 (Remove `in_band_lifetimes` from `rustc_typeck`)
- #91940 (Update cargo)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Looser check for overflowing_binary_op
Fix for issue #91636 tight check resulted in ICE, this makes the check a little looser. It seems `eq` allows comparing of `supertype` and `subtype` if `lhs = supertype` and `rhs = subtype` but not vice versa, is this intended behavior ?
|
|
|
|
See #91867 for more information.
|
|
|
|
|
|
|
|
Eliminate ConstnessAnd again
Closes #91489.
Closes #89432.
Reverts #91491.
Reverts #89450.
r? `@spastorino`
|
|
better span for unexpected normalization failure in CTFE engine
No reason to use `DUMMY_SP` here.
|
|
doc: fix typo in comments
`dereferencable -> dereferenceable`
Fixes #91802.
|
|
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing
changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
|
|
|
|
dereferencable -> dereferenceable
|
|
Make `intrinsics::write_bytes` const
This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.
Tracking issue: #86302
|
|
|
|
Allow for failure of subst_normalize_erasing_regions in const_eval
Fixes https://github.com/rust-lang/rust/issues/72845
Using associated types that cannot be normalized previously resulted in an ICE. We now allow for normalization failure and return a "TooGeneric" error in that case.
r? ```@RalfJung``` maybe?
|
|
Print a suggestion when comparing references to primitive types in `const fn`
Fixes #90870.
|
|
|
|
Add a MIR pass manager (Taylor's Version)
The final draft of #91386 and #77665.
While the compile-time constraints in #91386 are cool, I decided on a more minimal approach for now. I want to explore phase constraints and maybe relative-ordering constraints in the future, though. This should preserve existing behavior **exactly** (please let me know if it doesn't) while making the following changes to the way we organize things today:
- Each `MirPhase` now corresponds to a single MIR pass. `run_passes` is not responsible for listing the correct MIR phase.
- `run_passes` no longer silently skips passes if the declared MIR phase is greater than or equal to the body's. This has bitten me multiple times. If you want this behavior, you can always branch on `body.phase` yourself.
- If your pass is solely to emit errors, you can use the `MirLint` interface instead, which gets a shared reference to `Body` instead of a mutable one. By differentiating the two, I hope to make it clearer in the short term where lints belong in the pipeline. In the long term perhaps we could enforce this at compile-time?
- MIR is no longer dumped for passes that aren't enabled, or for lints.
I tried to check that `-Zvalidate` still works correctly, since the MIR phase is now updated as soon as the associated pass is done, instead of at the end of all the passes in `run_passes`. However, it looks like `-Zvalidate` is broken with current nightlies anyways :cry: (it spits out a bunch of errors).
cc `@oli-obk` `@wesleywiser`
r? rust-lang/wg-mir-opt
|
|
|
|
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing
changes made to d9baa361902b172be716f96619b909f340802dea.
|
|
|
|
Rollup of 12 pull requests
Successful merges:
- #89954 (Fix legacy_const_generic doc arguments display)
- #91321 (Handle placeholder regions in NLL type outlive constraints)
- #91329 (Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives`)
- #91364 (Improve error message for incorrect field accesses through raw pointers)
- #91387 (Clarify and tidy up explanation of E0038)
- #91410 (Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline)
- #91435 (Improve diagnostic for missing half of binary operator in `if` condition)
- #91444 (disable tests in Miri that take too long)
- #91457 (Add additional test from rust issue number 91068)
- #91460 (Document how `last_os_error` should be used)
- #91464 (Document file path case sensitivity)
- #91466 (Improve the comments in `Symbol::interner`.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=oli-obk
Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline
Should mitigate the issues found during MCP on #73255.
Once this is done, we should clean up the queries a bit, since I think `mir_drops_elaborated_and_const_checked` can be merged back into `mir_promoted`.
Fixes #90770.
cc ``@rust-lang/wg-const-eval``
r? ``@nikomatsakis`` (since they reviewed #71824)
|
|
|
|
Cleanup: Eliminate ConstnessAnd
This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature.
We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`.
This is a continuation of https://github.com/rust-lang/rust/pull/90274.
r? `@oli-obk`
cc `@spastorino` `@ecstatic-morse`
|
|
It runs before the real drop elaboration pass.
|
|
Don't re-export `MirPass`
`rust-analyzer` wants to use the `rustc_const_eval` one by default, which is weird.
r? ``@cjgillot``
|
|
CTFE: support assert_zero_valid and assert_uninit_valid
This ensures the implementation of all three type-based assert_ intrinsics remains consistent in Miri.
`assert_inhabited` recently got stabilized in https://github.com/rust-lang/rust/pull/90896 (meaning stable `const fn` can call it), so do the same with these other intrinsics.
Cc ```@rust-lang/wg-const-eval```
|
|
|
|
|
|
Nothing else makes sense, and there is no "danger" in doing so, as it only does something if there are const bounds, which are unstable. This used to happen implicitly via the inferctxt before, which was much more fragile.
|
|
for it
This breaks a ~const test that will be fixed in a follow up commit of this PR
|
|
Perform Sync check on static items in wf-check instead of during const checks
r? `@RalfJung`
This check is solely happening on the signature of the static item and not on its body, therefor it belongs into wf-checking instead of const checking.
|
|
Make `TypeFolder::fold_*` return `Result`
Implements rust-lang/compiler-team#432.
Initially this is just a rebase of `@LeSeulArtichaut's` work in #85469 (abandoned; see https://github.com/rust-lang/rust/pull/85485#issuecomment-908781112). At that time, it caused a regression in performance that required some further exploration... with this rebased PR bors can hopefully report some perf analysis from which we can investigate further (if the regression is indeed still present).
r? `@jackh726` cc `@nikomatsakis`
|
|
|
|
functions
|
|
|
|
Co-authored-by: Alan Egerton <eggyal@gmail.com>
|
|
explain why CTFE/Miri perform truncation on shift offset
Closes https://github.com/rust-lang/miri/issues/1920
|
|
|