Display source code check cound unify items
Author: A4-TacksCreated Sep 26, 2026Updated Sep 27, 2026
LabelsC-feature
struct Error;
fn foo() -> Result<(), Error> { Ok(()) }
fn main() {
type Result<T> = std::result::Result<T, Error>;
let _x$0 = foo();
}Actual:
struct Error;
fn foo() -> Result<(), Error> { Ok(()) }
fn main() {
type Result<T> = std::result::Result<T, Error>;
let _x: std::prelude::v1::Result<(), Error> = foo();
}Expect:
struct Error;
fn foo() -> Result<(), Error> { Ok(()) }
fn main() {
type Result<T> = std::result::Result<T, Error>;
let _x: Result<()> = foo();
}Perhaps this feature is a sub case of #12307
Source: rust-lang/rust-analyzer