Skip to content

Commit 7058471

Browse files
committed
Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth
Rollup of 9 pull requests Successful merges: - #72456 (Try to suggest dereferences on trait selection failed) - #72788 (Projection bound validation) - #72790 (core/time: Add Duration methods for zero) - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options) - #73287 (lint: normalize projections using opaque types) - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs) - #73378 (Remove use of specialization from librustc_arena) - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15)) - #73443 (ci: allow gating GHA on everything but macOS) Failed merges: r? @ghost
2 parents f455e46 + 929f032 commit 7058471

File tree

136 files changed

+2864
-995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+2864
-995
lines changed

Diff for: .github/workflows/ci.yml

+129-29
Original file line numberDiff line numberDiff line change
@@ -369,35 +369,6 @@ jobs:
369369
env:
370370
DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
371371
os: ubuntu-latest-xl
372-
- name: dist-x86_64-apple
373-
env:
374-
SCRIPT: "./x.py dist"
375-
RUST_CONFIGURE_ARGS: "--target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc"
376-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
377-
MACOSX_DEPLOYMENT_TARGET: 10.7
378-
NO_LLVM_ASSERTIONS: 1
379-
NO_DEBUG_ASSERTIONS: 1
380-
DIST_REQUIRE_ALL_TOOLS: 1
381-
os: macos-latest
382-
- name: dist-x86_64-apple-alt
383-
env:
384-
SCRIPT: "./x.py dist"
385-
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc"
386-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
387-
MACOSX_DEPLOYMENT_TARGET: 10.7
388-
NO_LLVM_ASSERTIONS: 1
389-
NO_DEBUG_ASSERTIONS: 1
390-
os: macos-latest
391-
- name: x86_64-apple
392-
env:
393-
SCRIPT: "./x.py test"
394-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
395-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
396-
MACOSX_DEPLOYMENT_TARGET: 10.8
397-
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
398-
NO_LLVM_ASSERTIONS: 1
399-
NO_DEBUG_ASSERTIONS: 1
400-
os: macos-latest
401372
- name: x86_64-msvc-1
402373
env:
403374
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
@@ -580,6 +551,135 @@ jobs:
580551
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
581552
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
582553
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
554+
auto-fallible:
555+
name: auto-fallible
556+
env:
557+
CI_JOB_NAME: "${{ matrix.name }}"
558+
SCCACHE_BUCKET: rust-lang-gha-caches
559+
DEPLOY_BUCKET: rust-lang-gha
560+
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
561+
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
562+
TOOLSTATE_PUBLISH: 1
563+
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
564+
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
565+
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
566+
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
567+
strategy:
568+
matrix:
569+
include:
570+
- name: dist-x86_64-apple
571+
env:
572+
SCRIPT: "./x.py dist"
573+
RUST_CONFIGURE_ARGS: "--target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc"
574+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
575+
MACOSX_DEPLOYMENT_TARGET: 10.7
576+
NO_LLVM_ASSERTIONS: 1
577+
NO_DEBUG_ASSERTIONS: 1
578+
DIST_REQUIRE_ALL_TOOLS: 1
579+
os: macos-latest
580+
- name: dist-x86_64-apple-alt
581+
env:
582+
SCRIPT: "./x.py dist"
583+
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc"
584+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
585+
MACOSX_DEPLOYMENT_TARGET: 10.7
586+
NO_LLVM_ASSERTIONS: 1
587+
NO_DEBUG_ASSERTIONS: 1
588+
os: macos-latest
589+
- name: x86_64-apple
590+
env:
591+
SCRIPT: "./x.py test"
592+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc"
593+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
594+
MACOSX_DEPLOYMENT_TARGET: 10.8
595+
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
596+
NO_LLVM_ASSERTIONS: 1
597+
NO_DEBUG_ASSERTIONS: 1
598+
os: macos-latest
599+
timeout-minutes: 600
600+
runs-on: "${{ matrix.os }}"
601+
steps:
602+
- name: disable git crlf conversion
603+
run: git config --global core.autocrlf false
604+
shell: bash
605+
- name: checkout the source code
606+
uses: actions/checkout@v1
607+
with:
608+
fetch-depth: 2
609+
- name: configure GitHub Actions to kill the build when outdated
610+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
611+
with:
612+
github_token: "${{ secrets.github_token }}"
613+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
614+
- name: add extra environment variables
615+
run: src/ci/scripts/setup-environment.sh
616+
env:
617+
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
618+
if: success() && !env.SKIP_JOB
619+
- name: decide whether to skip this job
620+
run: src/ci/scripts/should-skip-this.sh
621+
if: success() && !env.SKIP_JOB
622+
- name: collect CPU statistics
623+
run: src/ci/scripts/collect-cpu-stats.sh
624+
if: success() && !env.SKIP_JOB
625+
- name: show the current environment
626+
run: src/ci/scripts/dump-environment.sh
627+
if: success() && !env.SKIP_JOB
628+
- name: install awscli
629+
run: src/ci/scripts/install-awscli.sh
630+
if: success() && !env.SKIP_JOB
631+
- name: install sccache
632+
run: src/ci/scripts/install-sccache.sh
633+
if: success() && !env.SKIP_JOB
634+
- name: install clang
635+
run: src/ci/scripts/install-clang.sh
636+
if: success() && !env.SKIP_JOB
637+
- name: install WIX
638+
run: src/ci/scripts/install-wix.sh
639+
if: success() && !env.SKIP_JOB
640+
- name: install InnoSetup
641+
run: src/ci/scripts/install-innosetup.sh
642+
if: success() && !env.SKIP_JOB
643+
- name: ensure the build happens on a partition with enough space
644+
run: src/ci/scripts/symlink-build-dir.sh
645+
if: success() && !env.SKIP_JOB
646+
- name: disable git crlf conversion
647+
run: src/ci/scripts/disable-git-crlf-conversion.sh
648+
if: success() && !env.SKIP_JOB
649+
- name: install MSYS2
650+
run: src/ci/scripts/install-msys2.sh
651+
if: success() && !env.SKIP_JOB
652+
- name: install MinGW
653+
run: src/ci/scripts/install-mingw.sh
654+
if: success() && !env.SKIP_JOB
655+
- name: install ninja
656+
run: src/ci/scripts/install-ninja.sh
657+
if: success() && !env.SKIP_JOB
658+
- name: enable ipv6 on Docker
659+
run: src/ci/scripts/enable-docker-ipv6.sh
660+
if: success() && !env.SKIP_JOB
661+
- name: disable git crlf conversion
662+
run: src/ci/scripts/disable-git-crlf-conversion.sh
663+
if: success() && !env.SKIP_JOB
664+
- name: checkout submodules
665+
run: src/ci/scripts/checkout-submodules.sh
666+
if: success() && !env.SKIP_JOB
667+
- name: ensure line endings are correct
668+
run: src/ci/scripts/verify-line-endings.sh
669+
if: success() && !env.SKIP_JOB
670+
- name: run the build
671+
run: src/ci/scripts/run-build-from-ci.sh
672+
env:
673+
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
674+
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
675+
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
676+
if: success() && !env.SKIP_JOB
677+
- name: upload artifacts to S3
678+
run: src/ci/scripts/upload-artifacts.sh
679+
env:
680+
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
681+
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
682+
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
583683
master:
584684
name: master
585685
runs-on: ubuntu-latest

Diff for: src/ci/github-actions/ci.yml

+45-36
Original file line numberDiff line numberDiff line change
@@ -414,42 +414,6 @@ jobs:
414414
DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
415415
<<: *job-linux-xl
416416

417-
####################
418-
# macOS Builders #
419-
####################
420-
421-
- name: dist-x86_64-apple
422-
env:
423-
SCRIPT: ./x.py dist
424-
RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
425-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
426-
MACOSX_DEPLOYMENT_TARGET: 10.7
427-
NO_LLVM_ASSERTIONS: 1
428-
NO_DEBUG_ASSERTIONS: 1
429-
DIST_REQUIRE_ALL_TOOLS: 1
430-
<<: *job-macos-xl
431-
432-
- name: dist-x86_64-apple-alt
433-
env:
434-
SCRIPT: ./x.py dist
435-
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc
436-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
437-
MACOSX_DEPLOYMENT_TARGET: 10.7
438-
NO_LLVM_ASSERTIONS: 1
439-
NO_DEBUG_ASSERTIONS: 1
440-
<<: *job-macos-xl
441-
442-
- name: x86_64-apple
443-
env:
444-
SCRIPT: ./x.py test
445-
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
446-
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
447-
MACOSX_DEPLOYMENT_TARGET: 10.8
448-
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
449-
NO_LLVM_ASSERTIONS: 1
450-
NO_DEBUG_ASSERTIONS: 1
451-
<<: *job-macos-xl
452-
453417
######################
454418
# Windows Builders #
455419
######################
@@ -595,6 +559,51 @@ jobs:
595559
SCRIPT: python x.py dist
596560
<<: *job-windows-xl
597561

