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

Rustup #9881

Merged
merged 54 commits into from
Nov 21, 2022
Merged

Rustup #9881

merged 54 commits into from
Nov 21, 2022

Conversation

flip1995
Copy link
Member

r? @ghost

It took >4 weeks, but I finally got to do the sync 🎉

changelog: none

bors and others added 30 commits October 8, 2022 08:53
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
Filtering spans when emitting json

According to the issue #102902, we shouldn't emit spans which have an empty span and no suggested replacement.
Rollup of 6 pull requests

Successful merges:

 - #102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`)
 - #102922 (Filtering spans when emitting json)
 - #103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use)
 - #103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names)
 - #103260 (Fixup a few tests needing asm support)
 - #103321 (rustdoc: improve appearance of source page navigation bar)

Failed merges:

 - #103209 (Diagnostic derives: allow specifying multiple alternative suggestions)

r? `@ghost`
`@rustbot` modify labels: rollup
update Miri

I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri.

Also I want to add some cross-testing of Miri in x.py.
privacy: Rename "accessibility levels" to "effective visibilities"

And a couple of other naming and comment tweaks.

Related to rust-lang/rust#48054

For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often.
So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
spastorino noticed some silly expressions like `item_id.def_id.def_id`.

This commit renames several `def_id: OwnerId` fields as `owner_id`, so
those expressions become `item_id.owner_id.def_id`.

`item_id.owner_id.local_def_id` would be even clearer, but the use of
`def_id` for values of type `LocalDefId` is *very* widespread, so I left
that alone.
…iler-errors

Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions

Functions in answer:

- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`

This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3

r? `@compiler-errors`
Track where diagnostics were created.

This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`.

For example, the following code...

```rust
struct A;
struct B;

fn main(){
    let _: A = B;
}
```
...now emits the following error message:

```
error[E0308]: mismatched types
 --> src\main.rs:5:16
  |
5 |     let _: A = B;
  |            -   ^ expected struct `A`, found struct `B`
  |            |
  |            expected due to this
-Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31
```
Signed-off-by: Onur Özkan <work@onurozkan.dev>
improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves rust-lang/rust#98832

re-opened from #103581
@bors
Copy link
Collaborator

bors commented Nov 19, 2022

📌 Commit 182fbb8 has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 19, 2022

⌛ Testing commit 182fbb8 with merge d2c53d8...

bors added a commit that referenced this pull request Nov 19, 2022
Rustup

r? `@ghost`

It took >4 weeks, but I finally got to do the sync 🎉

changelog: none
@bors
Copy link
Collaborator

bors commented Nov 19, 2022

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

Further blocked by rust-lang/rust#103660 😭 I try to deal with this tomorrow...

@flip1995 flip1995 added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Nov 19, 2022
…er-errors

Minimal implementation of implicit deref patterns for Strings

cc `@compiler-errors` `@BoxyUwU` rust-lang/lang-team#88 #87121

~~I forgot to add a feature gate, will do so in a minute~~ Done
@bors
Copy link
Collaborator

bors commented Nov 20, 2022

☔ The latest upstream changes (presumably #9870) made this pull request unmergeable. Please resolve the merge conflicts.

@flip1995
Copy link
Member Author

Doing the sync one more time. Closing the tree until it is done (~1h)

@bors treeclosed=1000

@flip1995
Copy link
Member Author

@bors r+ p=1000

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

📌 Commit 5907e91 has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

⌛ Testing commit 5907e91 with merge e9c7e20...

bors added a commit that referenced this pull request Nov 21, 2022
Rustup

r? `@ghost`

It took >4 weeks, but I finally got to do the sync 🎉

changelog: none
@bors
Copy link
Collaborator

bors commented Nov 21, 2022

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

📌 Commit 05b914a has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

⌛ Testing commit 05b914a with merge f4850f7...

@bors
Copy link
Collaborator

bors commented Nov 21, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing f4850f7 to master...

@bors bors merged commit f4850f7 into rust-lang:master Nov 21, 2022
@flip1995 flip1995 deleted the rustup branch November 21, 2022 19:27
@flip1995
Copy link
Member Author

Whoooooooop Whoooooooop 🎉

Comment on lines +255 to +260
let sys_root_env = std::env::var("SYSROOT").ok();
let pass_sysroot_env_if_given = |args: &mut Vec<String>, sys_root_env| {
if let Some(sys_root) = sys_root_env {
args.extend(vec!["--sysroot".into(), sys_root]);
};
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer avoids passing --sysroot twice if it's already present in the arguments (i.e. have_sys_root_arg is missing). @flip1995 @ozkanonur Is that intentional? It's making rust-lang/rust#97443 a little tricky to fix.

(I am not sure this is the actual PR where the change was made, it's been pretty hard to track down through the subtree updates.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implemented intentionally to fix rust-lang/rust#103660 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we need to check if --sysroot presents before this process. Do you want me to fix it ? @jyn514

Copy link
Member Author

@flip1995 flip1995 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ozkanonur The fix is already implemented in #10149 . It's just waiting for my review. (This'll be merged before the sync on Thursday)

Thanks for offering your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work
Projects
None yet
Development

Successfully merging this pull request may close these issues.