about summary refs log tree commit diff
path: root/src/test/ui/derived-errors
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2019-07-14 08:16:46 +0000
committerLzu Tao <taolzu@gmail.com>2019-08-09 02:29:44 +0000
commit6842316f6ff4586465e6412edce5e6808cfcd396 (patch)
tree2267ddcef44206bba43910b25ba3d3841e99bb4d /src/test/ui/derived-errors
parent90fa7901b98367d04857cb96366b2eedf70693e2 (diff)
downloadrust-6842316f6ff4586465e6412edce5e6808cfcd396.tar.gz
rust-6842316f6ff4586465e6412edce5e6808cfcd396.zip
Allow deprecated try macro in test crates
Diffstat (limited to 'src/test/ui/derived-errors')
-rw-r--r--src/test/ui/derived-errors/issue-31997.rs3
-rw-r--r--src/test/ui/derived-errors/issue-31997.stderr6
2 files changed, 5 insertions, 4 deletions
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<F, T>(x: F) -> Result<T, ()>
 }
 
 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