]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/invalid_promotion.rs
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
[rust.git] / src / test / ui / consts / invalid_promotion.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 // note this was only reproducible with lib crates
3 // compile-flags: --crate-type=lib
4
5 pub struct Hz;
6
7 impl Hz {
8     pub const fn num(&self) -> u32 {
9         42
10     }
11     pub const fn normalized(&self) -> Hz {
12         Hz
13     }
14
15     pub const fn as_u32(&self) -> u32 {
16         self.normalized().num() // this used to promote the `self.normalized()`
17     }
18 }