diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-12-02 19:36:57 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-12-02 19:40:40 +0100 |
| commit | 93d7aa146d8a91c281c32cd050fceba8312ed9a6 (patch) | |
| tree | d87be9f35303d2772707ff4346ff264efb847ca0 /src | |
| parent | af45040acd86d8881fd3dfbfdb08525627d63347 (diff) | |
| download | rust-93d7aa146d8a91c281c32cd050fceba8312ed9a6.tar.gz rust-93d7aa146d8a91c281c32cd050fceba8312ed9a6.zip | |
Add rustdoc test for bounds de-duplication and merge
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/rustdoc/bounds-in-multiple-parts.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/rustdoc/bounds-in-multiple-parts.rs b/src/test/rustdoc/bounds-in-multiple-parts.rs new file mode 100644 index 00000000000..279e3c14888 --- /dev/null +++ b/src/test/rustdoc/bounds-in-multiple-parts.rs @@ -0,0 +1,20 @@ +#![crate_name = "foo"] + +pub trait Eq {} +pub trait Eq2 {} + +// Checking that "where predicates" and "generics params" are merged. +// @has 'foo/trait.T.html' +// @has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a," +pub trait T { + fn f<'a, 'b, 'c: 'a, T: Eq + 'a>() + where Self: Eq, Self: Eq, T: Eq, 'c: 'b; +} + +// Checking that a duplicated "where predicate" is removed. +// @has 'foo/trait.T2.html' +// @has - "//*[@id='tymethod.f']/h4" "fn f<T>()where Self: Eq + Eq2, T: Eq2 + Eq," +pub trait T2 { + fn f<T: Eq>() + where Self: Eq, Self: Eq2, T: Eq2; +} |
