From 7b74d72d9a4414f088d7f638343d5d8a7c67084a Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 8 Jul 2019 01:00:54 +0300 Subject: [PATCH] Fix failing tests --- src/librustc/ty/query/on_disk_cache.rs | 5 +++-- .../feature-gates/feature-gate-custom_test_frameworks.stderr | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index d0be13a711117..a508d9846bce3 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -610,8 +610,9 @@ impl<'a, 'tcx> SpecializedDecoder for CacheDecoder<'a, 'tcx> { } TAG_EXPANSION_INFO_SHORTHAND => { let pos = AbsoluteBytePos::decode(self)?; - if let Some(cached_ctxt) = self.synthetic_expansion_infos.borrow().get(&pos) { - Span::new(lo, hi, *cached_ctxt) + let cached_ctxt = self.synthetic_expansion_infos.borrow().get(&pos).cloned(); + if let Some(ctxt) = cached_ctxt { + Span::new(lo, hi, ctxt) } else { let expn_info = self.with_position(pos.to_usize(), |this| ExpnInfo::decode(this))?; diff --git a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr index 1cc53db2c364c..38304e7f3f934 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr +++ b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr @@ -1,8 +1,8 @@ error[E0658]: use of unstable library feature 'custom_test_frameworks': custom test frameworks are an unstable feature - --> $DIR/feature-gate-custom_test_frameworks.rs:3:1 + --> $DIR/feature-gate-custom_test_frameworks.rs:3:3 | LL | #[test_case] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/50297 = help: add `#![feature(custom_test_frameworks)]` to the crate attributes to enable