-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librustc: Remove cross borrowing from mutable Box
es to &mut
.
#15171
Conversation
This will break code like: fn f(x: &mut int) {} let mut a = box 1i; f(a); Change it to: fn f(x: &mut int) {} let mut a = box 1i; f(&mut *a); RFC 33; issue rust-lang#10504. [breaking-change]
ty::ty_box(typ) | ty::ty_uniq(typ) => typ, | ||
ty::ty_box(typ) | ty::ty_uniq(typ) => { | ||
if mt_b.mutbl == ast::MutMutable { | ||
return Err(ty::terr_mutability) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this it? I was expecting some enum variants (from auto-adjustments) and a bunch more related code to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need auto-adjustment for the LHS of .
. I believe this is the only place where the thing we want to remove is checked, though I could be wrong of course…
For the record: I made some measurements about Doing a plain
Additional borrows in all the crate test harnesses:
|
@nick29581, you were a big proponent of |
Reference: rust-lang/rust#15171. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Reference: rust-lang/rust#15171. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This will break code like:
Change it to:
RFC 33; issue #10504.
[breaking-change]
r? @brson