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

Sync from rust-lang/rust #12871

Merged
merged 11 commits into from
Jul 25, 2022
Merged

Conversation

fasterthanlime
Copy link
Contributor

This is the first subtree sync PR from rust-lang/rust to rust-lang/rust-analyzer, made by following the instructions at: https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html#performing-the-sync-from-rust-langrust-to-clippy

It includes all the commits that were made in:

(And that were reviewed ahead of time by @Veykril + @lnicola)

fasterthanlime and others added 10 commits July 24, 2022 10:38
- use `path` instead of `paths`
- don't mark rust-analyzer as an optional tool
- print the cargo command that's run in the proc-macro-test build script

  this originally was part of a change to fix `test --stage 0 rust-analyzer`,
  but I'm going to leave that for a separate PR so it's easier to review.
…on order isn't guaranteed

(And, in fact, it failed on i686)
@fasterthanlime fasterthanlime marked this pull request as ready for review July 25, 2022 12:09
# git grep shouldn't match entries in this benchmark data
bench_data/** binary
crates/syntax/test_data/** -text eof=LF
Copy link
Member

Choose a reason for hiding this comment

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

Why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a fun story! The short answer it: it caused bors to fail to merge the rust-lang/rust subtree PR.

The longer story is: that change was introduced in #2166 - but it never did what was intended.

eof is not a gitattribute setting. eol is, but even that line used eol, it still wouldn't do anything, because of -text. So by mistake, 3 files were treated as binary, and checked out with CRLF line endings (those were the ones bors choked on).

After removing this line from .gitattribute, I re-added the folder to git, removed it from disk and used git restore to write it with the proper line endings. The relevant commit is here: rust-lang/rust@1bb63df

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just did a fresh clone of that branch from Windows and ran cargo test with the latest stable, no issues whatsoever.

I'm still convinced #2166 wasn't needed, as explained here: #2166 (comment)

} else {
Some((name, per_ns))
}
if per_ns.is_none() { None } else { Some((name, per_ns)) }
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 the result of some nightly only options rust-lang/rust uses: https://github.com/rust-lang/rust/blob/2f320a224e827b400be25966755a621779f797cc/rustfmt.toml#L2-L4 Stable rustfmt without those options as used in this repo will revert these changes. You will need to do one of:

  • Copy the options to a rustfmt.toml in this repo and switch to nightly rustfmt
  • Ignore rust-analyzer for rustfmt in rust-lang/rust
  • Explicitly use the stable defaults of those options in rustfmt.toml in this repo and hope rustfmt will pick them in favor of the global rustfmt.toml of rust-lang/rust

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one's my bad, I had "format on save" set up when doing those edits. I'll revert them in this PR.

type Foo = fn() -> dyn Send + 'static;
fn main() {
let b = (&a) as &dyn Add<Other, Output = Addable> + Other;
}
Copy link
Member

Choose a reason for hiding this comment

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

What is the difference in this file?

Copy link
Member

Choose a reason for hiding this comment

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

Line endings I would assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CR => LF (as for the other 2 files in the same folder), see #12871 (comment)

@bjorn3
Copy link
Member

bjorn3 commented Jul 25, 2022

Please make sure to fix my review comments in additional commits to avoid confusing git subtree.

@fasterthanlime
Copy link
Contributor Author

Please make sure to fix my review comments in additional commits to avoid confusing git subtree.

@bjorn3 Do you mean avoiding to squash/rebase this PR? If I git commit on that branch and push to fasterthanlime:sync-from-rust-2 we should be fine, right?

@bjorn3
Copy link
Member

bjorn3 commented Jul 25, 2022

Do you mean avoiding to squash/rebase this PR?

Indeed

If I git commit on that branch and push to fasterthanlime:sync-from-rust-2 we should be fine, right?

Yes

@fasterthanlime
Copy link
Contributor Author

This is good for a re-review. I addressed the rustfmt issue, and the rest of the comments was about the 3 CRLF files: the rationale is explained here: #12871 (comment)

@Veykril
Copy link
Member

Veykril commented Jul 25, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 25, 2022

📌 Commit dc94050 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 25, 2022

⌛ Testing commit dc94050 with merge 0b1ed70...

@bors
Copy link
Contributor

bors commented Jul 25, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 0b1ed70 to master...

@bors bors merged commit 0b1ed70 into rust-lang:master Jul 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 28, 2022
…ent, r=Mark-Simulacrum

Sync `rust-analyzer`, add `rust-analyzer-proc-macro-srv` binary to Rustc component

As discussed earlier with `@jyn514` and `@pietroalbini,` I'm also going to use this PR to have `dist::Rustc` build the `rust-analyzer-proc-macro-srv` binary introduced in:

  * rust-lang/rust-analyzer#12871
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
…rk-Simulacrum

Sync `rust-analyzer`, add `rust-analyzer-proc-macro-srv` binary to Rustc component

As discussed earlier with `@jyn514` and `@pietroalbini,` I'm also going to use this PR to have `dist::Rustc` build the `rust-analyzer-proc-macro-srv` binary introduced in:

  * rust-lang#12871
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
…rk-Simulacrum

Sync `rust-analyzer`, add `rust-analyzer-proc-macro-srv` binary to Rustc component

As discussed earlier with `@jyn514` and `@pietroalbini,` I'm also going to use this PR to have `dist::Rustc` build the `rust-analyzer-proc-macro-srv` binary introduced in:

  * rust-lang#12871
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants