Rollup merge of #103176 - nnethercote:fix-TyKind-is_simple_path, r=spastorino
Fix `TyKind::is_simple_path` Fixes #103157. r? `@spastorino`
This commit is contained in:
commit
e86bc89831
5 changed files with 54 additions and 5 deletions
|
@ -2060,8 +2060,11 @@ impl TyKind {
|
|||
}
|
||||
|
||||
pub fn is_simple_path(&self) -> Option<Symbol> {
|
||||
if let TyKind::Path(None, Path { segments, .. }) = &self && segments.len() == 1 {
|
||||
Some(segments[0].ident.name)
|
||||
if let TyKind::Path(None, Path { segments, .. }) = &self
|
||||
&& let [segment] = &segments[..]
|
||||
&& segment.args.is_none()
|
||||
{
|
||||
Some(segment.ident.name)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue