about summary refs log tree commit diff
path: root/compiler/rustc_infer
AgeCommit message (Collapse)AuthorLines
2022-07-24Handle additional lifetime bounds on GATs like on methodsMichael Goulet-9/+15
2022-07-24Slightly improve mismatched GAT where clause errorMichael Goulet-52/+18
2022-07-24Auto merge of #93429 - fee1-dead-contrib:allow-super-trait-tilde-const, ↵bors-1/+6
r=oli-obk Allow `trait A: ~const B` What's included: a minimal working change set for `~const` supertraits to work. r? `@oli-obk`
2022-07-23Remap elaborated obligation constnessDeadbeef-1/+6
2022-07-23Rollup merge of #99580 - fmease:fix-issue-99565, r=estebankMatthias Krüger-6/+35
Don't suggest unnameable generic arguments Fixes #99565. `@rustbot` label T-compiler A-diagnostics r? `@rust-lang/wg-diagnostics`
2022-07-22Rollup merge of #99539 - compiler-errors:bidirectional-block-suggestions, ↵Dylan DPC-117/+422
r=fee1-dead Improve suggestions for returning binding Fixes #99525 Also reworks the cause codes for match and if a bit, I think cleaning them up in a positive way. We no longer need to call `could_remove_semicolon` in successful code, which might save a few cycles?
2022-07-22Don't suggest unnameable generic argumentsLeón Orell Valerian Liehr-6/+35
2022-07-21Address more nitsMichael Goulet-37/+31
2022-07-21Generalize same_type_modulo_inferMichael Goulet-3/+34
2022-07-21`region_outlives_predicate` no snapshotlcnr-10/+5
2022-07-21move `considering_regions` to the infcxlcnr-2/+21
2022-07-21And for patterns tooMichael Goulet-78/+89
2022-07-21Do if-expression obligation stuff less eagerlyMichael Goulet-38/+297
2022-07-21Resolve vars in same_type_modulo_inferMichael Goulet-68/+78
2022-07-20Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisabors-3/+3
Remove the unused StableSet and StableMap types from rustc_data_structures. The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp. I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.
2022-07-20remove `commit_unconditionally`lcnr-12/+0
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-3/+3
2022-07-20Rollup merge of #99383 - ouz-a:issue_57961, r=oli-obkDylan DPC-47/+70
Formalize defining_use_anchor This tackles issue #57961 Introduces new enum called `DefiningAnchor` that replaces `Option<LocalDefId>` of `defining_use_anchor`. Now every use of it is explicit and exhaustively matched, catching errors like one in the linked issue. This is not a perfect fix but it's a step in the right direction. r? `@oli-obk`
2022-07-20Rollup merge of #99345 - compiler-errors:issue-99073-redux, r=oli-obkDylan DPC-1/+1
Do not allow typeck children items to constrain outer RPITs Fixes #99073 in a simpler and more conservative way than #99079. Simply raise a mismatched types error if we try to constrain an RPIT in an item that isn't the RPIT's parent. r? `@oli-obk`
2022-07-20take opaq typesouz-a-47/+70
2022-07-19use opaque_ty_origin_unchecked instead of destructuring HIRMichael Goulet-1/+1
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-1/+1
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-19Use LocalDefId in OpaqueTypeKeyMichael Goulet-14/+20
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-16Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, ↵Matthias Krüger-2/+2
r=compiler-errors Avoid some `Symbol` to `String` conversions This patch removes some Symbol to String conversions.
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