Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fcf1571
Add Atomic*::from_mut.
m-ou-se Jul 19, 2020
09fff5f
Disable Atomic*::from_mut when alignment is wrong.
m-ou-se Aug 13, 2020
8142457
Update tracking issue for const_caller_location
ArekPiekarz Aug 31, 2020
8783c62
Add missing link in README
camelid Sep 2, 2020
3e29fdb
Remove a number of vec UI tests, make them unit tests in the alloc li…
CraftSpider Sep 3, 2020
791f93c
Allow try blocks as the argument to return expressions
scottmcm Sep 3, 2020
2278c72
Remove vec-to_str.rs, merge the remaining test in with vec
CraftSpider Sep 3, 2020
a2e077e
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`
CDirkx Sep 3, 2020
8c93125
Address review comments on `Peekable::next_if`
jyn514 Sep 3, 2020
7b823df
Link to `#capacity-and-reallocation` when using with_capacity
jyn514 Sep 3, 2020
538e198
Move various ui const tests to `library`
CDirkx Sep 4, 2020
a3ee65f
Remove a useless allowed attr
tesuji Sep 4, 2020
8f11127
time.rs: Make spelling of "Darwin" consistent
numbermaniac Sep 4, 2020
fac2726
Use ops::ControlFlow in graph::iterate
scottmcm Sep 4, 2020
d16bbd1
Move Vec slice UI tests in library
Sep 4, 2020
8f2d906
Implementation of incompatible features error
Amjad50 Sep 3, 2020
2ed1a21
add some intra-doc links to `Iterator`
euclio Sep 4, 2020
59e3733
Add `BREAK` too, and improve the comments
scottmcm Sep 4, 2020
dfd219d
Indent a note to make folding work nicer
tesuji Sep 5, 2020
7cc2569
Add tracking issue number for atomic_from_mut.
m-ou-se Sep 5, 2020
8af85fa
Improve the documentation of `filter()` and `filter_map()`.
vext01 Aug 26, 2020
7cbfbd3
compiletest: Introduce "min-cdb-version"
MaulingMonkey Sep 5, 2020
4046f92
debuginfo: Ignore HashMap tests before cdb 10.0.18362.1
MaulingMonkey Sep 5, 2020
099af05
Rollup merge of #74532 - fusion-engineering-forks:atomic-from-mut, r=…
Dylan-DPC Sep 6, 2020
8abb528
Rollup merge of #75949 - vext01:filter-docs, r=jyn514
Dylan-DPC Sep 6, 2020
bdd3b05
Rollup merge of #76157 - ArekPiekarz:const_caller_location_tracking_i…
Dylan-DPC Sep 6, 2020
de3e0a6
Rollup merge of #76229 - camelid:patch-3, r=jonas-schievink
Dylan-DPC Sep 6, 2020
26b67dd
Rollup merge of #76273 - CraftSpider:master, r=matklad
Dylan-DPC Sep 6, 2020
3e0a83c
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
Dylan-DPC Sep 6, 2020
5d24dd0
Rollup merge of #76287 - lzutao:rm-allowed, r=jyn514
Dylan-DPC Sep 6, 2020
a979810
Rollup merge of #76293 - Amjad50:incompatible_features_error, r=lcnr
Dylan-DPC Sep 6, 2020
2d5f21d
Rollup merge of #76299 - CDirkx:ip-tests, r=matklad
Dylan-DPC Sep 6, 2020
f06c59e
Rollup merge of #76302 - jyn514:peekable-2, r=Dylan-DPC
Dylan-DPC Sep 6, 2020
7d9d348
Rollup merge of #76303 - jyn514:vec-assert-doc, r=Dylan-DPC
Dylan-DPC Sep 6, 2020
bdd9561
Rollup merge of #76305 - CDirkx:const-tests, r=matklad
Dylan-DPC Sep 6, 2020
4782725
Rollup merge of #76309 - lzutao:indent-note, r=jyn514
Dylan-DPC Sep 6, 2020
eb02832
Rollup merge of #76312 - numbermaniac:patch-1, r=shepmaster
Dylan-DPC Sep 6, 2020
97cd85d
Rollup merge of #76318 - scottmcm:one-control-flow, r=ecstatic-morse
Dylan-DPC Sep 6, 2020
378274b
Rollup merge of #76324 - ayushmishra2005:move_vec_tests_in_library, r…
Dylan-DPC Sep 6, 2020
d80185b
Rollup merge of #76338 - euclio:intra-link-iterator, r=jyn514
Dylan-DPC Sep 6, 2020
caaf743
Rollup merge of #76390 - MaulingMonkey:pr-min-cdb-version, r=petroche…
Dylan-DPC Sep 6, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move various ui const tests to library
Move: - `src\test\ui\consts\const-nonzero.rs` to `library\core` - `src\test\ui\consts\ascii.rs` to `library\core` - `src\test\ui\consts\cow-is-borrowed` to `library\alloc` Part of #76268
  • Loading branch information
CDirkx committed Sep 4, 2020
commit 538e198193451e680cc95b66c82baac3ac687c8c
13 changes: 13 additions & 0 deletions library/alloc/tests/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@ fn test_from_cow_path() {
let path = Path::new("hello");
test_from_cow!(path: &Path);
}

#[test]
fn cow_const() {
// test that the methods of `Cow` are usable in a const context

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);
}
1 change: 1 addition & 0 deletions library/alloc/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(allocator_api)]
#![feature(box_syntax)]
#![feature(cow_is_borrowed)]
#![feature(drain_filter)]
#![feature(exact_size_is_empty)]
#![feature(new_uninit)]
Expand Down
11 changes: 11 additions & 0 deletions library/core/tests/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,14 @@ fn test_is_ascii_align_size_thoroughly() {
}
}
}

#[test]
fn ascii_const() {
// test that the `is_ascii` methods of `char` and `u8` are usable in a const context

const CHAR_IS_ASCII: bool = 'a'.is_ascii();
assert!(CHAR_IS_ASCII);

const BYTE_IS_ASCII: bool = 97u8.is_ascii();
assert!(BYTE_IS_ASCII);
}
17 changes: 17 additions & 0 deletions library/core/tests/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,20 @@ fn test_nonzero_from_int_on_err() {
assert!(NonZeroI8::try_from(0).is_err());
assert!(NonZeroI32::try_from(0).is_err());
}

#[test]
fn nonzero_const() {
// test that the methods of `NonZeroX>` are usable in a const context
// Note: only tests NonZero8

const NONZERO: NonZeroU8 = unsafe { NonZeroU8::new_unchecked(5) };

const GET: u8 = NONZERO.get();
assert_eq!(GET, 5);

const ZERO: Option<NonZeroU8> = NonZeroU8::new(0);
assert!(ZERO.is_none());

const ONE: Option<NonZeroU8> = NonZeroU8::new(1);
assert!(ONE.is_some());
}
16 changes: 0 additions & 16 deletions src/test/ui/consts/const-nonzero.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/consts/cow-is-borrowed.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/consts/is_ascii.rs

This file was deleted.