Skip to content

Commit 0cfb22f

Browse files
paldepindhvitved
authored andcommitted
Rust: Add example with multiple where clause items for the same type parameter
1 parent b302f3f commit 0cfb22f

File tree

3 files changed

+3493
-3476
lines changed

3 files changed

+3493
-3476
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
multipleCallTargets
22
| dereference.rs:61:15:61:24 | e1.deref() |
3-
| main.rs:2305:13:2305:31 | ...::from(...) |
4-
| main.rs:2306:13:2306:31 | ...::from(...) |
5-
| main.rs:2307:13:2307:31 | ...::from(...) |
6-
| main.rs:2313:13:2313:31 | ...::from(...) |
73
| main.rs:2314:13:2314:31 | ...::from(...) |
84
| main.rs:2315:13:2315:31 | ...::from(...) |
5+
| main.rs:2316:13:2316:31 | ...::from(...) |
6+
| main.rs:2322:13:2322:31 | ...::from(...) |
7+
| main.rs:2323:13:2323:31 | ...::from(...) |
8+
| main.rs:2324:13:2324:31 | ...::from(...) |

rust/ql/test/library-tests/type-inference/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,15 @@ mod type_parameter_bounds {
559559
fn snd(self) -> P2;
560560
}
561561

562+
fn trait_per_multiple_where_bounds_with_type<T>(x: T, y: T)
563+
where
564+
T: FirstTrait<S1>,
565+
T: Pair<S1, bool>,
566+
{
567+
let _ = x.fst(); // $ target=fst type=_:S1
568+
let _ = y.method(); // $ target=FirstTrait::method _:S1
569+
}
570+
562571
fn call_trait_per_bound_with_type_1<T: Pair<S1, S2>>(x: T, y: T) {
563572
// The type in the type parameter bound determines the return type.
564573
let s1 = x.fst(); // $ target=fst type=s1:S1

0 commit comments

Comments
 (0)