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

Closed
wants to merge 15 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

ecstatic-morse and others added 15 commits May 23, 2020 11:11
Use raw pointers to avoid making any assertions about the data field.
Fixes rust-lang#72590

With PR rust-lang#70551, observing a `ty::Error` guarantees that compilation is
going to fail. Therefore, there are no soundness impliciations to
continuing on when we encounter a `ty::Error` - we can only affect
whether or not additional error messags are emitted.

By not bailing out, we avoid incorrectly determining that types are
`!Sized` when a type error is present, which allows us to avoid emitting
additional spurious error messages.

The original comment mentioned this code being shared by coherence -
howver, this change resulted in no diagnostic changes in any of the
existing tests.
confusing diagnostics, issue rust-lang#72253

add test for confusing error message, issue-72253


remove is_multiline check, refactor to self.expect(&token:Semi)


update issue-72253 tests


return Ok
Fix confusing error message for comma typo in multiline statement

Fixes rust-lang#72253.  Expands on the issue with a colon typo check.

r? @estebank

cc @ehuss
…matsakis

Make `PolyTraitRef::self_ty` return `Binder<Ty>`

This came up during review of rust-lang#71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of rust-lang#72507.
Resolve UB in Arc/Weak interaction (2)

Use raw pointers to avoid making any assertions about the data field.

Follow up from rust-lang#72479, see that PR for more detail on the motivation.

@RalfJung I was able to avoid a lot of the changes to `Weak`, by making a helper type (`WeakInner`) - because of auto-deref and because the fields have the same name, the rest of the code continues to compile.
…=nikomatsakis

Add test for old compiler ICE when using `Borrow`

The original issue was caused by implementing `Borrow` on a local type and using the tokio-reactor crate which had this impl: https://github.com/tokio-rs/tokio/blob/tokio-0.1.4/tokio-reactor/src/poll_evented.rs#L547-L577

This causes an ICE on Rust 1.27.0:

```console
$ RUSTUP_TOOLCHAIN=1.27.0 rustc src/test/ui/issues/issue-50687-ice-on-borrow.rs
error: internal compiler error: librustc/traits/structural_impls.rs:180: impossible case reached

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.27.0 (3eda71b 2018-06-19) running on x86_64-apple-darwin
```

Closes rust-lang#50687
…=nikomatsakis

Don't bail out of trait selection when predicate references an error

Fixes rust-lang#72590

With PR rust-lang#70551, observing a `ty::Error` guarantees that compilation is
going to fail. Therefore, there are no soundness impliciations to
continuing on when we encounter a `ty::Error` - we can only affect
whether or not additional error messags are emitted.

By not bailing out, we avoid incorrectly determining that types are
`!Sized` when a type error is present, which allows us to avoid emitting
additional spurious error messages.

The original comment mentioned this code being shared by coherence -
howver, this change resulted in no diagnostic changes in any of the
existing tests.
…olnay

Add remark regarding DoubleEndedIterator

While reviewing rust-itertools/itertools@14293bd#diff-2c16d2ada06ad2fd1fc754679646d471, I realized that a `DoubleEndedIterator` may yield different elements depending on whether it is traversed forwards or backwards. (Not only the *order*, but possibly also the yielded values.)

I found this remarkable, but could not find anything in the current docs, so I thought it may be worth mentioning this explicitly.

Unfortunately, I could not test these changes locally (`rustdoc` complains about `unresolved import`). Sorry if this causes headache.

If I should change something, please let me know. If it seems too trivial, feel free to just close this PR.
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 27, 2020

📌 Commit 1ef8491 has been approved by Dylan-DPC

@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 May 27, 2020
@bors
Copy link
Contributor

bors commented May 27, 2020

⌛ Testing commit 1ef8491 with merge 19d65819bd2f989e040f609188b6495827e3eac3...

@Dylan-DPC-zz
Copy link
Author

@bors r-

failed in CI

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 27, 2020
@rust-highfive
Copy link
Collaborator

The job mingw-check 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 mingw-check
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 6'
Agent machine name: 'fv-az578'
Current agent version: '2.168.2'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200517.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200517.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.2)
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/97cfb72c-4045-4553-8ccf-2d6774a3707d.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72638/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/72638/merge:refs/remotes/pull/72638/merge
---
 ---> 3adb0605cc65
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 28dbc326cb7f
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 537a01811900
Successfully built 537a01811900
Successfully tagged rust-ci:latest
Built container sha256:537a018119009dc218456238dec90b5530050db1e2a1e166550c218003f6159d
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking chalk-rust-ir v0.10.0
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
    Checking rustc_symbol_mangling v0.0.0 (/checkout/src/librustc_symbol_mangling)
    Checking rustc_save_analysis v0.0.0 (/checkout/src/librustc_save_analysis)
    Checking rustc_trait_selection v0.0.0 (/checkout/src/librustc_trait_selection)
    Checking rustc_resolve v0.0.0 (/checkout/src/librustc_resolve)
error[E0609]: no field `kind` on type `rustc_middle::ty::Binder<&rustc_middle::ty::TyS<'_>>`
    |
717 |                 if let ty::Ref(_, inner_ty, _) = suggested_ty.kind {
    |                                                               ^^^^ unknown field


error[E0308]: mismatched types
   --> src/librustc_trait_selection/traits/error_reporting/suggestions.rs:718:36
    |
718 |                     suggested_ty = inner_ty;
    |                                    ^^^^^^^^ expected struct `rustc_middle::ty::Binder`, found `&rustc_middle::ty::TyS<'_>`
    |
    = note: expected struct `rustc_middle::ty::Binder<&rustc_middle::ty::TyS<'_>>`
            found reference `&rustc_middle::ty::TyS<'_>`
error[E0308]: mismatched types
   --> src/librustc_trait_selection/traits/error_reporting/suggestions.rs:723:25
    |
723 |                         suggested_ty,
723 |                         suggested_ty,
    |                         ^^^^^^^^^^^^ expected `&rustc_middle::ty::TyS<'_>`, found struct `rustc_middle::ty::Binder`
    |
    = note: expected reference `&rustc_middle::ty::TyS<'_>`
                  found struct `rustc_middle::ty::Binder<&rustc_middle::ty::TyS<'_>>`
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0609.
For more information about an error, try `rustc --explain E0308`.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `rustc_trait_selection`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:04:57
== clock drift check ==
  local time: Wed May 27 01:07:41 UTC 2020
  local time: Wed May 27 01:07:41 UTC 2020
  network time: Wed, 27 May 2020 01:07:41 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72638/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/72638/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3842) (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)

@JohnTitor JohnTitor added the rollup A PR which is a rollup label May 28, 2020
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-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.