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 #73558

Closed
wants to merge 34 commits into from

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

pietroalbini and others added 30 commits June 15, 2020 15:12
In our GitHub Actions setup macOS is too unreliable to gate on it, but
the other builders work fine. This commit splits the macOS builders into
a separate job (called auto-fallible), allowing us to gate on the auto
job without failing due to macOS spurious failures.
This commit normalizes projections which contain opaque types (opaque types
are otherwise linted against, which is would have previously made the
test cases added in this commit fail).

Signed-off-by: David Wood <david@davidtw.co>
We now require that projection candidates are applicable with the
idenitity substs of the trait, rather than allowing predicates that are
only applicable for certain substs.
This was currently only happening due to eager normalization, which
isn't possible if there's specialization or bound variables.
Given `trait X { type U; }` the bound `<Self as X>::U` now lives
on the type, rather than the trait. This is feature gated on
`feature(generic_associated_types)` for now until more testing can
be done.

The also enabled type-generic associated types since we no longer
need "implies bounds".
This patch adds two methods to `Duration`. The first, `Duration::zero`,
provides a `const` constructor for getting an zero-length duration. This
is also what `Default` provides (this was clarified in the docs), though
`default` is not `const`.

The second, `Duration::is_zero`, returns true if a `Duration` spans no
time (i.e., because its components are all zero). Previously, the way to
do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
compare against `Duration::new(0, 0)`, or to use the `u128` method
`as_nanos`, none of which were particularly elegant.
…dation, r=nikomatsakis

Projection bound validation

During selection we use bounds declared on associated types (e.g. `type X: Copy`) to satisfy trait/projection bounds. This would be fine so long as those bounds are checked on any impls/trait objects. For simple cases they are because the bound `Self::X: Copy` gets normalized when we check the impl.

However, for default values with specialization and higher-ranked bounds from GATs or otherwise, we can't normalize when checking the impl, and so we use the bound from the trait to prove that the bound applies to the impl, which is clearly unsound.

This PR makes 2 fixes for this:

1. Requiring that the bounds on the trait apply to a projection type with the corresponding substs, so a bound `for<'a> <Self as X<'a>>::U: Copy` on the trait cannot be used to prove `<T as X<'_>>::U: Copy`.
2. Actually checking that the bounds that we still allow apply to generic/default associated types.

Opening for a crater run.

Closes rust-lang#68641
Closes rust-lang#68642
Closes rust-lang#68643
Closes rust-lang#68644
Closes rust-lang#68645
Closes rust-lang#68656

r? @ghost
…bertodt

core/time: Add Duration methods for zero

This patch adds two methods to `Duration`. The first, `Duration::zero`,
provides a `const` constructor for getting an zero-length duration. This
is also what `Default` provides (this was clarified in the docs), though
`default` is not `const`.

The second, `Duration::is_zero`, returns true if a `Duration` spans no
time (i.e., because its components are all zero). Previously, the way to
do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
compare against `Duration::new(0, 0)`, or to use the `u128` method
`as_nanos`, none of which were particularly elegant.
remove leftover mentions of `skol` and `int` from the compiler

This PR mostly changes `skol` -> `placeholder` and all cases where `int` is used as a type to `i32`.
…in-projections, r=estebank

lint: normalize projections using opaque types

Fixes rust-lang#73251.

This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).
…=petrochenkov

Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs

cc rust-lang#50928

I don't know who is exactly the best person to review this.

r? @petrochenkov
…oli-obk

Remove use of specialization from librustc_arena

This reworks the macro so that specialization, `transmute` and `#[marker]` are not used.

r? @oli-obk
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15)

Pulls in changes from rust-lang#73326.

Closes rust-lang#73286
…ark-Simulacrum

ci: allow gating GHA on everything but macOS

In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures.

