]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/synthetic_auto/overflow.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / rustdoc / synthetic_auto / overflow.rs
1 // Tests that we don't fail with an overflow error for certain
2 // strange types
3 // See https://github.com/rust-lang/rust/pull/72936#issuecomment-643676915
4
5 pub trait Interner {
6     type InternedType;
7 }
8
9 struct RustInterner<'tcx> {
10     foo: &'tcx ()
11 }
12
13 impl<'tcx> Interner for RustInterner<'tcx> {
14     type InternedType = Box<TyData<Self>>;
15 }
16
17 enum TyData<I: Interner> {
18     FnDef(I::InternedType)
19 }
20
21 struct VariableKind<I: Interner>(I::InternedType);
22
23 // @has overflow/struct.BoundVarsCollector.html
24 // @has - '//h3[@class="code-header"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>"
25 pub struct BoundVarsCollector<'tcx> {
26     val: VariableKind<RustInterner<'tcx>>
27 }
28
29 fn is_send<T: Send>() {}
30
31 struct MyInterner<'tcx> {
32     val: &'tcx ()
33 }
34
35 fn main() {}