Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- #![feature(const_fn)]
- fn main() {
- println!("{:?}", {
- const fn test(a: bool) -> u32 { if a { 1 } else { 2 } } test(true)
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0019]: constant function contains unimplemented expression type
- --> src/main.rs:6:45
- |
- 6 | const fn test(a: bool) -> u32 { if a { 1 } else { 2 } } test(true)
- | ^
- error[E0019]: constant function contains unimplemented expression type
- --> src/main.rs:6:42
- |
- 6 | const fn test(a: bool) -> u32 { if a { 1 } else { 2 } } test(true)
- | ^^^^^^^^^^^^^^^^^^^^^
- error: aborting due to 2 previous errors
- For more information about this error, try `rustc --explain E0019`.
- error: could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement