about summary refs log tree commit diff
path: root/tests/ui/deprecation/try-macro-suggestion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/deprecation/try-macro-suggestion.rs')
-rw-r--r--tests/ui/deprecation/try-macro-suggestion.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/deprecation/try-macro-suggestion.rs b/tests/ui/deprecation/try-macro-suggestion.rs
new file mode 100644
index 00000000000..635ceac0b19
--- /dev/null
+++ b/tests/ui/deprecation/try-macro-suggestion.rs
@@ -0,0 +1,9 @@
+// compile-flags: --edition 2018
+fn foo() -> Result<(), ()> {
+    Ok(try!()); //~ ERROR use of deprecated `try` macro
+    Ok(try!(Ok(()))) //~ ERROR use of deprecated `try` macro
+}
+
+fn main() {
+    let _ = foo();
+}