about summary refs log tree commit diff
path: root/src/test/compile-fail/variance-trait-matching.rs
AgeCommit message (Collapse)AuthorLines
2018-08-14Moved compile-fail tests to ui tests.David Wood-48/+0
2017-11-12update failing E0621 testsCengiz Can-1/+1
2016-10-18Fix some pretty printing testsVadim Petrochenkov-2/+0
2015-04-02Fallout in testsNiko Matsakis-12/+33
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-1/+0
2015-01-08Update compile fail tests to use isize.Huon Wilson-5/+5
2014-06-28librustc: Match trait self types exactly.Patrick Walton-0/+30
This can break code that looked like: impl Foo for Box<Any> { fn f(&self) { ... } } let x: Box<Any + Send> = ...; x.f(); Change such code to: impl Foo for Box<Any> { fn f(&self) { ... } } let x: Box<Any> = ...; x.f(); That is, upcast before calling methods. This is a conservative solution to #5781. A more proper treatment (see the xfail'd `trait-contravariant-self.rs`) would take variance into account. This change fixes the soundness hole. Some library changes had to be made to make this work. In particular, `Box<Any>` is no longer showable, and only `Box<Any+Send>` is showable. Eventually, this restriction can be lifted; for now, it does not prove too onerous, because `Any` is only used for propagating the result of task failure. This patch also adds a test for the variance inference work in #12828, which accidentally landed as part of DST. Closes #5781. [breaking-change]