Skip to content

Commit 67fe842

Browse files
committed
update comment
1 parent d68cb1f commit 67fe842

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_passes/src/stability.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
820820
);
821821

822822
if item_is_allowed {
823-
// Check parent modules stability as well
823+
// Check parent modules stability as well if the item the path refers to is itself
824+
// stable. We only emit warnings for unstable path segments if the item is stable
825+
// because stability is often inherited, so the most common case is that both the
826+
// segments and the item are unstable behind the same feature flag.
824827
//
825828
// We check here rather than in `visit_path_segment` to prevent visiting the last
826829
// path segment twice

0 commit comments

Comments
 (0)