Deactivate feature gate explicit_generic_args_with_impl_trait
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
parent
12872b6807
commit
640a461388
22 changed files with 32 additions and 169 deletions
|
@ -0,0 +1,21 @@
|
|||
// check-pass
|
||||
|
||||
trait Usizer {
|
||||
fn m(self) -> usize;
|
||||
}
|
||||
|
||||
fn f<const N: usize>(u: impl Usizer) -> usize {
|
||||
N + u.m()
|
||||
}
|
||||
|
||||
struct Usizable;
|
||||
|
||||
impl Usizer for Usizable {
|
||||
fn m(self) -> usize {
|
||||
16
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(f::<4usize>(Usizable), 20usize);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue