diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-06-13 15:05:21 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-06-13 15:29:29 +0200 |
| commit | 99cd9cae10fd7c9db35f3047a7f376bdb2d13f66 (patch) | |
| tree | fef2f4156d5bbff624f31fb0d57c359f2df1d4b9 | |
| parent | a752f82f19c167e86708157704342bf94a47a6ec (diff) | |
| download | rust-99cd9cae10fd7c9db35f3047a7f376bdb2d13f66.tar.gz rust-99cd9cae10fd7c9db35f3047a7f376bdb2d13f66.zip | |
Add regression test for #97986
| -rw-r--r-- | src/test/rustdoc-json/generic_impl.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/rustdoc-json/generic_impl.rs b/src/test/rustdoc-json/generic_impl.rs new file mode 100644 index 00000000000..ac68ba578b6 --- /dev/null +++ b/src/test/rustdoc-json/generic_impl.rs @@ -0,0 +1,24 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/97986>. + +// @has generic_impl.json +// @has - "$.index[*][?(@.name=='f')]" +// @has - "$.index[*][?(@.name=='AssocTy')]" +// @has - "$.index[*][?(@.name=='AssocConst')]" + +pub mod m { + pub struct S; +} + +pub trait F { + type AssocTy; + const AssocConst: usize; + fn f() -> m::S; +} + +impl<T> F for T { + type AssocTy = u32; + const AssocConst: usize = 0; + fn f() -> m::S { + m::S + } +} |
