Add a test for const

Similar to the tests for Option and Result.
This commit is contained in:
CDirkx 2020-09-01 01:53:43 +02:00
parent af24bdbd96
commit d591829ed0

View File

@ -0,0 +1,15 @@
// run-pass
#![feature(cow_is_borrowed)]
use std::borrow::Cow;
fn main() {
const COW: Cow<str> = Cow::Borrowed("moo");
const IS_BORROWED: bool = COW.is_borrowed();
assert!(IS_BORROWED);
const IS_OWNED: bool = COW.is_owned();
assert!(!IS_OWNED);
}