File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/rustc_passes/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,12 @@ enum AnnotationKind {
37
37
Container ,
38
38
}
39
39
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.
42
46
#[ derive( PartialEq , Copy , Clone ) ]
43
47
enum InheritDeprecation {
44
48
Yes ,
You can’t perform that action at this time.
0 commit comments