about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/double-error-for-unimplemented-trait.rs
blob: f4b01efe95908a6a18a3ff3737ea5b2d7e2648b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Make sure we don't issue *two* error messages for the trait predicate *and* host predicate.

#![feature(const_trait_impl)]

#[const_trait]
trait Trait {
  type Out;
}

const fn needs_const<T: ~const Trait>(_: &T) {}

const IN_CONST: () = {
  needs_const(&());
  //~^ ERROR the trait bound `(): Trait` is not satisfied
};

const fn conditionally_const() {
  needs_const(&());
  //~^ ERROR the trait bound `(): Trait` is not satisfied
}

fn main() {}