You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.A-pluginArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
$ rustc crate_lint.rs
$ rustc -L . test_crate_lint.rs
test_crate_lint.rs:1:1: 4:12 error: internal compiler error: unprocessed lint crate_test at unknown node (id=0): test
test_crate_lint.rs:1 #![feature(phase)]
test_crate_lint.rs:2 #[phase(plugin)] extern crate crate_lint;
test_crate_lint.rs:3
test_crate_lint.rs:4 fn main() {}
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ast_util.rs:776
The commented out .lint(...) call works fine:
test_crate_lint.rs:1:1: 4:12 warning: test, #[warn(crate_test)] on by default
test_crate_lint.rs:1 #![feature(phase)]
test_crate_lint.rs:2 #[phase(plugin)] extern crate crate_lint;
test_crate_lint.rs:3
test_crate_lint.rs:4 fn main() {}
The text was updated successfully, but these errors were encountered:
cx.visit_id(ast::CRATE_NODE_ID);
cx.visit_ids(|v| {
v.visited_outermost = true;
visit::walk_crate(v, krate,());});// since the root module isn't visited as an item (because it isn't an// item), warn for it here.run_lints!(cx,check_crate, krate);
visit::walk_crate(cx, krate,());
First the visit_id steps print the lints previously stored with add_lint, then we invoke the dedicated lint passes. Do you still get the ICE if you add_lint before the phase when lint plugins run?
add_lint is only for earlier stages in the compiler; lint plugins aren't meant to use it. On the other hand, I don't think there's any harm in switching the order of these two steps.
Triage: it's been over a year, no minimal updated test case yet. I'm going to give this one a close as stale; let me know if you have some sort of update I'm missing!
A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.A-pluginArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
The commented out
.lint(...)
call works fine:The text was updated successfully, but these errors were encountered: