You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Borrow checker incorrectly accepts code when calling function with complex lifetime bounds through a fn pointer #57170
Expected result: a borrow checker error, the same as the one obtained when calling shorten_lifetime directly.
I accidentally ran into this issue when trying to spell the fn pointer type of fnptr (I'm not sure how to add constraints to the lifetimes of a higher-ranked fn type like for<'a, 'b> fn(...) -> T)
Activity
jonas-schievink commentedon Dec 28, 2018
The 2015 edition correctly rejects this (which doesn't yet have NLL)
nagisa commentedon Dec 28, 2018
cc @pnkfelix
nagisa commentedon Dec 28, 2018
@rust-lang/wg-compiler-nll
matthewjasper commentedon Dec 28, 2018
It appears that we lose the function bounds when we promote
shorten_lifetime. Relavant FIXME:rust/src/librustc_mir/borrow_check/nll/type_check/mod.rs
Lines 433 to 443 in 48742c6
pnkfelix commentedon Feb 27, 2019
triage: P-high. Hopefully fix in PR #57202 lands very soon.
Auto merge of #57202 - matthewjasper:nll-typeck-promoteds, r=pnkfelix