]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/substs-ppaux.rs
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.
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.
11 // revisions: verbose normal
13 //[verbose] compile-flags: -Z verbose
15 trait Foo
<'b
, 'c
, S
=u32> {
16 fn bar
<'a
, T
>() where T
: 'a {}
20 impl<'a
,'b
,T
,S
> Foo
<'a
, 'b
, S
> for T {}
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>}`
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>}`
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}`
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>}`
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