mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Add BuiltinShadowMode
This commit is contained in:
parent
8b278b1ab6
commit
bb601e7eaf
7 changed files with 157 additions and 31 deletions
|
@ -3641,6 +3641,42 @@ fn main() {
|
|||
assert_eq!(t, "Foo");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn not_shadowing_primitive_by_module() {
|
||||
let t = type_at(
|
||||
r#"
|
||||
//- /str.rs
|
||||
fn foo() {}
|
||||
|
||||
//- /main.rs
|
||||
mod str;
|
||||
fn foo() -> &'static str { "" }
|
||||
|
||||
fn main() {
|
||||
foo()<|>;
|
||||
}"#,
|
||||
);
|
||||
assert_eq!(t, "&str");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn not_shadowing_module_by_primitive() {
|
||||
let t = type_at(
|
||||
r#"
|
||||
//- /str.rs
|
||||
fn foo() -> u32 {0}
|
||||
|
||||
//- /main.rs
|
||||
mod str;
|
||||
fn foo() -> &'static str { "" }
|
||||
|
||||
fn main() {
|
||||
str::foo()<|>;
|
||||
}"#,
|
||||
);
|
||||
assert_eq!(t, "u32");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deref_trait() {
|
||||
let t = type_at(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue