diff options
| author | NotLebedev <notlebedev@gmail.com> | 2025-03-02 13:02:20 +0300 |
|---|---|---|
| committer | NotLebedev <notlebedev@gmail.com> | 2025-03-02 13:02:20 +0300 |
| commit | a3378f59388ced7f6011e508bb7dff5f90362e00 (patch) | |
| tree | 55cb34ceafeca4045a15d506be8073f8b6cf86d6 | |
| parent | 141d2f3f025c649e92e71dc1f22198cb265c435a (diff) | |
| download | rust-a3378f59388ced7f6011e508bb7dff5f90362e00.tar.gz rust-a3378f59388ced7f6011e508bb7dff5f90362e00.zip | |
Remove duplication in `name`/`trimmed_anem` docs
Reference `DefId` in `CrateDef` docs to avoid duplicating long description of `trimmed_name`
| -rw-r--r-- | compiler/stable_mir/src/crate_def.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/stable_mir/src/crate_def.rs b/compiler/stable_mir/src/crate_def.rs index d36426d5a99..2577c281ca4 100644 --- a/compiler/stable_mir/src/crate_def.rs +++ b/compiler/stable_mir/src/crate_def.rs @@ -40,20 +40,15 @@ pub trait CrateDef { fn def_id(&self) -> DefId; /// Return the fully qualified name of the current definition. + /// + /// See [`DefId::name`] for more details fn name(&self) -> Symbol { self.def_id().name() } /// Return a trimmed name of this definition. /// - /// This can be used to print more user friendly diagnostic messages. - /// - /// If a symbol name can only be imported from one place for a type, and as - /// long as it was not glob-imported anywhere in the current crate, we trim its - /// path and print only the name. - /// - /// For example, this function may shorten `std::vec::Vec` to just `Vec`, - /// as long as there is no other `Vec` importable anywhere. + /// See [`DefId::trimmed_name`] for more details fn trimmed_name(&self) -> Symbol { self.def_id().trimmed_name() } |
