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 be985b7 commit f125094Copy full SHA for f125094
src/traits.rs
@@ -34,3 +34,23 @@ impl TextSized for char {
34
(self.len_utf8() as u32).into()
35
}
36
37
+
38
+// assertion shape from static_assertions::assert_impl_all!
39
+const _: fn() = || {
40
+ use std::borrow::Cow;
41
42
+ fn assert_impl<T: TextSized>() {}
43
44
+ assert_impl::<&String>();
45
+ assert_impl::<&Cow<str>>();
46
47
+ struct StringLike {}
48
+ impl Deref for StringLike {
49
+ type Target = str;
50
+ fn deref(&self) -> &str {
51
+ unreachable!()
52
+ }
53
54
55
+ assert_impl::<&StringLike>();
56
+};
0 commit comments