-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ref
in function parameter patterns
#8860
Comments
Huh. I remember putting in some effort to make sure this kind of test worked. I am not sure why I said |
Yes, there is a test |
Also occurs with a non-unit struct: struct S { i: int }
impl Drop for S {
fn drop(&self) {
println("drop");
}
}
fn f(ref _s: S) {}
fn main() {
let s = S { i: 42 };
f(s);
} (and either version will print "drop" if I remove the I assumed the problem with my code is that |
Presumably that is the problem. |
This is not good. Nominating. |
Accepted for "first major release, P-high" |
Both cases work for me as expected now. $ rustc --version
rustc 0.10-pre
host: x86_64-apple-darwin |
Hurray! flagging as needstest. |
The issue can be closed now. |
FYI if you put "closes #8860" in the commit message, Github will automatically close the issue when the commit merges. |
I did but the PR was integrated as part of a rollup. So it didn't get closed properly. |
We recommend putting the "Closes #XXX" in the commit message rather than just the PR for the reason that it'll still get closed during a rollup. |
Ah, I misunderstood @sfackler's comment. The "Closes #xxxx" in both commit and PR message, now I see. |
The following program doesn't print "drop". Looks unsound to me.
In #5239, @nikomatsakis suggested that
ref
shouldn't be allowed in argument patterns at all, but then that bug got closed because the ICE/llvm asserts over there stopped occuring.The text was updated successfully, but these errors were encountered: