diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-11 07:01:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-11 07:01:58 +0100 |
commit | ef6ccd75e0961956cb8bd07c59382f85da1dadd3 (patch) | |
tree | c51b9acd97d0f3a336a8473b743e468cd570224c /crates/ra_ide_api/src/references.rs | |
parent | 3b4c506f338d03a633419459bb32daf331153d5e (diff) | |
parent | 0d0a444d4380d9d1eb580d862b2376b9693d77f3 (diff) |
Merge #1991
1991: Use `original_file` instead of `as_original_file` r=matklad a=sinkuu
I saw ra_lsp_server panics originating from `as_original_file`, though I have not been able to reproduce.
Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/references.rs')
-rw-r--r-- | crates/ra_ide_api/src/references.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 84c2eb793..c95c47bf1 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs | |||
@@ -140,7 +140,7 @@ fn rename_mod( | |||
140 | let module_src = hir::Source { file_id: position.file_id.into(), ast: ast_module.clone() }; | 140 | let module_src = hir::Source { file_id: position.file_id.into(), ast: ast_module.clone() }; |
141 | if let Some(module) = hir::Module::from_declaration(db, module_src) { | 141 | if let Some(module) = hir::Module::from_declaration(db, module_src) { |
142 | let src = module.definition_source(db); | 142 | let src = module.definition_source(db); |
143 | let file_id = src.file_id.as_original_file(); | 143 | let file_id = src.file_id.original_file(db); |
144 | match src.ast { | 144 | match src.ast { |
145 | ModuleSource::SourceFile(..) => { | 145 | ModuleSource::SourceFile(..) => { |
146 | let mod_path: RelativePathBuf = db.file_relative_path(file_id); | 146 | let mod_path: RelativePathBuf = db.file_relative_path(file_id); |