diff options
| author | Ellen <supbscripter@gmail.com> | 2022-05-05 17:44:54 +0100 |
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2022-05-05 17:45:39 +0100 |
| commit | fea1d765033eada386ffc1684d47c00a48d104f1 (patch) | |
| tree | fef19174b45842ee05a51064217311a101fed588 /src/test/ui/const-generics/issues/issue-86820.rs | |
| parent | 4208c53ed695ddb822b6510e3faa0a46e591060e (diff) | |
| download | rust-fea1d765033eada386ffc1684d47c00a48d104f1.tar.gz rust-fea1d765033eada386ffc1684d47c00a48d104f1.zip | |
make `compare_generic_param_kinds` errors consistent
Diffstat (limited to 'src/test/ui/const-generics/issues/issue-86820.rs')
| -rw-r--r-- | src/test/ui/const-generics/issues/issue-86820.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/test/ui/const-generics/issues/issue-86820.rs b/src/test/ui/const-generics/issues/issue-86820.rs index 04650403c6b..9bcb8e1aeed 100644 --- a/src/test/ui/const-generics/issues/issue-86820.rs +++ b/src/test/ui/const-generics/issues/issue-86820.rs @@ -1,6 +1,6 @@ // Regression test for the ICE described in #86820. -#![allow(unused,dead_code)] +#![allow(unused, dead_code)] use std::ops::BitAnd; const C: fn() = || is_set(); @@ -9,13 +9,12 @@ fn is_set() { } trait Bits { - fn bit<const I : u8>(self) -> bool; - //~^ NOTE: the const parameter `I` has type `usize`, but the declaration in trait `Bits::bit` has type `u8` + fn bit<const I: u8>(self) -> bool; } impl Bits for u8 { - fn bit<const I : usize>(self) -> bool { - //~^ ERROR: method `bit` has an incompatible const parameter type for trait [E0053] + fn bit<const I: usize>(self) -> bool { + //~^ ERROR: method `bit` has an incompatible generic parameter for trait: `Bits` [E0053] let i = 1 << I; let mask = u8::from(i); mask & self == mask |
