Skip to content

Commit 8c14d58

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 22f88fb commit 8c14d58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)