Skip to content

Commit

Permalink
Add regression test for rust-lang#73298
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Oct 21, 2020
1 parent 1d27267 commit 10d6f2d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/ui/const-generics/issue-73298.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// build-pass
// revisions: full min

#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

use std::convert::AsMut;
use std::default::Default;

trait Foo: Sized {
type Baz: Default + AsMut<[u8]>;
fn bar() {
Self::Baz::default().as_mut();
}
}

impl Foo for () {
type Baz = [u8; 1 * 1];
}

fn main() {
<() as Foo>::bar();
}

0 comments on commit 10d6f2d

Please sign in to comment.