diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/consts/cow-is-borrowed.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/consts/cow-is-borrowed.rs b/src/test/ui/consts/cow-is-borrowed.rs new file mode 100644 index 00000000000..adebe20f5a2 --- /dev/null +++ b/src/test/ui/consts/cow-is-borrowed.rs @@ -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); +} |
