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 10 pull requests #68011

Merged
merged 28 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4d04b0b
Remove wrong advice about spin locks from `spin_loop_hint` docs
matklad Jan 2, 2020
91334e0
add a check for variable names that might match by word
cjkenn Jan 3, 2020
27ea4c8
missed tidy check
cjkenn Jan 4, 2020
e01e8b9
add ui test
cjkenn Jan 4, 2020
90adafb
Distinguish between private items and hidden items in rustdoc
dtolnay Jan 4, 2020
2e9d573
Option's panics are all #[track_caller].
anp Jan 5, 2020
7a6af7e
Result's panics have `#[track_caller]`.
anp Jan 5, 2020
b97ee0f
Fix typo
anp Jan 5, 2020
b25eeef
Add more nuanced advice about spin_loop_hint
matklad Jan 5, 2020
012127b
Remove weak.rs for VxWorks
Dec 9, 2019
86b9d49
rustdoc: Remove more `#[doc(cfg(..))]` duplicates
ollie27 Jan 6, 2020
cec957e
ignore signal SIGPIPE
BaoshanPang Dec 20, 2019
3acd346
Skip caller location test in wasm32.
anp Jan 7, 2020
48add54
Remove insignificant notes from CStr documentation
dtolnay Jan 7, 2020
f5baa03
Try statx for all linux-gnu targets
oxalica Jan 8, 2020
588296a
Move constness.rs to librustc_mir.
cjgillot Jan 1, 2020
c1c09be
Move `is_min_const_fn` query to librustc_mir.
cjgillot Jan 1, 2020
aabc736
ci: fix wrong shared.sh import for publish_toolstate
pietroalbini Jan 8, 2020
9f8f97b
Rollup merge of #67774 - oxalica:more-statx, r=alexcrichton
JohnTitor Jan 8, 2020
b85b1dd
Rollup merge of #67781 - cjgillot:passes-const, r=oli-obk
JohnTitor Jan 8, 2020
256f401
Rollup merge of #67798 - matklad:spin-thouse-docs, r=Amanieu
JohnTitor Jan 8, 2020
429a7e7
Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebank
JohnTitor Jan 8, 2020
03fe834
Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomez
JohnTitor Jan 8, 2020
1c9b803
Rollup merge of #67887 - anp:tracked-std-panics, r=nagisa
JohnTitor Jan 8, 2020
1f94425
Rollup merge of #67955 - ollie27:rustdoc_cfg_dupes, r=GuillaumeGomez
JohnTitor Jan 8, 2020
b687461
Rollup merge of #67977 - Wind-River:master_2020, r=alexcrichton
JohnTitor Jan 8, 2020
98a5c7d
Rollup merge of #67985 - dtolnay:cstr, r=Mark-Simulacrum
JohnTitor Jan 8, 2020
844530e
Rollup merge of #68003 - pietroalbini:yet-another-toolstate-fix, r=Ma…
JohnTitor Jan 8, 2020
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
2 changes: 1 addition & 1 deletion src/ci/publish_toolstate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail
IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
source "$(cd "$(dirname "$0")" && pwd)/shared.sh"

# The following lines are also found in src/bootstrap/toolstate.rs,
# so if updating here, please also update that file.
Expand Down
6 changes: 6 additions & 0 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ impl<T> Option<T> {
/// x.expect("the world is ending"); // panics with `the world is ending`
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn expect(self, msg: &str) -> T {
match self {
Expand Down Expand Up @@ -374,6 +375,7 @@ impl<T> Option<T> {
/// assert_eq!(x.unwrap(), "air"); // fails
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap(self) -> T {
match self {
Expand Down Expand Up @@ -1015,6 +1017,7 @@ impl<T: fmt::Debug> Option<T> {
/// }
/// ```
#[inline]
#[track_caller]
#[unstable(feature = "option_expect_none", reason = "newly added", issue = "62633")]
pub fn expect_none(self, msg: &str) {
if let Some(val) = self {
Expand Down Expand Up @@ -1057,6 +1060,7 @@ impl<T: fmt::Debug> Option<T> {
/// }
/// ```
#[inline]
#[track_caller]
#[unstable(feature = "option_unwrap_none", reason = "newly added", issue = "62633")]
pub fn unwrap_none(self) {
if let Some(val) = self {
Expand Down Expand Up @@ -1184,13 +1188,15 @@ impl<T, E> Option<Result<T, E>> {
// This is a separate function to reduce the code size of .expect() itself.
#[inline(never)]
#[cold]
#[track_caller]
fn expect_failed(msg: &str) -> ! {
panic!("{}", msg)
}

// This is a separate function to reduce the code size of .expect_none() itself.
#[inline(never)]
#[cold]
#[track_caller]
fn expect_none_failed(msg: &str, value: &dyn fmt::Debug) -> ! {
panic!("{}: {:?}", msg, value)
}
Expand Down
5 changes: 5 additions & 0 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
/// x.unwrap(); // panics with `emergency failure`
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap(self) -> T {
match self {
Expand Down Expand Up @@ -984,6 +985,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
/// x.expect("Testing expect"); // panics with `Testing expect: emergency failure`
/// ```
#[inline]
#[track_caller]
#[stable(feature = "result_expect", since = "1.4.0")]
pub fn expect(self, msg: &str) -> T {
match self {
Expand Down Expand Up @@ -1017,6 +1019,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
/// assert_eq!(x.unwrap_err(), "emergency failure");
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_err(self) -> E {
match self {
Expand Down Expand Up @@ -1044,6 +1047,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
/// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
/// ```
#[inline]
#[track_caller]
#[stable(feature = "result_expect_err", since = "1.17.0")]
pub fn expect_err(self, msg: &str) -> E {
match self {
Expand Down Expand Up @@ -1188,6 +1192,7 @@ impl<T, E> Result<Option<T>, E> {
// This is a separate function to reduce the code size of the methods
#[inline(never)]
#[cold]
#[track_caller]
fn unwrap_failed(msg: &str, error: &dyn fmt::Debug) -> ! {
panic!("{}: {:?}", msg, error)
}
Expand Down
14 changes: 4 additions & 10 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,10 @@ use crate::hint::spin_loop;
/// This function is different from [`std::thread::yield_now`] which directly yields to the
/// system's scheduler, whereas `spin_loop_hint` does not interact with the operating system.
///
/// Spin locks can be very efficient for short lock durations because they do not involve context
/// switches or interaction with the operating system. For long lock durations they become wasteful
/// however because they use CPU cycles for the entire lock duration, and using a
/// [`std::sync::Mutex`] is likely the better approach. If actively spinning for a long time is
/// required, e.g. because code polls a non-blocking API, calling [`std::thread::yield_now`]
/// or [`std::thread::sleep`] may be the best option.
///
/// **Note**: Spin locks are based on the underlying assumption that another thread will release
/// the lock 'soon'. In order for this to work, that other thread must run on a different CPU or
/// core (at least potentially). Spin locks do not work efficiently on single CPU / core platforms.
/// A common use case for `spin_loop_hint` is implementing bounded optimistic spinning in a CAS
/// loop in synchronization primitives. To avoid problems like priority inversion, it is strongly
/// recommended that the spin loop is terminated after a finite amount of iterations and an
/// appropriate blocking syscall is made.
///
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
/// do anything at all.
Expand Down
156 changes: 0 additions & 156 deletions src/librustc/ty/constness.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ pub mod cast;
#[macro_use]
pub mod codec;
pub mod _match;
mod constness;
mod erase_regions;
pub mod error;
pub mod fast_reject;
Expand Down Expand Up @@ -3318,7 +3317,6 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
context::provide(providers);
erase_regions::provide(providers);
layout::provide(providers);
constness::provide(providers);
*providers = ty::query::Providers {
asyncness,
associated_item,
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_mir/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ use crate::interpret::{intern_const_alloc_recursive, ConstValue, InterpCx};

mod error;
mod eval_queries;
mod fn_queries;
mod machine;

pub use error::*;
pub use eval_queries::*;
pub use fn_queries::*;
pub use machine::*;

/// Extracts a field of a (variant of a) const.
Expand Down
Loading