diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-01 00:33:38 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:29 +0100 |
| commit | 996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd (patch) | |
| tree | 2b92c207effac29986b51278ec11b7d5883cdf0e /compiler/rustc_save_analysis/src/sig.rs | |
| parent | 786a80e9ea7af4909f67207c542eb02727f74756 (diff) | |
| download | rust-996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd.tar.gz rust-996dc8d5c55a496bfbdc99a936fb6055bcbe2fcd.zip | |
Only store a LocalDefId in hir::ForeignItem.
Diffstat (limited to 'compiler/rustc_save_analysis/src/sig.rs')
| -rw-r--r-- | compiler/rustc_save_analysis/src/sig.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index a1fee58629a..33db189af37 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -736,14 +736,14 @@ impl<'hir> Sig for hir::Variant<'hir> { impl<'hir> Sig for hir::ForeignItem<'hir> { fn make(&self, offset: usize, _parent_id: Option<hir::HirId>, scx: &SaveContext<'_>) -> Result { - let id = Some(self.hir_id); + let id = Some(self.hir_id()); match self.kind { hir::ForeignItemKind::Fn(decl, _, ref generics) => { let mut text = String::new(); text.push_str("fn "); let mut sig = - name_and_generics(text, offset, generics, self.hir_id, self.ident, scx)?; + name_and_generics(text, offset, generics, self.hir_id(), self.ident, scx)?; sig.text.push('('); for i in decl.inputs { @@ -774,7 +774,7 @@ impl<'hir> Sig for hir::ForeignItem<'hir> { } let name = self.ident.to_string(); let defs = vec![SigElement { - id: id_from_hir_id(self.hir_id, scx), + id: id_from_def_id(self.def_id.to_def_id()), start: offset + text.len(), end: offset + text.len() + name.len(), }]; @@ -790,7 +790,7 @@ impl<'hir> Sig for hir::ForeignItem<'hir> { let mut text = "type ".to_owned(); let name = self.ident.to_string(); let defs = vec![SigElement { - id: id_from_hir_id(self.hir_id, scx), + id: id_from_def_id(self.def_id.to_def_id()), start: offset + text.len(), end: offset + text.len() + name.len(), }]; |
