Merge pull request #18986 from Veykril/push-zlwvwlowpzqm

Goto `Display::fmt` when invoked on `to_string`
This commit is contained in:
Lukas Wirth 2025-01-21 09:25:05 +00:00 committed by GitHub
commit 2c040c03cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 0 deletions

View file

@ -142,6 +142,13 @@ impl FamousDefs<'_, '_> {
self.find_macro("core:unimplemented")
}
pub fn core_fmt_Display(&self) -> Option<Trait> {
self.find_trait("core:fmt:Display")
}
pub fn alloc_string_ToString(&self) -> Option<Trait> {
self.find_trait("alloc:string:ToString")
}
pub fn builtin_crates(&self) -> impl Iterator<Item = Crate> {
IntoIterator::into_iter([
self.std(),