mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
Replace stray println!() in lint code by bug!() (#14618)
To avoid crashing Clippy, the `bug!()` is used only when debug assertions are enabled. In regular usage, the result will be the same as before, but without the extra line printed on the standard output which has the potential for disrupting shell scripts. changelog: none
This commit is contained in:
@@ -382,7 +382,9 @@ struct CurItem<'a> {
|
||||
// Filters the auto-included Rust standard library.
|
||||
continue;
|
||||
}
|
||||
println!("Unknown item: {item:?}");
|
||||
if cfg!(debug_assertions) {
|
||||
rustc_middle::bug!("unknown item: {item:?}");
|
||||
}
|
||||
}
|
||||
} else if let ItemKind::Impl(_) = item.kind
|
||||
&& get_item_name(item).is_some()
|
||||
|
||||
Reference in New Issue
Block a user