562+
auto-fallible:
563+
<<: *base-ci-job
564+
name: auto-fallible
565+
env:
566+
<<: [*shared-ci-variables, *prod-variables]
567+
if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
568+
strategy:
569+
matrix:
570+
include:
571+
####################
572+
# macOS Builders #
573+
####################
574+
575+
- name: dist-x86_64-apple
576+
env:
577+
SCRIPT: ./x.py dist
578+
RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
579+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
580+
MACOSX_DEPLOYMENT_TARGET: 10.7
581+
NO_LLVM_ASSERTIONS: 1
582+
NO_DEBUG_ASSERTIONS: 1
583+
DIST_REQUIRE_ALL_TOOLS: 1
584+
<<: *job-macos-xl
585+
586+
- name: dist-x86_64-apple-alt
587+
env:
588+
SCRIPT: ./x.py dist
589+
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc
590+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
591+
MACOSX_DEPLOYMENT_TARGET: 10.7
592+
NO_LLVM_ASSERTIONS: 1
593+
NO_DEBUG_ASSERTIONS: 1
594+
<<: *job-macos-xl
595+
596+
- name: x86_64-apple
597+
env:
598+
SCRIPT: ./x.py test
599+
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
600+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
601+
MACOSX_DEPLOYMENT_TARGET: 10.8
602+
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
603+
NO_LLVM_ASSERTIONS: 1
604+
NO_DEBUG_ASSERTIONS: 1
605+
<<: *job-macos-xl
606+
598607
master:
599608
name: master
600609
runs-on: ubuntu-latest

Diff for: src/libcore/result.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ impl<T: Deref, E> Result<T, E> {
11551155
/// # Examples
11561156
///
11571157
/// ```
1158+
/// #![feature(inner_deref)]
11581159
/// let x: Result<String, u32> = Ok("hello".to_string());
11591160
/// let y: Result<&str, &u32> = Ok("hello");
11601161
/// assert_eq!(x.as_deref(), y);
@@ -1189,12 +1190,15 @@ impl<T: DerefMut, E> Result<T, E> {
11891190
/// # Examples
11901191
///
11911192
/// ```
1193+
/// #![feature(inner_deref)]
1194+
/// let mut s = "HELLO".to_string();
11921195
/// let mut x: Result<String, u32> = Ok("hello".to_string());
1193-
/// let y: Result<&mut str, &mut u32> = Ok("HELLO");
1196+
/// let y: Result<&mut str, &mut u32> = Ok(&mut s);
11941197
/// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
11951198
///
1199+
/// let mut i = 42;
11961200
/// let mut x: Result<String, u32> = Err(42);
1197-
/// let y: Result<&mut str, &mut u32> = Err(&42);
1201+
/// let y: Result<&mut str, &mut u32> = Err(&mut i);
11981202
/// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
11991203
/// ```
12001204
pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> {

Diff for: src/libcore/time.rs

+42-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const MICROS_PER_SEC: u64 = 1_000_000;
3131
/// the number of nanoseconds.
3232
///
3333
/// `Duration`s implement many common traits, including [`Add`], [`Sub`], and other
34-
/// [`ops`] traits.
34+
/// [`ops`] traits. It implements `Default` by returning a zero-length `Duration`.
3535
///
3636
/// [`Add`]: ../../std/ops/trait.Add.html
3737
/// [`Sub`]: ../../std/ops/trait.Sub.html
@@ -138,6 +138,24 @@ impl Duration {
138138
Duration { secs, nanos }
139139
}
140140

141+
/// Creates a new `Duration` that spans no time.
142+
///
143+
/// # Examples
144+
///
145+
/// ```
146+
/// #![feature(duration_zero)]
147+
/// use std::time::Duration;
148+
///
149+
/// let duration = Duration::zero();
150+
/// assert!(duration.is_zero());
151+
/// assert_eq!(duration.as_nanos(), 0);
152+
/// ```
153+
#[unstable(feature = "duration_zero", issue = "73544")]
154+
#[inline]
155+
pub const fn zero() -> Duration {
156+
Duration { secs: 0, nanos: 0 }
157+
}
158+
141159
/// Creates a new `Duration` from the specified number of whole seconds.
142160
///
143161
/// # Examples
@@ -223,6 +241,29 @@ impl Duration {
223241
}
224242
}
225243

244+
/// Returns true if this `Duration` spans no time.
245+
///
246+
/// # Examples
247+
///
248+
/// ```
249+
/// #![feature(duration_zero)]
250+
/// use std::time::Duration;
251+
///
252+
/// assert!(Duration::zero().is_zero());
253+
/// assert!(Duration::new(0, 0).is_zero());
254+
/// assert!(Duration::from_nanos(0).is_zero());
255+
/// assert!(Duration::from_secs(0).is_zero());
256+
///
257+
/// assert!(!Duration::new(1, 1).is_zero());
258+
/// assert!(!Duration::from_nanos(1).is_zero());
259+
/// assert!(!Duration::from_secs(1).is_zero());
260+
/// ```
261+
#[unstable(feature = "duration_zero", issue = "73544")]
262+
#[inline]
263+
pub const fn is_zero(&self) -> bool {
264+
self.secs == 0 && self.nanos == 0
265+
}
266+
226267
/// Returns the number of _whole_ seconds contained by this `Duration`.
227268
///
228269
/// The returned value does not include the fractional (nanosecond) part of the

0 commit comments

Comments
 (0)