-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Incorrect "non-exhaustive patterns" using @-binding in match #8391
Comments
Reproduced with 16b8a41 . Unfortunate, but not a milestone blocker IMO. |
Not an issue any more. The following compiles happily: pub fn main() {
let _x = match Some(1) {
_y @ Some(_) => 1,
None => 2,
};
} |
Flagging as needstest |
I just hit this, and it is an issue which still fails. @edwardw, you missed the key fact in the initial report: the usage of Can we please reopen this issue? |
Test case: pub fn main() {
let _x = match Some(1) {
ref _y @ Some(_) => 1,
None => 2,
};
} |
Ah, my bad to misread the original ticket. Obliged to fix it then :) |
Closes rust-lang#8391
Closes rust-lang#8391
Closes #14184 (std: Move the owned module from core to std) Closes #14183 (Allow blocks in const expressions) Closes #14176 (Add tests for from_bits.) Closes #14175 (Replaced ~T by Box<T> in manual) Closes #14173 (Implements Default trait for BigInt and BigUint) Closes #14171 (Fix #8391) Closes #14159 (Clean up unicode code in libstd) Closes #14126 (docs: Add a not found page) Closes #14123 (add a line to the example to clarify semantics) Closes #14106 (Pretty printer improvements) Closes #14083 (rustllvm: Add LLVMRustArrayType) Closes #13957 (io: Implement process wait timeouts)
Don't lint `needless_borrow` in method receiver positions fixes rust-lang#8408 fixes rust-lang#8407 fixes rust-lang#8391 fixes rust-lang#8367 fixes rust-lang#8380 This is a temporary fix for `needless_borrow`. The proper fix is included in rust-lang#8355. This should probably be merged into rustc before beta branches on Friday. This issue has been reported six or seven times in the past couple of weeks. changelog: Fix various issues with `needless_borrow` n´. Note to changelog writer: those issues might have been introduced in this release cycle, so this might not matter in the changelog.
Binding a match arm using "as-patterns"
ref x @
orref mut x @
will emit an incorrect error message.rustc will be silent and happy if a third case
_ => fail!()
is provided.The text was updated successfully, but these errors were encountered: