Skip to content

Commit a3378f5

Browse files
committed
Remove duplication in name/trimmed_anem docs
Reference `DefId` in `CrateDef` docs to avoid duplicating long description of `trimmed_name`
1 parent 141d2f3 commit a3378f5

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

compiler/stable_mir/src/crate_def.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,15 @@ pub trait CrateDef {
4040
fn def_id(&self) -> DefId;
4141

4242
/// Return the fully qualified name of the current definition.
43+
///
44+
/// See [`DefId::name`] for more details
4345
fn name(&self) -> Symbol {
4446
self.def_id().name()
4547
}
4648

4749
/// Return a trimmed name of this definition.
4850
///
49-
/// This can be used to print more user friendly diagnostic messages.
50-
///
51-
/// If a symbol name can only be imported from one place for a type, and as
52-
/// long as it was not glob-imported anywhere in the current crate, we trim its
53-
/// path and print only the name.
54-
///
55-
/// For example, this function may shorten `std::vec::Vec` to just `Vec`,
56-
/// as long as there is no other `Vec` importable anywhere.
51+
/// See [`DefId::trimmed_name`] for more details
5752
fn trimmed_name(&self) -> Symbol {
5853
self.def_id().trimmed_name()
5954
}

0 commit comments

Comments
 (0)