Обложка канала

oleg_log

4503 @oleg_log

Приют для асоциальных программистов "Олег"

oleg_log

5 лет назад
Открыть в
Attribute Macro you_can::turn_off_the_borrow_checker The macro looks for references created in the code by use of the & or &mut operators or the ref and ref mut bindings, and wraps them with ::unbounded::reference() to unbind their lifetimes, causing the borrow checker to effectively ignore them. docs.rs/you-can…ker.html А ведь прикольно.
turn_off_the_borrow_checker in you_can - Rust

You can’t “turn off the borrow checker” in Rust, and you shouldn’t want to. Rust’s references aren’t pointers, and the compiler is free to decimate code that tries to use references as though they are. However, if you would like to pretend the borrow checker doesn’t exist for educational purposes and never in production code, this macro that will suppress many (though not all) borrow checker errors in the code it’s applied to.

docs.rs