mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
Merge #11436
11436: fix: renaming modules does not change references by super r=Veykril a=TheDoctor314 Fixes #11289. Co-authored-by: TheDoctor314 <64731940+TheDoctor314@users.noreply.github.com>
This commit is contained in:
commit
8ac459501e
@ -1108,6 +1108,31 @@ pub mod foo$0;
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rename_mod_ref_by_super() {
|
||||
check(
|
||||
"baz",
|
||||
r#"
|
||||
mod $0foo {
|
||||
struct X;
|
||||
|
||||
mod bar {
|
||||
use super::X;
|
||||
}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
mod baz {
|
||||
struct X;
|
||||
|
||||
mod bar {
|
||||
use super::X;
|
||||
}
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_enum_variant_from_module_1() {
|
||||
cov_mark::check!(rename_non_local);
|
||||
|
@ -343,6 +343,10 @@ fn source_edit_from_name_ref(
|
||||
new_name: &str,
|
||||
def: Definition,
|
||||
) -> bool {
|
||||
if name_ref.super_token().is_some() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if let Some(record_field) = ast::RecordExprField::for_name_ref(name_ref) {
|
||||
let rcf_name_ref = record_field.name_ref();
|
||||
let rcf_expr = record_field.expr();
|
||||
|
Loading…
Reference in New Issue
Block a user