We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Debug
1 parent 0493557 commit e8f0c68Copy full SHA for e8f0c68
library/core/src/fmt/mod.rs
@@ -845,6 +845,8 @@ impl Display for Arguments<'_> {
845
/// assert_eq!(format!("The origin is: {origin:#?}"), expected);
846
/// ```
847
848
+#[const_trait]
849
+#[rustc_const_unstable(feature = "const_debug", issue = "none")]
850
#[stable(feature = "rust1", since = "1.0.0")]
851
#[rustc_on_unimplemented(
852
on(
tests/ui/traits/const-traits/debug.rs
@@ -0,0 +1,16 @@
1
+//@ check-pass
2
+
3
+#![feature(const_debug, const_trait_impl)]
4
5
+use std::fmt::Debug;
6
+use std::fmt::Formatter;
7
8
+pub struct Foo;
9
10
+impl const Debug for Foo {
11
+ fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
12
+ Ok(())
13
+ }
14
+}
15
16
+fn main() {}
0 commit comments