Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 19 pull requests #58495

Merged
merged 60 commits into from
Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1ac7277
Remove rustdoc old style files generation
GuillaumeGomez Dec 6, 2018
270151b
Add generate-old-style-files option to rustdoc
GuillaumeGomez Dec 11, 2018
65440a3
Make 'generate-redirect-pages' option unstable
GuillaumeGomez Jan 26, 2019
e6d5f25
Fix #57730
Zoxc Jan 29, 2019
397eb4f
Add missing generation for test and proc_macro, remove old macro redi…
GuillaumeGomez Jan 30, 2019
9d2a0b9
add regression test for #57979
nikomatsakis Feb 1, 2019
0d28a24
Remove code for updating copyright years in generate-deriving-span-tests
KamilaBorowska Feb 8, 2019
df420aa
Remove initial newline from automatically generated span tests
KamilaBorowska Feb 8, 2019
8f6d05b
Don't default on std crate when manipulating browser history
GuillaumeGomez Feb 8, 2019
d264755
put back macro redirect
GuillaumeGomez Feb 9, 2019
6156def
librustc_mir: use ? in impl_snapshot_for! macro
taiki-e Feb 10, 2019
7b2a08c
Add Instant::checked_duration_since, address #58402.
vi Feb 12, 2019
3777b86
Stabilize slice_sort_by_cached_key
scottmcm Jan 31, 2019
317f153
Revert "Remove mentions of unstable sort_by_cached key from stable do…
scottmcm Feb 2, 2019
d15c358
Fix tests for checked_duration_since
vi Feb 13, 2019
91f67fd
Add Instant::saturating_duration_since
vi Feb 13, 2019
719be24
fix Box::into_unique effecitvely transmuting to a raw ptr
RalfJung Feb 13, 2019
26ade1c
mark failures expected due to panics
RalfJung Feb 9, 2019
7f5dc49
review or fix miri failures in iter, slice, cell, time
RalfJung Feb 9, 2019
72be9a6
review or fix remaining miri failures in libcore
RalfJung Feb 9, 2019
e24af6c
the formatting issue got fixed
RalfJung Feb 13, 2019
b17ca01
review failures in binary_heap, str, vec_deque
RalfJung Feb 13, 2019
4c1a1c3
review failures in btree, string
RalfJung Feb 13, 2019
767dadf
review failures in heap, slice, vec
RalfJung Feb 13, 2019
c154bf7
miri: test with slightly larger BTrees
RalfJung Feb 13, 2019
a301655
Use posix_spawn_file_actions_addchdir_np when possible
cuviper Feb 13, 2019
6bce2b8
Whitelist the ARM v6 target-feature
gnzlbg Feb 13, 2019
f565efd
mask `compiler_builtins` docs
euclio Feb 14, 2019
2c339ae
Add specific error for unstable const fn features
varkor Feb 5, 2019
feb3408
Update const fn tests
varkor Feb 5, 2019
519783a
Fix documentation typo
varkor Feb 5, 2019
cce2c89
add .stderr file
nikomatsakis Feb 14, 2019
8ca4406
Add updated NLL tests
varkor Feb 14, 2019
b5ab2c7
split MaybeUninit into several features, expand docs a bit
RalfJung Feb 14, 2019
1d6ce52
Whitelist the ARM v8 target-feature
gnzlbg Feb 14, 2019
95ef9b4
make Centril happy
RalfJung Feb 14, 2019
2c8e708
compile-pass test for #53606
Feb 15, 2019
14001e8
Fix runtime error in generate-keyword-tests
KamilaBorowska Feb 15, 2019
4ad8770
Fix documentation for std::path::PathBuf::pop
nathan Feb 15, 2019
84e88da
Rollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakis
kennytm Feb 15, 2019
f05e6bf
Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=Sim…
kennytm Feb 15, 2019
49107c3
Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk
kennytm Feb 15, 2019
9472f0c
Rollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrum
kennytm Feb 15, 2019
9a3e22e
Rollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=Quie…
kennytm Feb 15, 2019
092d191
Rollup merge of #58359 - taiki-e:impl_snapshot_for, r=oli-obk
kennytm Feb 15, 2019
13b055d
Rollup merge of #58429 - RalfJung:box, r=TimNN
kennytm Feb 15, 2019
0fecb6d
Rollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN
kennytm Feb 15, 2019
50f3c81
Rollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np…
kennytm Feb 15, 2019
30019ed
Rollup merge of #58440 - gnzlbg:v6, r=japaric
kennytm Feb 15, 2019
762b988
Rollup merge of #58448 - euclio:missing-summaries, r=QuietMisdreavus
kennytm Feb 15, 2019
9a2437c
Rollup merge of #58468 - RalfJung:maybe-uninit-split, r=Centril
kennytm Feb 15, 2019
d6a98f4
Notify myself when Clippy toolstate changes
phansch Feb 16, 2019
3ba6177
Fix tracking issue for error iterators
sfackler Feb 16, 2019
cfa6a70
Rollup merge of #58479 - saleemjaffer:test_promote_evaluation_unused_…
kennytm Feb 15, 2019
4739cd8
Rollup merge of #58489 - xfix:fix-keyword-tests-runtime-error, r=alex…
kennytm Feb 15, 2019
f8ccdeb
Rollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-file…
kennytm Feb 16, 2019
17b07f9
Rollup merge of #58395 - vi:checked_duration_since, r=dtolnay
kennytm Feb 16, 2019
98f1865
Rollup merge of #58496 - nathan:doc-std-path-pathbuf-pop, r=frewsxcv
kennytm Feb 16, 2019
4fcee62
Rollup merge of #58509 - phansch:add_myself_to_clippy_toolstate_maint…
kennytm Feb 16, 2019
c65a82a
Rollup merge of #58521 - sfackler:error-iter-issue, r=withoutboats
kennytm Feb 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/bootstrap/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fn main() {
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
let mut has_unstable = false;

use std::str::FromStr;

Expand Down Expand Up @@ -54,9 +55,22 @@ fn main() {
// it up so we can make rustdoc print this into the docs
if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") {
// This "unstable-options" can be removed when `--crate-version` is stabilized
cmd.arg("-Z")
.arg("unstable-options")
.arg("--crate-version").arg(version);
if !has_unstable {
cmd.arg("-Z")
.arg("unstable-options");
}
cmd.arg("--crate-version").arg(version);
has_unstable = true;
}

// Needed to be able to run all rustdoc tests.
if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") {
// This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
if !has_unstable {
cmd.arg("-Z")
.arg("unstable-options");
}
cmd.arg("--generate-redirect-pages");
}

if verbose > 1 {
Expand Down
9 changes: 6 additions & 3 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ impl Step for Std {
cargo.arg("--")
.arg("--markdown-css").arg("rust.css")
.arg("--markdown-no-toc")
.arg("--generate-redirect-pages")
.arg("--index-page").arg(&builder.src.join("src/doc/index.md"));

builder.run(&mut cargo);
Expand Down Expand Up @@ -581,7 +582,9 @@ impl Step for Test {
let mut cargo = builder.cargo(compiler, Mode::Test, target, "doc");
compile::test_cargo(builder, &compiler, target, &mut cargo);

cargo.arg("--no-deps").arg("-p").arg("test");
cargo.arg("--no-deps")
.arg("-p").arg("test")
.env("RUSTDOC_GENERATE_REDIRECT_PAGES", "1");

builder.run(&mut cargo);
builder.cp_r(&my_out, &out);
Expand Down Expand Up @@ -650,9 +653,9 @@ impl Step for WhitelistedRustc {
// We don't want to build docs for internal compiler dependencies in this
// step (there is another step for that). Therefore, we whitelist the crates
// for which docs must be built.
cargo.arg("--no-deps");
for krate in &["proc_macro"] {
cargo.arg("-p").arg(krate);
cargo.arg("-p").arg(krate)
.env("RUSTDOC_GENERATE_REDIRECT_PAGES", "1");
}

builder.run(&mut cargo);
Expand Down
30 changes: 7 additions & 23 deletions src/etc/generate-deriving-span-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
sample usage: src/etc/generate-deriving-span-tests.py
"""

import os, datetime, stat, re
import os, stat

TEST_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), '../test/ui/derives/'))

YEAR = datetime.datetime.now().year

TEMPLATE = """
TEMPLATE = """\
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'

{error_deriving}
Expand Down Expand Up @@ -63,19 +61,11 @@ def create_test_case(type, trait, super_traits, error_count):

errors = '\n'.join('//~%s ERROR' % ('^' * n) for n in range(error_count))
code = string.format(traits = all_traits, errors = errors)
return TEMPLATE.format(year = YEAR, error_deriving=error_deriving, code = code)
return TEMPLATE.format(error_deriving=error_deriving, code = code)

def write_file(name, string):
test_file = os.path.join(TEST_DIR, 'derives-span-%s.rs' % name)

with open(test_file) as f:
old_str = f.read()
old_str_ignoring_date = re.sub(r'^// Copyright \d+',
'// Copyright {year}'.format(year = YEAR), old_str)
if old_str_ignoring_date == string:
# if all we're doing is updating the copyright year, ignore it
return 0

# set write permission if file exists, so it can be changed
if os.path.exists(test_file):
os.chmod(test_file, stat.S_IWUSR)
Expand All @@ -86,8 +76,6 @@ def write_file(name, string):
# mark file read-only
os.chmod(test_file, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)

return 1


ENUM = 1
STRUCT = 2
Expand All @@ -110,15 +98,11 @@ def write_file(name, string):
('Hash', [], 1)]:
traits[trait] = (ALL, supers, errs)

files = 0

for (trait, (types, super_traits, error_count)) in traits.items():
mk = lambda ty: create_test_case(ty, trait, super_traits, error_count)
if types & ENUM:
files += write_file(trait + '-enum', mk(ENUM_TUPLE))
files += write_file(trait + '-enum-struct-variant', mk(ENUM_STRUCT))
write_file(trait + '-enum', mk(ENUM_TUPLE))
write_file(trait + '-enum-struct-variant', mk(ENUM_STRUCT))
if types & STRUCT:
files += write_file(trait + '-struct', mk(STRUCT_FIELDS))
files += write_file(trait + '-tuple-struct', mk(STRUCT_TUPLE))

print('Generated {files} deriving span test{}.'.format('s' if files != 1 else '', files = files))
write_file(trait + '-struct', mk(STRUCT_FIELDS))
write_file(trait + '-tuple-struct', mk(STRUCT_TUPLE))
4 changes: 2 additions & 2 deletions src/etc/generate-keyword-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import stat


template = """
template = """\
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'

fn main() {
Expand All @@ -35,7 +35,7 @@
os.chmod(test_file, stat.S_IWUSR)

with open(test_file, 'wt') as f:
f.write(template % (datetime.datetime.now().year, kw, kw, kw))
f.write(template % (kw, kw, kw))

# mark file read-only
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
1 change: 0 additions & 1 deletion src/liballoc/benches/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(repr_simd)]
#![feature(slice_sort_by_cached_key)]
#![feature(test)]

extern crate rand;
Expand Down
11 changes: 8 additions & 3 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,15 @@ impl<T: ?Sized> Box<T> {
#[unstable(feature = "ptr_internals", issue = "0", reason = "use into_raw_non_null instead")]
#[inline]
#[doc(hidden)]
pub fn into_unique(b: Box<T>) -> Unique<T> {
let unique = b.0;
pub fn into_unique(mut b: Box<T>) -> Unique<T> {
// Box is kind-of a library type, but recognized as a "unique pointer" by
// Stacked Borrows. This function here corresponds to "reborrowing to
// a raw pointer", but there is no actual reborrow here -- so
// without some care, the pointer we are returning here still carries
// the `Uniq` tag. We round-trip through a mutable reference to avoid that.
let unique = unsafe { b.0.as_mut() as *mut T };
mem::forget(b);
unique
unsafe { Unique::new_unchecked(unique) }
}

/// Consumes and leaks the `Box`, returning a mutable reference,
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
root: self.root,
_marker: PhantomData
},
idx: unsafe { usize::from(*self.as_header().parent_idx.get_ref()) },
idx: unsafe { usize::from(*self.as_header().parent_idx.as_ptr()) },
_marker: PhantomData
})
} else {
Expand Down Expand Up @@ -1143,7 +1143,7 @@ impl<BorrowType, K, V>
NodeRef {
height: self.node.height - 1,
node: unsafe {
self.node.as_internal().edges.get_unchecked(self.idx).get_ref().as_ptr()
(&*self.node.as_internal().edges.get_unchecked(self.idx).as_ptr()).as_ptr()
},
root: self.node.root,
_marker: PhantomData
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit)]
#![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
#![feature(alloc_layout_extra)]
#![feature(try_trait)]

Expand Down
7 changes: 5 additions & 2 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ impl<T> [T] {
/// This sort is stable (i.e., does not reorder equal elements) and `O(m n log(m n))`
/// worst-case, where the key function is `O(m)`.
///
/// For expensive key functions (e.g. functions that are not simple property accesses or
/// basic operations), [`sort_by_cached_key`](#method.sort_by_cached_key) is likely to be
/// significantly faster, as it does not recompute element keys.
///
/// When applicable, unstable sorting is preferred because it is generally faster than stable
/// sorting and it doesn't allocate auxiliary memory.
/// See [`sort_unstable_by_key`](#method.sort_unstable_by_key).
Expand Down Expand Up @@ -312,15 +316,14 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// #![feature(slice_sort_by_cached_key)]
/// let mut v = [-5i32, 4, 32, -3, 2];
///
/// v.sort_by_cached_key(|k| k.to_string());
/// assert!(v == [-3, -5, 2, 32, 4]);
/// ```
///
/// [pdqsort]: https://github.com/orlp/pdqsort
#[unstable(feature = "slice_sort_by_cached_key", issue = "34447")]
#[stable(feature = "slice_sort_by_cached_key", since = "1.34.0")]
#[inline]
pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/tests/arc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(miri))]

use std::any::Any;
use std::sync::{Arc, Weak};
use std::cell::RefCell;
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/tests/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ fn assert_covariance() {
//
// Destructors must be called exactly once per element.
#[test]
#[cfg(not(miri))]
#[cfg(not(miri))] // Miri does not support panics
fn panic_safe() {
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);

Expand Down
30 changes: 30 additions & 0 deletions src/liballoc/tests/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use super::DeterministicRng;
#[test]
fn test_basic_large() {
let mut map = BTreeMap::new();
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 200;
assert_eq!(map.len(), 0);

for i in 0..size {
Expand Down Expand Up @@ -69,7 +72,10 @@ fn test_basic_small() {

#[test]
fn test_iter() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand All @@ -91,7 +97,10 @@ fn test_iter() {

#[test]
fn test_iter_rev() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand Down Expand Up @@ -127,7 +136,10 @@ fn test_values_mut() {

#[test]
fn test_iter_mixed() {
#[cfg(not(miri))] // Miri is too slow
let size = 10000;
#[cfg(miri)]
let size = 200;

// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
Expand Down Expand Up @@ -214,42 +226,50 @@ fn test_range_equal_empty_cases() {

#[test]
#[should_panic]
#[cfg(not(miri))] // Miri does not support panics
fn test_range_equal_excluded() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(2), Excluded(2)));
}

#[test]
#[should_panic]
#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_1() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Included(3), Included(2)));
}

#[test]
#[should_panic]
#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_2() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Included(3), Excluded(2)));
}

#[test]
#[should_panic]
#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_3() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(3), Included(2)));
}

#[test]
#[should_panic]
#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_4() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(3), Excluded(2)));
}

#[test]
fn test_range_1000() {
#[cfg(not(miri))] // Miri is too slow
let size = 1000;
#[cfg(miri)]
let size = 200;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

fn test(map: &BTreeMap<u32, u32>, size: u32, min: Bound<&u32>, max: Bound<&u32>) {
Expand Down Expand Up @@ -286,7 +306,10 @@ fn test_range_borrowed_key() {

#[test]
fn test_range() {
#[cfg(not(miri))] // Miri is too slow
let size = 200;
#[cfg(miri)]
let size = 30;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

for i in 0..size {
Expand All @@ -305,7 +328,10 @@ fn test_range() {

#[test]
fn test_range_mut() {
#[cfg(not(miri))] // Miri is too slow
let size = 200;
#[cfg(miri)]
let size = 30;
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();

for i in 0..size {
Expand Down Expand Up @@ -479,7 +505,10 @@ fn test_bad_zst() {
#[test]
fn test_clone() {
let mut map = BTreeMap::new();
#[cfg(not(miri))] // Miri is too slow
let size = 100;
#[cfg(miri)]
let size = 30;
assert_eq!(map.len(), 0);

for i in 0..size {
Expand Down Expand Up @@ -631,6 +660,7 @@ create_append_test!(test_append_145, 145);
create_append_test!(test_append_170, 170);
create_append_test!(test_append_181, 181);
create_append_test!(test_append_239, 239);
#[cfg(not(miri))] // Miri is too slow
create_append_test!(test_append_1700, 1700);

fn rand_data(len: usize) -> Vec<(u32, u32)> {
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/tests/btree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(miri))]

mod map;
mod set;

Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/tests/heap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(miri))]

use std::alloc::{Global, Alloc, Layout, System};

/// Issue #45955.
Expand Down
Loading