Rollup merge of #72600 - Aaron1011:fix/anon-const-encoding, r=varkor
Properly encode AnonConst into crate metadata Fixes #68104 Previous, we were encoding AnonConst as a regular Const, causing us to treat them differently after being deserialized in another compilation session.
This commit is contained in:
commit
5431ef6530
5 changed files with 31 additions and 3 deletions
9
src/test/ui/const-generics/auxiliary/impl-const.rs
Normal file
9
src/test/ui/const-generics/auxiliary/impl-const.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![feature(const_generics)]
|
||||
|
||||
pub struct Num<const N: usize>;
|
||||
|
||||
// Braces around const expression causes crash
|
||||
impl Num<{5}> {
|
||||
pub fn five(&self) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
// aux-build:impl-const.rs
|
||||
// run-pass
|
||||
|
||||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
extern crate impl_const;
|
||||
|
||||
use impl_const::*;
|
||||
|
||||
pub fn main() {
|
||||
let n = Num::<5>;
|
||||
n.five();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue