Render closure fn trait kind in siganture help

This commit is contained in:
Lukas Wirth 2024-05-18 15:01:37 +02:00
parent 7c6f31a45b
commit ff79903cf6
3 changed files with 79 additions and 27 deletions

View file

@ -1,5 +1,6 @@
//! Trait solving using Chalk.
use core::fmt;
use std::env::var;
use chalk_ir::{fold::TypeFoldable, DebruijnIndex, GoalData};
@ -209,6 +210,16 @@ pub enum FnTrait {
Fn,
}
impl fmt::Display for FnTrait {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
FnTrait::FnOnce => write!(f, "FnOnce"),
FnTrait::FnMut => write!(f, "FnMut"),
FnTrait::Fn => write!(f, "Fn"),
}
}
}
impl FnTrait {
const fn lang_item(self) -> LangItem {
match self {