diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
index 01c347bfae5..d7c6c50d8be 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
@@ -33,5 +33,10 @@ fn change_assoc_1<'a, 'b>(
            //~| error: lifetime may not live long enough
 }
 
+// This tests the default borrow check error, without the special casing for return values.
+fn require_static(_: *const dyn Trait<'static>) {}
+fn extend_to_static<'a>(ptr: *const dyn Trait<'a>) {
+    require_static(ptr as _) //~ error: lifetime may not live long enough
+}
 
 fn main() {}
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
index 7044e4dec1f..4a699780c64 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
@@ -132,5 +132,13 @@ help: `'b` and `'a` must be the same: replace one with the other
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error: aborting due to 8 previous errors
+error: lifetime may not live long enough
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:39:20
+   |
+LL | fn extend_to_static<'a>(ptr: *const dyn Trait<'a>) {
+   |                     -- lifetime `'a` defined here
+LL |     require_static(ptr as _)
+   |                    ^^^ cast requires that `'a` must outlive `'static`
+
+error: aborting due to 9 previous errors