|
|
|
|
|
by Xirdus
7 days ago
|
|
Define "would work". As far as I know, this already existed in pre-1.0 Rust, it compiled, it worked, it prevented borrowing variables with shorter lifetime than the thread, and it only fell apart if you did something very questionable with cyclical Rc's. Would upper bounds prevent falling apart if you did something very questionable with cyclical Rc's? If so, how so? What kind of code would compiler REJECT that it wouldn't today? |
|
I don’t understand the second paragraph. “Questionable” is vague, lots of things are questionable. The last sentence I don’t understand.
I’m illustrating a limitation of the compiler and of Rust as it exists today, not some pre-1.0 version, and I’m not comparing it to some complete alternative compiler without that limitation. The sample code above is an illustration of the limitation only.