Skip to content

Rollup of 10 pull requests #75606

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

Closed
wants to merge 34 commits into from
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2303939
Don't visit foreign function bodies when lowering ast to hir
ayazhafiz Jul 10, 2020
ab4275c
fixup! Don't visit foreign function bodies when lowering ast to hir
ayazhafiz Jul 10, 2020
68aca3b
fixup! fixup! Don't visit foreign function bodies when lowering ast t…
ayazhafiz Jul 15, 2020
0c64d32
fixup! Don't visit foreign function bodies when lowering ast to hir
ayazhafiz Jul 15, 2020
d442bf7
fixup! Don't visit foreign function bodies when lowering ast to hir
ayazhafiz Jul 16, 2020
50ead68
Add regression test for issue-66768
JohnTitor Aug 5, 2020
0d0546a
Add #[track_caller] to `Session::delay_span_bug`
Aaron1011 Aug 6, 2020
3c2eb18
Use intra-doc links
denisvasilik Aug 11, 2020
c492341
Revert broken link
denisvasilik Aug 11, 2020
4c5896f
Remove intra-doc link as it resolves without reference link
denisvasilik Aug 12, 2020
8de63eb
Bump minor version of emsdk to 1.38.47
tmiasko Aug 15, 2020
764dc3d
lang_items: add support for lang items on variants
davidtwco Aug 4, 2020
734441c
tests: add test for #61019's current behaviour
davidtwco Aug 4, 2020
7dee5f8
hir: introduce lang items for AST lowering
davidtwco Aug 4, 2020
762137e
hir: introduce `QPath::LangItem`
davidtwco Aug 4, 2020
1e2f350
save_analysis: support `QPath::LangItem`
davidtwco Aug 4, 2020
664ecf1
hir: simplify `is_range_literal`
davidtwco Aug 4, 2020
8367af4
resolve: support `GenericBound::LangItemTrait`
davidtwco Aug 4, 2020
dde93c9
rustdoc: clean `QPath::LangItem`
davidtwco Aug 4, 2020
bde529f
clippy: support `QPath::LangItem`
davidtwco Aug 4, 2020
0a96e08
Switch to intra-doc links in /sys/windows/ext/{ffi,fs,process}.rs
nixphix Aug 16, 2020
8b86b28
Use LocalDefId instead of HirId for reachable_set elements.
eddyb Jul 14, 2020
5d44d54
rustc_typeck: construct {Closure,Generator}Substs more directly.
eddyb Jul 13, 2020
e1cd185
move DelaySpanBugEmitted to ty::context
mark-i-m Jul 16, 2020
67f02ea
Rollup merge of #74204 - ayazhafiz:i/74120, r=eddyb
Dylan-DPC Aug 16, 2020
772038d
Rollup merge of #74314 - eddyb:closure-substs-direct, r=nikomatsakis
Dylan-DPC Aug 16, 2020
c531545
Rollup merge of #74346 - eddyb:reachable-defs, r=nikomatsakis
Dylan-DPC Aug 16, 2020
c8a5acd
Rollup merge of #74399 - mark-i-m:ty-err-4, r=eddyb
Dylan-DPC Aug 16, 2020
3e5ce7b
Rollup merge of #75145 - davidtwco:issue-60607-preallocate-defid-for-…
Dylan-DPC Aug 16, 2020
f33f111
Rollup merge of #75177 - JohnTitor:broken-mir-test, r=eddyb
Dylan-DPC Aug 16, 2020
60fc66b
Rollup merge of #75223 - Aaron1011:feature/session-track-caller, r=eddyb
Dylan-DPC Aug 16, 2020
58a0860
Rollup merge of #75423 - denisvasilik:intra-doc-links-core-hint, r=dt…
Dylan-DPC Aug 16, 2020
f350f9c
Rollup merge of #75569 - tmiasko:emscripten, r=tlively
Dylan-DPC Aug 16, 2020
76d61c7
Rollup merge of #75596 - nixphix:docs/windows-ext, r=jyn514
Dylan-DPC Aug 16, 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
1 change: 1 addition & 0 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
@@ -385,6 +385,7 @@ pub trait Into<T>: Sized {
))]
pub trait From<T>: Sized {
/// Performs the conversion.
#[cfg_attr(not(bootstrap), lang = "from")]
#[stable(feature = "rust1", since = "1.0.0")]
fn from(_: T) -> Self;
}
1 change: 1 addition & 0 deletions library/core/src/future/future.rs
Original file line number Diff line number Diff line change
@@ -96,6 +96,7 @@ pub trait Future {
/// [`Context`]: ../task/struct.Context.html
/// [`Waker`]: ../task/struct.Waker.html
/// [`Waker::wake`]: ../task/struct.Waker.html#method.wake
#[cfg_attr(not(bootstrap), lang = "poll")]
#[stable(feature = "futures_api", since = "1.36.0")]
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
}
2 changes: 2 additions & 0 deletions library/core/src/future/mod.rs
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ unsafe impl Sync for ResumeTy {}
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
// This is `const` to avoid extra errors after we recover from `const async fn`
#[cfg_attr(not(bootstrap), lang = "from_generator")]
#[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")]
#[inline]
@@ -85,6 +86,7 @@ where
GenFuture(gen)
}

#[cfg_attr(not(bootstrap), lang = "get_context")]
#[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")]
#[inline]
3 changes: 1 addition & 2 deletions library/core/src/hint.rs
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ use crate::intrinsics;
/// Otherwise, consider using the [`unreachable!`] macro, which does not allow
/// optimizations but will panic when executed.
///
/// [`unreachable!`]: ../macro.unreachable.html
///
/// # Example
///
@@ -61,7 +60,7 @@ pub const unsafe fn unreachable_unchecked() -> ! {
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
/// do anything at all.
///
/// [`core::sync::atomic::spin_loop_hint`]: ../sync/atomic/fn.spin_loop_hint.html
/// [`core::sync::atomic::spin_loop_hint`]: crate::sync::atomic::spin_loop_hint
#[inline]
#[unstable(feature = "renamed_spin_loop", issue = "55002")]
pub fn spin_loop() {
1 change: 1 addition & 0 deletions library/core/src/iter/traits/collect.rs
Original file line number Diff line number Diff line change
@@ -235,6 +235,7 @@ pub trait IntoIterator {
/// assert_eq!(Some(3), iter.next());
/// assert_eq!(None, iter.next());
/// ```
#[cfg_attr(not(bootstrap), lang = "into_iter")]
#[stable(feature = "rust1", since = "1.0.0")]
fn into_iter(self) -> Self::IntoIter;
}
1 change: 1 addition & 0 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
@@ -129,6 +129,7 @@ pub trait Iterator {
/// assert_eq!(None, iter.next());
/// assert_eq!(None, iter.next());
/// ```
#[cfg_attr(not(bootstrap), lang = "next")]
#[stable(feature = "rust1", since = "1.0.0")]
fn next(&mut self) -> Option<Self::Item>;

7 changes: 7 additions & 0 deletions library/core/src/ops/range.rs
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ use crate::hash::Hash;
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
#[cfg_attr(not(bootstrap), lang = "RangeFull")]
#[doc(alias = "..")]
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
@@ -70,6 +71,7 @@ impl fmt::Debug for RangeFull {
/// assert_eq!(arr[1.. 3], [ 1,2 ]); // Range
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
/// ```
#[cfg_attr(not(bootstrap), lang = "Range")]
#[doc(alias = "..")]
#[derive(Clone, Default, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")]
@@ -178,6 +180,7 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
/// ```
///
/// [`Iterator`]: ../iter/trait.IntoIterator.html
#[cfg_attr(not(bootstrap), lang = "RangeFrom")]
#[doc(alias = "..")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")]
@@ -260,6 +263,7 @@ impl<Idx: PartialOrd<Idx>> RangeFrom<Idx> {
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
#[cfg_attr(not(bootstrap), lang = "RangeTo")]
#[doc(alias = "..")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
@@ -328,6 +332,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
/// assert_eq!(arr[1.. 3], [ 1,2 ]);
/// assert_eq!(arr[1..=3], [ 1,2,3 ]); // RangeInclusive
/// ```
#[cfg_attr(not(bootstrap), lang = "RangeInclusive")]
#[doc(alias = "..=")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "inclusive_range", since = "1.26.0")]
@@ -359,6 +364,7 @@ impl<Idx> RangeInclusive<Idx> {
///
/// assert_eq!(3..=5, RangeInclusive::new(3, 5));
/// ```
#[cfg_attr(not(bootstrap), lang = "range_inclusive_new")]
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline]
#[rustc_promotable]
@@ -555,6 +561,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
#[cfg_attr(not(bootstrap), lang = "RangeToInclusive")]
#[doc(alias = "..=")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "inclusive_range", since = "1.26.0")]
3 changes: 3 additions & 0 deletions library/core/src/ops/try.rs
Original file line number Diff line number Diff line change
@@ -43,16 +43,19 @@ pub trait Try {
/// in the return type of the enclosing scope (which must itself implement
/// `Try`). Specifically, the value `X::from_error(From::from(e))`
/// is returned, where `X` is the return type of the enclosing function.
#[cfg_attr(not(bootstrap), lang = "into_result")]
#[unstable(feature = "try_trait", issue = "42327")]
fn into_result(self) -> Result<Self::Ok, Self::Error>;

/// Wrap an error value to construct the composite result. For example,
/// `Result::Err(x)` and `Result::from_error(x)` are equivalent.
#[cfg_attr(not(bootstrap), lang = "from_error")]
#[unstable(feature = "try_trait", issue = "42327")]
fn from_error(v: Self::Error) -> Self;

/// Wrap an OK value to construct the composite result. For example,
/// `Result::Ok(x)` and `Result::from_ok(x)` are equivalent.
#[cfg_attr(not(bootstrap), lang = "from_ok")]
#[unstable(feature = "try_trait", issue = "42327")]
fn from_ok(v: Self::Ok) -> Self;
}
2 changes: 2 additions & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
@@ -144,9 +144,11 @@ use crate::{
#[stable(feature = "rust1", since = "1.0.0")]
pub enum Option<T> {
/// No value
#[cfg_attr(not(bootstrap), lang = "None")]
#[stable(feature = "rust1", since = "1.0.0")]
None,
/// Some value `T`
#[cfg_attr(not(bootstrap), lang = "Some")]
#[stable(feature = "rust1", since = "1.0.0")]
Some(#[stable(feature = "rust1", since = "1.0.0")] T),
}
1 change: 1 addition & 0 deletions library/core/src/pin.rs
Original file line number Diff line number Diff line change
@@ -562,6 +562,7 @@ impl<P: Deref> Pin<P> {
/// ```
///
/// [`mem::swap`]: ../../std/mem/fn.swap.html
#[cfg_attr(not(bootstrap), lang = "new_unchecked")]
#[stable(feature = "pin", since = "1.33.0")]
#[inline(always)]
pub unsafe fn new_unchecked(pointer: P) -> Pin<P> {
2 changes: 2 additions & 0 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
@@ -246,10 +246,12 @@ use crate::{convert, fmt};
#[stable(feature = "rust1", since = "1.0.0")]
pub enum Result<T, E> {
/// Contains the success value
#[cfg_attr(not(bootstrap), lang = "Ok")]
#[stable(feature = "rust1", since = "1.0.0")]
Ok(#[stable(feature = "rust1", since = "1.0.0")] T),

/// Contains the error value
#[cfg_attr(not(bootstrap), lang = "Err")]
#[stable(feature = "rust1", since = "1.0.0")]
Err(#[stable(feature = "rust1", since = "1.0.0")] E),
}
2 changes: 2 additions & 0 deletions library/core/src/task/poll.rs
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ use crate::result::Result;
#[stable(feature = "futures_api", since = "1.36.0")]
pub enum Poll<T> {
/// Represents that a value is immediately ready.
#[cfg_attr(not(bootstrap), lang = "Ready")]
#[stable(feature = "futures_api", since = "1.36.0")]
Ready(#[stable(feature = "futures_api", since = "1.36.0")] T),

@@ -18,6 +19,7 @@ pub enum Poll<T> {
/// When a function returns `Pending`, the function *must* also
/// ensure that the current task is scheduled to be awoken when
/// progress can be made.
#[cfg_attr(not(bootstrap), lang = "Pending")]
#[stable(feature = "futures_api", since = "1.36.0")]
Pending,
}
27 changes: 6 additions & 21 deletions library/std/src/sys/windows/ext/ffi.rs
Original file line number Diff line number Diff line change
@@ -30,13 +30,13 @@
//! [`OsString`] is the Rust wrapper for owned strings in the
//! preferred representation of the operating system. On Windows,
//! this struct gets augmented with an implementation of the
//! [`OsStringExt`] trait, which has a [`from_wide`] method. This
//! [`OsStringExt`] trait, which has a [`OsStringExt::from_wide`] method. This
//! lets you create an [`OsString`] from a `&[u16]` slice; presumably
//! you get such a slice out of a `WCHAR` Windows API.
//!
//! Similarly, [`OsStr`] is the Rust wrapper for borrowed strings from
//! preferred representation of the operating system. On Windows, the
//! [`OsStrExt`] trait provides the [`encode_wide`] method, which
//! [`OsStrExt`] trait provides the [`OsStrExt::encode_wide`] method, which
//! outputs an [`EncodeWide`] iterator. You can [`collect`] this
//! iterator, for example, to obtain a `Vec<u16>`; you can later get a
//! pointer to this vector's contents and feed it to Windows APIs.
@@ -47,15 +47,8 @@
//! ill-formed UTF-16.
//!
//! [ill-formed-utf-16]: https://simonsapin.github.io/wtf-8/#ill-formed-utf-16
//! [`OsString`]: ../../../ffi/struct.OsString.html
//! [`OsStr`]: ../../../ffi/struct.OsStr.html
//! [`OsStringExt`]: trait.OsStringExt.html
//! [`OsStrExt`]: trait.OsStrExt.html
//! [`EncodeWide`]: struct.EncodeWide.html
//! [`from_wide`]: trait.OsStringExt.html#tymethod.from_wide
//! [`encode_wide`]: trait.OsStrExt.html#tymethod.encode_wide
//! [`collect`]: ../../../iter/trait.Iterator.html#method.collect
//! [U+FFFD]: ../../../char/constant.REPLACEMENT_CHARACTER.html
//! [`collect`]: crate::iter::Iterator::collect
//! [U+FFFD]: crate::char::REPLACEMENT_CHARACTER

#![stable(feature = "rust1", since = "1.0.0")]

@@ -68,14 +61,12 @@ use crate::sys_common::{AsInner, FromInner};
pub use crate::sys_common::wtf8::EncodeWide;

/// Windows-specific extensions to [`OsString`].
///
/// [`OsString`]: ../../../../std/ffi/struct.OsString.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait OsStringExt {
/// Creates an `OsString` from a potentially ill-formed UTF-16 slice of
/// 16-bit code units.
///
/// This is lossless: calling [`encode_wide`] on the resulting string
/// This is lossless: calling [`OsStrExt::encode_wide`] on the resulting string
/// will always return the original code units.
///
/// # Examples
@@ -89,8 +80,6 @@ pub trait OsStringExt {
///
/// let string = OsString::from_wide(&source[..]);
/// ```
///
/// [`encode_wide`]: ./trait.OsStrExt.html#tymethod.encode_wide
#[stable(feature = "rust1", since = "1.0.0")]
fn from_wide(wide: &[u16]) -> Self;
}
@@ -103,14 +92,12 @@ impl OsStringExt for OsString {
}

/// Windows-specific extensions to [`OsStr`].
///
/// [`OsStr`]: ../../../../std/ffi/struct.OsStr.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait OsStrExt {
/// Re-encodes an `OsStr` as a wide character sequence, i.e., potentially
/// ill-formed UTF-16.
///
/// This is lossless: calling [`OsString::from_wide`] and then
/// This is lossless: calling [`OsStringExt::from_wide`] and then
/// `encode_wide` on the result will yield the original code units.
/// Note that the encoding does not add a final null terminator.
///
@@ -128,8 +115,6 @@ pub trait OsStrExt {
/// let result: Vec<u16> = string.encode_wide().collect();
/// assert_eq!(&source[..], &result[..]);
/// ```
///
/// [`OsString::from_wide`]: ./trait.OsStringExt.html#tymethod.from_wide
#[stable(feature = "rust1", since = "1.0.0")]
fn encode_wide(&self) -> EncodeWide<'_>;
}
11 changes: 2 additions & 9 deletions library/std/src/sys/windows/ext/fs.rs
Original file line number Diff line number Diff line change
@@ -8,9 +8,7 @@ use crate::path::Path;
use crate::sys;
use crate::sys_common::{AsInner, AsInnerMut};

/// Windows-specific extensions to [`File`].
///
/// [`File`]: ../../../fs/struct.File.html
/// Windows-specific extensions to [`fs::File`].
#[stable(feature = "file_offset", since = "1.15.0")]
pub trait FileExt {
/// Seeks to a given position and reads a number of bytes.
@@ -94,8 +92,6 @@ impl FileExt for fs::File {
}

/// Windows-specific extensions to [`fs::OpenOptions`].
///
/// [`fs::OpenOptions`]: ../../../../std/fs/struct.OpenOptions.html
#[stable(feature = "open_options_ext", since = "1.10.0")]
pub trait OpenOptionsExt {
/// Overrides the `dwDesiredAccess` argument to the call to [`CreateFile`]
@@ -295,7 +291,6 @@ impl OpenOptionsExt for OpenOptions {
/// The data members that this trait exposes correspond to the members
/// of the [`BY_HANDLE_FILE_INFORMATION`] structure.
///
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
/// [`BY_HANDLE_FILE_INFORMATION`]:
/// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information
#[stable(feature = "metadata_ext", since = "1.1.0")]
@@ -499,11 +494,9 @@ impl MetadataExt for Metadata {
}
}

/// Windows-specific extensions to [`FileType`].
/// Windows-specific extensions to [`fs::FileType`].
///
/// On Windows, a symbolic link knows whether it is a file or directory.
///
/// [`FileType`]: ../../../../std/fs/struct.FileType.html
#[unstable(feature = "windows_file_type_ext", issue = "none")]
pub trait FileTypeExt {
/// Returns `true` if this file type is a symbolic link that is also a directory.
4 changes: 0 additions & 4 deletions library/std/src/sys/windows/ext/process.rs
Original file line number Diff line number Diff line change
@@ -73,8 +73,6 @@ impl IntoRawHandle for process::ChildStderr {
}

/// Windows-specific extensions to [`process::ExitStatus`].
///
/// [`process::ExitStatus`]: ../../../../std/process/struct.ExitStatus.html
#[stable(feature = "exit_status_from", since = "1.12.0")]
pub trait ExitStatusExt {
/// Creates a new `ExitStatus` from the raw underlying `u32` return value of
@@ -91,8 +89,6 @@ impl ExitStatusExt for process::ExitStatus {
}

/// Windows-specific extensions to the [`process::Command`] builder.
///
/// [`process::Command`]: ../../../../std/process/struct.Command.html
#[stable(feature = "windows_process_extensions", since = "1.16.0")]
pub trait CommandExt {
/// Sets the [process creation flags][1] to be passed to `CreateProcess`.
4 changes: 2 additions & 2 deletions src/ci/docker/scripts/emscripten.sh
Original file line number Diff line number Diff line change
@@ -19,5 +19,5 @@ exit 1

git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
hide_output ./emsdk install 1.38.46-upstream
./emsdk activate 1.38.46-upstream
hide_output ./emsdk install 1.38.47-upstream
./emsdk activate 1.38.47-upstream
Loading