Describe the bug
The current method of determining return lifetimes allows you to reset the lifetimes of a pointer. This causes lots of bugs, like being able to store short lived data in them.
To Reproduce
struct Container {
x: &i32;
}
define reset_lifetime(x: &Container) -> &Container {
return x;
}
define gets_lifetime(x: &Container) {
reset_lifetime(x).x = &12; // not possible via `x.x = &12;`
}
Expected behavior
The return lifetime should be coupled to the lifetime of it's returned arguments.
Describe the bug The current method of determining return lifetimes allows you to reset the lifetimes of a pointer. This causes lots of bugs, like being able to store short lived data in them.
To Reproduce
Expected behavior The return lifetime should be coupled to the lifetime of it's returned arguments.
Error given, or a screenshot of the bug
platform information
Additional context You goofy bastard, fix this.