| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
make Map::def_kind take LocalDefId
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
crates are DefKind::Mod
|
|
Replace fragile erroneous const sys
Closes #67191
r? @oli-obk
|
|
marmeladema:issue70853/librustc_middle-local-def-id-2, r=eddyb
Simplify `local_def_id` and `as_local_hir_id`
See #70853
|
|
Add leading 0x to offset in Debug fmt of Pointer
Currently the `Debug` format for `Pointer` prints its offset in hexadecimal, for example, `alloc38657819+e2` or `alloc35122748+64`. This PR adds a leading `0x` to the offset, in order to make it apparent that it is indeed a hexadecimal number. This came up during discussion of rust-lang/miri#1354. r? @RalfJung
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove outdated reference to interpreter snapshotting
This should have been a part of #70087.
r? @RalfJung
|
|
Reading from the return place is fine
Const eval thinks that reading from local `_0` is UB, but it isn't. `_0` is just a normal local like any other, and codegen handles it that way too. The only special thing is that the `Return` terminator will read from it.
I've hit these errors while working on an NRVO pass that can merge other locals with `_0` in https://github.com/rust-lang/rust/pull/71003.
r? @oli-obk
|
|
|
|
|
|
...instead of a `LockGuard` which means the lock is held for longer than
necessary.
|
|
There is no `Arc::map` equivalent to `LockGuard::map`
|
|
|
|
|
|
Remove `BodyAndCache`
...returning to the original approach using interior mutability within `Body`. This simplifies the API at the cost of some uncontended mutex locks when the parallel compiler is enabled.
The current API requires you to either have a mutable reference to `Body` (`&mut BodyAndCache`), or to compute the predecessor graph ahead of time by creating a `ReadOnlyBodyAndCache`. This is not a good fit for, e.g., the dataflow framework, which
1. does not mutate the MIR
2. only sometimes needs the predecessor graph (for backward dataflow problems)
|
|
...with a single one to `predecessors`. `predecessors_for` requires
taking the lock/incrementing the `RefCell` once each call.
|
|
|
|
|
|
|
|
visit_place_base is just visit_local
r? @wesleywiser
|
|
Rollup of 6 pull requests
Successful merges:
- #70970 (Detect mistyped associated consts in `Instance::resolve`.)
- #71203 (Correct await span for async-await error reporting)
- #71214 (Add error code for inner doc error)
- #71337 (Moving all rustdoc-ui tests to check-pass)
- #71412 (Clarify unused_doc_comments note on macro invocations)
- #71414 (More diagnostic items for Clippy usage)
Failed merges:
r? @ghost
|
|
Correct await span for async-await error reporting
Closes #71137
r? @tmandry
|
|
Detect mistyped associated consts in `Instance::resolve`.
*Based on #71049 to prevent redundant/misleading downstream errors.*
Fixes #70942 by refusing to resolve an associated `const` if it doesn't have the same type in the `impl` that it does in the `trait` (which we assume had errored, and `delay_span_bug` guards against bugs).
|
|
Add `-Cbitcode-in-rlib`.
This is a cut-down version of #70458 that gets the compile-time wins.
r? @alexcrichton
|
|
This comment wasn't supposed to have landed.
|
|
|
|
Remove unused rustc_serialize::hex module
* Remove unused `rustc_serialize::hex` module
* Cleanup `Cargo.toml`
|
|
|
|
|
|
Copy its value to the `return_place` upon leaving a call frame
|
|
|
|
A big options clean-up
Lots of improvements here.
r? @Centril
|
|
|
|
ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).
Oddly enough, we don't have any UI tests showing this off in types, only `mir-opt` tests.
However, the pretty form should show up in the test output diff of #71018, if this PR is merged first.
<hr/>
Examples of before/after:
|`Option<bool>`|
|:-:|
|`{transmute(0x01): std::option::Option<bool>}`|
| :sparkles: ↓↓↓ :sparkles: |
|`std::option::Option::<bool>::Some(true)`|
| `RawVec<u32>` |
|:-:|
| `ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::<u32>`|
| :sparkles: ↓↓↓ :sparkles: |
|`alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }`|
<hr/>
This PR is a prerequisite for #61486, *sort of*, in that we need to be able to pretty-print values in order to even consider how we might mangle them.
We still don't have pretty-printing for constants of reference types, @oli-obk has the necessary support logic in a PR but I didn't want to interfere with that.
<hr/>
Each commit should be reviewed separately, as I've fixed a couple deficiencies along the way.
r? @oli-obk cc @rust-lang/wg-mir-opt @varkor @yodaldevoid
|
|
Rollup of 4 pull requests
Successful merges:
- #71026 (Fix false "never constructed" warnings for `Self::` variant paths)
- #71310 (Do not show DefId in diagnostics)
- #71317 (miri-unleash test for llvm_asm)
- #71324 (Fix some tests failing in `--pass check` mode)
Failed merges:
r? @ghost
|
|
Do not show DefId in diagnostics
Fixes #71222
r? @estebank cc @eddyb
|
|
|
|
Make `needs_drop` less pessimistic on generators
Generators only have non-trivial drop logic when they may store (in upvars or across yields) a type that does.
This prevents generation of some unnecessary MIR in simple generators. There might be some impact on compile times, but this is probably limited in real-world applications.
~~This builds off of https://github.com/rust-lang/rust/pull/69814 since that contains some fixes that are made relevant by *this* PR (see https://github.com/rust-lang/rust/pull/69814#issuecomment-599147269).~~ (this has been merged)
|
|
This lets us specify the default at the options declaration point,
instead of using `.unwrap(default)` or `None | Some(default)` at some
use point far away. It also makes the code more concise.
|
|
|
|
|