Make assoc types work with ?const opt=out
This commit is contained in:
parent
8c2a1e8e43
commit
1fa712d0ba
7 changed files with 24 additions and 27 deletions
|
|
@ -1,5 +1,7 @@
|
|||
// FIXME(fee1-dead): this should have a better error message
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(const_trait_bound_opt_out)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct NonConstAdd(i32);
|
||||
|
||||
|
|
@ -20,4 +22,12 @@ impl const Foo for NonConstAdd {
|
|||
//~^ ERROR
|
||||
}
|
||||
|
||||
trait Baz {
|
||||
type Qux: ?const std::ops::Add;
|
||||
}
|
||||
|
||||
impl const Baz for NonConstAdd {
|
||||
type Qux = NonConstAdd; // OK
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: cannot add `NonConstAdd` to `NonConstAdd`
|
||||
--> $DIR/assoc-type.rs:19:5
|
||||
--> $DIR/assoc-type.rs:21:5
|
||||
|
|
||||
LL | type Bar: std::ops::Add;
|
||||
| ------------- required by this bound in `Foo::Bar`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue