Originally posted by IndioNuvemChuva
View Post
So you have static borrow checker and functions to have runtime borrow checker where that cannot work.
Originally posted by oleid
View Post
Not being used in the compiler does not mean its not part of the borrow checker design of rust.
The reality here is some oxide design with runtime borrow checking is to deal with the cases of borrow checking that the static borrow checking cannot do. This includes across dynamically loaded libraries.
The Oxide design included the option that long term that the compiler could dynamically change cell for refcell and other functions like this cases where the borrow checker could not solve safely any more. Like building what would be a static library normally as a dynamic library.
Interesting enough it appears rust compiler developers have stalled on implementing oxide completely so that people can keep on claiming that rust does not have a dynamic borrow checker or if people use the dynamic borrow checker parts they had to opt in. Not that they were force by their use case to use the dynamic borrow checker because if they don't the static borrow checker will not let their code build. This happens where developers is force with some cases of multi threaded with rust when if you attempt to use Cell the code will refuse build but Refcell will build due to the fact the static borrow checker cannot solve.
The truth of the matter rust design has opt in runtime borrow checking. Sometimes it not that opt in as it you use the opt in runtime borrow checking or your code will not build because the static borrow solver cannot see there will never be a problem. Yes this forced hand can happen when nothing is technically wrong in the code. Fun of rust compiler bugs/limitations for you.
Comment