| Age | Commit message (Collapse) | Author | Lines |
|
Lazy dominator tree construction in borrowck
Motivated by the observation that sometimes constructed dominator tree was never queried.
|
|
|
|
Do not filter substs in `remap_generic_params_to_declaration_params`.
The relevant filtering should have been performed by borrowck.
Fixes https://github.com/rust-lang/rust/issues/105826
r? types
|
|
Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB
Fix for issue #105507
The problem:
When generic associated types (GATs) are from higher-ranked trait bounds (HRTB), they are implied 'static requirement (see
[Implied 'static requirement from higher-ranked trait bounds](https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds) for more details). If the user did not explicitly specify the `'static` lifetime when using the GAT, the current error message will only point out the type `does not live long enough` where the type is used, but not where the GAT is specified and how to fix the problem.
The solution:
Add notes at the span where the problematic GATs are specified and suggestions of how to fix the problem by adding `'static` lifetime at the right spans.
|
|
Motivated by the observation that sometimes constructed dominator tree
was never queried.
|
|
|
|
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
|
|
|
|
Unify `Opaque`/`Projection` handling in region outlives code
They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias`
r? types
|
|
Improve a TAIT error and add an error code plus documentation
cc https://github.com/rust-lang/rust/issues/106858
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Provide help on closures capturing self causing borrow checker errors
Fixes #105761
r? ````@estebank````
|
|
|
|
|
|
|
|
The relevant filtering should have been performed by borrowck.
|
|
|
|
No need to take opaques in `check_type_bounds`
`InferCtxt` already has its defining use anchor set to err
r? ``@oli-obk``
|
|
Rollup of 10 pull requests
Successful merges:
- #105292 (Change a commit_if_ok call to probe)
- #105655 (Remove invalid case for mutable borrow suggestion)
- #106047 (Fix ui constant tests for big-endian platforms)
- #106061 (Enable Shadow Call Stack for Fuchsia on AArch64)
- #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`)
- #106291 (Fix incorrect suggestion for extra `&` in pattern)
- #106389 (Simplify some canonical type alias names)
- #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`)
- #106549 (Use fmt named parameters in rustc_borrowck)
- #106614 (error-code docs improvements (No. 2))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
r=estebank
Use fmt named parameters in rustc_borrowck
|
|
Don't normalize in AstConv
See individual commits.
Fixes #101350
Fixes #54940
|
|
r=compiler-errors
Suggest `mut self: &mut Self` for `?Sized` impls
Closes #106325
Closes #93078
The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start.
``@rustbot`` label +A-diagnostics
|
|
Detect closures assigned to binding in block
Fix #58497.
|
|
Projection types in user annotations may contain inference variables.
This makes the normalization depend on the unification with the actual
type and thus requires a separate TypeOp to track the obligations.
Otherwise simply calling `TypeChecker::normalize` would ICE with
"unexpected ambiguity"
|
|
|
|
more than one lifetimes of the function's inputs
|
|
Fix #58497.
|
|
|
|
Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent`
The `hir::Map::get_parent_node` function doesn't return a `Node`, and I think that's quite confusing. Let's rename it to something that sounds more like something that gets the parent hir id => `hir::Map::parent_id`. Same with `find_parent_node` => `opt_parent_id`.
Also, combine `hir.get(hir.parent_id(hir_id))` and similar `hir.find(hir.parent_id(hir_id))` function into new functions that actually retrieve the parent node in one call. This last commit is the only one that might need to be looked at closely.
|
|
Merge `check_access_permission` and
`check_if_reassignment_to_immutable_state`.
The goal of this commit is twofold:
First, we simplify the codebase by removing duplicate logic.
Second, we avoid duplicate reporting of illegal reassignment
errors by reusing the exiting de-duplicating logic of
access_place.
|
|
|
|
|
|
|
|
|
|
Fix #53466.
|
|
Use verbose suggestions for mutability errors
|
|
|
|
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already
as well.
|
|
Suggest `Pin::as_mut` when encountering borrow error
Fix #65409 for `Pin<&mut T>`.
|
|
|
|
|
|
|
|
match_result_ok
obfuscated_if_else
single_char_add
writeln_empty_string
collapsible_match
iter_cloned_collect
unnecessary_mut_passed
|
|
|