about summary refs log tree commit diff
path: root/src/librustc_middle/ty
AgeCommit message (Collapse)AuthorLines
2020-08-03Auto merge of #74969 - nnethercote:rm-GCX_PTR, r=Mark-Simulacrumbors-53/+16
Remove `GCX_PTR`. We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows implicit access to a `GlobalCtxt` and some other things. We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same `GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR` is only used in the parallel compiler's `handle_deadlock()` function. This commit does the following. - It removes `GCX_PTR`. - It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now equivalent to the old `tls::enter_global()`. - Makes `tls::get_tlv()` public for the parallel compiler, because it's now used in `handle_deadlock()`. r? @petrochenkov
2020-08-03Use more appropriate `tls::with_*` methods in some places.Nicholas Nethercote-3/+2
2020-08-03Remove `GCX_PTR`.Nicholas Nethercote-54/+18
We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows implicit access to a `GlobalCtxt` and some other things. We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same `GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR` is only used in the parallel compiler's `handle_deadlock()` function. This commit does the following. - It removes `GCX_PTR`. - It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now equivalent to the old `tls::enter_global()`. - Makes `tls::get_tlv()` public for the parallel compiler, because it's now used in `handle_deadlock()`.
2020-08-02Rollup merge of #75059 - shengsheng:typos, r=Dylan-DPCManish Goregaokar-1/+1
fix typos Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2020-08-03Rollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkovYuki Okushi-6/+6
Rename rustc_middle::cstore::DepKind to CrateDepKind It is ambiguous with DepGraph's own DepKind.
2020-08-02fix typosliuzhenyu-1/+1
2020-08-02Rename rustc_middle::cstore::DepKind to DependencyKind.Camille GILLOT-6/+6
2020-08-02Use Lift derive proc-macro in librustc_traits.Camille GILLOT-0/+2
2020-08-01rustc_metadata: track the simplified Self type for every trait impl.Eduard-Mihai Burtescu-22/+28
2020-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-1/+1
2020-07-31Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakisbors-76/+122
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-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-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 #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/+15
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-72/+148
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-23Auto merge of #74611 - Mark-Simulacrum:revert-74069-bad-niche, r=eddybbors-22/+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-23Auto merge of #74662 - Manishearth:rollup-jdt7t71, r=Manishearthbors-4/+4
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-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-22Increase accuracy of lifetime bound on trait object impl suggestionEsteban Küber-4/+4
2020-07-22Fix rebase falloutAaron Hill-6/+10
2020-07-22Skip computing param_env and size if not neededAaron Hill-1/+0
2020-07-22Erase regions in try_eval_bitsAaron Hill-0/+1
2020-07-22Normalize opaque types when converting `ParamEnv` to `Reveal::All`Aaron Hill-72/+114
Fixes #65918
2020-07-21Revert "Compare tagged/niche-filling layout and pick the best one"Mark Rousskov-22/+4
2020-07-21fetch -> lookupBastian Kauschke-1/+1
2020-07-21`try_update` -> `try_upgrade`Bastian Kauschke-1/+1
2020-07-21remove some const arg in ty dep path boilerplateBastian Kauschke-0/+21