about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorJacob Hughes <j@jacobhughes.me>2020-09-22 22:54:52 -0400
committerJacob Hughes <j@jacobhughes.me>2020-09-22 22:54:52 -0400
commit3f1b4b39e3dbff49d3298af1acaa526310b255a7 (patch)
tree987d271bcec26db1ff27b0ca0c1c2db9821f8ce5 /compiler/rustc_passes/src
parentd281620d8f630346ea96c8c65b9fd7f5b7f1da9e (diff)
downloadrust-3f1b4b39e3dbff49d3298af1acaa526310b255a7.tar.gz
rust-3f1b4b39e3dbff49d3298af1acaa526310b255a7.zip
Fix compilation & test failures
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/stability.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs
index 5b0df9e884f..b807dff5fd2 100644
--- a/compiler/rustc_passes/src/stability.rs
+++ b/compiler/rustc_passes/src/stability.rs
@@ -43,6 +43,7 @@ enum AnnotationKind {
 /// 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(Clone)]
 enum InheritDeprecation {
     Yes,
     No,
@@ -81,7 +82,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
         debug!("annotate(id = {:?}, attrs = {:?})", hir_id, attrs);
         let mut did_error = false;
         if !self.tcx.features().staged_api {
-            did_error = self.forbid_staged_api_attrs(hir_id, attrs, inherit_deprecation);
+            did_error = self.forbid_staged_api_attrs(hir_id, attrs, inherit_deprecation.clone());
         }
 
         let depr =
@@ -257,7 +258,12 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
     }
 
     // returns true if an error occurred, used to suppress some spurious errors
-    fn forbid_staged_api_attrs(&mut self, hir_id: HirId, attrs: &[Attribute], inherit_deprecation: InheritDeprecation) -> bool {
+    fn forbid_staged_api_attrs(
+        &mut self,
+        hir_id: HirId,
+        attrs: &[Attribute],
+        inherit_deprecation: InheritDeprecation,
+    ) -> bool {
         // Emit errors for non-staged-api crates.
         let unstable_attrs = [
             sym::unstable,