*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 360dd6b8 authored by Rebola Pardo, Adrian's avatar Rebola Pardo, Adrian
Browse files

added notes in unsafe-rust-is-cpp

parent c55c148f
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@ pub fn rust_like_its_2025() {
// So far this is the same. Let's move the rest to a function.
println!("OUTPUT: {}", foo(n_mut1, n_mut2));
// This works if you compile on debug.
// It also works if `foo` is hinted as never inlined.
// But it won't work anymore if non-inlined and compiled in release!
// You can't code in unsafe Rust like it's C++.
// Unsafe Rust does not allow you to jump over the borrow rules.
// It merely stops preventing you from trying.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment