mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Render closure fn trait kind in siganture help
This commit is contained in:
parent
7c6f31a45b
commit
ff79903cf6
3 changed files with 79 additions and 27 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue