From 70553711ae3cc3670d3921140b296a007493f8f0 Mon Sep 17 00:00:00 2001 From: Centri3 <114838443+Centri3@users.noreply.github.com> Date: Sat, 3 Jun 2023 18:34:12 -0500 Subject: [PATCH] add test for `?` desugaring --- tests/ui/allow_attributes_without_reason.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/ui/allow_attributes_without_reason.rs b/tests/ui/allow_attributes_without_reason.rs index 95a9fa2aa47..2b26624b424 100644 --- a/tests/ui/allow_attributes_without_reason.rs +++ b/tests/ui/allow_attributes_without_reason.rs @@ -28,3 +28,17 @@ fn main() { fn b() {} } } + +// Make sure this is not triggered on `?` desugaring + +pub fn trigger_fp_option() -> Option<()>{ + Some(())?; + None?; + Some(()) +} + +pub fn trigger_fp_result() -> Result<(), &'static str> { + Ok(())?; + Err("asdf")?; + Ok(()) +}