Closed
Description
Regression in rustc 1.27.0-nightly (2f2a11d 2018-05-16), still present in rustc 1.28.0-nightly (29ffe51 2018-05-23). Previous day's nightly, and stable, compile fine.
#![allow(dead_code)]
struct Foo<T>(T);
struct Duck;
struct Quack;
trait Hello<A> where A: Animal {
}
trait Animal {
type Noise;
}
trait Loud<R> {
}
impl Loud<Quack> for f32 {
}
impl Animal for Duck {
type Noise = Quack;
}
impl Hello<Duck> for Foo<f32> where f32: Loud<<Duck as Animal>::Noise> {
}
// impl Hello<Duck> for Foo<f32> where f32: Loud<Quack> // builds fine
On rustc 1.27.0-nightly (f0fdaba 2018-05-15) it builds fine.
On rustc 1.27.0-nightly (2f2a11d 2018-05-16) it fails with:
error[E0277]: the trait bound `f32: Loud<<Duck as Animal>::Noise>` is not satisfied
--> src/lib.rs:23:1
|
23 | / impl Hello<Duck> for Foo<f32> where f32: Loud<<Duck as Animal>::Noise> {
24 | | }
| |_^ the trait `Loud<<Duck as Animal>::Noise>` is not implemented for `f32`
|
= help: consider adding a `where f32: Loud<<Duck as Animal>::Noise>` bound
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable