-
Notifications
You must be signed in to change notification settings - Fork 996
Closed
Labels
A-commentsArea: commentsArea: commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce
Description
There is a piece of code in my project like:
fn main() {
if xxx {
let xxx = xxx
.into_iter()
.filter(|(xxx, xxx)| {
if let Some(x) = Some(1) {
// xxxxxxxxxxxxxxxxxx, xxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxx xxx xxxxxxx, xxxxx xxx
// xxxxxxxxxx. xxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxx xxx xxxxxxx
// 是sdfadsdfxxxxxxxxx,sdfaxxxxxx_xxxxx_masdfaonxxx,
if false {
return true;
}
}
false
})
.collect();
}
}When I execute cargo fmt, I got an error:
thread 'main' panicked at 'index out of bounds: the len is 48 but the index is 18446744073709551615', src/tools/rustfmt/src/string.rs:285:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The rustfmt.toml is the following:
wrap_comments = true
I can't understand why a few lines of comments can make fmt crash...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-commentsArea: commentsArea: commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce