Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 4834d4f

Browse files
committed
Auto merge of #1408 - Xanewok:bump-rustfmt, r=Xanewok
Update Rustfmt to 1.2 In case it's needed by rust-lang/rust#59454.
2 parents 2d18d3d + f4f1444 commit 4834d4f

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ racer = { version = "2.1.21", default-features = false }
4545
rand = "0.6"
4646
rayon = "1"
4747
rustc_tools_util = "0.1.1"
48-
rustfmt-nightly = "1.1"
48+
rustfmt-nightly = "1.2"
4949
rustc-serialize = "0.3"
5050
serde = "1.0"
5151
serde_json = "1.0"

tests/client.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -1788,8 +1788,8 @@ fn client_reformat_with_range() {
17881788
uri: Url::from_file_path(p.root().join("src/main.rs")).unwrap(),
17891789
},
17901790
range: Range {
1791-
start: Position { line: 2, character: 0 },
1792-
end: Position { line: 3, character: 0 },
1791+
start: Position { line: 1, character: 0 },
1792+
end: Position { line: 2, character: 0 },
17931793
},
17941794
options: FormattingOptions {
17951795
tab_size: 4,
@@ -1800,8 +1800,17 @@ fn client_reformat_with_range() {
18001800
);
18011801

18021802
let newline = if cfg!(windows) { "\r\n" } else { "\n" };
1803-
let formatted = "pub fn main() {\n let world1 = \"world\";\n println!(\"Hello, {}!\", world1);\n let world2 = \"world\";\n println!(\"Hello, {}!\", world2);\n let world3 = \"world\";\n println!(\"Hello, {}!\", world3);\n}\n"
1804-
.replace("\n", newline);
1803+
let formatted = r#"pub fn main() {
1804+
let world1 = "world";
1805+
println!("Hello, {}!", world1);
1806+
1807+
// Work around rustfmt#3494
1808+
let world2 = "world"; println!("Hello, {}!", world2);
1809+
let world3 = "world"; println!("Hello, {}!", world3);
1810+
}
1811+
"#
1812+
.replace("\r", "")
1813+
.replace("\n", newline);
18051814

18061815
assert_eq!(result.unwrap()[0].new_text, formatted);
18071816
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pub fn main()
22
{
33
let world1 = "world"; println!("Hello, {}!", world1);
4+
5+
// Work around rustfmt#3494
46
let world2 = "world"; println!("Hello, {}!", world2);
57
let world3 = "world"; println!("Hello, {}!", world3);
68
}

0 commit comments

Comments
 (0)