about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@ferrous-systems.com>2023-05-26 11:59:44 +0200
committerSebastian Ziebell <sebastian.ziebell@ferrous-systems.com>2023-06-02 12:46:01 +0200
commitc0e9b5737153a15f15d400a26114ccb067a51e9d (patch)
treeb2950d3de08bae485c26bfe21ab51e035925fb90 /compiler/rustc_interface/src/errors.rs
parent0b4c09b1d2d3e6be0499f2683743716661821bf2 (diff)
downloadrust-c0e9b5737153a15f15d400a26114ccb067a51e9d.tar.gz
rust-c0e9b5737153a15f15d400a26114ccb067a51e9d.zip
Improve assist to filter invalid params
The change updates the logic to determine if a function parameter is
valid for replacing the type param with the trait implementation.

First all usages are determined, to check if they are used outside the function
parameter list. If an outside reference is found, e.g. in body, return type or
where clause, the assist is skipped. All remaining usages only appear in the
function param list. For each usage the param type is checked to see if
it's valid.

**Please note** the logic currently follows a heuristic and may not cover
all existing parameter declarations.

* determine valid usage references by checking ancestors (on AST level)
* split test into separate ones
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions