diff --git a/src/test/ui/nll/issue-55825-const-fn.rs b/src/test/ui/nll/issue-55825-const-fn.rs
new file mode 100644
index 0000000000000..c9efccd15b7c5
--- /dev/null
+++ b/src/test/ui/nll/issue-55825-const-fn.rs
@@ -0,0 +1,8 @@
+// Regression test for issue #55825
+// Tests that we don't emit a spurious warning in NLL mode
+
+#![feature(nll)]
+
+const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } //~ ERROR const
+
+fn main() { }
diff --git a/src/test/ui/nll/issue-55825-const-fn.stderr b/src/test/ui/nll/issue-55825-const-fn.stderr
new file mode 100644
index 0000000000000..9af5180343bf2
--- /dev/null
+++ b/src/test/ui/nll/issue-55825-const-fn.stderr
@@ -0,0 +1,12 @@
+error[E0658]: trait objects in const fn are unstable
+  --> $DIR/issue-55825-const-fn.rs:6:32
+   |
+LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
+   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.