Closed
Description
Example
type T = u32;
pub fn main() {
let boxed : Option<Box<T>> = Some(Box::new(5));
let reference : Option<&T> = match boxed {
Some(ref x) => Some(x.borrow()),
None => None
};
}
<anon>:7:31: 7:39 error: no method named `borrow` found for type `&Box<u32>` in the current scope
<anon>:7 Some(ref x) => Some(x.borrow()),
^~~~~~~~
<anon>:7:31: 7:39 help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
<anon>:7:31: 7:39 help: candidate #1: use `collections::borrow::Borrow`
error: aborting due to previous error
playpen: application terminated with error code 101
Compilation failed.
it would be correct if it suggested to use std::borrow::Borrow