about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-07-22Don't suggest unnameable generic argumentsLeón Orell Valerian Liehr-3/+3
2022-07-21Auto merge of #99501 - lcnr:check-regions-infcx, r=oli-obkbors-98/+32
move `considering_regions` to the infcx it seems weird to prove some obligations which constrain inference vars while ignoring regions in a context which considers regions. This is especially weird because even for a fulfillment context with ignored regions, we still added region outlives bounds when directly relating regions. tbh our handling of regions is still very weird, but at least this is a step in the right direction imo. r? rust-lang/types
2022-07-21Rollup merge of #99558 - fee1-dead-contrib:remap_constness_fix, r=oli-obkMatthias Krüger-3/+3
Fix `remap_constness` `~const Drop` was renamed to `~const Destruct` and this special case should be removed
2022-07-21Rollup merge of #99552 - lcnr:orphan_check-rework, r=oli-obkMatthias Krüger-196/+123
Rewrite `orphan_check_trait_ref` to use a `TypeVisitor` The current impl is far more confusing than it has any right to be :sparkles: r? rust-lang/types
2022-07-21Rollup merge of #99528 - matthiaskrgr:2022_07_perf, r=estebankMatthias Krüger-2/+2
couple of clippy::perf fixes
2022-07-21Fix `remap_constness`Deadbeef-3/+3
`~const Drop` was renamed to `~const Destruct` and this special case should be removed
2022-07-21`region_outlives_predicate` no snapshotlcnr-29/+7
2022-07-21move `considering_regions` to the infcxlcnr-77/+33
2022-07-21rewrite the orphan check to use a type visitorlcnr-169/+124
2022-07-21orphan check: opaque types are an errorlcnr-29/+1
2022-07-21change `map_bound(|_| x` to `rebind(x`Deadbeef-2/+2
2022-07-21Resolve vars in same_type_modulo_inferMichael Goulet-2/+1
2022-07-20Fix hack that remaps env constness.Deadbeef-46/+27
WARNING: might have perf implications. Are there any more problems with having a constness in the `ParamEnv` now? :)
2022-07-20no leak_check -> commit_unconditionally is nooplcnr-186/+167
2022-07-20clippy::perf fixesMatthias Krüger-2/+2
2022-07-20take opaq typesouz-a-3/+6
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-2/+2
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-19Rollup merge of #98028 - aticu:master, r=estebankMatthias Krüger-0/+92
Add E0790 as more specific variant of E0283 Fixes #81701 I think this should be good to go, there are only two things where I am somewhat unsure: - Is there a better way to get the fully-qualified path for the suggestion? I tried `self.tcx.def_path_str`, but that didn't seem to always give a correct path for the context. - Should all this be extracted into it's own method or is it fine where it is? r? `@estebank`
2022-07-19Add E0790 as more specific variant of E0283aticu-0/+92
2022-07-18Check generators for well formednessOli Scherer-9/+10
2022-07-18Auto merge of #99232 - lcnr:no-bound-vars-check, r=jackh726bors-2/+5
`replace_bound_vars` fast path: check predicates, don't check consts split out from #98900 `ty::Const` doesn't have precomputed type flags, so computing `has_vars_bound_at_or_above` for constants requires us to visit the const and its contained types and constants. A noop fold should be pretty much equally as fast so removing it prevents us from walking the constant twice in case it contains bound vars. r? `@jackh726`
2022-07-18Auto merge of #99181 - lcnr:arenaGTrc, r=wesleywiserbors-10/+11
`arena > Rc` for query results The `Rc`s have to live for the whole duration as their count cannot go below 1 while stored as part of the query results. By storing them in an arena we should save a bit of memory because we don't have as many independent allocations and also don't have to clone the `Rc` anymore.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-2/+2
2022-07-18Auto merge of #99137 - jackh726:wf-no-infcx, r=estebankbors-58/+46
Don't pass InferCtxt to WfPredicates Simple cleanup. Infer vars will get passed up as obligations and shallowed resolved later. This actually improves one test output.
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-16Rollup merge of #99290 - compiler-errors:revert-98794, r=lcnrMatthias Krüger-71/+13
Revert "Highlight conflicting param-env candidates" This reverts #98794, commit 08135254dcf22be0d5661ea8f75e703b29a83514. Seems to have caused an incremental compilation bug. The root cause of the incr comp bug is somewhat unrelated but is triggered by this PR, so I don't feel comfortable with having this PR in the codebase until it can be investigated further. Fixes #99233.
2022-07-15Fix suggestion regression with incorrect syntactic combination of trait boundsWill Crichton-1/+13
2022-07-15Propagate Expectation around binop typeck code to construct more precise ↵Will Crichton-3/+14
trait obligations for binops.
2022-07-15Revert "Highlight conflicting param-env candidates"Michael Goulet-71/+13
This reverts commit 08135254dcf22be0d5661ea8f75e703b29a83514.
2022-07-15hir typeck: `fulfillment_cx` ignore regionslcnr-0/+10
2022-07-15provide `generic_param_scope` for region errorslcnr-15/+23
2022-07-15try to avoid `FnCtxt` during wflcnr-2/+96
2022-07-15`QueryNormalizer` bug on ambiguitylcnr-2/+2
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-8/+2
2022-07-15remove tcx from ObligationCauseCode::spanMichael Goulet-3/+3
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-2/+2
2022-07-14Rollup merge of #99222 - atsuzaki:generic_const_err, r=lcnrDylan DPC-0/+27
Better error message for generic_const_exprs inference failure Fixes #90531 This code: ```rs #![feature(generic_const_exprs)] fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} fn main() { let arr = [5; 5]; foo(arr); } ``` Will now emit the following error: ```rs warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> test.rs:1:12 | 1 | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information error[E0284]: type annotations needed --> test.rs:8:7 | 8 | foo(arr); | ^^^ cannot infer the value of the const parameter `N` declared on the function `foo` | note: required by a bound in `foo` --> test.rs:3:56 | 3 | fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} | ^^^^^ required by this bound in `foo` help: consider specifying the generic argument | 8 | foo::<N>(arr); | +++++ error: aborting due to previous error; 1 warning emitted ``` cc: `@lcnr` thanks a lot again for the help on this
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-667/+151
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-3/+3
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-14eagerly check for bound vars of predicateslcnr-0/+4
2022-07-14remove `ct.has_vars_bound_at_or_above` callslcnr-2/+1
`ty::Const` doesn't have precomputed type flags, so computing `has_vars_bound_at_or_above` for constants requires us to visit the const and its contained types and constants. A noop fold should be pretty much equally as fast so removing it prevents us from walking the constant twice in case it contains bound vars.
2022-07-14Fix overlapping implskadmin-30/+140
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-3/+3
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-13Remove predicate noteKatherine Philip-2/+1
2022-07-13Add checks & fallback branchKatherine Philip-1/+13
2022-07-13Use emit_inference_failure_err for ConstEvaluatable predicatesKatherine Philip-0/+16
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-3/+3
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13Rollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obkDylan DPC-1/+1
Lower let-else in MIR This MR will switch to lower let-else statements in MIR building instead. To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements. cc https://github.com/rust-lang/rust/issues/87335 Fix #98672
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-3/+3
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-12remove outdated commentlcnr-9/+9