Skip to content

Commit

Permalink
Add a test for const
Browse files Browse the repository at this point in the history
Similar to the tests for Option and Result.
  • Loading branch information
CDirkx committed Aug 31, 2020
1 parent af24bdb commit d591829
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/ui/consts/cow-is-borrowed.rs
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit d591829

Please sign in to comment.