about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/diagnostics
AgeCommit message (Collapse)AuthorLines
2022-07-11rename a methodTakayuki Maeda-2/+2
2022-07-11implement `is_accessible_span`Takayuki Maeda-9/+2
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-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-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/+58
2022-07-07On partial uninit error point at where we need initEsteban Küber-22/+200
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 `predecessors` from Body to BasicBlocksTomasz Miąsko-1/+1
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-6/+1
2022-07-02Rollup merge of #98766 - lcnr:mir-visit-pass_by_value, r=oli-obkDylan DPC-3/+3
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-3/+3
2022-06-29Rollup merge of #98415 - ↵Dylan DPC-12/+24
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-12/+24
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-27fold_region: remove unused parameterlcnr-1/+1
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-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-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-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-15/+15
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-13/+15
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-2/+2
2022-05-29Handle anonymous lifetimes properly in diagnostics.Camille GILLOT-4/+6
2022-05-28Auto merge of #97284 - b-naber:constraint-dyn-impl-suggestion, r=estebankbors-41/+211
Add suggestion for relaxing static lifetime bounds on dyn trait impls in NLL This PR introduces suggestions for relaxing static lifetime bounds on impls of dyn trait items for NLL similar to what is already available in lexical region diagnostics. Fixes https://github.com/rust-lang/rust/issues/95701 r? `@estebank`
2022-05-26clippy::complexity fixesMatthias Krüger-3/+3
clone_on_copy useless_format bind_instead_of_map filter_map_identity useless_conversion map_flatten unnecessary_unwrap
2022-05-26rebase, use Ty in CallArgument and re-insert static_assert_size on ↵b-naber-8/+9
ConstraintCategory
2022-05-25suggest constraining dyn trait in impl in NLLb-naber-27/+196
2022-05-25add def_id and substs to ConstraintCategory::CallArgumentb-naber-14/+14
2022-05-23Refactor call terminator to always hold a destination placeJakob Degen-4/+4
2022-05-22Lifetime variance fixes for rustcMichael Goulet-3/+4
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-33/+37
2022-05-17Change `Successors` to `impl Iterator<Item = BasicBlock>`SparrowLii-4/+4
2022-05-10Introduce EarlyBinderJack Huey-2/+4
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-12/+15
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-06turn `append_place_to_string` from recursion into iterationSparrowLii-132/+78
2022-05-02fix most compiler/ doctestsElliot Roberts-12/+15
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-29errors: `span_suggestion` takes `impl ToString`David Wood-1/+1
Change `span_suggestion` (and variants) to take `impl ToString` rather than `String` for the suggested code, as this simplifies the requirements on the diagnostic derive. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-27Recover suggestions to introduce named lifetime under NLLmarmeladema-1/+34
2022-04-27Rollup merge of #96385 - ↵Dylan DPC-77/+42
marmeladema:nll-fix-trait-lifetime-bound-suggestions, r=jackh726 Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`. Fixes #96277 r? ```@jackh726```
2022-04-25simplify `describe_field` func in borrowck's diagnostics partSparrowLii-19/+10
2022-04-25Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLLmarmeladema-77/+42