mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-28 21:05:13 +00:00
Auto merge of #15140 - tetsuharuohzeki:issue-15088-comment, r=Veykril
Add the comment why `HasSource::source()` returns `Option` Fix https://github.com/rust-lang/rust-analyzer/issues/15088
This commit is contained in:
commit
8769cd24bc
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ pub trait HasSource {
|
||||||
/// Fetches the definition's source node.
|
/// Fetches the definition's source node.
|
||||||
/// Using [`crate::Semantics::source`] is preferred when working with [`crate::Semantics`],
|
/// Using [`crate::Semantics::source`] is preferred when working with [`crate::Semantics`],
|
||||||
/// as that caches the parsed file in the semantics' cache.
|
/// as that caches the parsed file in the semantics' cache.
|
||||||
|
///
|
||||||
|
/// The current some implementations can return `InFile` instead of `Option<InFile>`.
|
||||||
|
/// But we made this method `Option` to support rlib in the future
|
||||||
|
/// by https://github.com/rust-lang/rust-analyzer/issues/6913
|
||||||
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>;
|
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue