Lift Niche from just captures-niche to generic niche

This commit is contained in:
Ayaz Hafiz 2022-12-27 16:21:17 -06:00
parent ea53a50447
commit 972046445b
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
16 changed files with 119 additions and 140 deletions

View file

@ -513,7 +513,7 @@ impl<'a> BorrowInfState<'a> {
..
} => {
let top_level =
ProcLayout::new(self.arena, arg_layouts, name.captures_niche(), **ret_layout);
ProcLayout::new(self.arena, arg_layouts, name.niche(), **ret_layout);
// get the borrow signature of the applied function
let ps = param_map
@ -556,7 +556,7 @@ impl<'a> BorrowInfState<'a> {
let closure_layout = ProcLayout {
arguments: passed_function.argument_layouts,
result: passed_function.return_layout,
captures_niche: passed_function.name.captures_niche(),
niche: passed_function.name.niche(),
};
let function_ps =
@ -739,8 +739,7 @@ impl<'a> BorrowInfState<'a> {
Stmt::Ret(z),
) = (v, b)
{
let top_level =
ProcLayout::new(self.arena, arg_layouts, g.captures_niche(), **ret_layout);
let top_level = ProcLayout::new(self.arena, arg_layouts, g.niche(), **ret_layout);
if self.current_proc == g.name() && x == *z {
// anonymous functions (for which the ps may not be known)