about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2023-02-19Use InferCtxt::probe to properly detect ambiguous candidatesLeón Orell Valerian Liehr-21/+26
2023-02-19Switch from for-loop to filter_mapLeón Orell Valerian Liehr-27/+26
2023-02-19Groundwork for detecting ambiguous candidatesLeón Orell Valerian Liehr-2/+85
NB: Since we are using the same InferCtxt in each iteration, we essentially *spoil* the inference variables and we only ever get at most *one* applicable candidate (only the 1st candidate has clean variables that can still unify correctly).
2023-02-19Make use of ObligationCtxtLeón Orell Valerian Liehr-54/+33
2023-02-19Use the correct ParamEnvLeón Orell Valerian Liehr-1/+1
2023-02-19Type-directed probing for inherent associated typesLeón Orell Valerian Liehr-54/+369
2023-02-19Make public API, docs algorithm-agnosticJacob Pratt-2/+2
2023-02-18Assume we can normalize trait default method RPITITs in param-env insteadMichael Goulet-1/+1
2023-02-18Rollup merge of #108186 - ↵Matthias Krüger-85/+114
compiler-errors:closures-with-late-bound-types-r-bad, r=cjgillot Deny non-lifetime bound vars in `for<..> ||` closure binders Moves the check for illegal bound var types from astconv to resolve_bound_vars. If a binder is defined to have a type or const late-bound var that's not allowed, we'll resolve any usages to ty error or const error values, so we shouldn't ever see late-bound types or consts in places they aren't expected. Fixes #108184 Fixes #108181 Fixes #108192
2023-02-18Move late-bound arg type checks to resolve_bound_varsMichael Goulet-85/+114
2023-02-18Auto merge of #108112 - nnethercote:clarify-iterator-interners, ↵bors-27/+14
r=oli-obk,compiler-errors Clarify iterator interners I found the iterator interners very confusing. This PR clarifies things. r? `@compiler-errors`
2023-02-17Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstriebbors-54/+54
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref r? `@ghost`
2023-02-17Replace more `mk_foo` calls with `infer_foo`.Nicholas Nethercote-10/+6
2023-02-17Use `IntoIterator` for `mk_fn_sig`.Nicholas Nethercote-16/+7
This makes a lot of call sites nicer.
2023-02-17Replace `mk_foo` calls with `infer_foo` where possible.Nicholas Nethercote-1/+1
There are several `mk_foo`/`intern_foo` pairs, where the former takes an iterator and the latter takes a slice. (This naming convention is bad, but that's a fix for another PR.) This commit changes several `mk_foo` occurrences into `intern_foo`, avoiding the need for some `.iter()`/`.into_iter()` calls. Affected cases: - mk_type_list - mk_tup - mk_substs - mk_const_list
2023-02-17add predicate evaluation logicBoxy-5/+62
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-1/+3
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-71/+84
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-16fix new usage of type_ofKyle Matsuda-1/+1
2023-02-16changes from reviewKyle Matsuda-2/+10
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-79/+71
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-59/+72
2023-02-17Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillotMatthias Krüger-203/+306
Implement partial support for non-lifetime binders This implements support for non-lifetime binders. It's pretty useless currently, but I wanted to put this up so the implementation can be discussed. Specifically, this piggybacks off of the late-bound lifetime collection code in `rustc_hir_typeck::collect::lifetimes`. This seems like a necessary step given the fact we don't resolve late-bound regions until this point, and binders are sometimes merged. Q: I'm not sure if I should go along this route, or try to modify the earlier nameres code to compute the right bound var indices for type and const binders eagerly... If so, I'll need to rename all these queries to something more appropriate (I've done this for `resolve_lifetime::Region` -> `resolve_lifetime::ResolvedArg`) cc rust-lang/types-team#81 r? `@ghost`
2023-02-16Move call trait lang item malformed check to typeckMichael Goulet-51/+1
2023-02-16Auto merge of #108127 - matthiaskrgr:rollup-kpzfc6j, r=matthiaskrgrbors-8/+3
Rollup of 7 pull requests Successful merges: - #106347 (More accurate spans for arg removal suggestion) - #108057 (Prevent some attributes from being merged with others on reexports) - #108090 (`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`) - #108092 (note issue for feature(packed_bundled_libs)) - #108099 (use chars instead of strings where applicable) - #108115 (Do not ICE on unmet trait alias bounds) - #108125 (Add new people to the compiletest review rotation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16Auto merge of #108020 - nnethercote:opt-mk_region, r=compiler-errorsbors-58/+49
Optimize `mk_region` PR #107869 avoiding some interning under `mk_ty` by special-casing `Ty` variants with simple (integer) bodies. This PR does something similar for regions. r? `@compiler-errors`
2023-02-16Replace some `then`s with some `then_some`sMaybe Waffle-1/+1
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-7/+2
2023-02-16Rollup merge of #108103 - matthiaskrgr:lice, r=compiler-errorsDylan DPC-2/+2
be nice and don't slice These are already slices, no need to slice them again
2023-02-16Deny some late-bound ty/ct in some positions, add testsMichael Goulet-3/+47
2023-02-16A bit more work on late-bound constsMichael Goulet-5/+1
2023-02-16Make things actually workMichael Goulet-89/+141
2023-02-16Rename some region-specific stuffMichael Goulet-127/+138
2023-02-16be nice and don't sliceMatthias Krüger-2/+2
These are already slices, no need to slice them again
2023-02-15Rollup merge of #108010 - compiler-errors:can_eq-returns-bool, r=lcnrMatthias Krüger-3/+2
Make `InferCtxt::can_eq` and `InferCtxt::can_sub` return booleans Nobody matches on the result, nor does the result return anything useful...
2023-02-15Copy `ty::AssocItem` all other the placeMaybe Waffle-54/+54
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-200/+143
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-58/+49
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-14Auto merge of #108056 - matthiaskrgr:rollup-oa6bxvh, r=matthiaskrgrbors-5/+7
Rollup of 9 pull requests Successful merges: - #107573 (Update the minimum external LLVM to 14) - #107626 (Fix `x fix` on the standard library itself) - #107673 (update ICU4X to 1.1.0) - #107733 (Store metrics from `metrics.json` to CI PGO timer) - #108007 (Use `is_str` instead of string kind comparison) - #108033 (add an unstable `#[rustc_coinductive]` attribute) - #108039 (Refactor refcounted structural_impls via functors) - #108040 (Use derive attributes for uninteresting traversals) - #108044 (interpret: rename Pointer::from_addr → from_addr_invalid) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-14Move query out of path.Camille GILLOT-2/+7
2023-02-14Even less HIR.Camille GILLOT-33/+28
2023-02-14Fetch less HIR in signature check.Camille GILLOT-111/+72
2023-02-14Do not fetch HIR for inherent impls.Camille GILLOT-56/+36
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-16/+18
2023-02-14add a `#[rustc_coinductive]` attributelcnr-5/+7
2023-02-14s/eval_usize/eval_target_usize/ for clarityOli Scherer-1/+1
2023-02-13Rollup merge of #107942 - compiler-errors:tighter-inherent-impl-bad-spans, ↵Matthias Krüger-16/+17
r=Nilstrieb Tighter spans for bad inherent `impl` self types Self-explanatory
2023-02-13Make can_eq and can_sub return booleansMichael Goulet-3/+2
2023-02-13Tighter spans for bad inherent impl typesMichael Goulet-16/+17
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-7/+7