You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test case for issue #3979 was xfailed (and didn't parse), but that issue is closed, so I fixed up the syntax and ran it... and now it causes an ICE. I've committed the updated test, but it may be a while before that winds up in incoming, so I'll paste the text of the test here too:
Oog... I should have recorded the ICE. Now I get this compilation error:
Running /usr/local/bin/rustc:
/tmp/ggg.rs:9:14: 9:27 error: binary operation + cannot be applied to type `U`
/tmp/ggg.rs:9 self.SetX(self.X() + dx);
^~~~~~~~~~~~~
error: aborting due to previous error
... which might be because the ICE was fixed, or might be because something about the language changed to cause an earlier breakage. Sigh.
OK, I think your latest failure is due to language changes, and the test can be updated. I think that the test case was xfailed because it was broken, due to #4396. I think that I fixed the reason that it was originally xfailed with previous default method work (although there still generics problems with supertraits that I am working on at the moment).
Dropping the &muts and getting rid of the assignment in SetX makes the test pass. issue-3979-xcrate.rs has the same failure. issue-3979.rs, on the other hand, works fine, although it was xfailed with a comment saying it was because of "ICE with explicit self". That was added by @pcwalton while demuting the test suite, in 82062a6.
Here is an updated version of issue-3979-generics.rs:
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
trait Positioned<S> {
fn SetX(&mut self, S);
fn X(&self) -> S;
}
trait Movable<S: Add<S, S>>: Positioned<S> {
fn translate(&mut self, dx: S) {
self.SetX(self.X() + dx);
}
}
struct Point { x: int, y: int }
impl Positioned<int> for Point {
fn SetX(&mut self, x: int) {
self.x = x;
}
fn X(&self) -> int {
self.x
}
}
impl Movable<int> for Point;
pub fn main() {
let p = Point{ x: 1, y: 2};
p.translate(3);
assert_eq!(p.X(), 4);
}
OK, got it. The ICE is occuring while trying to report a borrow check error in translate. The self.X() + dx needs to be hoisted out of the method call.
I am going to fix the bugs in these tests, close this issue, and open a new one with a reduced test case for the real problem.
Activity
metajack commentedon Jun 11, 2013
@jbclements Is this sufficiently serious to warrant nominating?
emberian commentedon Jun 22, 2013
Still a bug.
emberian commentedon Jun 22, 2013
(@catamorphism)
jbclements commentedon Jul 8, 2013
Oog... I should have recorded the ICE. Now I get this compilation error:
... which might be because the ICE was fixed, or might be because something about the language changed to cause an earlier breakage. Sigh.
msullivan commentedon Jul 23, 2013
ICE isn't fixed.
msullivan commentedon Jul 23, 2013
OK, I think your latest failure is due to language changes, and the test can be updated. I think that the test case was xfailed because it was broken, due to #4396. I think that I fixed the reason that it was originally xfailed with previous default method work (although there still generics problems with supertraits that I am working on at the moment).
Dropping the
&muts and getting rid of the assignment inSetXmakes the test pass.issue-3979-xcrate.rshas the same failure.issue-3979.rs, on the other hand, works fine, although it was xfailed with a comment saying it was because of "ICE with explicit self". That was added by @pcwalton while demuting the test suite, in 82062a6.msullivan commentedon Jul 23, 2013
Here is an updated version of
issue-3979-generics.rs:msullivan commentedon Jul 23, 2013
OK, got it. The ICE is occuring while trying to report a borrow check error in
translate. Theself.X() + dxneeds to be hoisted out of the method call.I am going to fix the bugs in these tests, close this issue, and open a new one with a reduced test case for the real problem.
Auto merge of rust-lang#5946 - mikerite:fix-5729, r=flip1995
Merge rust-lang#10529