1
Fork 0

Handle parenthesised infer args

This commit is contained in:
Boxy 2025-01-20 06:34:57 +00:00
parent 1983c437ce
commit c58fe21cb9
3 changed files with 32 additions and 6 deletions

View file

@ -288,6 +288,7 @@ impl ParenthesizedArgs {
}
}
use crate::AstDeref;
pub use crate::node_id::{CRATE_NODE_ID, DUMMY_NODE_ID, NodeId};
/// Modifiers on a trait bound like `~const`, `?` and `!`.
@ -2166,6 +2167,14 @@ impl Ty {
}
final_ty
}
pub fn is_maybe_parenthesised_infer(&self) -> bool {
match &self.kind {
TyKind::Infer => true,
TyKind::Paren(inner) => inner.ast_deref().is_maybe_parenthesised_infer(),
_ => false,
}
}
}
#[derive(Clone, Encodable, Decodable, Debug)]