We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
..
{ .. }
{}
1 parent 1009bc8 commit 716d1c7Copy full SHA for 716d1c7
tools/unstable-api/src/util.rs
@@ -17,15 +17,18 @@ pub(crate) fn lit_is_str(lit: &syn::Lit, s: &str) -> bool {
17
pub(crate) fn empty_block() -> syn::Block {
18
syn::Block {
19
brace_token: Default::default(),
20
- stmts: Default::default(),
+ stmts: vec![syn::Stmt::Expr(empty_expr())],
21
}
22
23
24
pub(crate) fn empty_expr() -> syn::Expr {
25
- syn::ExprBlock {
26
- attrs: vec![],
27
- label: None,
28
- block: empty_block(),
+ // This is just a `..` token, which is technically a valid expression,
+ // but looks like a placeholder.
+ syn::ExprRange {
+ attrs: Vec::new(),
29
+ from: None,
30
+ to: None,
31
+ limits: syn::RangeLimits::HalfOpen(Default::default()),
32
33
.into()
34
0 commit comments