File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ // Regression test for issue #55825
2+ // Tests that we don't emit a spurious warning in NLL mode
3+
4+ #![ feature( nll) ]
5+
6+ const fn no_dyn_trait_ret ( ) -> & ' static dyn std:: fmt:: Debug { & ( ) } //~ ERROR const
7+
8+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0658]: trait objects in const fn are unstable
2+ --> $DIR/issue-55825-const-fn.rs:6:32
3+ |
4+ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8+ = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
9+
10+ error: aborting due to previous error
11+
12+ For more information about this error, try `rustc --explain E0658`.
You can’t perform that action at this time.
0 commit comments