forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#97835 - Dylan-DPC:rollup-0ae3pwp, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#95948 (Improve the safety docs for `CStr`) - rust-lang#97325 (Fix precise field capture of univariant enums) - rust-lang#97817 (:arrow_up: rust-analyzer) - rust-lang#97821 (Remove confusing sentence from `Mutex` docs) - rust-lang#97826 (Add more information for rustdoc-gui tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
10 changed files
with
133 additions
and
42 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
27 changes: 27 additions & 0 deletions
27
src/test/ui/closures/2229_closure_analysis/capture-enum-field.rs
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,27 @@ | ||
// edition:2021 | ||
// run-pass | ||
|
||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum Color { | ||
RGB(u8, u8, u8), | ||
} | ||
|
||
fn main() { | ||
let mut color = Color::RGB(0, 0, 0); | ||
let mut red = |v| { | ||
let Color::RGB(ref mut r, _, _) = color; | ||
*r = v; | ||
}; | ||
let mut green = |v| { | ||
let Color::RGB(_, ref mut g, _) = color; | ||
*g = v; | ||
}; | ||
let mut blue = |v| { | ||
let Color::RGB(_, _, ref mut b) = color; | ||
*b = v; | ||
}; | ||
red(1); | ||
green(2); | ||
blue(3); | ||
assert_eq!(Color::RGB(1, 2, 3), color); | ||
} |
Submodule rust-analyzer
updated
from f94fa6 to ad6810
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