mirror of
https://github.com/openharmony/third_party_rust_static-assertions-rs.git
synced 2026-07-21 04:05:27 -04:00
16 lines
293 B
Rust
16 lines
293 B
Rust
#![no_std]
|
|
#![deny(unsafe_code)]
|
|
|
|
#[macro_use]
|
|
extern crate static_assertions;
|
|
|
|
const_assert!(true && (true != false));
|
|
const_assert!((true && true) != false);
|
|
const_assert_eq!(false, false);
|
|
|
|
#[allow(dead_code)]
|
|
const FIVE: usize = 5;
|
|
|
|
const_assert!(FIVE * 2 == 10);
|
|
const_assert!(FIVE > 2);
|