about summary refs log tree commit diff
path: root/src/librustc_middle
AgeCommit message (Collapse)AuthorLines
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-32/+22
2020-04-24Split out the `Generator` case from `DefKind::Closure`.Eduard-Mihai Burtescu-1/+2
2020-04-24add a few more DefKindsmark-20/+27
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
2020-04-24Auto merge of #70820 - spastorino:replace-fragile-erroneous-const-sys, r=oli-obkbors-1/+12
Replace fragile erroneous const sys Closes #67191 r? @oli-obk
2020-04-24Auto merge of #71215 - ↵bors-63/+70
marmeladema:issue70853/librustc_middle-local-def-id-2, r=eddyb Simplify `local_def_id` and `as_local_hir_id` See #70853
2020-04-24Rollup merge of #71459 - divergentdave:pointer-offset-0x, r=RalfJungDylan DPC-2/+2
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
2020-04-23Address comments from reviewmarmeladema-23/+14
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-42/+31
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-34/+63
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-19/+17
2020-04-23Rename uneval_consts to required_constsSantiago Pastorino-5/+6
2020-04-23Visit unevaluated constants in super_bodySantiago Pastorino-0/+5
2020-04-23Add MirPass to collect Unevaluated consts in MIR bodySantiago Pastorino-0/+5
2020-04-23Make mir::Constant CopySantiago Pastorino-1/+1
2020-04-23add back Scalar::null_ptrRalf Jung-0/+5
2020-04-23Rollup merge of #71452 - ecstatic-morse:no-more-snapshot, r=RalfJungDylan DPC-2/+0
Remove outdated reference to interpreter snapshotting This should have been a part of #70087. r? @RalfJung
2020-04-23Rollup merge of #71005 - jonas-schievink:no-place-like-return, r=oli-obkDylan DPC-8/+0
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
2020-04-23Add leading 0x to offset in Debug fmt of PointerDavid Cook-2/+2
2020-04-22Add module docs and restrict visibilityDylan MacKenzie-5/+7
2020-04-22Use a ref-counted pointer for ownership of the predecessor cacheDylan MacKenzie-14/+23
...instead of a `LockGuard` which means the lock is held for longer than necessary.
2020-04-22Remove `predecessors_for`Dylan MacKenzie-12/+1
There is no `Arc::map` equivalent to `LockGuard::map`
2020-04-22Remove outdated reference to interpreter snapshottingDylan MacKenzie-2/+0
2020-04-22Move `{Free,}RegionRelations` and `FreeRegionMap` out of `rustc_middle`Dylan MacKenzie-179/+0
2020-04-22Auto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obkbors-340/+185
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)
2020-04-22Replace multiple calls to `predecessors_for`Dylan MacKenzie-2/+4
...with a single one to `predecessors`. `predecessors_for` requires taking the lock/incrementing the `RefCell` once each call.
2020-04-22Add `#[inline]` declarationsDylan MacKenzie-0/+15
2020-04-22Use `Body` everywhereDylan MacKenzie-51/+33
2020-04-22Use internal mutability for predecessor cacheDylan MacKenzie-287/+133
2020-04-22Rollup merge of #71401 - spastorino:remove-visit-place-base, r=wesleywiserDylan DPC-16/+2
visit_place_base is just visit_local r? @wesleywiser
2020-04-22Auto merge of #71424 - Dylan-DPC:rollup-iunh61a, r=Dylan-DPCbors-31/+47
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
2020-04-22Rollup merge of #71203 - csmoe:issue-71137, r=csmoeDylan DPC-3/+5
Correct await span for async-await error reporting Closes #71137 r? @tmandry
2020-04-22Rollup merge of #70970 - eddyb:trait-vs-impl-mismatch, r=oli-obkDylan DPC-28/+42
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).
2020-04-22Auto merge of #71323 - nnethercote:bitcode-in-rlib, r=alexcrichtonbors-1/+0
Add `-Cbitcode-in-rlib`. This is a cut-down version of #70458 that gets the compile-time wins. r? @alexcrichton
2020-04-22Remove an old in-progress comment from a previous PR.Nicholas Nethercote-1/+0
This comment wasn't supposed to have landed.
2020-04-22add test for correct await spancsmoe-2/+2
2020-04-22Rollup merge of #71236 - sinkuu:cleanup, r=nikomatsakisYuki Okushi-2/+0
Remove unused rustc_serialize::hex module * Remove unused `rustc_serialize::hex` module * Cleanup `Cargo.toml`
2020-04-21visit_place_base is just visit_localSantiago Pastorino-16/+2
2020-04-20Remove null placesJonas Schievink-5/+0
2020-04-20Treat RETURN_PLACE as a normal LocalJonas Schievink-3/+0
Copy its value to the `return_place` upon leaving a call frame
2020-04-20Use more `Iterator`s instead of `Vec`sEsteban Küber-7/+5
2020-04-20Auto merge of #70729 - nnethercote:a-big-options-clean-up, r=petrochenkovbors-3/+1
A big options clean-up Lots of improvements here. r? @Centril
2020-04-20Remove unused dependenciesShotaro Yamada-2/+0
2020-04-20Auto merge of #71232 - eddyb:print-const-adts, r=oli-obkbors-68/+93
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
2020-04-19Auto merge of #71331 - Dylan-DPC:rollup-5rn1isc, r=Dylan-DPCbors-6/+2
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
2020-04-19Rollup merge of #71310 - JohnTitor:dont-did, r=estebankDylan DPC-6/+2
Do not show DefId in diagnostics Fixes #71222 r? @estebank cc @eddyb
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-58/+61
2020-04-19Auto merge of #70015 - jonas-schievink:gen-needs-drop, r=matthewjasperbors-5/+3
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)
2020-04-19Replace uses of `parse_opt_*` with `parse_*` where possible.Nicholas Nethercote-3/+1
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.
2020-04-19Do not show DefId in diagnosticsYuki Okushi-6/+2
2020-04-18Do not emit note for projected derived obligationsEsteban Küber-1/+7