Merge pull request #2966 from topecongiro/issue-2953
Format in-place expression like assignment
This commit is contained in:
commit
d456161b67
3 changed files with 13 additions and 3 deletions
|
|
@ -338,8 +338,10 @@ pub fn format_expr(
|
|||
))
|
||||
}
|
||||
}
|
||||
// FIXME(#2743)
|
||||
ast::ExprKind::ObsoleteInPlace(..) => unimplemented!(),
|
||||
ast::ExprKind::ObsoleteInPlace(ref lhs, ref rhs) => lhs
|
||||
.rewrite(context, shape)
|
||||
.map(|s| s + " <-")
|
||||
.and_then(|lhs| rewrite_assign_rhs(context, lhs, &**rhs, shape)),
|
||||
ast::ExprKind::Async(capture_by, _node_id, ref block) => {
|
||||
let mover = if capture_by == ast::CaptureBy::Value {
|
||||
"move "
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(tool_attributes)]
|
||||
#![feature(decl_macro)]
|
||||
#![allow(unused_attributes)]
|
||||
#![feature(type_ascription)]
|
||||
|
|
|
|||
9
tests/target/obsolete_in_place.rs
Normal file
9
tests/target/obsolete_in_place.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// #2953
|
||||
|
||||
macro_rules! demo {
|
||||
($a:ident <- $b:expr) => {};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
demo!(i <- 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue