]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
Rollup merge of #107389 - zvavybir:master, r=estebank
[rust.git] / tests / rustdoc / inline_cross / assoc_item_trait_bounds.rs
1 // Regression test for issues #77763, #84579 and #102142.
2 #![crate_name = "main"]
3
4 // aux-build:assoc_item_trait_bounds.rs
5 // build-aux-docs
6 // ignore-cross-compile
7 extern crate assoc_item_trait_bounds as aux;
8
9 // @has main/trait.Main.html
10 // @has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support<Item = ()>'
11 // @has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support<Item = Self::Item>'
12 // @has - '//*[@id="associatedtype.Out2"]' 'type Out2<T>: Support<Item = T>'
13 // @has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support<Produce<()> = bool>'
14 // @has - '//*[@id="associatedtype.Out4"]' 'type Out4<T>: Support<Produce<T> = T>'
15 // @has - '//*[@id="associatedtype.Out5"]' "type Out5: Support<Output<'static> = &'static ()>"
16 // @has - '//*[@id="associatedtype.Out6"]' "type Out6: for<'a> Support<Output<'a> = &'a ()>"
17 // @has - '//*[@id="associatedtype.Out7"]' "type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated"
18 // @has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>"
19 // @has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone"
20 // @has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support<Output<'q> = ()>"
21 // @has - '//*[@id="associatedtype.Out11"]' "type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>"
22 // @has - '//*[@id="associatedtype.Out12"]' "type Out12: for<'w> Helper<B<'w> = Cow<'w, str>, A<'w> = bool>"
23 // @has - '//*[@id="associatedtype.Out13"]' "type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>"
24 // @has - '//*[@id="associatedtype.Out14"]' "type Out14<P: Copy + Eq, Q: ?Sized>"
25 //
26 // Snapshots:
27 // Check that we don't render any where-clauses for the following associated types since
28 // all corresponding projection equality predicates should have already been re-sugared
29 // to associated type bindings:
30 //
31 // @snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]'
32 // @snapshot out2 - '//*[@id="associatedtype.Out2"]/*[@class="code-header"]'
33 // @snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]'
34 //
35 // @has - '//*[@id="tymethod.make"]' \
36 // "fn make<F>(_: F, _: impl FnMut(&str) -> bool)\
37 // where \
38 //     F: FnOnce(u32) -> String, \
39 //     Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>"
40 pub use aux::Main;
41
42 // @has main/trait.Aid.html
43 // @has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>"
44 pub use aux::Aid;