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 9 pull requests #73563

Merged
merged 52 commits into from
Jun 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8bc3122
ci: allow gating gha on everything but macOS
pietroalbini Jun 15, 2020
2ea3864
Remove use of specialization from librustc_arena
matthewjasper Jun 15, 2020
1b92d59
Explain unused macro param
matthewjasper Jun 16, 2020
936b6bf
Move `trait_map` into `hir::Crate`
marmeladema Jun 12, 2020
a98f35f
Remove `NodeId` to `HirId` conversion APIs
marmeladema Jun 12, 2020
6a0f1af
Remove `HirId` to `NodeId` conversion APIs
marmeladema Jun 12, 2020
94817e3
Pre-compute `hir_id_to_def_id` mapping
marmeladema Jun 12, 2020
5155518
Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_…
ldm0 Jun 20, 2020
ef68bf3
Try to suggest dereferences when trait selection failed.
ldm0 Jun 20, 2020
2e781dd
lint: normalize projections using opaque types
davidtwco Jun 12, 2020
29272fc
Correctly handle binders inside trait predicates
matthewjasper May 30, 2020
04e589c
Consider fewer predicates for projection candidates
matthewjasper May 30, 2020
f1e0710
Prevent incorrect help message for dereference suggestion
ldm0 Jun 20, 2020
13104ef
Pre-compute `def_id_to_hir_id` table
marmeladema Jun 12, 2020
d660dbc
Check associated type satisfy their bounds
matthewjasper May 30, 2020
9818bc0
Don't set STILL_FURTHER_SPECIALIZABLE for regions/bound variables
matthewjasper Jun 10, 2020
db4826d
Move bounds on associated types to the type
matthewjasper Jun 11, 2020
5e8c9f4
Explain what the substs we're creating are
matthewjasper Jun 13, 2020
3ff5879
core/time: Add Duration methods for zero
jonhoo May 30, 2020
ad7fd62
Doctests need feature
jonhoo May 30, 2020
386114b
Revise according to review
jonhoo Jun 20, 2020
c883fa4
Allow multiple `asm!` options
camelid Jun 11, 2020
e614116
Update tests
camelid Jun 11, 2020
1d2acdf
Use `Vec<Span>` instead of `Option<Vec<Span>>`
camelid Jun 12, 2020
27cc7c7
Clean up
camelid Jun 12, 2020
820bba1
Add codegen test for multiple `asm!` options
camelid Jun 12, 2020
2be403c
Warn on duplicate `asm!` options
camelid Jun 14, 2020
7aaadb6
Add UI test for duplicate `asm!` options warning
camelid Jun 14, 2020
b94b7e7
Make warning an error; use help instead of suggestion; clean up code
camelid Jun 14, 2020
ac54265
Use `span_label`
camelid Jun 15, 2020
7c5b66f
Update duplicate options test
camelid Jun 15, 2020
c7da50d
Get option name from symbol instead of snippet
camelid Jun 15, 2020
e8be797
Use bitflags function instead of custom one
camelid Jun 15, 2020
b00b1a4
Use `span_suggestion` instead of `span_label`
camelid Jun 16, 2020
f4dfc61
Add more to duplicate options test
camelid Jun 16, 2020
4ba6697
Make suggestion machine-applicable
camelid Jun 16, 2020
8fe6710
Create a separate, tool-only suggestion for the comma
camelid Jun 16, 2020
db9d376
Add documentation
camelid Jun 17, 2020
58f812b
Use `p.token` instead of `p.look_ahead()`
camelid Jun 18, 2020
8d80cc5
Fix duplicate options error
camelid Jun 20, 2020
c31785a
Run `./x.py fmt`
camelid Jun 20, 2020
5a8e915
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)
ehuss Jun 16, 2020
bfb0e8d
Fix broken inner_deref doc tests.
ehuss Jun 20, 2020
a1404a9
Rollup merge of #72456 - ldm0:dereftrait, r=estebank
Manishearth Jun 20, 2020
1a171d0
Rollup merge of #72788 - matthewjasper:projection-bound-validation, r…
Manishearth Jun 20, 2020
c47550f
Rollup merge of #72790 - jonhoo:duration-is-zero, r=LukasKalbertodt
Manishearth Jun 20, 2020
45d6aef
Rollup merge of #73227 - camelid:multiple-asm-options, r=Amanieu
Manishearth Jun 20, 2020
9003087
Rollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projec…
Manishearth Jun 20, 2020
0a8fd43
Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petroche…
Manishearth Jun 20, 2020
a876a5a
Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk
Manishearth Jun 20, 2020
9a82736
Rollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum
Manishearth Jun 20, 2020
929f032
Rollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simul…
Manishearth Jun 20, 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
158 changes: 129 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -373,35 +373,6 @@ jobs:
env:
DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
os: ubuntu-latest-xl
- name: dist-x86_64-apple
env:
SCRIPT: "./x.py dist"
RUST_CONFIGURE_ARGS: "--target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
DIST_REQUIRE_ALL_TOOLS: 1
os: macos-latest
- name: dist-x86_64-apple-alt
env:
SCRIPT: "./x.py dist"
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
- name: x86_64-apple
env:
SCRIPT: "./x.py test"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
- name: x86_64-msvc-1
env:
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
Expand Down Expand Up @@ -584,6 +555,135 @@ jobs:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
auto-fallible:
name: auto-fallible
env:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
strategy:
matrix:
include:
- name: dist-x86_64-apple
env:
SCRIPT: "./x.py dist"
RUST_CONFIGURE_ARGS: "--target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
DIST_REQUIRE_ALL_TOOLS: 1
os: macos-latest
- name: dist-x86_64-apple-alt
env:
SCRIPT: "./x.py dist"
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
- name: x86_64-apple
env:
SCRIPT: "./x.py test"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
os: macos-latest
timeout-minutes: 600
runs-on: "${{ matrix.os }}"
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
shell: bash
- name: checkout the source code
uses: actions/checkout@v1
with:
fetch-depth: 2
- name: configure GitHub Actions to kill the build when outdated
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
if: success() && !env.SKIP_JOB
- name: decide whether to skip this job
run: src/ci/scripts/should-skip-this.sh
if: success() && !env.SKIP_JOB
- name: collect CPU statistics
run: src/ci/scripts/collect-cpu-stats.sh
if: success() && !env.SKIP_JOB
- name: show the current environment
run: src/ci/scripts/dump-environment.sh
if: success() && !env.SKIP_JOB
- name: install awscli
run: src/ci/scripts/install-awscli.sh
if: success() && !env.SKIP_JOB
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
- name: install WIX
run: src/ci/scripts/install-wix.sh
if: success() && !env.SKIP_JOB
- name: install InnoSetup
run: src/ci/scripts/install-innosetup.sh
if: success() && !env.SKIP_JOB
- name: ensure the build happens on a partition with enough space
run: src/ci/scripts/symlink-build-dir.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: install MSYS2
run: src/ci/scripts/install-msys2.sh
if: success() && !env.SKIP_JOB
- name: install MinGW
run: src/ci/scripts/install-mingw.sh
if: success() && !env.SKIP_JOB
- name: install ninja
run: src/ci/scripts/install-ninja.sh
if: success() && !env.SKIP_JOB
- name: enable ipv6 on Docker
run: src/ci/scripts/enable-docker-ipv6.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: checkout submodules
run: src/ci/scripts/checkout-submodules.sh
if: success() && !env.SKIP_JOB
- name: ensure line endings are correct
run: src/ci/scripts/verify-line-endings.sh
if: success() && !env.SKIP_JOB
- name: run the build
run: src/ci/scripts/run-build-from-ci.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
if: success() && !env.SKIP_JOB
- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
master:
name: master
runs-on: ubuntu-latest
Expand Down
81 changes: 45 additions & 36 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,42 +419,6 @@ jobs:
DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
<<: *job-linux-xl

####################
# macOS Builders #
####################

- name: dist-x86_64-apple
env:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
DIST_REQUIRE_ALL_TOOLS: 1
<<: *job-macos-xl

- name: dist-x86_64-apple-alt
env:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
<<: *job-macos-xl

- name: x86_64-apple
env:
SCRIPT: ./x.py test
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
<<: *job-macos-xl

######################
# Windows Builders #
######################
Expand Down Expand Up @@ -600,6 +564,51 @@ jobs:
SCRIPT: python x.py dist
<<: *job-windows-xl

auto-fallible:
<<: *base-ci-job
name: auto-fallible
env:
<<: [*shared-ci-variables, *prod-variables]
if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
strategy:
matrix:
include:
####################
# macOS Builders #
####################

- name: dist-x86_64-apple
env:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
DIST_REQUIRE_ALL_TOOLS: 1
<<: *job-macos-xl

- name: dist-x86_64-apple-alt
env:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
<<: *job-macos-xl

- name: x86_64-apple
env:
SCRIPT: ./x.py test
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
<<: *job-macos-xl

master:
name: master
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ impl<T: Deref, E> Result<T, E> {
/// # Examples
///
/// ```
/// #![feature(inner_deref)]
/// let x: Result<String, u32> = Ok("hello".to_string());
/// let y: Result<&str, &u32> = Ok("hello");
/// assert_eq!(x.as_deref(), y);
Expand Down Expand Up @@ -1189,12 +1190,15 @@ impl<T: DerefMut, E> Result<T, E> {
/// # Examples
///
/// ```
/// #![feature(inner_deref)]
/// let mut s = "HELLO".to_string();
/// let mut x: Result<String, u32> = Ok("hello".to_string());
/// let y: Result<&mut str, &mut u32> = Ok("HELLO");
/// let y: Result<&mut str, &mut u32> = Ok(&mut s);
/// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
///
/// let mut i = 42;
/// let mut x: Result<String, u32> = Err(42);
/// let y: Result<&mut str, &mut u32> = Err(&42);
/// let y: Result<&mut str, &mut u32> = Err(&mut i);
/// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
/// ```
pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> {
Expand Down
43 changes: 42 additions & 1 deletion src/libcore/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const MICROS_PER_SEC: u64 = 1_000_000;
/// the number of nanoseconds.
///
/// `Duration`s implement many common traits, including [`Add`], [`Sub`], and other
/// [`ops`] traits.
/// [`ops`] traits. It implements `Default` by returning a zero-length `Duration`.
///
/// [`Add`]: ../../std/ops/trait.Add.html
/// [`Sub`]: ../../std/ops/trait.Sub.html
Expand Down Expand Up @@ -138,6 +138,24 @@ impl Duration {
Duration { secs, nanos }
}

/// Creates a new `Duration` that spans no time.
///
/// # Examples
///
/// ```
/// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// let duration = Duration::zero();
/// assert!(duration.is_zero());
/// assert_eq!(duration.as_nanos(), 0);
/// ```
#[unstable(feature = "duration_zero", issue = "73544")]
#[inline]
pub const fn zero() -> Duration {
Duration { secs: 0, nanos: 0 }
}

/// Creates a new `Duration` from the specified number of whole seconds.
///
/// # Examples
Expand Down Expand Up @@ -223,6 +241,29 @@ impl Duration {
}
}

/// Returns true if this `Duration` spans no time.
///
/// # Examples
///
/// ```
/// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// assert!(Duration::zero().is_zero());
/// assert!(Duration::new(0, 0).is_zero());
/// assert!(Duration::from_nanos(0).is_zero());
/// assert!(Duration::from_secs(0).is_zero());
///
/// assert!(!Duration::new(1, 1).is_zero());
/// assert!(!Duration::from_nanos(1).is_zero());
/// assert!(!Duration::from_secs(1).is_zero());
/// ```
#[unstable(feature = "duration_zero", issue = "73544")]
#[inline]
pub const fn is_zero(&self) -> bool {
self.secs == 0 && self.nanos == 0
}

/// Returns the number of _whole_ seconds contained by this `Duration`.
///
/// The returned value does not include the fractional (nanosecond) part of the
Expand Down
Loading