about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-2/+30
2022-07-15provide `generic_param_scope` for region errorslcnr-1/+1
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-9/+9
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-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-9/+9
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-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-5/+5
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPCbors-12/+9
Rollup of 5 pull requests Successful merges: - #98574 (Lower let-else in MIR) - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside) - #99030 (diagnostics: error messages when struct literals fail to parse) - #99155 (Keep unstable target features for asm feature checking) - #99199 (Refactor: remove an unnecessary `span_to_snippet`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-13remove an unnecessary `span_to_snippet`Takayuki Maeda-12/+9
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-9/+9
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-12arena > Rc for query resultslcnr-4/+4
2022-07-12add new rval, pull deref earlyouz-a-0/+26
2022-07-11Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-deadDylan DPC-9/+2
Implement `SourceMap::is_span_accessible` This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
2022-07-11rename a methodTakayuki Maeda-2/+2
2022-07-11implement `is_accessible_span`Takayuki Maeda-9/+2
2022-07-11Rollup merge of #98713 - nikomatsakis:issue-98693, r=jackh726Matthias Krüger-5/+33
promote placeholder bounds to 'static obligations 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. Fixes #98693 ~~(Marking as WIP because I'm still running tests, haven't add the new test, etc)~~ r? ``@jackh726``
2022-07-10Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obkMatthias Krüger-4/+4
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-4/+4
2022-07-08Rollup merge of #98795 - jackh726:lexical_region_resolve_cleanup, ↵Matthias Krüger-14/+490
r=compiler-errors A few cleanups Each commit is (mostly) self-explanatory. These changes have come as I try to remove `ReEmpty` (#98559).
2022-07-08Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebankbors-4/+2
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
2022-07-07Move code from rustc_trait_selection/opaque_types to better placesJack Huey-2/+482
2022-07-07Move is_free and is_free_or_static to Region, change resolve_var to ↵Jack Huey-12/+8
resolve_region, and remove RootEmptyRegion
2022-07-07Wording tweakEsteban Küber-8/+21
2022-07-07Fix label on uninit binding field assignmentEsteban Küber-24/+25
2022-07-07Avoid misleading message/label in `match-cfg-fake-edges.rs` testEsteban Küber-23/+41
2022-07-07Review comments: wordingEsteban Küber-29/+40
2022-07-07Tweak wording and spansEsteban Küber-24/+68
2022-07-07On partial uninit error point at where we need initEsteban Küber-44/+204
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-07Fix borrowck closure span.Camille GILLOT-3/+1
2022-07-07Shorten span for closures.Camille GILLOT-1/+1
2022-07-07Move `dominators` from Body to BasicBlocksTomasz Miąsko-2/+2
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/+71
compiler-errors:rustc-borrowck-session-diagnostic-1, r=davidtwco Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic` Self-explanatory r? ```@davidtwco```
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-23/+71
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>