-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #91253 - matthiaskrgr:rollup-dnlcjmr, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #91169 (Change cg_ssa's get_param to borrow the builder mutably) - #91176 (If the thread does not get the lock in the short term, yield the CPU) - #91212 (Fix ICE due to out-of-bounds statement index when reporting borrowck error) - #91225 (Fix invalid scrollbar display on source code page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
8 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
struct TestClient; | ||
|
||
impl TestClient { | ||
fn get_inner_ref(&self) -> &Vec<usize> { | ||
todo!() | ||
} | ||
} | ||
|
||
fn main() { | ||
let client = TestClient; | ||
let inner = client.get_inner_ref(); | ||
//~^ HELP consider changing this to be a mutable reference | ||
inner.clear(); | ||
//~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0596]: cannot borrow `*inner` as mutable, as it is behind a `&` reference | ||
--> $DIR/issue-91206.rs:13:5 | ||
| | ||
LL | let inner = client.get_inner_ref(); | ||
| ----- help: consider changing this to be a mutable reference: `&mut Vec<usize>` | ||
LL | | ||
LL | inner.clear(); | ||
| ^^^^^^^^^^^^^ `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0596`. |