Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Rust
/
Smart pointers
A function accepts &str and receives &Box<String> through deref coercion. What happens to…
from Smart pointers
Rust 1.98
intermediate
1 min
A function accepts &str and receives &Box<String> through deref coercion. What happens to ownership?
The function borrows the string; the caller keeps ownership of the Box.
The String moves out of the Box and into the function.
The Box is cloned and a reference count is incremented.
The heap allocation is converted into static storage.
Check
Ask AI about this kata
Report an error
next kata
What does this program print?
Predict the output
A new version is available
Reload