Skip to content

Commit e9b0ce8

Browse files
Aaron1011matthewjasper
authored andcommitted
Add test for overflow when finding auto-trait impls in Rustdoc
1 parent ba2ef58 commit e9b0ce8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 - '//code' "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() {}

0 commit comments

Comments
 (0)