Skip to content

Commit fb41b93

Browse files
committed
Explain that FileLines cannot be given in rustfmt.toml
This adds a note to both the `--config-help` output for `file_lines`, and to the panic message on attempting to deserialize a `FileLines` struct.
1 parent 3af9cc5 commit fb41b93

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ create_config! {
335335
verbose: bool, false, "Use verbose output";
336336
skip_children: bool, false, "Don't reformat out of line modules";
337337
file_lines: FileLines, FileLines::all(),
338-
"Lines to format";
338+
"Lines to format; this is not supported in rustfmt.toml, and can only be specified \
339+
via the --file-lines option";
339340
max_width: usize, 100, "Maximum width of each line";
340341
ideal_width: usize, 80, "Ideal width of each line";
341342
tab_spaces: usize, 4, "Number of spaces per tab";

src/file_lines.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ impl JsonSpan {
181181
// for `FileLines`, so it will just panic instead.
182182
impl rustc_serialize::Decodable for FileLines {
183183
fn decode<D: rustc_serialize::Decoder>(_: &mut D) -> Result<Self, D::Error> {
184-
unimplemented!();
184+
panic!("FileLines cannot be deserialized from a project rustfmt.toml file: please \
185+
specify it via the `--file-lines` option instead");
185186
}
186187
}
187188

0 commit comments

Comments
 (0)