-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check before adding constants to constant folding map. (#5968)
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[derive(Drop)] | ||
pub enum Pattern { | ||
Leaf, | ||
Boxed: Box<Pattern> | ||
} | ||
|
||
pub fn boxed(pat: Pattern) -> Pattern { | ||
return Pattern::Boxed(BoxTrait::new(pat)); | ||
} | ||
|
||
pub fn boxed_leaf() -> Pattern { | ||
boxed(Pattern::Leaf) | ||
} | ||
|
||
#[inline(never)] | ||
pub fn boxed_boxed_leaf() -> Pattern { | ||
boxed(boxed_leaf()) | ||
} | ||
|
||
#[test] | ||
fn test() { | ||
let _ = boxed_boxed_leaf(); | ||
} |
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