about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-07-17avoid some `Symbol` to `String` conversionsTakayuki Maeda-2/+2
2022-07-15provide `generic_param_scope` for region errorslcnr-59/+37
2022-07-15Rollup merge of #98869 - compiler-errors:stop_guessing_head_span, r=cjgillotDylan DPC-18/+13
Remove some usages of `guess_head_span` No need to pass things through `guess_head_span` if they already point to the head span. Only major change is that we point to the head span of `enum`s on some errors now, which I prefer. r? `@cjgillot`
2022-07-15Auto merge of #97406 - aliemjay:verify-bounds-fix-master, r=oli-obkbors-53/+46
Make outlives::{components,verify} agree fixes #97405 cc `@oli-obk` this is should fix https://github.com/rust-lang/rust/pull/95474#discussion_r880660075 r? `@oli-obk`
2022-07-15remove tcx from ObligationCauseCode::spanMichael Goulet-11/+5
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-8/+9
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-3/+8
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-2/+2
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Fix overlapping implskadmin-3/+8
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-2/+2
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-14Make outlives::{components,verify} agreeAli MJ Al-Nasrawy-53/+46
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-2/+2
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-09Auto merge of #99056 - lcnr:higher_ranked_sub, r=oli-obkbors-21/+17
don't use `commit_if_ok` during `higher_ranked_sub` This snapshot doesn't really do anything useful for us, especially once we deal with placeholder outlive bounds during trait solving. I guess that currently the idea is that `higher_ranked_sub` could cause a later `leak_check` to fail even if the combine operation isn't actually relevant. But really, using combine outside of snapshot and ignoring its result is wrong anyways, as it can constrain inference variables. r? rust-lang/types
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-2/+10
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-08don't use `commit_if_ok` during `higher_ranked_sub`lcnr-21/+17
2022-07-08Only register hidden types for opaque types from the current crate, nothing ↵Oli Scherer-1/+1
else would work anyway.
2022-07-07Move is_free and is_free_or_static to Region, change resolve_var to ↵Jack Huey-38/+22
resolve_region, and remove RootEmptyRegion
2022-07-06use `TraitEngineExt` to register obligationslcnr-4/+2
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-8/+8
2022-07-06Update TypeVisitor pathsAlan Egerton-19/+19
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-6/+9
2022-07-05Explicit TypeVisitable implementationsAlan Egerton-0/+3
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-4/+4
2022-07-05Auto merge of #98584 - lcnr:region-stuff-more-beans, r=oli-obkbors-136/+48
continue nll transition by removing stuff r? `@jackh726` for now building on #98641
2022-07-04region obligations, remove `body_id`lcnr-19/+9
2022-07-04implied bounds byebye nested hir idslcnr-97/+20
2022-07-04only use `FnCtxt` for regionck inside of bodieslcnr-0/+13
2022-07-04remove an unused `DefId`lcnr-24/+10
2022-07-04`InferSource::GenericArg`, check for containslcnr-17/+20
2022-07-04resolve vars in node substslcnr-3/+8
2022-07-04stop suggesting things inside of macroslcnr-2/+23
2022-07-04update infer cost computation for typeslcnr-22/+40
2022-07-04remove unused function argumentlcnr-2/+0
2022-07-01Only label place where type is needed if span is meaningfulMichael Goulet-3/+9
2022-07-01Rollup merge of #98610 - lcnr:emit_inference_failure_err-ice, r=estebankMatthias Krüger-6/+17
fix `emit_inference_failure_err` ICE fixes #98598 this fix doesn't make me too happy, but :shrug:
2022-06-30Make `evaluate_obligation` not succeed unconditionally if it registered new ↵Oli Scherer-0/+8
hidden types for opaque types
2022-06-30add issue number to fixmelcnr-1/+1
2022-06-30use a method instead of manually doing what its body doesOli Scherer-1/+1
2022-06-30Rollup merge of #96727 - oli-obk:no_expect, r=lcnrMatthias Krüger-14/+7
Make TAIT behave exactly like RPIT fixes https://github.com/rust-lang/rust/issues/96552 This makes type-alias-impl-trait behave like return-position-impl-trait. Unfortunately it also causes some cases to stop compiling due to "needing type annotations" and makes panicking cause fallback for the hidden type to `()`. All of these are addressable, but we should probably address them for RPIT and TAIT together r? ``@lcnr``
2022-06-29Rollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, ↵Matthias Krüger-20/+9
r=Dylan-DPC Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label` This patch removes some`&str` to `String` conversions with `MultiSpan::push_span_label`.
2022-06-29Rollup merge of #98607 - compiler-errors:tuple-wrap-suggestion, r=oli-obkDylan DPC-2/+2
Clean up arg mismatch diagnostic, generalize tuple wrap suggestion This is based on top of #97542, so just look at the last commit which contains the relevant changes. 1. Remove `final_arg_types` which was one of the last places we were using raw (`usize`) indices instead of typed indices in the arg mismatch suggestion code. 2. Improve the tuple wrap suggestion, now we suggest things like `call(a, b, c, d)` -> `call(a, (b, c), d)` :smiley_cat: 3. Folded in fix #98645
2022-06-29avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`Takayuki Maeda-20/+9
2022-06-29The only reason we had to replace opaque types in closures was due to async ↵Oli Scherer-22/+4
fn desugaring, make that explicit
2022-06-29Make RPIT and TAIT work exactly the sameOli Scherer-11/+22
2022-06-28Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obkDylan DPC-8/+6
Remove a back-compat hack on lazy TAIT This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446 ~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~ r? ``@oli-obk``
2022-06-28fix `emit_inference_failure_err` ICElcnr-6/+17
2022-06-28Remove `final_arg_types`, improve tuple wrapping suggestionMichael Goulet-2/+2
2022-06-27lower-generic vs. outlivelcnr-2/+2
2022-06-27fold_region: remove unused parameterlcnr-2/+2