-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
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
ICE: Clippy panics, during constructing a span in TabsInDocComments::check_attribute
#5835
Comments
Thanks for the report. Is the code you run clippy on available somehow? |
|
@emacsist Can you share the code or a minimal example, that produces this ICE with us? Without example code debugging this is nearly impossible. Another thing that might help is, if you could share the output of
|
Sorry, the code is company project, so it's inconvenient to share. The output is Checking rtb-rust v0.1.0 (/home/hello/rtb-rust)
thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', src/librustc_span/source_map.rs:906:17
stack backtrace:
thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', src/librustc_span/source_map.rs:906:17
stack backtrace:
0: backtrace::backtrace::libunwind::trace
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1076
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1537
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:218
10: clippy_driver::report_clippy_ice
11: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
at /home/hello/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/boxed.rs:1090
12: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}
at /home/hello/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libproc_macro/bridge/client.rs:318
13: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:490
4: core::fmt::write
at src/libcore/fmt/mod.rs:1076
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1537
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:218
10: clippy_driver::report_clippy_ice
11: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
at /home/hello/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/boxed.rs:1090
12: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}
at /home/hello/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libproc_macro/bridge/client.rs:318
13: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:490
14: std::panicking::begin_panic
15: rustc_span::source_map::SourceMap::bytepos_to_file_charpos
16: rustc_span::source_map::SourceMap::lookup_char_pos
17: rustc_errors::emitter::EmitterWriter::get_multispan_max_line_num
18: <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit_diagnostic
19: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
20: rustc_errors::HandlerInner::emit_diagnostic
14: std::panicking::begin_panic
15: rustc_span::source_map::SourceMap::bytepos_to_file_charpos
16: rustc_span::source_map::SourceMap::lookup_char_pos
21: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
17: rustc_errors::emitter::EmitterWriter::get_multispan_max_line_num
18: <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit_diagnostic
22: core::ops::function::FnOnce::call_once{{vtable.shim}}
19: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
20: rustc_errors::HandlerInner::emit_diagnostic
21: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
22: core::ops::function::FnOnce::call_once{{vtable.shim}}
23: rustc_middle::lint::struct_lint_level::struct_lint_level_impl
23: rustc_middle::lint::struct_lint_level::struct_lint_level_impl
24: rustc_lint::levels::LintLevelsBuilder::struct_lint
24: rustc_lint::levels::LintLevelsBuilder::struct_lint
25: <clippy_lints::tabs_in_doc_comments::TabsInDocComments as rustc_lint::passes::EarlyLintPass>::check_attribute
25: <clippy_lints::tabs_in_doc_comments::TabsInDocComments as rustc_lint::passes::EarlyLintPass>::check_attribute
26: <rustc_lint::early::EarlyLintPassObjects as rustc_lint::passes::EarlyLintPass>::check_attribute
26: <rustc_lint::early::EarlyLintPassObjects as rustc_lint::passes::EarlyLintPass>::check_attribute
27: rustc_ast::visit::walk_item
28: rustc_ast::visit::walk_mod
29: rustc_ast::visit::walk_item
30: rustc_ast::visit::walk_mod
31: rustc_ast::visit::walk_item
32: rustc_ast::visit::walk_mod
27: rustc_ast::visit::walk_item
28: rustc_ast::visit::walk_mod
29: rustc_ast::visit::walk_item
30: rustc_ast::visit::walk_mod
31: rustc_ast::visit::walk_item
32: rustc_ast::visit::walk_mod
33: rustc_lint::early::early_lint_crate
33: rustc_lint::early::early_lint_crate
34: rustc_lint::early::check_ast_crate
34: rustc_lint::early::check_ast_crate
35: rustc_session::utils::<impl rustc_session::session::Session>::time
36: rustc_interface::passes::BoxedResolver::access::{{closure}}
37: rustc_interface::passes::configure_and_expand::{{closure}}
38: rustc_interface::queries::Queries::lower_to_hir
35: rustc_session::utils::<impl rustc_session::session::Session>::time
39: rustc_interface::queries::Queries::global_ctxt
40: rustc_interface::interface::run_compiler_in_existing_thread_pool
36: rustc_interface::passes::BoxedResolver::access::{{closure}}
37: rustc_interface::passes::configure_and_expand::{{closure}}
38: rustc_interface::queries::Queries::lower_to_hir
39: rustc_interface::queries::Queries::global_ctxt
40: rustc_interface::interface::run_compiler_in_existing_thread_pool
41: rustc_ast::attr::with_globals
41: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
note: Clippy version: clippy 0.0.212 (5c1f21c 2020-07-13)
query stack during panic:
end of query stack
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
note: Clippy version: clippy 0.0.212 (5c1f21c 2020-07-13)
query stack during panic:
end of query stack
error: could not compile `rtb-rust`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
|
I think this is the code triggering the ICE (aka it produces the faulty span, that triggers the ICE): rust-clippy/clippy_lints/src/tabs_in_doc_comments.rs Lines 67 to 71 in f5d429c
|
It's possible that this was fixed in Rust 1.45.1. It seems to have been a rustc issue? rust-lang/rust#68730 @emacsist Could you upgrade to Rust 1.45.1 and check if the panic still happens? |
I'm going to close this issue as it seems like it has been fixed with rust-lang/rust#68730. Feel free to re-open it, if it still happens. |
This still happens on 1.51.0:
|
@WiSaGaN can you share code, where this happens. We don't have anything to go off of here. |
TabsInDocComments::check_attribute
Ok. I did trim down to this in playground. I think there is a whitespace (tab?) after the non-ascii character in the doc comment that causes this. (Edit: which is mentioned in the issue title now) |
env
clippy 0.0.212 (5c1f21c 2020-07-13)
rustc 1.45.0 (5c1f21c3b 2020-07-13)
Mint 18.3 sylvia
The text was updated successfully, but these errors were encountered: