Revert "Revert global fmt config and use rustfmt::skip"

This reverts commit b70b3b14aa.
This commit is contained in:
uHOOCCOOHu 2019-07-23 02:57:49 +08:00
parent b70b3b14aa
commit 434f83a6c7
No known key found for this signature in database
GPG key ID: CED392DE0C483D00
3 changed files with 36 additions and 40 deletions

View file

@ -2,5 +2,5 @@ max_width = 120
comment_width = 100 comment_width = 100
match_block_trailing_comma = true match_block_trailing_comma = true
wrap_comments = true wrap_comments = true
edition = "2018"
error_on_line_overflow = true error_on_line_overflow = true

View file

@ -2,41 +2,37 @@
#![feature(async_await)] #![feature(async_await)]
#![allow(dead_code)] #![allow(dead_code)]
// No edition 2018 async fn sink1<'a>(_: &'a str) {} // lint
#[rustfmt::skip] async fn sink1_elided(_: &str) {} // ok
mod m {
async fn sink1<'a>(_: &'a str) {} // lint
async fn sink1_elided(_: &str) {} // ok
// lint // lint
async fn one_to_one<'a>(s: &'a str) -> &'a str { async fn one_to_one<'a>(s: &'a str) -> &'a str {
s s
} }
// ok
async fn one_to_one_elided(s: &str) -> &str {
s
}
// ok
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
a
}
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
// #3988
struct Foo;
impl Foo {
// ok // ok
async fn one_to_one_elided(s: &str) -> &str { pub async fn foo(&mut self) {}
s }
}
// ok // rust-lang/rust#61115
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str { // ok
a async fn print(s: &str) {
} println!("{}", s);
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
// #3988
struct Foo;
impl Foo {
// ok
pub async fn foo(&mut self) {}
}
// rust-lang/rust#61115
// ok
async fn print(s: &str) {
println!("{}", s);
}
} }
fn main() {} fn main() {}

View file

@ -1,18 +1,18 @@
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/issue_4266.rs:8:5 --> $DIR/issue_4266.rs:5:1
| |
LL | async fn sink1<'a>(_: &'a str) {} // lint LL | async fn sink1<'a>(_: &'a str) {} // lint
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::needless-lifetimes` implied by `-D warnings` = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> $DIR/issue_4266.rs:12:5 --> $DIR/issue_4266.rs:9:1
| |
LL | / async fn one_to_one<'a>(s: &'a str) -> &'a str { LL | / async fn one_to_one<'a>(s: &'a str) -> &'a str {
LL | | s LL | | s
LL | | } LL | | }
| |_____^ | |_^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors