Remix.run Logo
▲ fg137 3 hours ago

> is definitely something you'd easily come across in normal code.

The fact that nobody reported this before means it's not, by definition.

▲vincent-uden 2 hours ago | parent [-]

Not at all. There are way more valid lifetimes than the lifetime system of Rust can express. There are countless scenarios where you could accidentally use the unsound behaviour while not producing a segmentation fault because the lifetimes happens to be arranged such that no invalid memory access actually happened.

A program isn't invalid just because it violates the ownership and borrowing rules of Rust. There are tons of programs in the world with shared, mutable access, devoid of Mutexes, Arcs and Locks that nonetheless are completely valid.

▲fg137 an hour ago | parent [-]

I think you are talking about a different problem and that has nothing to do with my comment.

▲foldr 33 minutes ago | parent [-]

Simplified, the point is that a lot of badly typed code that this bug lets through might be mostly harmless (or even fully semantically correct, in some instances). So you can't conclude that 'normal' code wouldn't trigger this bug just because no-one's noticed it until now. The bad code could could be happily executing and performing as expected.