We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I may have found a bug in rustfmt, resulting in the following error
bad span: `.`: ``', src/tools/rustfmt/src/source_map.rs:52:13
The problem can be reproduced in rustfmt 1.4.21-nightly using the following program:
rustfmt 1.4.21-nightly
fn main() { let t1 = (1u8, 2u8); let mut t2 = (t1, 3u8); t2.1 = t2.0.1; }
Compiling works fine. Changing the code to t2.1 = (t2.0).1; fixes the problem, so it appears like it's parsing the double indexing as a float.
t2.1 = (t2.0).1;
Backtrace:
0: rust_begin_unwind at /rustc/73dc675b9437c2a51a975a9f58cc66f05463c351/library/std/src/panicking.rs:483 1: std::panicking::begin_panic_fmt at /rustc/73dc675b9437c2a51a975a9f58cc66f05463c351/library/std/src/panicking.rs:437 2: <rustfmt_nightly::visitor::SnippetProvider as rustfmt_nightly::source_map::SpanUtils>::span_before::{{closure}} 3: <rustfmt_nightly::visitor::SnippetProvider as rustfmt_nightly::source_map::SpanUtils>::span_before 4: rustfmt_nightly::chains::rewrite_chain 5: rustfmt_nightly::expr::format_expr 6: rustfmt_nightly::expr::rewrite_assign_rhs_with 7: rustfmt_nightly::expr::rewrite_assignment 8: rustfmt_nightly::expr::format_expr 9: rustfmt_nightly::stmt::format_stmt 10: rustfmt_nightly::visitor::FmtVisitor::walk_stmts 11: rustfmt_nightly::visitor::FmtVisitor::walk_stmts 12: rustfmt_nightly::visitor::FmtVisitor::walk_stmts 13: rustfmt_nightly::visitor::FmtVisitor::visit_block 14: rustfmt_nightly::visitor::FmtVisitor::visit_fn 15: rustfmt_nightly::visitor::FmtVisitor::visit_item 16: rustfmt_nightly::reorder::<impl rustfmt_nightly::visitor::FmtVisitor>::visit_items_with_reordering 17: rustfmt_nightly::visitor::FmtVisitor::walk_mod_items 18: rustfmt_nightly::visitor::FmtVisitor::format_separate_mod 19: rustfmt_nightly::formatting::format_project 20: scoped_tls::ScopedKey<T>::set 21: rustfmt_nightly::Session<T>::format 22: rustfmt::format_and_emit_report 23: rustfmt_nightly::Session<T>::override_config 24: rustfmt::execute 25: rustfmt::main
The text was updated successfully, but these errors were encountered:
Duplicate of rust-lang/rustfmt#4355
Sorry, something went wrong.
No branches or pull requests
I may have found a bug in rustfmt, resulting in the following error
The problem can be reproduced in
rustfmt 1.4.21-nightly
using the following program:Compiling works fine. Changing the code to
t2.1 = (t2.0).1;
fixes the problem, so it appears like it's parsing the double indexing as a float.Backtrace:
The text was updated successfully, but these errors were encountered: