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 8 pull requests #93932

Closed
wants to merge 26 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 26 commits February 2, 2022 10:33
In Debian and Ubuntu, there are some patches that change the rustc/fonts
directory to a symlink to the system fonts. This triggers a latent bug
in linkchecker, as the DirEntry filetype isn't a dir but later on the
file itself, when opened, is one, triggering an unreachable!() clause.

This patch fixes the situation by using std::fs::metadata, which goes
through symlinks.

I'd have added a test case but `tidy` doesn't seem to like symlinks, and
moreover I'm not sure how Git deals with symlinks on Windows.

Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
- Implement lowering for subtype goals
- Use correct lang item for Generator trait
- Use `lower_into` for lowering `ty::Variance`
This is required to avoid creating large numbers of universes from each
Chalk query, while still having enough universe information for lifetime
errors.
canonicalize_chalk_query -> canonicalize_query_preserving_universes
Revert spurious changes included in PR
Co-authored-by: David Tolnay <dtolnay@gmail.com>
…, r=jackh726

fix ICE when parsing lifetime as function argument

I don't really like this, but we basically need to emit an error instead of just delaying an bug, because there are too many places in the AST that aren't covered by my previous PRs...

cc: rust-lang#93282 (comment)
Add some known GAT bugs as tests

In the spirit of rust-lang/compiler-team#476

These tests are marked as "check-fail", but also commented with "this should pass". This many of the open GAT issues that are accepted bugs.

r? `@nikomatsakis`
Pretty print ItemKind::Use in rustfmt style

This PR backports the formatting for `use` items from https://github.com/dtolnay/prettyplease into rustc_ast_pretty.

Before:

```rust
use core::{cmp::{Eq, Ord, PartialEq, PartialOrd},
    convert::{AsMut, AsRef, From, Into},
    iter::{DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
    IntoIterator, Iterator},
    marker::{Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin
    as U}, ops::{*, Drop, Fn, FnMut, FnOnce}};
```

After:

```rust
use core::{
    cmp::{Eq, Ord, PartialEq, PartialOrd},
    convert::{AsMut, AsRef, From, Into},
    iter::{
        DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
        IntoIterator, Iterator,
    },
    marker::{
        Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin as U,
    },
    ops::{*, Drop, Fn, FnMut, FnOnce},
};
```
…niverses, r=jackh726

Improve chalk integration

- Support subtype bounds in chalk lowering
- Handle universes in canonicalization
- Handle type parameters in chalk responses
- Use `chalk_ir::LifetimeData::Empty` for `ty::ReEmpty`
- Remove `ignore-compare-mode-chalk` for tests that no longer hang (they may still fail or ICE)

This is enough to get a hello world program to compile with `-Zchalk` now. Some of the remaining issues that are needed to get Chalk integration working on larger programs are:

- rust-lang/chalk#234
- rust-lang/chalk#548
- rust-lang/chalk#734
- Generators are handled differently in chalk and rustc

r? ``@jackh726``
…Mark-Simulacrum

linkchecker: fix panic on directory symlinks

In Debian and Ubuntu, there are some patches that change the rustc/fonts
directory to a symlink to the system fonts. This triggers a latent bug
in linkchecker, as the DirEntry filetype isn't a dir but later on the
file itself, when opened, is one, triggering an unreachable!() clause.

This patch fixes the situation by using std::fs::metadata, which goes
through symlinks.

I'd have added a test case but `tidy` doesn't seem to like symlinks, and
moreover I'm not sure how Git deals with symlinks on Windows.

Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
…Mark-Simulacrum

tidy: Extend error code check

We discovered in rust-lang#93845 that the error code tidy check didn't check everything: if you remove an error code from the listing even if it has an explanation, then it should error.

It also allowed me to put back `E0192` in that listing as well.

r? ``@Mark-Simulacrum``
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 12, 2022
@matthiaskrgr

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Feb 12, 2022

📌 Commit 7e3fb2b has been approved by matthiaskrgr

@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 Feb 12, 2022
@bors
Copy link
Contributor

bors commented Feb 12, 2022

⌛ Testing commit 7e3fb2b with merge 776c484d68ff10be633d8bf6b04910ea51ace800...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-nopt failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
1 error: lifetime may not live long enough
-   --> $DIR/issue-55796.rs:18:9
+   --> $DIR/issue-55796.rs:16:9
3    |
4 LL | pub trait Graph<'a> {
5    |                 -- lifetime `'a` defined here

8    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
10 error: lifetime may not live long enough
-   --> $DIR/issue-55796.rs:23:9
+   --> $DIR/issue-55796.rs:21:9
12    |
12    |
13 LL | pub trait Graph<'a> {
14    |                 -- lifetime `'a` defined here

The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796.nll/issue-55796.nll.stderr
To only update this specific test, also pass `--test-args issues/issue-55796.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-55796.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796.nll" "-Zborrowck=mir" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796.nll/auxiliary"
stdout:
Some tests failed in compiletest suite=ui compare_mode=Nll mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

------------------------------------------
stderr:
------------------------------------------
------------------------------------------
error: lifetime may not live long enough
  --> /checkout/src/test/ui/issues/issue-55796.rs:16:9
   |
LL | pub trait Graph<'a> {
   |                 -- lifetime `'a` defined here
...
LL |         Box::new(self.out_edges(u).map(|e| e.target()))
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
error: lifetime may not live long enough
  --> /checkout/src/test/ui/issues/issue-55796.rs:21:9
   |
   |
LL | pub trait Graph<'a> {
   |                 -- lifetime `'a` defined here
...
LL |         Box::new(self.in_edges(u).map(|e| e.target()))
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors


------------------------------------------

@bors
Copy link
Contributor

bors commented Feb 12, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 12, 2022
@matthiaskrgr matthiaskrgr deleted the rollup-c2tkeoc branch February 13, 2022 00:53
@rust-lang rust-lang deleted a comment from bors Mar 3, 2022
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-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.