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:
commit
08c78e0095
1 changed files with 3 additions and 1 deletions
|
|
@ -382,7 +382,9 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
|
|||
// 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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue