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