Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Implementation details

Maik Klein edited this page Jun 12, 2018 · 5 revisions
  • Structs are not allowed to contain pointers
struct Foo<'a>{
    b: &'a Bar // <- Not allowed
}
  • Functions that return a reference are all inlined and removed from the MIR
fn foo(..) -> &Bar{..} // All uses of `foo` will be inlined
  • All pointers are optimized away
let i = 42;
let i_ref = &i; // i_ref doesn't exist, and it also has no address
Clone this wiki locally