about summary refs log tree commit diff
path: root/compiler/rustc_borrowck
AgeCommit message (Collapse)AuthorLines
2022-07-07Move `predecessors` from Body to BasicBlocksTomasz Miąsko-3/+3
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-6/+1
2022-07-06Update TypeVisitor pathsAlan Egerton-6/+9
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-4/+5
2022-07-04Rollup merge of #98878 - lcnr:more-rustc_pass_by_value, r=oli-obkMatthias Krüger-1/+1
add more `rustc_pass_by_value` r? ```@oli-obk``` cc #98766
2022-07-04fully move dropck to mirlcnr-35/+53
2022-07-04more `rustc_pass_by_value`lcnr-1/+1
2022-07-03Auto merge of #98673 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrumbors-1/+1
Bump bootstrap compiler r? `@Mark-Simulacrum`
2022-07-02Rollup merge of #98766 - lcnr:mir-visit-pass_by_value, r=oli-obkDylan DPC-13/+13
cleanup mir visitor for `rustc::pass_by_value` by changing `& $($mutability)?` to `$(& $mutability)?` I also did some formatting changes because I started doing them for the visit methods I changed and then couldn't get myself to stop xx, I hope that's still fairly easy to review.
2022-07-01Factor out hir::Node::BindingCameron Steffen-1/+1
2022-07-01cleanup mir visitor for `rustc::pass_by_value`lcnr-13/+13
2022-07-01update cfg(bootstrap)sPietro Albini-1/+1
2022-06-30promote placeholder bounds to 'static obligationsNiko Matsakis-5/+33
In NLL, when we are promoting a bound out from a closure, if we have a requirement that `T: 'a` where `'a` is in a higher universe, we were previously ignoring that, which is totally wrong. We should be promoting those constraints to `'static`, since universes are not expressible across closure boundaries.
2022-06-29Rollup merge of #98415 - ↵Dylan DPC-23/+72
compiler-errors:rustc-borrowck-session-diagnostic-1, r=davidtwco Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic` Self-explanatory r? ```@davidtwco```
2022-06-29Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqdbors-1/+1
Update `smallvec` to 1.8.1. This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc. r? `@lqd`
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-23/+72
2022-06-28Do not use a suggestion to change a binding's name to a typeMichael Goulet-25/+30
2022-06-28Remove redundant logic to suggest `as_ref`Michael Goulet-46/+7
2022-06-28Rollup merge of #98420 - ↵Dylan DPC-2/+6
davidtwco:translation-lint-fixes-and-more-migration, r=compiler-errors translation: lint fix + more migration - Unfortunately, the diagnostic lints are very broken and trigger much more often than they should. This PR corrects the conditional which checks if the function call being made is to a diagnostic function so that it returns in every intended case. - The `rustc_lint_diagnostics` attribute is used by the diagnostic translation/struct migration lints to identify calls where non-translatable diagnostics or diagnostics outwith impls are being created. Any function used in creating a diagnostic should be annotated with this attribute so this PR adds the attribute to many more functions. - Port the diagnostics from the `rustc_privacy` crate and enable the lints for that crate. r? ``@compiler-errors``
2022-06-27fold_region: remove unused parameterlcnr-12/+10
2022-06-27outside of borrowck, do not provide an implicit_region_boundlcnr-8/+8
see comment added to the field in `VerifyBoundCx`.
2022-06-27various: add `rustc_lint_diagnostics` to diag fnsDavid Wood-2/+6
The `rustc_lint_diagnostics` attribute is used by the diagnostic translation/struct migration lints to identify calls where non-translatable diagnostics or diagnostics outwith impls are being created. Any function used in creating a diagnostic should be annotated with this attribute so this commit adds the attribute to many more functions. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-24Auto merge of #98109 - nikomatsakis:issue-98095, r=jackh726bors-21/+82
fix universes in the NLL type tests In the NLL code, we were not accommodating universes in the `type_test` logic. Fixes #98095. r? `@compiler-errors` This breaks some tests, however, so the purpose of this branch is more explanatory and perhaps to do a crater run.
2022-06-23Rollup merge of #98184 - compiler-errors:elided-lifetime-in-impl-nll, r=cjgillotMichael Goulet-5/+56
Give name if anonymous region appears in impl signature Fixes #98170 We probably should remove the two unwraps in [`report_general_error`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_borrowck/diagnostics/region_errors.rs.html#683-685), but I have no idea what to provide if those regions are missing, so I've kept those in. Let me know if I should try harder to remove those.
2022-06-23run `x.py fmt`Niko Matsakis-4/+1
2022-06-23apply suggestions from oli-obkNiko Matsakis-1/+1
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-06-23rename IfEqBound to IfEqNiko Matsakis-4/+4
2022-06-23remove VerifyBound::IfEq variantNiko Matsakis-23/+0
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-1/+8
Create elided lifetime parameters for function-like types Split from https://github.com/rust-lang/rust/pull/97720 This PR refactor lifetime generic parameters in bare function types and parenthesized traits to introduce the additional required lifetimes as fresh parameters in a `for<>` bound. This PR does the same to lifetimes appearing in closure signatures, and as-if introducing `for<>` bounds on closures (without the associated change in semantics). r? `@petrochenkov`
2022-06-21Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obkYuki Okushi-10/+14
Fix erroneous span for borrowck error I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead. Fixes #97997 The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant. There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
2022-06-20Give name if anonymous region appears in impl signatureMichael Goulet-5/+56
2022-06-19Only use special async fn case for actual async fns in borrowck diagnostics.Camille GILLOT-1/+8
2022-06-19Move RegionKind to rustc_type_irJack Huey-1/+1
2022-06-15fix universes in the NLL type testsNiko Matsakis-1/+24
In the NLL code, we were not accommodating universes in the `type_test` logic. This led to issue 98095.
2022-06-15implement (unused) matching solverNiko Matsakis-22/+81
2022-06-15simply the IfEq bound -- we only ever use a regionNiko Matsakis-3/+8
the excessive generality becomes annoying later because it wouldn't implement type folding etc
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-13/+15
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-2/+2
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-16/+16
2022-06-12Fix erroneous span for borrowck errorMichael Goulet-10/+14
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-13/+15
2022-06-10bound_vars -> infer: don't return lt maplcnr-7/+5
2022-06-10only expect lb lt for fn calls in mir typecklcnr-6/+8
2022-06-07Auto merge of #97081 - oli-obk:outlives_query_fast_path, r=jackh726bors-1/+1
Re-use the type op instead of calling the implied_outlives_bounds query directly r? `@ghost`
2022-06-03Rollup merge of #97415 - cjgillot:is-late-bound-solo, r=estebankDylan DPC-4/+4
Compute `is_late_bound_map` query separately from lifetime resolution This query is actually very simple, and is only useful for functions and method. It can be computed directly by fetching the HIR, with no need to embed it within the lifetime resolution visitor. Based on https://github.com/rust-lang/rust/pull/96296
2022-06-03Compute `is_late_bound` in a separate query.Camille GILLOT-2/+2
The computation is actually much simpler, and can be done by directly fetching the HIR for the `FnDecl` and its generics.
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-2/+2
2022-06-03Rollup merge of #97653 - RalfJung:int-to-ptr, r=oli-obkDylan DPC-13/+37
add cast kind of from_exposed_addr (int-to-ptr casts) This is basically the dual to https://github.com/rust-lang/rust/pull/97582, for int2ptr casts. Cc `@tmiasko` https://github.com/rust-lang/rust/issues/97649
2022-06-02add cast kind of from_exposed_addr (int-to-ptr casts)Ralf Jung-13/+37