about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
2023-02-20Auto merge of #107969 - b-naber:proj-relate-variance, r=lcnrbors-4/+25
Use covariance on type relations of field projection types if possible It's fine to use covariance here unless we're in a mutating context. Fixes https://github.com/rust-lang/rust/issues/96514 Supersedes https://github.com/rust-lang/rust/pull/105958 r? `@lcnr`
2023-02-19add some cfgs backb-naber-73/+130
2023-02-19remove cfgsb-naber-209/+42
2023-02-19rebaseb-naber-81/+92
2023-02-19some conditional importsb-naber-5/+5
2023-02-19sccs infob-naber-3/+69
2023-02-19collect existentials and placeholdersb-naber-14/+58
2023-02-19collect region contexts during mir renumberingb-naber-35/+337
2023-02-19add BorrowckInferCtxtb-naber-1/+29
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-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-16/+12
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-8/+10
2023-02-16Auto merge of #108127 - matthiaskrgr:rollup-kpzfc6j, r=matthiaskrgrbors-21/+8
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-22/+16
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-21/+8
2023-02-15exhaustive matching in get_ambient_varianceb-naber-1/+9
2023-02-15Rollup merge of #108010 - compiler-errors:can_eq-returns-bool, r=lcnrMatthias Krüger-1/+1
Make `InferCtxt::can_eq` and `InferCtxt::can_sub` return booleans Nobody matches on the result, nor does the result return anything useful...
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-9/+9
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-15Rollup merge of #105300 - aliemjay:member-lower, r=oli-obkDylan DPC-11/+24
rework min_choice algorithm of member constraints See [this comment](https://github.com/rust-lang/rust/pull/105300#issuecomment-1384312743) for the description of the new algorithm. Fixes #63033 Fixes #104639 This uses a more general algorithm than #89056 that doesn't treat `'static` as a special case. It thus accepts more code. For example: ```rust async fn test2<'s>(_: &'s u8, _: &'_ &'s u8, _: &'_ &'s u8) {} ``` I claim it's more correct as well because it fixes #104639. cc ``@nikomatsakis`` ``@lqd`` ``@tmandry`` ``@eholk`` ``@chenyukang`` ``@oli-obk`` r? types
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-22/+16
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-14Add `of_trait` to DefKind::Impl.Camille GILLOT-9/+9
2023-02-14s/eval_usize/eval_target_usize/ for clarityOli Scherer-1/+1
2023-02-13Make can_eq and can_sub return booleansMichael Goulet-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-02-12only require sub type relation on field projection typesb-naber-4/+17
2023-02-11Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnrbors-5/+1
Implement `deferred_projection_equality` for erica solver Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-10emit `AliasEq` when relating type and const aliasesBoxy-5/+1
2023-02-10Auto merge of #107652 - estebank:re_error, r=oli-obkbors-7/+18
Introduce `ReError` CC #69314 r? `@nagisa`
2023-02-09Update implied_outlives_bounds to properly register implied bounds behind ↵Jack Huey-5/+10
normalization
2023-02-09Cleanup free_region_relations a bitJack Huey-69/+86
2023-02-09Use 'static RegionVid for ReErrorEsteban Küber-3/+9
2023-02-09Change to `ReError(ErrorGuaranteed)`Esteban Küber-5/+4
2023-02-09Introduce `ReError`Esteban Küber-4/+10
CC #69314
2023-02-08Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnrMatthias Krüger-2/+2
Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*` Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole. Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways. r? types
2023-02-07Replacing bound vars is actually instantiating a binderMichael Goulet-2/+2
2023-02-07Auto merge of #107768 - matthiaskrgr:rollup-9u4cal4, r=matthiaskrgrbors-10/+2
Rollup of 8 pull requests Successful merges: - #107719 (Remove `arena_cache` modifier from `upstream_monomorphizations_for`) - #107740 (Avoid locking the global context across the `after_expansion` callback) - #107746 (Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks) - #107749 (allow quick-edit convenience) - #107750 (make more readable) - #107755 (remove binder from query constraints) - #107756 (miri: fix ICE when running out of address space) - #107764 (llvm-16: Use Triple.h from new header location.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-07remove binder from query constraintslcnr-10/+2
2023-02-06Modify existing bounds if they existEdward Shen-0/+1
2023-02-04Rollup merge of #107646 - estebank:specific-span, r=compiler-errorsMatthias Krüger-6/+57
Provide structured suggestion for binding needing type on E0594 Partially address #45405.
2023-02-04Auto merge of #107267 - cjgillot:keep-aggregate, r=oli-obkbors-2/+6
Do not deaggregate MIR This turns out to simplify a lot of things. I haven't checked the consequences for miri yet. cc `@JakobDegen` r? `@oli-obk`
2023-02-03review commentsEsteban Küber-14/+17
2023-02-03Provide structured suggestion for binding needing type on E0594Esteban Küber-6/+54
Partially address #45405.
2023-02-03Rollup merge of #106575 - estebank:issue-64008, r=pnkfelixMatthias Krüger-16/+12
Suggest `move` in nested closure when appropriate Fix #64008.
2023-02-02Put a DefId in AggregateKind.Camille GILLOT-2/+6
2023-02-02Suggest `move` in nested closure when appropriateEsteban Küber-16/+12
Fix #64008.
2023-02-02Rollup merge of #107532 - compiler-errors:erase-regions-in-uninhabited, ↵Matthias Krüger-1/+4
r=jackh726 Erase regions before doing uninhabited check in borrowck ~Also, fingerprint query keys/values when debug assertions are enabled. This should make it easier to check for issues like this without `-Cincremental`, and make UI tests a bit cleaner.~ edit: moving that to a separate PR Fixes #107505
2023-02-01Erase regions before uninhabited checkMichael Goulet-1/+4
2023-01-31Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obkGuillaume Gomez-2/+2
Improve enum checks Some light refactoring.
2023-01-31Auto merge of #100754 - davidtwco:translation-incremental, r=compiler-errorsbors-13/+9
incremental: migrate diagnostics - Apply the diagnostic migration lints to more functions on `Session`, namely: `span_warn`, `span_warn_with_code`, `warn` `note_without_error`, `span_note_without_error`, `struct_note_without_error`. - Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path` and `std::path::PathBuf`. - Migrate the `rustc_incremental` crate's diagnostics to translatable diagnostic structs. r? `@compiler-errors` cc #100717