Skip to content

Commit b70b3b1

Browse files
committed
Revert global fmt config and use rustfmt::skip
1 parent 2cc373a commit b70b3b1

File tree

3 files changed

+38
-34
lines changed

3 files changed

+38
-34
lines changed

rustfmt.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ max_width = 120
22
comment_width = 100
33
match_block_trailing_comma = true
44
wrap_comments = true
5-
edition = "2018"
5+
66
error_on_line_overflow = true

tests/ui/issue_4266.rs

+29-25
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,41 @@
22
#![feature(async_await)]
33
#![allow(dead_code)]
44

5-
async fn sink1<'a>(_: &'a str) {} // lint
6-
async fn sink1_elided(_: &str) {} // ok
5+
// No edition 2018
6+
#[rustfmt::skip]
7+
mod m {
8+
async fn sink1<'a>(_: &'a str) {} // lint
9+
async fn sink1_elided(_: &str) {} // ok
710

8-
// lint
9-
async fn one_to_one<'a>(s: &'a str) -> &'a str {
10-
s
11-
}
11+
// lint
12+
async fn one_to_one<'a>(s: &'a str) -> &'a str {
13+
s
14+
}
1215

13-
// ok
14-
async fn one_to_one_elided(s: &str) -> &str {
15-
s
16-
}
16+
// ok
17+
async fn one_to_one_elided(s: &str) -> &str {
18+
s
19+
}
1720

18-
// ok
19-
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
20-
a
21-
}
21+
// ok
22+
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str {
23+
a
24+
}
2225

23-
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
26+
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn
2427

25-
// #3988
26-
struct Foo;
27-
impl Foo {
28-
// ok
29-
pub async fn foo(&mut self) {}
30-
}
28+
// #3988
29+
struct Foo;
30+
impl Foo {
31+
// ok
32+
pub async fn foo(&mut self) {}
33+
}
3134

32-
// rust-lang/rust#61115
33-
// ok
34-
async fn print(s: &str) {
35-
println!("{}", s);
35+
// rust-lang/rust#61115
36+
// ok
37+
async fn print(s: &str) {
38+
println!("{}", s);
39+
}
3640
}
3741

3842
fn main() {}

tests/ui/issue_4266.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
2-
--> $DIR/issue_4266.rs:5:1
2+
--> $DIR/issue_4266.rs:8:5
33
|
4-
LL | async fn sink1<'a>(_: &'a str) {} // lint
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | async fn sink1<'a>(_: &'a str) {} // lint
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
88

99
error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
10-
--> $DIR/issue_4266.rs:9:1
10+
--> $DIR/issue_4266.rs:12:5
1111
|
12-
LL | / async fn one_to_one<'a>(s: &'a str) -> &'a str {
13-
LL | | s
14-
LL | | }
15-
| |_^
12+
LL | / async fn one_to_one<'a>(s: &'a str) -> &'a str {
13+
LL | | s
14+
LL | | }
15+
| |_____^
1616

1717
error: aborting due to 2 previous errors
1818

0 commit comments

Comments
 (0)