Skip to content

Cargo update #2814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ env_logger = "0.5"
getopts = "0.2"
derive-new = "0.5"
cargo_metadata = "0.5.1"
rustc-ap-rustc_target = "174.0.0"
rustc-ap-syntax = "174.0.0"
rustc-ap-rustc_target = "177.0.0"
rustc-ap-syntax = "177.0.0"
failure = "0.1.1"

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion src/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use utils::{last_line_width, left_most_sub_expr, stmt_expr};
// statement without needing a semi-colon), then adding or removing braces
// can change whether it is treated as an expression or statement.

// FIXME(topecongiro) Format async closures (#2813).
pub fn rewrite_closure(
capture: ast::CaptureBy,
movability: ast::Movability,
Expand Down Expand Up @@ -288,7 +289,7 @@ pub fn rewrite_last_closure(
expr: &ast::Expr,
shape: Shape,
) -> Option<String> {
if let ast::ExprKind::Closure(capture, movability, ref fn_decl, ref body, _) = expr.node {
if let ast::ExprKind::Closure(capture, _, movability, ref fn_decl, ref body, _) = expr.node {
let body = match body.node {
ast::ExprKind::Block(ref block, _)
if !is_unsafe_block(block)
Expand Down
4 changes: 3 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn format_expr(
} else {
Some("yield".to_string())
},
ast::ExprKind::Closure(capture, movability, ref fn_decl, ref body, _) => {
ast::ExprKind::Closure(capture, _, movability, ref fn_decl, ref body, _) => {
closures::rewrite_closure(
capture, movability, fn_decl, body, expr.span, context, shape,
)
Expand Down Expand Up @@ -344,6 +344,8 @@ pub fn format_expr(
}
// FIXME(#2743)
ast::ExprKind::ObsoleteInPlace(..) => unimplemented!(),
// FIXME(topecongiro) Format async block.
ast::ExprKind::Async(..) => None,
};

expr_rw
Expand Down
14 changes: 7 additions & 7 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ impl<'a> FnSig<'a> {
generics: &'a ast::Generics,
) -> FnSig<'a> {
FnSig {
unsafety: method_sig.unsafety,
constness: method_sig.constness.node,
unsafety: method_sig.header.unsafety,
constness: method_sig.header.constness.node,
defaultness: ast::Defaultness::Final,
abi: method_sig.abi,
abi: method_sig.header.abi,
decl: &*method_sig.decl,
generics,
visibility: DEFAULT_VISIBILITY,
Expand All @@ -209,13 +209,13 @@ impl<'a> FnSig<'a> {
defaultness: ast::Defaultness,
) -> FnSig<'a> {
match *fn_kind {
visit::FnKind::ItemFn(_, unsafety, constness, abi, visibility, _) => FnSig {
visit::FnKind::ItemFn(_, fn_header, visibility, _) => FnSig {
decl,
generics,
abi,
constness: constness.node,
abi: fn_header.abi,
constness: fn_header.constness.node,
defaultness,
unsafety,
unsafety: fn_header.unsafety,
visibility: visibility.clone(),
},
visit::FnKind::Method(_, method_sig, vis, _) => {
Expand Down
7 changes: 4 additions & 3 deletions src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {

// Note that this only gets called for function definitions. Required methods
// on traits do not get handled here.
// FIXME(topecongiro) Format async fn (#2812).
fn visit_fn(
&mut self,
fk: visit::FnKind,
Expand All @@ -264,7 +265,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
let indent = self.block_indent;
let block;
let rewrite = match fk {
visit::FnKind::ItemFn(ident, _, _, _, _, b) | visit::FnKind::Method(ident, _, _, b) => {
visit::FnKind::ItemFn(ident, _, _, b) | visit::FnKind::Method(ident, _, _, b) => {
block = b;
self.rewrite_fn(
indent,
Expand Down Expand Up @@ -392,10 +393,10 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
ast::ItemKind::Static(..) | ast::ItemKind::Const(..) => {
self.visit_static(&StaticParts::from_item(item));
}
ast::ItemKind::Fn(ref decl, unsafety, constness, abi, ref generics, ref body) => {
ast::ItemKind::Fn(ref decl, fn_header, ref generics, ref body) => {
let inner_attrs = inner_attributes(&item.attrs);
self.visit_fn(
visit::FnKind::ItemFn(item.ident, unsafety, constness, abi, &item.vis, body),
visit::FnKind::ItemFn(item.ident, fn_header, &item.vis, body),
generics,
decl,
item.span,
Expand Down