You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// baz.rspubstructFoo<T>{t:T,}pubstructBar<'a,T>{other:&'aFoo<T>,}impl<T:Clone>Foo<T>{pubfnget(&self) -> T{self.borrow().clone()// this causes the bug, (*self.borrow()).clone() does not cause the bug}}impl<T>Foo<T>{pubfnborrow<'a>(&'aself) -> Bar<'a,T>{Bar{other:self}}}impl<'a,T>Deref<T>forBar<'a,T>{fnderef<'a>(&'aself) -> &'aT{&self.other.t}}
// bar.rsexterncrate baz;pubfnmain(){let a = baz::Foo{t:3};
a.get();}
This commit removes the `get()` method from `Ref` and `RefMut` in favor of the `*` operator, and removes all usage of the `deref()` function manually from rustc, favoring using `*` instead.
Some of the code is a little wacky, but that's due to either #13044 or #13042
fix: a bunch of typos
This PR will fix some typos detected by [typos].
There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.
[typos]: https://github.com/crate-ci/typos
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jul 11, 2024
The text was updated successfully, but these errors were encountered: