Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Update TypeckResuts::closure_kind_origin to use Place #21

Closed
arora-aman opened this issue Nov 9, 2020 · 0 comments · Fixed by sexxi-goose/rust#36 or rust-lang/rust#80635
Closed
Assignees

Comments

@arora-aman
Copy link
Member

closure_kind_origin uses a (Span, Symbol) to store which Variable and which span resulted in us selected a particular closure kind(Fn, FnMut, FnOnce).

We want to update this to now use (Span, Place) to point to precise access. This would require us to modify the definition in rustc_middle/src/ty/context.rs, adjust_closure-kind, and uses of this map.

@arora-aman arora-aman assigned ChrisPardy and unassigned null-sleep Nov 21, 2020
@arora-aman arora-aman assigned roxelo and unassigned ChrisPardy Nov 30, 2020
m-ou-se added a commit to m-ou-se/rust that referenced this issue Jan 16, 2021
…mbol, r=nikomatsakis`

Improve diagnostics when closure doesn't meet trait bound

Improves the diagnostics when closure doesn't meet trait bound by modifying `TypeckResuts::closure_kind_origins` such that `hir::Place` is used instead of `Symbol`. Using `hir::Place` to describe which capture influenced the decision of selecting a trait a closure satisfies to (Fn/FnMut/FnOnce, Copy) allows us to show precise path in the diagnostics when `capture_disjoint_field` feature is enabled.

Closes rust-lang/project-rfc-2229/issues/21

r? `@nikomatsakis`
m-ou-se added a commit to m-ou-se/rust that referenced this issue Jan 17, 2021
…mbol, r=nikomatsakis`

Improve diagnostics when closure doesn't meet trait bound

Improves the diagnostics when closure doesn't meet trait bound by modifying `TypeckResuts::closure_kind_origins` such that `hir::Place` is used instead of `Symbol`. Using `hir::Place` to describe which capture influenced the decision of selecting a trait a closure satisfies to (Fn/FnMut/FnOnce, Copy) allows us to show precise path in the diagnostics when `capture_disjoint_field` feature is enabled.

Closes rust-lang/project-rfc-2229/issues/21

r? ``@nikomatsakis``
@nikomatsakis nikomatsakis added this to the Feature complete milestone Feb 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.