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
Rust-analyzer knows the correct type, but inline hint shows different types.
Is this problem with configuration, or I inline hint cannot resolve types creates in proc_macro?
/*
#[throws(i32)]
fn foo(x: bool) -> i32 {
if x {
0
} else {
throw!(1);
}
}
// expanded code
fn bar(x: bool) -> Result<i32, i32> {
if x {
Ok(0)
} else {
Err(1)
}
}
*/
// --------------------------------------------------
#[derive(Debug)]
struct Xerror;
#[throws(Xerror)]
fn foo(i: i32) -> i32 {
if i < 0 {
Err(Xerror)?;
}
i
}
fn main() {
let _x = foo(32); // this shows inline hint as i32, but correct type is Result<i32, Xerror>
}
The text was updated successfully, but these errors were encountered:
Rust-analyzer knows the correct type, but inline hint shows different types.
Is this problem with configuration, or I inline hint cannot resolve types creates in proc_macro?
The text was updated successfully, but these errors were encountered: