diff options
| author | bors <bors@rust-lang.org> | 2021-02-20 04:35:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-20 04:35:58 +0000 |
| commit | b75baad5c3fcb85676c4df648962e53c9756e7ba (patch) | |
| tree | 1f5d7c38692a14278e3eaf87de658442870ab999 /src/test | |
| parent | 9b471a3f5fe57e5c6e08acf665f2094422415a3d (diff) | |
| parent | 46f24c912f55c0a31d4708a145e56b5cf0f5c8f0 (diff) | |
Auto merge of #78181 - GuillaumeGomez:sized-trait, r=jyn514
Add Sized trait display when implemented on type Fixes https://github.com/rust-lang/rust/issues/24183. I'm not too happy about the hack I had to add in here, however, it seems like the `Sized` trait is **very** special. cc `@jyn514` r? `@ollie27`
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/sized_trait.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/rustdoc/sized_trait.rs b/src/test/rustdoc/sized_trait.rs new file mode 100644 index 00000000000..26d12817afc --- /dev/null +++ b/src/test/rustdoc/sized_trait.rs @@ -0,0 +1,17 @@ +#![crate_name = "foo"] + +// @has foo/struct.Bar.html +// @!has - '//h3[@id="impl-Sized"]' +pub struct Bar { + a: u16, +} + +// @has foo/struct.Foo.html +// @!has - '//h3[@id="impl-Sized"]' +pub struct Foo<T: ?Sized>(T); + +// @has foo/struct.Unsized.html +// @has - '//h3[@id="impl-Sized"]/code' 'impl !Sized for Unsized' +pub struct Unsized { + data: [u8], +} |
