]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/issues/issue-86820.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / const-generics / issues / issue-86820.rs
1 // Regression test for the ICE described in #86820.
2
3 #![allow(unused, dead_code)]
4 use std::ops::BitAnd;
5
6 const C: fn() = || is_set();
7 fn is_set() {
8 0xffu8.bit::<0>();
9 }
10
11 trait Bits {
12 fn bit<const I: u8>(self) -> bool;
13 }
14
15 impl Bits for u8 {
16 fn bit<const I: usize>(self) -> bool {
17 //~^ ERROR: method `bit` has an incompatible generic parameter for trait `Bits` [E0053]
18 let i = 1 << I;
19 let mask = u8::from(i);
20 mask & self == mask
21 }
22 }
23
24 fn main() {}