mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Fix a failing test
The reason this test passed previously is not because it was working as intended, but because prior to the previous commit we did not resolve the `use` at all! Now, `use self as _` is invalid code anyway (it prints E0429), and because we fallback to the value namespace if we can't resolve in the type namespace (which is a reasonable behavior), this test now actually fails. I don't think we want to change the fallback, so I removed `use self as _` and instead added a new test, where the value can be resolved in the type namespace.
This commit is contained in:
parent
134b6f2228
commit
bffc169925
@ -2001,19 +2001,37 @@ impl Foo {
|
||||
"foo",
|
||||
r#"
|
||||
fn f($0self) -> i32 {
|
||||
use self as _;
|
||||
self.i
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
fn f(foo: _) -> i32 {
|
||||
use self as _;
|
||||
foo.i
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_type_value_ns_confuse() {
|
||||
// Test that we don't rename items from different namespaces.
|
||||
check(
|
||||
"bar",
|
||||
r#"
|
||||
struct foo {}
|
||||
fn f(foo$0: i32) -> i32 {
|
||||
use foo as _;
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
struct foo {}
|
||||
fn f(bar: i32) -> i32 {
|
||||
use foo as _;
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_self_in_path_to_parameter() {
|
||||
check(
|
||||
|
Loading…
x
Reference in New Issue
Block a user