From: topecongiro Date: Fri, 1 Dec 2017 04:28:36 +0000 (+0900) Subject: Add whitelists of macros that need special-case format X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=ffbe52eb7638f6647d09564d44314b9bf8d76836;p=rust.git Add whitelists of macros that need special-case format --- diff --git a/src/expr.rs b/src/expr.rs index afa31983046..ce2ea65b65a 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1807,6 +1807,18 @@ fn rewrite_string_lit(context: &RewriteContext, span: Span, shape: Shape) -> Opt ) } +const FORMAT_LIKE_WHITELIST: &[&str] = &[ + "eprint!", + "eprintln!", + "format!", + "format_args!", + "panic!", + "println!", + "unreachable!", +]; + +const WRITE_LIKE_WHITELIST: &[&str] = &["assert!", "write!", "writeln!"]; + pub fn rewrite_call( context: &RewriteContext, callee: &str,