summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/issue-72766.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/suggestions/issue-72766.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-72766.rs b/src/test/ui/suggestions/issue-72766.rs
new file mode 100644
index 000000000..c54be7f5d
--- /dev/null
+++ b/src/test/ui/suggestions/issue-72766.rs
@@ -0,0 +1,20 @@
+// edition:2018
+// incremental
+
+pub struct SadGirl;
+
+impl SadGirl {
+ pub async fn call(&self) -> Result<(), ()> {
+ Ok(())
+ }
+}
+
+async fn async_main() -> Result<(), ()> {
+ // should be `.call().await?`
+ SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values
+ Ok(())
+}
+
+fn main() {
+ let _ = async_main();
+}