about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAvi Dessauer <avi.the.coder@gmail.com>2020-07-08 15:31:48 -0400
committerJacob Hughes <j@jacobhughes.me>2020-09-22 21:55:29 -0400
commit41eec9065aef513cc41d8e2297c4f469fd7029b7 (patch)
tree1f0aab149d5bad1878be6a3cfb98d11aa365a11e
parent19e90843a4eb99d528dea62f793ad6d523c4af6c (diff)
downloadrust-41eec9065aef513cc41d8e2297c4f469fd7029b7.tar.gz
rust-41eec9065aef513cc41d8e2297c4f469fd7029b7.zip
Update src/librustc_passes/stability.rs
Co-authored-by: varkor <github@varkor.com>
-rw-r--r--compiler/rustc_passes/src/stability.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs
index d34363e0577..dd453f28554 100644
--- a/compiler/rustc_passes/src/stability.rs
+++ b/compiler/rustc_passes/src/stability.rs
@@ -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,