summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2021-09-03Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebankbors-6/+3
Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix. This PR fixes a regression (#87745) with `--remap-path-prefix` where the flag stopped causing diagnostic messages to be remapped as well. The regression was introduced in https://github.com/rust-lang/rust/pull/83813 where we erroneously assumed that remapping of diagnostic messages was not desired anymore (because #70642 partially undid that functionality with nobody objecting). The issue is fixed by making `--remap-path-prefix` remap diagnostic messages again, including for paths that have been remapped in upstream crates (e.g. the standard library). This means that "sysroot-localization" (implemented in #70642) is also disabled if `rustc` is invoked with `--remap-path-prefix`. The assumption is that once someone starts explicitly remapping paths they also don't want paths to their local Rust installation in their build output. In the future we might want to give more fine-grained control over this behavior via compiler flags (see https://github.com/rust-lang/rfcs/pull/3127 for a related RFC). For now this PR is intended as a regression fix. This PR is an alternative to https://github.com/rust-lang/rust/pull/88191, which makes diagnostic messages be remapped unconditionally. That approach, however, would effectively revert #70642. Fixes https://github.com/rust-lang/rust/issues/87745. cc `@cbeuw` r? `@ghost`
2021-08-30Enforce diverging let...elseCameron Steffen-0/+5
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-1/+1
2021-08-30remove lazy_normalization_constsEllen-1/+1
2021-08-27Path remapping: Make behavior of diagnostics output dependent on presence of ↵Michael Woerister-6/+3
--remap-path-prefix.
2021-08-26reviewlcnr-1/+1
2021-08-26shrink `ty::PredicateKind` againlcnr-2/+2
2021-08-26use `ty::Unevaluated` instead of def substs pairlcnr-4/+1
2021-08-26don't just compare `ty::Const`lcnr-0/+2
2021-08-26update `TypeFlags` to deal with missing ct substslcnr-2/+2
2021-08-26add `tcx` to `fn walk`lcnr-2/+2
2021-08-26make unevaluated const substs optionallcnr-23/+23
2021-08-26require a `tcx` for `TypeVisitor`lcnr-3/+24
2021-08-25Rollup merge of #88218 - Aaron1011:missing-method-dyn, r=nagisaLéo Lanteri Thauvin-6/+0
Remove `Session.trait_methods_not_found` Instead, avoid registering the problematic well-formed obligation to begin with. This removes global untracked mutable state, and avoids potential issues with incremental compilation.
2021-08-23Rollup merge of #88230 - steffahn:a_an, r=oli-obkMara Bos-6/+6
Fix typos “a”→“an” Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an. While automation was used to find these, every change was checked manually. Changes in submodules get separate PRs: * https://github.com/rust-lang/stdarch/pull/1201 * https://github.com/rust-lang/cargo/pull/9821 * https://github.com/rust-lang/miri/pull/1874 * https://github.com/rust-lang/rls/pull/1746 * https://github.com/rust-analyzer/rust-analyzer/pull/9984 _folks @ rust-analyzer are fast at merging…_ * https://github.com/rust-analyzer/rust-analyzer/pull/9985 * https://github.com/rust-analyzer/rust-analyzer/pull/9987 * https://github.com/rust-analyzer/rust-analyzer/pull/9989 _For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._ <hr> This has some overlap with #88226, but neither is a strict superset of the other. If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2021-08-22Auto merge of #88166 - BoxyUwU:const-equate-canon, r=lcnrbors-0/+16
canonicalize consts before calling try_unify_abstract_consts query Fixes #88022 Fixes #86953 Fixes #77708 Fixes #82034 Fixes #85031 these ICEs were all caused by calling the `try_unify_abstract_consts` query with inference vars in substs r? `@lcnr`
2021-08-22Fix more “a”/“an” typosFrank Steffahn-2/+2
2021-08-22Fix typos “a”→“an”Frank Steffahn-4/+4
2021-08-21Remove `Session.trait_methods_not_found`Aaron Hill-6/+0
Instead, avoid registering the problematic well-formed obligation to begin with. This removes global untracked mutable state, and avoids potential issues with incremental compilation.
2021-08-20move `fallback_if_possible` and friends to fallback.rsNiko Matsakis-23/+18
Along the way, simplify and document the logic more clearly.
2021-08-20move the `sub-unify` check and extend the documentation a bitNiko Matsakis-25/+46
I didn't like the sub-unify code executing when a predicate was ENQUEUED, that felt fragile. I would have preferred to move the sub-unify code so that it only occurred during generalization, but that impacted diagnostics, so having it also occur when we process subtype predicates felt pretty reasonable. (I guess we only need one or the other, but I kind of prefer both, since the generalizer ultimately feels like the *right* place to guarantee the properties we want.)
2021-08-19introduce a Coerce predicateNiko Matsakis-0/+34
2021-08-19introduce a `Diverging` enum instead of a boolNiko Matsakis-15/+27
2021-08-19move code to `InferCtxt` methodEllen-0/+16
2021-08-18Auto merge of #86700 - lqd:matthews-nll-hrtb-errors, r=nikomatsakisbors-6/+33
Matthew's work on improving NLL's "higher-ranked subtype error"s This PR rebases `@matthewjasper's` [branch](https://github.com/matthewjasper/rust/tree/nll-hrtb-errors) which has great work to fix the obscure higher-ranked subtype errors that are tracked in #57374. These are a blocker to turning full NLLs on, and doing some internal cleanups to remove some of the old region code. The goal is so `@nikomatsakis` can take a look at this early, and I'll then do my best to help do the changes and followup work to land this work, and move closer to turning off the migration mode. I've only updated the branch and made it compile, removed a warning or two. r? `@nikomatsakis` (Here's the [zulip topic to discuss this](https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll/topic/.2357374.3A.20improving.20higher-ranked.20subtype.20errors.20via.20.2386700) that Niko wanted)
2021-08-18Remove box syntax from rustc_inferest31-5/+4
2021-08-16Rollup merge of #88030 - fee1-dead:fixme, r=oli-obkMara Bos-1/+1
Assign FIXMEs to me and remove obsolete ones Also fixed capitalization of documentation We also don't need to transform predicates to be non-const since we basically ignore const predicates in non-const contexts. r? `````@oli-obk`````
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-18/+0
2021-08-15Report nicer errors for HRTB NLL errors from queriesMatthew Jasper-1/+17
2021-08-15Track causes for universes created during borrowckMatthew Jasper-1/+1
2021-08-15Show bound lifetimes when comparing types in diagnosticsMatthew Jasper-4/+15
2021-08-14Assign FIXMEs to me and remove obsolete onesDeadbeef-1/+1
Also fixed capitalization of documentation
2021-08-14Auto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obkbors-1/+19
Try filtering out non-const impls when we expect const impls **TL;DR**: Associated types on const impls are now bounded; we now disallow calling a const function with bounds when the specified type param only has a non-const impl. r? `@oli-obk`
2021-08-13Point to where clause for GATsjackh726-4/+95
2021-08-13Pass constness to SelectionContextDeadbeef-0/+18
2021-08-13move Constness into TraitPredicateDeadbeef-1/+1
2021-08-06Document `with_opaque_type_inference`'s use cases.Oli Scherer-0/+4
2021-08-06Use existing type alias instead of manually writing itOli Scherer-4/+2
2021-08-06Store the `DefId` of the currently typechecked item in `InferCtxt`Oli Scherer-2/+21
This allows opaque type inference to check for defining uses without having to pass down that def id via function arguments to every method that could possibly cause an opaque type to be compared with a concrete type
2021-08-06Remove a field that is computed later anywayOli Scherer-23/+0
2021-08-06Move opaque type cache into `InferCtxt`Oli Scherer-0/+89
2021-08-03Do not suggest impl traits as type argumentsYuki Okushi-16/+4
2021-08-02Auto merge of #87628 - estebank:unmet-explicit-lifetime-bound, r=oli-obkbors-27/+97
Point at unmet explicit lifetime obligation bound r? `@oli-obk` Split off of #85799.
2021-08-02Rollup merge of #87673 - estebank:opaque-ty-mismatch, r=davidtwcoCameron Steffen-25/+43
Tweak opaque type mismatch error
2021-08-02Implement a `explicit_generic_args_with_impl_trait` feature gateGary Guo-1/+1
When this gate is enabled, explicit generic arguments can be specified even if `impl Trait` is used in argument position. Generic arguments can only be specified for explicit generic parameters but not for the synthetic type parameters from `impl Trait`
2021-07-31Tweak opaque type mismatch errorEsteban Küber-25/+43
2021-07-31Point at unmet explicit lifetime obligation boundEsteban Küber-27/+97
2021-07-24Auto merge of #86461 - crlf0710:rich_vtable, r=nikomatsakisbors-3/+3
Refactor vtable format for upcoming trait_upcasting feature. This modifies vtable format: 1. reordering occurrence order of methods coming from different traits 2. include `VPtr`s for supertraits where this vtable cannot be directly reused during trait upcasting. Also, during codegen, the vtables corresponding to these newly included `VPtr` will be requested and generated. For the cases where this vtable can directly used, now the super trait vtable has exactly the same content to some prefix of this one. r? `@bjorn3` cc `@RalfJung` cc `@rust-lang/wg-traits`
2021-07-22Rollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakisGuillaume Gomez-0/+1
Normalize generic_ty before checking if bound is met Fixes #81487 r? `@nikomatsakis`
2021-07-22Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakisbors-1/+1
When pretty printing, name placeholders as bound regions Split from #85499 When we see a placeholder that we are going to print, treat it as a bound var (and add it to a `for<...>`