]> git.proxmox.com Git - rustc.git/blame_incremental - 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
1// Regression test for the ICE described in #86820.
2
3#![allow(unused, dead_code)]
4use std::ops::BitAnd;
5
6const C: fn() = || is_set();
7fn is_set() {
8 0xffu8.bit::<0>();
9}
10
11trait Bits {
12 fn bit<const I: u8>(self) -> bool;
13}
14
15impl 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
24fn main() {}