Skip to content

Commit 41eec90

Browse files
Avi-D-codervarkor
authored andcommitted
Update src/librustc_passes/stability.rs
Co-authored-by: varkor <[email protected]>
1 parent 19e9084 commit 41eec90

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_passes/src/stability.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ enum AnnotationKind {
3737
Container,
3838
}
3939

40-
/// Inheriting deprecations Nested items causes duplicate warnings.
41-
/// Inheriting the deprecation of `Foo<T>` onto the parameter `T`, would cause a duplicate warnings.
40+
/// Whether to inherit deprecation flags for nested items. In most cases, we do want to inherit
41+
/// deprecation, because nested items rarely have individual deprecation attributes, and so
42+
/// should be treated as deprecated if their parent is. However, default generic parameters
43+
/// have separate deprecation attributes from their parents, so we do not wish to inherit
44+
/// deprecation in this case. For example, inheriting deprecation for `T` in `Foo<T>`
45+
/// would cause a duplicate warning arising from both `Foo` and `T` being deprecated.
4246
#[derive(PartialEq, Copy, Clone)]
4347
enum InheritDeprecation {
4448
Yes,

0 commit comments

Comments
 (0)