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
fnnone<T>() -> Option<T>{returnNone;}pubfnmain(){let a = none::<u32>();}
inlining the none function replaces it with let a = { return None; };, which tries to return None in main
the generic type param T of none was first known to be u32, to preserve this information (and not end up with "type annotations needed for Option<T>") let a = None::<u32>; would work
antonilol
changed the title
return statements in inlined function just get moved over and try to return out of the outer function + generic types are discardedreturn statements in inlined functions just get moved over and try to return out of the outer function + generic types are discarded
Aug 16, 2023
title,
code example
none
function replaces it withlet a = { return None; };
, which tries to returnNone
inmain
T
ofnone
was first known to beu32
, to preserve this information (and not end up with "type annotations needed forOption<T>
")let a = None::<u32>;
would workrust-analyzer version: 0.4.1625-standalone
rustc version: rustc 1.71.1 (eb26296b5 2023-08-03)
relevant settings: none
The text was updated successfully, but these errors were encountered: