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 7 pull requests #74493

Merged
merged 22 commits into from
Jul 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ba6857d
Document the trait keyword
poliorcetics Jun 26, 2020
18be370
Add core::ready! macro
yoshuawuyts Apr 5, 2020
8a2f147
Fix small nits, clarfying some confusing vocabulary and using more co…
poliorcetics Jul 16, 2020
0bac361
add test for #62878
lcnr Jul 16, 2020
4fefa2c
Make unreachable_unchecked a const fn
canova Jul 17, 2020
2f28d59
Add a passing test for const unsafe_unreachable
canova Jul 17, 2020
c45e9c8
Add a test for const unsafe_unreachable that triggers UB
canova Jul 17, 2020
6cd164f
Update UB test to fail during build with contant errors
canova Jul 18, 2020
de03a12
rustc_metadata: Remove a bit of ancient profiling
petrochenkov Jul 4, 2020
926ac5a
rustc_metadata: Remove some extra diagnostics for legacy plugins
petrochenkov Jul 4, 2020
4044cbc
rustc_metadata: Refactor away `CrateLocator::(dy,static)libname`
petrochenkov Jul 4, 2020
0a4217d
rustc_metadata: Make crate loading fully speculative
petrochenkov Jul 5, 2020
09240a4
Revert "Use an UTF-8 locale for the linker."
jonas-schievink Jul 18, 2020
f08aae6
impl Index<RangeFrom<usize>> for CStr
1011X Jul 4, 2020
30b8835
Update stability attribute for CStr indexing
dtolnay Jul 18, 2020
479c8ad
Rollup merge of #70817 - yoshuawuyts:task-ready, r=dtolnay
Manishearth Jul 18, 2020
a6266e2
Rollup merge of #73762 - poliorcetics:trait-keyword, r=KodrAus
Manishearth Jul 18, 2020
f305b20
Rollup merge of #74021 - 1011X:master, r=dtolnay
Manishearth Jul 18, 2020
43ba840
Rollup merge of #74071 - petrochenkov:cload3, r=matthewjasper
Manishearth Jul 18, 2020
1a54b61
Rollup merge of #74445 - lcnr:const-generic-ty-decl, r=Dylan-DPC
Manishearth Jul 18, 2020
2fad396
Rollup merge of #74459 - canova:const-unreachable-unchecked, r=oli-obk
Manishearth Jul 18, 2020
a83e294
Rollup merge of #74478 - rust-lang:revert-74416-linker-locale-utf8, r…
Manishearth Jul 18, 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
3 changes: 2 additions & 1 deletion src/libcore/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ use crate::intrinsics;
/// ```
#[inline]
#[stable(feature = "unreachable", since = "1.27.0")]
pub unsafe fn unreachable_unchecked() -> ! {
#[rustc_const_unstable(feature = "const_unreachable_unchecked", issue = "53188")]
pub const unsafe fn unreachable_unchecked() -> ! {
// SAFETY: the safety contract for `intrinsics::unreachable` must
// be upheld by the caller.
unsafe { intrinsics::unreachable() }
Expand Down
1 change: 1 addition & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ extern "rust-intrinsic" {
///
/// The stabilized version of this intrinsic is
/// [`std::hint::unreachable_unchecked`](../../std/hint/fn.unreachable_unchecked.html).
#[rustc_const_unstable(feature = "const_unreachable_unchecked", issue = "53188")]
pub fn unreachable() -> !;

/// Informs the optimizer that a condition is always true.
Expand Down
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#![feature(const_slice_ptr_len)]
#![feature(const_type_name)]
#![feature(const_likely)]
#![feature(const_unreachable_unchecked)]
#![feature(custom_inner_attributes)]
#![feature(decl_macro)]
#![feature(doc_cfg)]
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ pub use self::poll::Poll;
mod wake;
#[stable(feature = "futures_api", since = "1.36.0")]
pub use self::wake::{Context, RawWaker, RawWakerVTable, Waker};

mod ready;
#[unstable(feature = "ready_macro", issue = "70922")]
pub use ready::ready;
60 changes: 60 additions & 0 deletions src/libcore/task/ready.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// Extracts the successful type of a `Poll<T>`.
///
/// This macro bakes in propagation of `Pending` signals by returning early.
///
/// # Examples
///
/// ```
/// #![feature(future_readiness_fns)]
/// #![feature(ready_macro)]
///
/// use core::task::{ready, Context, Poll};
/// use core::future::{self, Future};
/// use core::pin::Pin;
///
/// pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
/// let mut fut = future::ready(42);
/// let fut = Pin::new(&mut fut);
///
/// let num = ready!(fut.poll(cx));
/// # drop(num);
/// // ... use num
///
/// Poll::Ready(())
/// }
/// ```
///
/// The `ready!` call expands to:
///
/// ```
/// # #![feature(future_readiness_fns)]
/// # #![feature(ready_macro)]
/// #
/// # use core::task::{Context, Poll};
/// # use core::future::{self, Future};
/// # use core::pin::Pin;
/// #
/// # pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
/// # let mut fut = future::ready(42);
/// # let fut = Pin::new(&mut fut);
/// #
/// let num = match fut.poll(cx) {
/// Poll::Ready(t) => t,
/// Poll::Pending => return Poll::Pending,
/// };
/// # drop(num);
/// # // ... use num
/// #
/// # Poll::Ready(())
/// # }
/// ```
#[unstable(feature = "ready_macro", issue = "70922")]
#[rustc_macro_transparency = "semitransparent"]
pub macro ready($e:expr) {
match $e {
$crate::task::Poll::Ready(t) => t,
$crate::task::Poll::Pending => {
return $crate::task::Poll::Pending;
}
}
}
4 changes: 1 addition & 3 deletions src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
pub fn disable_localization(linker: &mut Command) {
// No harm in setting both env vars simultaneously.
// Unix-style linkers.
// We use an UTF-8 locale, as the generic C locale disables support for non-ASCII
// bytes in filenames on some platforms.
linker.env("LC_ALL", "en_US.UTF-8");
linker.env("LC_ALL", "C");
// MSVC's `link.exe`.
linker.env("VSLANG", "1033");
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ E0770: include_str!("./error_codes/E0770.md"),
// E0420, merged into 532
// E0421, merged into 531
// E0427, merged into 530
E0456, // plugin `..` is not available for triple `..`
// E0456, // plugin `..` is not available for triple `..`
E0457, // plugin `..` only found in rlib format, but must be available...
E0460, // found possibly newer version of crate `..`
E0461, // couldn't find crate `..` with expected target triple ..
Expand Down
Loading