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:
Ralf Jung 2020-06-20 16:39:45 +02:00 committed by GitHub
commit 5431ef6530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 3 deletions

View 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) {
}
}

View file

@ -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();
}