Skip to content

Commit d716eee

Browse files
committed
Wrap contract clauses in brances instead of parenthesis
The compiler complained about uncecessary parenthesis on contract clauses, which were insterted by the contract macros. This commit changes the macro to use braces as the delimiter instead, fixing the issue.
1 parent ad9a20c commit d716eee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/rustc_builtin_macros/src/contracts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn expand_requires_tts(
141141
new_tts.push_tree(TokenTree::Delimited(
142142
DelimSpan::from_single(attr_span),
143143
DelimSpacing::new(Spacing::JointHidden, Spacing::JointHidden),
144-
token::Delimiter::Parenthesis,
144+
token::Delimiter::Brace,
145145
annotation,
146146
));
147147
Ok(())
@@ -163,7 +163,7 @@ fn expand_ensures_tts(
163163
new_tts.push_tree(TokenTree::Delimited(
164164
DelimSpan::from_single(attr_span),
165165
DelimSpacing::new(Spacing::JointHidden, Spacing::JointHidden),
166-
token::Delimiter::Parenthesis,
166+
token::Delimiter::Brace,
167167
annotation,
168168
));
169169
Ok(())

0 commit comments

Comments
 (0)