diff --git a/src/ty.rs b/src/ty.rs index 9b341dafaf..9282ba4e61 100644 --- a/src/ty.rs +++ b/src/ty.rs @@ -1076,6 +1076,11 @@ mod printing { fn to_tokens(&self, tokens: &mut TokenStream) { self.paren_token.surround(tokens, |tokens| { self.elems.to_tokens(tokens); + // If we only have one argument, we need a trailing comma to + // distinguish TypeTuple from TypeParen. + if self.elems.len() == 1 && !self.elems.trailing_punct() { + ::default().to_tokens(tokens); + } }); } }