about summary refs log tree commit diff
path: root/src/librustc_middle
AgeCommit message (Collapse)AuthorLines
2020-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-1/+1
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-31Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakisbors-79/+135
Normalize all opaque types when converting ParamEnv to Reveal::All When we normalize a type using a ParamEnv with a reveal mode of RevealMode::All, we will normalize opaque types to their underlying types (e.g. `type MyOpaque = impl Foo` -> `StructThatImplsFoo`). However, the ParamEnv may still have predicates referring to the un-normalized opaque type (e.g. `<T as MyTrait<MyOpaque>>`). This can cause trait projection to fail, since a type containing normalized opaque types will not match up with the un-normalized type in the `ParamEnv`. To fix this, we now explicitly normalize all opaque types in caller_bounds of a `ParamEnv` when changing its mode to `RevealMode::All`. This ensures that all predicatse will refer to the underlying types of any opaque types involved, allowing them to be matched up properly during projection. To reflect the fact that normalization is occuring, `ParamEnv::with_reveal_all` is renamed to `ParamEnv::with_reveal_all_normalized` Fixes #65918
2020-07-30Address code review comments.jumbatm-4/+11
- Make `is_repr_nullable_ptr` freestanding again to avoid usage of ImproperCTypesVisitor in ClashingExternDeclarations (and don't accidentally revert the ParamEnv::reveal_all() fix from a week earlier) - Revise match condition for 1 Adt, 1 primitive - Generalise check for non-null type so that it would also work for ranges which exclude any single value (all bits set, for example) - Make is_repr_nullable_ptr return the representable type instead of just a boolean, to avoid adding an additional, independent "source of truth" about the FFI-compatibility of Option-like enums. Also, rename to `repr_nullable_ptr`.
2020-07-30Auto merge of #74876 - oli-obk:lumberjack_disable, r=RalfJungbors-37/+52
Replace all uses of `log::log_enabled` with `Debug` printers cc @RalfJung this touches a bunch of logging in the miri engine. There are some visual changes, mainly that in several cases we stop prepending lines with the module path and just have a newline.
2020-07-29Auto merge of #74733 - richkadel:llvm-coverage-map-gen-5, r=tmandrybors-4/+4
Fixed coverage map issues; better aligned with LLVM APIs Found some problems with the coverage map encoding when testing with more than one counter per function. While debugging, I realized some better ways to structure the Rust implementation of the coverage mapping generator. I refactored somewhat, resulting in less code overall, expanded coverage of LLVM Coverage Map capabilities, and much closer alignment with LLVM data structures, APIs, and naming. This should be easier to follow and easier to maintain. r? @tmandry Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-29Address review commentsOliver Scherer-39/+43
2020-07-28Cache non-exhaustive separately from attributesMark Rousskov-9/+3
2020-07-28Replace all uses of `log::log_enabled` with `Debug` printersOliver Scherer-17/+28
2020-07-27Auto merge of #73503 - lcnr:forall-predicate-what-and-why-2, r=nikomatsakisbors-179/+270
convert higher ranked `Predicate`s to `PredicateKind::ForAll` implements step 2 of https://github.com/rust-lang/compiler-team/issues/285 r? @nikomatsakis
2020-07-27cleanupBastian Kauschke-43/+23
2020-07-27it works again :tada:Bastian Kauschke-8/+14
2020-07-27fix rebaseBastian Kauschke-3/+3
2020-07-27directly contain `PredicateAtom` in `PredicateKind::ForAll`Bastian Kauschke-113/+106
2020-07-27introduce PredicateAtomBastian Kauschke-183/+202
2020-07-27add reuse_or_mk_predicateBastian Kauschke-5/+14
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-8/+11
2020-07-27split ignore_qualifiersBastian Kauschke-10/+39
2020-07-27reviewBastian Kauschke-13/+3
2020-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-304/+185
2020-07-27progressBastian Kauschke-20/+32
2020-07-27subst_supertraitBastian Kauschke-29/+12
2020-07-27somewhat related cleanupBastian Kauschke-8/+1
2020-07-27convert trivial predicatesBastian Kauschke-2/+2
2020-07-27minimalBastian Kauschke-9/+5
2020-07-27add `PredicateKint`, because who doesn't like bodgingBastian Kauschke-3/+200
2020-07-27Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obkbors-5/+3
Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id We only have to call `extern_static_alloc_id` when a `Pointer` is "imported" from the `tcx` to the machine, not on each access. Also drop the old hook for TLS handling, it is not needed any more. The Miri side of this is at https://github.com/rust-lang/miri/pull/1489. Fixes https://github.com/rust-lang/rust/issues/71194 r? @oli-obk
2020-07-27Auto merge of #74784 - anp:track-vtables, r=eddybbors-1/+1
Fix #[track_caller] shims for trait objects. We were missing an Instance::resolve_for_fn_ptr in resolve_for_vtable. Closes #74764.
2020-07-26compare tagged/niche-filling layout and pick the best oneErik Desjardins-1/+16
2020-07-26[experiment] ty/layout: compute both niche-filling and tagged layouts for enums.Eduard-Mihai Burtescu-4/+8
2020-07-26Share serialization optimization between incr and metadataAaron Hill-28/+34
2020-07-26Hygiene serialization implementationAaron Hill-80/+156
2020-07-26report kind of deprecated item in messageAndy Russell-7/+13
This is important for fields, which are incorrectly referred to as "items".
2020-07-26Fix #[track_caller] shims for trait objects.Adam Perry-1/+1
We were missing an Instance::resolve_for_fn_ptr in resolve_for_vtable. Closes #74764.
2020-07-26typos + fmtRalf Jung-3/+1
2020-07-26Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id which ↵Ralf Jung-4/+4
is called only when a pointer is 'imported' into the machine
2020-07-26Auto merge of #74664 - pnadon:Miri-rename-undef-uninit, r=RalfJungbors-62/+62
Miri rename undef uninit Renamed parts of code within the `librustc_middle/mir/interpret/` directory. Related issue [#71193](https://github.com/rust-lang/rust/issues/71193)
2020-07-25Miri: rename "undef" to "uninit"Philippe Nadon-47/+47
renamed Allocation::check_defined_and_ptr to Allocation::check_init_and_ptr renamed Allocation::check_defined_and_ptr to Allocation::check_init_and_ptr in src/librustc_middle/mir/interpret/allocation.rs renamed Allocation::is_defined and Allocation::check_defined, fixed documentation renamed Allocation::is_defined and Allocation::check_defined to is_init and check_init respectively. Fixed documentation so it correctly refers to "initialization" instead of "defined"-ness renamed Allocation::mark_definedness renamed Allocation::mark_definedness to Allocation::mark_init Renamed new_state parameter in Allocation::mark_init Renamed new_state to is_init, as the latter is more descriptive. renamed functions in AllocationDefinedness renamed AllocationDefinedness::all_bytes_undef and AllocationDefinedness::mark_compressed_undef_range to no_bytes_init and mark_compressed_init_range respectively. renamed AllocationDefinedness to InitMaskCompressed renamed Immediate::to_scalar_or_undef renamed to to_scalar_or_uninit fixed comment references to "undef" Changed comments referring to "undef" and "definedness" to "initialization" and "initialization state" in src/librustc_mir/interpret/memory.rs and src/librustc_middle/mir/interpret/allocation.rs changed references to "undef" in comments and a variable Changed some comments referring to "undef" to use "uninitialized" instead. Also changed a variable from "undef_end" to "uninit_end". All changes were made within src/librustc_middle/mir/interpret/allocation.rs. Changed more comments referring to undef Changed comments to use "uninitialized" instead of "undef" in src/librustc_middle/mir/interpret/allocation.rs.
2020-07-25Fixed coverage map issues; better aligned with LLVM APIsRich Kadel-4/+4
Found some problems with the coverage map encoding when testing with more than one counter per function. While debugging, I realized some better ways to structure the Rust implementation of the coverage mapping generator. I refactored somewhat, resulting in less code overall, expanded coverage of LLVM Coverage Map capabilities, and much closer alignment with LLVM data structures, APIs, and naming. This should be easier to follow and easier to maintain.
2020-07-24Rollup merge of #74572 - Mark-Simulacrum:unify-rustc-depr, r=petrochenkovYuki Okushi-30/+41
Internally unify rustc_deprecated and deprecated This PR intentionally tries to be "featureless" in that the behavior is not altered for either attribute, though it more clearly exposes cases where that is the case in the code.
2020-07-23Auto merge of #74611 - Mark-Simulacrum:revert-74069-bad-niche, r=eddybbors-23/+4
Revert "Compare tagged/niche-filling layout and pick the best one" Reverts rust-lang/rust#74069. It caused a performance regression, see https://github.com/rust-lang/rust/pull/74069#issuecomment-662166827. perf: https://perf.rust-lang.org/compare.html?start=d3df8512d2c2afc6d2e7d8b5b951dd7f2ad77b02&end=cfade73820883adf654fe34fd6b0b03a99458a51 r? @eddyb cc @nnethercote
2020-07-22renamed ScalarMaybeUninit::not_undef to check_initPhilippe Nadon-15/+15
Renamed the function ScalarMaybeUninit::not_undef to ScalarMaybeUninit::check_init in the file src/librustc_middle/mir/interpret/value.rs, to reflect changes in terminology used. Related issue rust-lang#71193
2020-07-23Auto merge of #74662 - Manishearth:rollup-jdt7t71, r=Manishearthbors-16/+27
Rollup of 9 pull requests Successful merges: - #73783 (Detect when `'static` obligation might come from an `impl`) - #73868 (Advertise correct stable version for const control flow) - #74460 (rustdoc: Always warn when linking from public to private items) - #74538 (Guard against non-monomorphized type_id intrinsic call) - #74541 (Add the aarch64-apple-darwin target ) - #74600 (Enable perf try builder) - #74618 (Do not ICE on assoc type with bad placeholder) - #74631 (rustc_target: Add a target spec option for disabling `--eh-frame-hdr`) - #74643 (build: Remove unnecessary `cargo:rerun-if-env-changed` annotations) Failed merges: r? @ghost
2020-07-22Rollup merge of #74643 - petrochenkov:noenvrerun, r=Mark-SimulacrumManish Goregaokar-12/+0
build: Remove unnecessary `cargo:rerun-if-env-changed` annotations ... and a couple of related cleanups. rustc and cargo now track the majority of env var dependencies automatically (https://github.com/rust-lang/cargo/pull/8421), so the annotations are no longer necessary.
2020-07-22Auto merge of #74404 - lcnr:ty-dep-path-cleanup-aaaaa, r=eddybbors-0/+21
remove some const arg in ty dep path boilerplate followup to #74113, together with #74376, this closes #74360. r? @eddyb
2020-07-22Use `ty::Instance::resolve` to identify `'static` bound sourceEsteban Küber-2/+22
2020-07-22Increase accuracy of lifetime bound on trait object impl suggestionEsteban Küber-4/+7
2020-07-22build: Remove unnecessary `cargo:rerun-if-env-changed` annotationsVadim Petrochenkov-12/+0
2020-07-22Fix rebase falloutAaron Hill-6/+10
2020-07-22Skip computing param_env and size if not neededAaron Hill-1/+0