-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary substitution of type params when generating
vtable methods before translating the ref to the method itself.
- Loading branch information
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2014 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. | ||
|
||
// Testing casting of a generic Struct to a Trait with a generic method. | ||
// This is test for issue 10955. | ||
#[allow(unused_variable)]; | ||
|
||
trait Foo { | ||
fn f<A>(a: A) -> A { | ||
a | ||
} | ||
} | ||
|
||
struct Bar<T> { | ||
x: T, | ||
} | ||
|
||
impl<T> Foo for Bar<T> { } | ||
|
||
pub fn main() { | ||
let a = Bar { x: 1 }; | ||
let b = &a as &Foo; | ||
} |
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from pcwalton
at rcatolino@1812a7b
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging rcatolino/rust/ice-10955 = 1812a7b into auto
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rcatolino/rust/ice-10955 = 1812a7b merged ok, testing candidate = 93b40283
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-mac-32-nopt-t/builds/1298
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/3452
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/3454
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3470
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2564
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/3460
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2566
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from pcwalton
at rcatolino@1812a7b
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging rcatolino/rust/ice-10955 = 1812a7b into auto
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rcatolino/rust/ice-10955 = 1812a7b merged ok, testing candidate = ebc079c
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/3459
success: http://buildbot.rust-lang.org/builders/auto-mac-32-nopt-c/builds/1301
success: http://buildbot.rust-lang.org/builders/auto-mac-32-nopt-t/builds/1305
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/3461
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/2562
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/2567
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3477
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/2565
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2571
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/3479
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/2565
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/2570
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/2639
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/3467
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/2569
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2573
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/3240
1812a7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = ebc079c