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.
1 parent 2da9856 commit 9678362Copy full SHA for 9678362
library/std/src/io/error/tests.rs
@@ -57,3 +57,13 @@ fn test_downcasting() {
57
let extracted = err.into_inner().unwrap();
58
extracted.downcast::<TestError>().unwrap();
59
}
60
+
61
+#[test]
62
+fn test_const() {
63
+ const E: Error = Error::new_const(ErrorKind::NotFound, &"hello");
64
65
+ assert_eq!(E.kind(), ErrorKind::NotFound);
66
+ assert_eq!(E.to_string(), "hello");
67
+ assert!(format!("{:?}", E).contains("\"hello\""));
68
+ assert!(format!("{:?}", E).contains("NotFound"));
69
+}
0 commit comments