-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Some Promotion Refactoring #80458
Some Promotion Refactoring #80458
Conversation
} | ||
|
||
Rvalue::Ref(_, kind, place) => { | ||
// Special-case reborrows to be more like a copy of the reference. | ||
let mut place_simplified = place.as_ref(); | ||
if let [proj_base @ .., ProjectionElem::Deref] = &place_simplified.projection { | ||
let base_ty = Place::ty_from(place_simplified.local, proj_base, self.body, self.tcx).ty; | ||
let base_ty = | ||
Place::ty_from(place_simplified.local, proj_base, self.body, self.tcx).ty; |
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.
huh what happened here?
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.
Just rustfmt
, or is there any other difference that I am missing?
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.
yea, but I was confused why rustfmt would do this.
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.
Because it is being rustfmt
? ;)
The variable name got longer, since I need to keep the original place
around. As a result this line crossed the threshold.
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.
oh... this is due to an intermediate state that was reverted later? Because this specific line is exactly the same (modulo whitespace) as the line that was there before.
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.
Maybe I didn't fmt between all commits.
@bors r+ |
📌 Commit 51cec58 has been approved by |
Some Promotion Refactoring Clean up promotion a bit: * factor out some common code * more exhaustive matches This *should* not break anything... the only potentially-breaking change is that `BorrowKind::Shallow | BorrowKind::Unique` are now rejected for internal references. r? `@oli-obk`
Rollup of 9 pull requests Successful merges: - rust-lang#78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength) - rust-lang#79479 (Add `Iterator::intersperse`) - rust-lang#80128 (Edit rustc_ast::ast::FieldPat docs) - rust-lang#80424 (Don't give an error when creating a file for the first time) - rust-lang#80458 (Some Promotion Refactoring) - rust-lang#80488 (Do not create dangling &T in Weak<T>::drop) - rust-lang#80491 (Miri: make size/align_of_val work for dangling raw ptrs) - rust-lang#80495 (Rename kw::Invalid -> kw::Empty) - rust-lang#80513 (Add regression test for rust-lang#80062) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Clean up promotion a bit:
This should not break anything... the only potentially-breaking change is that
BorrowKind::Shallow | BorrowKind::Unique
are now rejected for internal references.r? @oli-obk