8000 RFC-2229: Implement Precise Capture Analysis by arora-aman · Pull Request #78801 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

RFC-2229: Implement Precise Capture Analysis #78801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests with min capture information
Co-authored-by: Chris Pardy <chrispardy36@gmail.com>
Co-authored-by: Logan Mosier <logmosier@gmail.com>
  • Loading branch information
3 people committed Nov 11, 2020
commit b16815b58d2f584b0a337a3456c1238a96b3f443
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,30 @@ For closure=DefId(0:4 ~ arrays_completely_captured[317d]::main::{closure#0}): ca
),
},
}
For closure=DefId(0:4 ~ arrays_completely_captured[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:3 ~ arrays_completely_captured[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: [i32; 5],
base: Upvar(
UpvarId(HirId { owner: DefId(0:3 ~ arrays_completely_captured[317d]::main), local_id: 1 };`m`;DefId(0:4 ~ arrays_completely_captured[317d]::main::{closure#0})),
),
projections: [],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:3 ~ arrays_completely_captured[317d]::main),
local_id: 12,
},
),
capture_kind: ByRef(
UpvarBorrow(MutBorrow, '_#6r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,38 @@ For closure=DefId(0:7 ~ capture_disjoint_field_struct[317d]::main::{closure#0}):
),
},
}
For closure=DefId(0:7 ~ capture_disjoint_field_struct[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:6 ~ capture_disjoint_field_struct[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: Point,
base: Upvar(
UpvarId(HirId { owner: DefId(0:6 ~ capture_disjoint_field_struct[317d]::main), local_id: 1 };`p`;DefId(0:7 ~ capture_disjoint_field_struct[317d]::main::{closure#0})),
),
projections: [
Projection {
ty: i32,
kind: Field(
0,
0,
),
},
],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:6 ~ capture_disjoint_field_struct[317d]::main),
local_id: 31,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#35r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,38 @@ For closure=DefId(0:4 ~ capture_disjoint_field_tuple[317d]::main::{closure#0}):
),
},
}
For closure=DefId(0:4 ~ capture_disjoint_field_tuple[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:3 ~ capture_disjoint_field_tuple[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: (i32, i32),
base: Upvar(
UpvarId(HirId { owner: DefId(0:3 ~ capture_disjoint_field_tuple[317d]::main), local_id: 1 };`t`;DefId(0:4 ~ capture_disjoint_field_tuple[317d]::main::{closure#0})),
),
projections: [
Projection {
ty: i32,
kind: Field(
0,
0,
),
},
],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:3 ~ capture_disjoint_field_tuple[317d]::main),
local_id: 28,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#35r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,30 @@ For closure=DefId(0:4 ~ feature_gate_capture_disjoint_fields[317d]::main::{closu
),
},
}
For closure=DefId(0:4 ~ feature_gate_capture_disjoint_fields[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:3 ~ feature_gate_capture_disjoint_fields[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: std::string::String,
base: Upvar(
UpvarId(HirId { owner: DefId(0:3 ~ feature_gate_capture_disjoint_fields[317d]::main), local_id: 1 };`s`;DefId(0:4 ~ feature_gate_capture_disjoint_fields[317d]::main::{closure#0})),
),
projections: [],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:3 ~ feature_gate_capture_disjoint_fields[317d]::main),
local_id: 52,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#50r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,42 @@ For closure=DefId(0:12 ~ filter_on_struct_member[317d]::{impl#1}::update::{closu
),
},
}
For closure=DefId(0:12 ~ filter_on_struct_member[317d]::{impl#1}::update::{closure#0}): min_captures={
HirId {
owner: DefId(0:11 ~ filter_on_struct_member[317d]::{impl#1}::update),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: &mut Data,
base: Upvar(
UpvarId(HirId { owner: DefId(0:11 ~ filter_on_struct_member[317d]::{impl#1}::update), local_id: 1 };`self`;DefId(0:12 ~ filter_on_struct_member[317d]::{impl#1}::update::{closure#0})),
),
projections: [
Projection {
ty: Data,
kind: Deref,
},
Projection {
ty: Filter,
kind: Field(
0,
0,
),
},
],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:11 ~ filter_on_struct_member[317d]::{impl#1}::update),
local_id: 13,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#7r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,38 @@ For closure=DefId(0:9 ~ multilevel_path_1[317d]::main::{closure#0}): capture inf
),
},
}
For closure=DefId(0:9 ~ multilevel_path_1[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:8 ~ multilevel_path_1[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: Wrapper,
base: Upvar(
UpvarId(HirId { owner: DefId(0:8 ~ multilevel_path_1[317d]::main), local_id: 1 };`w`;DefId(0:9 ~ multilevel_path_1[317d]::main::{closure#0})),
),
projections: [
Projection {
ty: Point,
kind: Field(
0,
0,
),
},
],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:8 ~ multilevel_path_1[317d]::main),
local_id: 20,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#37r),
),
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,45 @@ For closure=DefId(0:9 ~ multilevel_path_2[317d]::main::{closure#0}): capture inf
),
},
}
For closure=DefId(0:9 ~ multilevel_path_2[317d]::main::{closure#0}): min_captures={
HirId {
owner: DefId(0:8 ~ multilevel_path_2[317d]::main),
local_id: 1,
}: [
CapturedPlace {
place: Place {
base_ty: Wrapper,
base: Upvar(
UpvarId(HirId { owner: DefId(0:8 ~ multilevel_path_2[317d]::main), local_id: 1 };`w`;DefId(0:9 ~ multilevel_path_2[317d]::main::{closure#0})),
),
projections: [
Projection {
ty: Point,
kind: Field(
0,
0,
),
},
Projection {
ty: i32,
kind: Field(
0,
0,
),
},
],
},
info: CaptureInfo {
expr_id: Some(
HirId {
owner: DefId(0:8 ~ multilevel_path_2[317d]::main),
local_id: 35,
},
),
capture_kind: ByRef(
UpvarBorrow(ImmBorrow, '_#35r),
),
},
},
],
}
Loading
0