about summary refs log tree commit diff
path: root/src/librustc_middle/ty
AgeCommit message (Collapse)AuthorLines
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-16/+114
2020-07-05expected found `&T` -> `T`Bastian Kauschke-31/+26
2020-07-04add `lazy_normalization_consts` feature gateBastian Kauschke-1/+1
2020-07-02Auto merge of #73751 - eddyb:no-empty-tables, r=nikomatsakisbors-42/+27
Remove `TypeckTables::empty(None)` and make hir_owner non-optional. Each commit before the last one removes uses of `TypeckTables::empty(None)`, replacing the empty tables with having `Option` around the `&'tcx TypeckTables<'tcx>` that HIR visitors kept track of. The last commit removes the concept of "empty `TypeckTables`" altogether, guaranteeing that every `TypeckTables` corresponds to a HIR body owner. r? @nikomatsakis
2020-07-02Remove `TypeckTables::empty(None)` and make hir_owner non-optional.Eduard-Mihai Burtescu-42/+27
2020-07-01Rollup merge of #73906 - JohnTitor:missing-bt, r=jonas-schievinkManish Goregaokar-1/+1
Add missing backtick in `ty_error_with_message`
2020-07-01Rollup merge of #73569 - Aaron1011:fix/macro-rules-group, r=petrochenkovManish Goregaokar-0/+1
Handle `macro_rules!` tokens consistently across crates When we serialize a `macro_rules!` macro, we used a 'lowered' `TokenStream` for its body, which has all `Nonterminal`s expanded in-place via `nt_to_tokenstream`. This matters when an 'outer' `macro_rules!` macro expands to an 'inner' `macro_rules!` macro - the inner macro may use tokens captured from the 'outer' macro in its definition. This means that invoking a foreign `macro_rules!` macro may use a different body `TokenStream` than when the same `macro_rules!` macro is invoked in the same crate. This difference is observable by proc-macros invoked by a `macro_rules!` macro - a `None`-delimited group will be seen in the same-crate case (inserted when convering `Nonterminal`s to the `proc_macro` crate's structs), but no `None`-delimited group in the cross-crate case. To fix this inconsistency, we now insert `None`-delimited groups when 'lowering' a `Nonterminal` `macro_rules!` body, just as we do in `proc_macro_server`. Additionally, we no longer print extra spaces for `None`-delimited groups - as far as pretty-printing is concerned, they don't exist (only their contents do). This ensures that `Display` output of a `TokenStream` does not depend on which crate a `macro_rules!` macro was invoked from. This PR is necessary in order to patch the `solana-genesis-programs` for the upcoming hygiene serialization breakage (https://github.com/rust-lang/rust/pull/72121#issuecomment-646924847). The `solana-genesis-programs` crate will need to use a proc macro to re-span certain tokens in a nested `macro_rules!`, which requires us to consistently use a `None`-delimited group. See `src/test/ui/proc-macro/nested-macro-rules.rs` for an example of the kind of nested `macro_rules!` affected by this crate.
2020-07-01Rollup merge of #73449 - ehuss:duplicate-lang-item, r=matthewjasperManish Goregaokar-0/+1
Provide more information on duplicate lang item error. This gives some notes on the location of the files where the lang items were loaded from. Some duplicate lang item errors can be a little confusing, and this might help in diagnosing what has happened. Here's an example when hitting a bug with Cargo's build-std: ``` error: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `try`. | = note: the lang item is first defined in crate `core` (which `z10` depends on) = note: first definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-a764da499c7385f4.rmeta = note: second definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-5b082675aea34986.rmeta ```
2020-07-01Review fixDan Aloni-1/+1
2020-07-01Insert NoDelim groups around nonterminals when lowering macro_rulesAaron Hill-0/+1
2020-07-01Add missing backtick in `ty_error_with_message`Yuki Okushi-1/+1
2020-06-30Switch crate_extern_paths to a query, and tweak wording.Eric Huss-9/+1
2020-06-30Provide more information on duplicate lang item error.Eric Huss-0/+9
2020-06-30Stabilize casts and coercions to `&[T]` in const fnOliver Scherer-1/+1
2020-06-30remove unused `TypeError::ProjectionBoundsLength`Bastian Kauschke-10/+0
2020-06-30change `skip_binder` to use T by valueBastian Kauschke-26/+22
2020-06-30stop taking references in RelateBastian Kauschke-141/+95
2020-06-29Fix try_print_visible_def_path for Rust 2018Dan Aloni-17/+18
The recursive check of `try_print_visible_def_path` did not properly handle the Rust 2018 case of crate-paths without 'extern crate'. Instead, it returned a "not found" via (false, self). This fixes issue #56175.
2020-06-28Rollup merge of #73833 - bjorn3:remove_gcx_enter_local, r=matthewjasperManish Goregaokar-27/+5
Remove GlobalCtxt::enter_local
2020-06-28Remove GlobalCtxt::enter_localbjorn3-27/+5
2020-06-27Rollup merge of #73796 - lcnr:LocalDefId, r=matthewjasperManish Goregaokar-12/+19
replace more `DefId`s with `LocalDefId` part of https://github.com/rust-lang/rust/issues/70853
2020-06-27more LocalDefId cleanupBastian Kauschke-8/+12
2020-06-27more LocalDefId in ty::contextBastian Kauschke-4/+7
2020-06-26Rollup merge of #73485 - estebank:dedup-preds, r=nikomatsakisManish Goregaokar-3/+13
Perform obligation deduplication to avoid buggy `ExistentialMismatch` Address #59326.
2020-06-26Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebankbors-30/+121
Show the values and computation that would overflow a const evaluation or propagation Fixes #71134 In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics. cc @shepmaster The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-30/+121
propagation
2020-06-26Rollup merge of #73748 - jyn514:doc-fix, r=ManishearthManish Goregaokar-0/+2
Add code block to code in documentation of `List::rebase_onto` Closes https://github.com/rust-lang/rust/issues/73676 @bors rollup=always
2020-06-25Add code block to code in documentation of `List::rebase_onto`Joshua Nelson-0/+2
2020-06-24Improve GeneratorLayout debug outputTyler Mandry-1/+0
2020-06-24Allow calling GeneratorSubsts::variant_name() without substsTyler Mandry-1/+1
2020-06-23Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandryManish Goregaokar-0/+7
code coverage foundation for hash and num_counters This PR is the next iteration after PR #73011 (which is still waiting on bors to merge). @wesleywiser - PTAL r? @tmandry (FYI, I'm also working on injecting the coverage maps, in another branch, while waiting for these to merge.) Thanks!
2020-06-23Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearthbors-36/+28
Rollup of 9 pull requests Successful merges: - #72271 (Improve compiler error message for wrong generic parameter order) - #72493 ( move leak-check to during coherence, candidate eval) - #73398 (A way forward for pointer equality in const eval) - #73472 (Clean up E0689 explanation) - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`) - #73515 (Add second message for LiveDrop errors) - #73567 (Clarify --extern documentation.) - #73572 (Fix typos in doc comments) - #73590 (bootstrap: no `config.toml` exists regression) Failed merges: r? @ghost
2020-06-23Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakisManish Goregaokar-36/+28
Account for multiple impl/dyn Trait in return type when suggesting `'_` Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient. Follow up to #72804. r? @nikomatsakis
2020-06-22PR no longer requires u32 impl TypeFoldableRich Kadel-1/+0
2020-06-23Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievinkDylan DPC-11/+5
Make is_freeze and is_copy_modulo_regions take TyCtxtAt Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.
2020-06-22review commentsEsteban Küber-1/+2
2020-06-21num_counters to u32, after implementing TypeFoldableRich Kadel-0/+1
2020-06-21Make is_freeze and is_copy_modulo_regions take TyCtxtAtRalf Jung-11/+5
2020-06-21Cache flags and escaping vars for predicatesMatthew Jasper-28/+201
Also hash predicates by address
2020-06-21Cache decoded predicate shorthandsMatthew Jasper-53/+84
2020-06-20Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearthbors-8/+13
Rollup of 9 pull requests Successful merges: - #72456 (Try to suggest dereferences on trait selection failed) - #72788 (Projection bound validation) - #72790 (core/time: Add Duration methods for zero) - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options) - #73287 (lint: normalize projections using opaque types) - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs) - #73378 (Remove use of specialization from librustc_arena) - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)) - #73443 (ci: allow gating GHA on everything but macOS) Failed merges: r? @ghost
2020-06-20Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petrochenkovManish Goregaokar-3/+2
Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs cc #50928 I don't know who is exactly the best person to review this. r? @petrochenkov
2020-06-20Don't set STILL_FURTHER_SPECIALIZABLE for regions/bound variablesMatthew Jasper-5/+0
2020-06-20Consider fewer predicates for projection candidatesMatthew Jasper-0/+11
We now require that projection candidates are applicable with the idenitity substs of the trait, rather than allowing predicates that are only applicable for certain substs.
2020-06-20Move `trait_map` into `hir::Crate`marmeladema-3/+2
2020-06-20int -> i32Bastian Kauschke-9/+9
2020-06-19Rollup merge of #73458 - tmiasko:arena-layout, r=matthewjasperManish Goregaokar-12/+5
Use alloc::Layout in DroplessArena API
2020-06-19Rollup merge of #73452 - matthewjasper:auto-rec, r=nikomatsakisManish Goregaokar-0/+10
Unify region variables when projecting associated types This is required to avoid cycles when evaluating auto trait predicates. Notably, this is required to be able add Chalk types to `CtxtInterners` for `cfg(parallel_compiler)`. r? @nikomatsakis
2020-06-19Rollup merge of #73442 - ↵Manish Goregaokar-1/+12
davidtwco:issue-72181-pretty-print-const-val-enum-no-variants, r=oli-obk pretty/mir: const value enums with no variants Fixes #72181. This PR modifies the pretty printer and const eval in the MIR so that `destructure_const` (used in `pretty_print_const_value`) can handle enums with no variants (or types containing enums with no variants). I'm not convinced that this is the correct approach, folks more familiar with `destructure_const` would be able to say - happy to adjust the PR. Looking through `destructure_const` and the functions that it invokes, it didn't seem like it was written to handle zero-variant-enums - I assume that case is handled earlier in some way so `destructure_const` doesn't need to under normal circumstances. It didn't seem like it would be straightforward to make `destructure_const` handle this case in a first-class-feeling way (e.g. adding a `Variants::None` variant), so this PR makes some minimal changes to avoid ICEs.
2020-06-19Rollup merge of #73359 - jonas-schievink:do-the-shimmy, r=matthewjasperManish Goregaokar-11/+41
shim.rs: avoid creating `Call` terminators calling `Self` Also contains some cleanup and doc comment additions so I could make sense of the code. Fixes https://github.com/rust-lang/rust/issues/73109 Closes https://github.com/rust-lang/rust/pull/73175 r? @matthewjasper