]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs
1 // Copyright 2014 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 // Test equality constraints in a where clause where the type being
12 // equated appears in a supertrait.
26 pub trait BoxCar
: Box
+ Vehicle
{
29 fn dent
<C
:BoxCar
>(c
: C
, color
: C
::Color
) {
30 //~^ ERROR ambiguous associated type `Color` in bounds of `C`
31 //~| NOTE ambiguous associated type `Color`
32 //~| NOTE could derive from `Vehicle`
33 //~| NOTE could derive from `Box`
36 fn dent_object
<COLOR
>(c
: BoxCar
<Color
=COLOR
>) {
37 //~^ ERROR ambiguous associated type
38 //~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
39 //~| NOTE ambiguous associated type `Color`
40 //~| NOTE could derive from `Vehicle`
41 //~| NOTE could derive from `Box`
42 //~| NOTE missing associated type `Color` value
45 fn paint
<C
:BoxCar
>(c
: C
, d
: C
::Color
) {
46 //~^ ERROR ambiguous associated type `Color` in bounds of `C`
47 //~| NOTE ambiguous associated type `Color`
48 //~| NOTE could derive from `Vehicle`
49 //~| NOTE could derive from `Box`