1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Ext 2 (0.8.0) conflict/overlap `impl{...}` tests: "looks like a conflict
//! but is legal" cases — slots bound to composite subtrees and reused in
//! bodies, and equal-base templates with different args.
//! Compile-failing conflicts (InconsistentBinding / shape mismatches) live
//! in `tests/ui/impl_*`.
use batch_impl;
// ------------------------------------------------------------
// 1. Slot bound to a composite subtree: `impl{X<Y>}` matches
// `Vec<Vec<u8>>` — X := Vec (base), Y := Vec<u8> (the whole arg subtree);
// the body returns `X<Y>` (rewritten to the full target type)
// ------------------------------------------------------------
// ------------------------------------------------------------
// 2. Same base, different args across merged templates: `impl{Base<A>}`
// and `impl{Base<B>}` both bind Base to Box (identical) — legal merge;
// A and B bind the same u8 arg
// ------------------------------------------------------------
// ------------------------------------------------------------
// 3. Slot reuse across a method call and a type position in the same body:
// `impl{W<T>}` with `W<T>` in the return type and `W::new` in the body
// ------------------------------------------------------------