Handle parenthesised infer args
This commit is contained in:
parent
1983c437ce
commit
c58fe21cb9
3 changed files with 32 additions and 6 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue