From 6842316f6ff4586465e6412edce5e6808cfcd396 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 14 Jul 2019 08:16:46 +0000 Subject: Allow deprecated try macro in test crates --- src/test/ui/derived-errors/issue-31997.rs | 3 ++- src/test/ui/derived-errors/issue-31997.stderr | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/test/ui/derived-errors') diff --git a/src/test/ui/derived-errors/issue-31997.rs b/src/test/ui/derived-errors/issue-31997.rs index 6d7d21e3673..ff619313afb 100644 --- a/src/test/ui/derived-errors/issue-31997.rs +++ b/src/test/ui/derived-errors/issue-31997.rs @@ -1,5 +1,6 @@ // Test that the resolve failure does not lead to downstream type errors. // See issue #31997. +#![allow(deprecated)] trait TheTrait { } @@ -10,7 +11,7 @@ fn closure(x: F) -> Result } fn foo() -> Result<(), ()> { - closure(|| bar(core::ptr::null_mut()))?; //~ ERROR cannot find function `bar` in this scope + try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope Ok(()) } diff --git a/src/test/ui/derived-errors/issue-31997.stderr b/src/test/ui/derived-errors/issue-31997.stderr index d9260f79f27..b53c0cda8de 100644 --- a/src/test/ui/derived-errors/issue-31997.stderr +++ b/src/test/ui/derived-errors/issue-31997.stderr @@ -1,8 +1,8 @@ error[E0425]: cannot find function `bar` in this scope - --> $DIR/issue-31997.rs:13:16 + --> $DIR/issue-31997.rs:14:21 | -LL | closure(|| bar(core::ptr::null_mut()))?; - | ^^^ not found in this scope +LL | try!(closure(|| bar(core::ptr::null_mut()))); + | ^^^ not found in this scope error: aborting due to previous error -- cgit 1.4.1-3-g733a5