Skip to content

Commit 65424de

Browse files
arielb1Ariel Ben-Yehuda
authored and
Ariel Ben-Yehuda
committed
---
yaml --- r: 272361 b: refs/heads/auto c: 0ac5e48 h: refs/heads/master i: 272359: cc81789
1 parent 916e6ab commit 65424de

File tree

4 files changed

+64
-49
lines changed

4 files changed

+64
-49
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 832b7075b6c2e4ed37978d00a7c629e468f3dab1
11+
refs/heads/auto: 0ac5e48069bcd2e54fa72086d0a9a206cf1a7bcf
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/traits/error_reporting.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
436436
// If we can't show anything useful, try to find
437437
// similar impls.
438438

439-
let impl_candidates = find_similar_impl_candidates(infcx, trait_ref);
439+
let impl_candidates =
440+
find_similar_impl_candidates(infcx, trait_ref);
440441
if impl_candidates.len() > 0 {
441442
report_similar_impl_candidates(obligation.cause.span,
442443
&mut err, &impl_candidates);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
//
11+
// revisions: verbose normal
12+
//
13+
//[verbose] compile-flags: -Z verbose
14+
15+
trait Foo<'b, 'c, S=u32> {
16+
fn bar<'a, T>() where T: 'a {}
17+
fn baz() {}
18+
}
19+
20+
impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
21+
22+
fn main() {}
23+
24+
fn foo<'z>() where &'z (): Sized {
25+
let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
26+
//[verbose]~^ ERROR mismatched types
27+
//[verbose]~| expected `()`
28+
//[verbose]~| found `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
29+
//[normal]~^^^^ ERROR mismatched types
30+
//[normal]~| expected `()`
31+
//[normal]~| found `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
32+
33+
34+
let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
35+
//[verbose]~^ ERROR mismatched types
36+
//[verbose]~| expected `()`
37+
//[verbose]~| found `fn() {<i8 as Foo<ReStatic, ReStatic, u32>>::bar::<ReStatic, char>}`
38+
//[normal]~^^^^ ERROR mismatched types
39+
//[normal]~| expected `()`
40+
//[normal]~| found `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
41+
42+
let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
43+
//[verbose]~^ ERROR mismatched types
44+
//[verbose]~| expected `()`
45+
//[verbose]~| found `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
46+
//[normal]~^^^^ ERROR mismatched types
47+
//[normal]~| expected `()`
48+
//[normal]~| found `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
49+
50+
let x: () = foo::<'static>;
51+
//[verbose]~^ ERROR mismatched types
52+
//[verbose]~| expected `()`
53+
//[verbose]~| found `fn() {foo::<ReStatic>}`
54+
//[normal]~^^^^ ERROR mismatched types
55+
//[normal]~| expected `()`
56+
//[normal]~| found `fn() {foo::<'static>}`
57+
58+
<str as Foo<u8>>::bar;
59+
//[verbose]~^ ERROR `str: std::marker::Sized` is not satisfied
60+
//[normal]~^^ ERROR `str: std::marker::Sized` is not satisfied
61+
}

branches/auto/src/test/compile-fail/substs-verbose.rs

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)