cc rust-lang/rust-central-station#848
r? @Mark-Simulacrum
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits

Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`.

Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused rust-lang#72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms.

This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
@Manishearth
Copy link
Member Author

@bors r+ p=8 rollup=never

to run after #73550 finishes

@bors
Copy link
Contributor

bors commented Jun 20, 2020

📌 Commit 14796b9 has been approved by Manishearth

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 20, 2020
@Manishearth Manishearth added the rollup A PR which is a rollup label Jun 20, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 28'
Agent machine name: 'fv-az578'
Current agent version: '2.170.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200614.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200614.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.3)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/b2f18d36-993b-418a-a3fe-4c51bef9178a.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/73558/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/73558/merge:refs/remotes/pull/73558/merge
---
 ---> 31fea614d2f3
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> 4195cadf126d
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 4e90f6b48f05
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> dfa0a356d899
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
.............i...................................................................................... 1900/10368
.................................................................................................... 2000/10368
.......................................i..i......................................................... 2100/10368
.................................................................................................... 2200/10368
.............................iiiii.................................................................. 2300/10368
.................................................................................................... 2500/10368
.................................................................................................... 2600/10368
.................................................................................................... 2700/10368
.................................................................................................... 2800/10368
---
.................................................................................................... 5300/10368
.................................................................................................... 5400/10368
.................i.................................................................................. 5500/10368
...........i........................................................................................ 5600/10368
...............................ii.ii........i...i................................................... 5700/10368
...........................................................................i.......................i 5800/10368
.................................................................................................... 6000/10368
.................................................ii.....................................i........... 6100/10368
.................................................................................................... 6200/10368
.................................................................................................... 6300/10368
.................................................................................................... 6300/10368
.................................................................................................... 6400/10368
............ii...i..ii...........i.................................................................. 6500/10368
.................................................................................................... 6700/10368
.................................................................................................... 6800/10368
...............................................i.ii................................................. 6900/10368
.................................................................................................... 7000/10368
---
.................................................................................................... 8300/10368
.................................................................................................... 8400/10368
...............................................i.................................................... 8500/10368
.................................................................................................... 8600/10368
.iiiiii..iiiiii.i................................................................................... 8700/10368
.................................................................................................... 8900/10368
.................................................................................................... 9000/10368
.................................................................................................... 9100/10368
.................................................................................................... 9200/10368
---
Suite("src/test/codegen") not skipped for "bootstrap::test::Codegen" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 196 tests
iiii......i...............ii.i..........i......................i...........i..i........i........i... 100/196
.i.............i.i.i...iii..iiii....................................iii.................ii......

 finished in 7.014
Suite("src/test/codegen-units") not skipped for "bootstrap::test::CodegenUnits" -- not in ["src/tools/tidy"]
Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 22 tests
iiiiiiiiiiiiiiiiiiiiii

 finished in 0.166
Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 116 tests
iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i...i.......ii.i.ii. 100/116
....iiii.....ii.

 finished in 15.722
Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---

   Doc-tests core

running 2585 tests
......iiiii......................................................................................... 100/2585
.................................................................................................ii. 200/2585
.......................................i............................................................ 400/2585
...............................................................................................i..i. 500/2585
...............................................................................................i..i. 500/2585
.................iiii............................................................................... 600/2585
.................................................................................................... 800/2585
.................................................................................................... 900/2585
.................................................................................................... 1000/2585
.................................................................................................... 1100/2585
---
---- result.rs - result::Result<T, E>::as_deref (line 1157) stdout ----
error[E0658]: use of unstable library feature 'inner_deref'
 --> result.rs:1160:14
  |
6 | assert_eq!(x.as_deref(), y);
  |
  |
  = note: see issue #50264 <***/issues/50264> for more information
  = help: add `#![feature(inner_deref)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'inner_deref'
  --> result.rs:1164:14
   |
   |
10 | assert_eq!(x.as_deref(), y);
   |
   |
   = note: see issue #50264 <***/issues/50264> for more information
   = help: add `#![feature(inner_deref)]` to the crate attributes to enable
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
Couldn't compile the test.
Couldn't compile the test.
---- result.rs - result::Result<T, E>::as_deref_mut (line 1191) stdout ----
error[E0308]: mismatched types
 --> result.rs:1193:40
  |
5 | let y: Result<&mut str, &mut u32> = Ok("HELLO");
  |                                        ^^^^^^^ types differ in mutability
  = note: expected mutable reference `&mut str`
                     found reference `&'static str`

error[E0658]: use of unstable library feature 'inner_deref'
error[E0658]: use of unstable library feature 'inner_deref'
 --> result.rs:1194:14
  |
6 | assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
  |
  |
  = note: see issue #50264 <***/issues/50264> for more information
  = help: add `#![feature(inner_deref)]` to the crate attributes to enable
error[E0308]: mismatched types
 --> result.rs:1197:41
  |
  |
9 | let y: Result<&mut str, &mut u32> = Err(&42);
  |                                         ^^^ types differ in mutability
  = note: expected mutable reference `&mut u32`
                     found reference `&u32`

error[E0658]: use of unstable library feature 'inner_deref'
error[E0658]: use of unstable library feature 'inner_deref'
  --> result.rs:1198:14
   |
10 | assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
   |
   |
   = note: see issue #50264 <***/issues/50264> for more information
   = help: add `#![feature(inner_deref)]` to the crate attributes to enable
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0308, E0658.
For more information about an error, try `rustc --explain E0308`.
---
  local time: Sat Jun 20 20:55:21 UTC 2020
  network time: Sat, 20 Jun 2020 20:55:21 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/73558/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/73558/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3713) (python)
##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@Manishearth Manishearth deleted the rollup-07nwc80 branch June 22, 2020 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.