]> git.lizzy.rs Git - rust.git/commitdiff
Update src/librustc_passes/stability.rs
authorAvi Dessauer <avi.the.coder@gmail.com>
Wed, 8 Jul 2020 19:31:48 +0000 (15:31 -0400)
committerJacob Hughes <j@jacobhughes.me>
Wed, 23 Sep 2020 01:55:29 +0000 (21:55 -0400)
Co-authored-by: varkor <github@varkor.com>
compiler/rustc_passes/src/stability.rs

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