-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
5 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) { | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/const-generics/issue-68104-print-stack-overflow.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |