mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Fallback to primitive when path doesn't resolve
This commit is contained in:
parent
63573d47aa
commit
d764e134d5
3 changed files with 39 additions and 0 deletions
|
@ -1767,3 +1767,26 @@ fn foo() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn primitive_assoc_fn_shadowed_by_use() {
|
||||
check_types(
|
||||
r#"
|
||||
//- /lib.rs crate:lib deps:core
|
||||
use core::u16;
|
||||
|
||||
fn f() -> u16 {
|
||||
let x = u16::from_le_bytes();
|
||||
x
|
||||
//^ u16
|
||||
}
|
||||
|
||||
//- /core.rs crate:core
|
||||
pub mod u16 {}
|
||||
|
||||
impl u16 {
|
||||
pub fn from_le_bytes() -> Self { 0 }
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue