diff options
| author | Soveu <marx.tomasz@gmail.com> | 2021-04-16 16:29:11 +0200 |
|---|---|---|
| committer | Soveu <marx.tomasz@gmail.com> | 2021-04-16 16:29:11 +0200 |
| commit | 9ecfae44d74cadd58c9909da8f4a2410dd583c03 (patch) | |
| tree | 3baae7e6aff87ddb870fa2a1de7fd55f49bdc75e /src/test | |
| parent | d4bc912c4816a660b052dd7c8dffbc63fd4dffdf (diff) | |
| download | rust-9ecfae44d74cadd58c9909da8f4a2410dd583c03.tar.gz rust-9ecfae44d74cadd58c9909da8f4a2410dd583c03.zip | |
builtin derive macros: fix error with const generics default
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/derives/derive-macro-const-default.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/derives/derive-macro-const-default.rs b/src/test/ui/derives/derive-macro-const-default.rs new file mode 100644 index 00000000000..a844f2d2023 --- /dev/null +++ b/src/test/ui/derives/derive-macro-const-default.rs @@ -0,0 +1,14 @@ +// check-pass +#![allow(incomplete_features)] +#![feature(const_generics_defaults)] + +#[derive(Clone, PartialEq, Debug)] +struct Example<T, const N: usize = 1usize>([T; N]); + +fn main() { + let a = Example([(); 16]); + let b = a.clone(); + if a != b { + let _c = format!("{:?}", a); + } +} |
