You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-24 09:46:45 +02:00
@ -11,7 +11,7 @@ pub extern "C" fn hello_from_rust() {
|
||||
```
|
||||
|
||||
**Important**: note that `no_mangle` here is considered a type of unsafety by
|
||||
the Rust compiler, so you'll need to to allow unsafe code in your `gn` target.
|
||||
the Rust compiler, so you'll need to allow unsafe code in your `gn` target.
|
||||
|
||||
Add this new Rust target as a dependency of `//ui/base:base`. Declare this
|
||||
function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll see
|
||||
|
@ -44,7 +44,7 @@ fn main() {
|
||||
|
||||
<details>
|
||||
|
||||
In this example, the the compiler does not know what lifetime to infer for `p3`.
|
||||
In this example, the compiler does not know what lifetime to infer for `p3`.
|
||||
Looking inside the function body shows that it can only safely assume that
|
||||
`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust
|
||||
requires explicit annotations of lifetimes on function arguments and return
|
||||
|
Reference in New Issue
Block a user