-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Impls should not allow methods not defined in the trait to be implemented #3973
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
Comments
Reproduced as of ae0ca9c |
Repro'd with 373504 -- but not critical for 0.6, de-milestoning |
Appears to be fixed, as per this updated test case: struct Point {
x: float,
y: float,
}
impl ToStr for Point {
fn new(x: float, y: float) -> Point {
Point { x: x, y: y }
}
fn to_str(&self) -> ~str {
fmt!("(%f, %f)", self.x, self.y)
}
}
fn main() {
} ...which fails with |
We've regressed: there's a test case (
|
Aaaand, we've un-regressed! Removing all tags except for neesdtest. |
Whoops, had the wrong code example, regression still here. |
ensure that a macOS os_unfair_lock that is moved while being held is not implicitly unlocked Fixes rust-lang/miri#3859 We mark an os_unfair_lock that is moved while being held as "poisoned", which means it is not considered forever locked. That's not quite what the real implementation does, but allowing arbitrary moves-while-locked would likely expose a ton of implementation details, so hopefully this is good enough.
This code is wrong because ToStr does not define
new
. But what's odd is that the compiler error does not happen in theToStr
block but in themain
:Error message:
The expected error message would point to the
impl
block that needs to be split into two (one with ToStr and one without a trait).The text was updated successfully, but these errors were encountered: