Open JustusAdam opened 10 months ago
Actually after some experimentation it sems to also happen with immutable references which is strange to me? This is the code I analyzed:
fn main() {
let s = new_s();
// 'a : 'b
let t = deref_t(&s);
read(t);
}
// Type signatures for external functions
fn deref_t(s: &S) -> &String;
fn read<T>(t: &T);
fn new_s() -> S;
The result has an edge from s
to the first argument of read
which I believe it shouldn't. It is not possible for any part of s
to reach that place without passing through/being selected by deref_t
.
I tried code equivalent to this
What I expected is that the vector connects to the first argument of
push
and then to the first argument ofsend
. Instead there is an additional direct connection from the initial vector to the first argument ofsend
.The same actually happens with return values too.
This also has a direct connection between the vector and
send
, despite the code clearly always going throughderef
.