Merge #701
701: Minor type inference tweaks r=flodiebold a=marcusklaas Pass down expectation for reference expressions and type the guard in match expressions. I wasn't able to add a test for the former addition because the type variable previously introduced would always resolve to the right type in the things I tried! Co-authored-by: Marcus Klaas de Vries <mail@marcusklaas.nl>
This commit is contained in:
@@ -371,6 +371,7 @@ fn test(x: &str, y: isize) {
|
||||
|
||||
let b = [a, ["b"]];
|
||||
let x: [u8; 0] = [];
|
||||
let z: &[u8] = &[1, 2, 3];
|
||||
}
|
||||
"#,
|
||||
);
|
||||
@@ -426,7 +427,8 @@ fn test() {
|
||||
|
||||
match e {
|
||||
E::A { x } => x,
|
||||
E::B => 1,
|
||||
E::B if foo => 1,
|
||||
E::B => 10,
|
||||
};
|
||||
|
||||
let ref d @ E::A { .. } = e;
|
||||
|
||||
Reference in New Issue
Block a user