Add warn(unreachable_pub)
to rustc_mir_build
.
This commit is contained in:
parent
938daf6033
commit
c16e2899dc
2 changed files with 2 additions and 1 deletions
|
@ -1027,7 +1027,7 @@ impl UnsafeOpKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
|
pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
|
||||||
// Closures and inline consts are handled by their owner, if it has a body
|
// Closures and inline consts are handled by their owner, if it has a body
|
||||||
// Also, don't safety check custom MIR
|
// Also, don't safety check custom MIR
|
||||||
if tcx.is_typeck_child(def.to_def_id()) || tcx.has_attr(def, sym::custom_mir) {
|
if tcx.is_typeck_child(def.to_def_id()) || tcx.has_attr(def, sym::custom_mir) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#![feature(if_let_guard)]
|
#![feature(if_let_guard)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(try_blocks)]
|
#![feature(try_blocks)]
|
||||||
|
#![warn(unreachable_pub)]
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
|
|
||||||
mod build;
|
mod build;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue