-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Migrate in-tree crates to 2021 #89103
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Changes rustc_apfloat. rustc_apfloat is currently in limbo and you almost certainly don't want to change it (see #55993). cc @eddyb Some changes occured to rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/rustfmt. rustdoc-json-types is a public (although nightly-only) API. Consider changing |
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
The drop time changes which we're accepting as part of this migration could be perf sensitive, but I believe it to be fairly unlikely -- they're mostly not in hot code, and moving the drop slightly shouldn't change too much. Closure sizes are also unlikely to be that important. That said, we should check: @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ccb46c236a8bd0eeac370d63a42781750857c3b5 with merge d70706afaa69357a70c0cdfdc13d6de7aa0a4396... |
@@ -125,6 +125,7 @@ pub fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: | |||
let result_ptr = Ptr(&mut result as *mut _ as *mut ()); | |||
|
|||
let thread = cfg.spawn(move || { | |||
let _ = (&run, &result_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are necessary since raw pointers aren't send/sync, but this whole block is likely to go away shortly anyway - #89104
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
It looks like some examples in the rust-2021-compatibility lint docs need |
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
This just applies the suggested fixes from the compatibility warnings, leaving any that are in practice spurious in. This is primarily intended to provide a starting point to identify possible fixes to the migrations (e.g., by avoiding spurious warnings). A secondary commit cleans these up where they are false positives (as is true in many of the cases).
0eae76e
to
edab8c7
Compare
This comment has been minimized.
This comment has been minimized.
edab8c7
to
d93dd0c
Compare
if let GenericParamDefKind::Lifetime = param.kind { | ||
if let hir::GenericArg::Lifetime(lifetime) = &lifetimes[i] { | ||
self.ast_region_to_region(lifetime, None).into() | ||
} else { | ||
bug!() | ||
} | ||
_ => bug!(), | ||
} else { | ||
bug!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could have been
match (param.kind, lifetimes.get(i)) {
(GenericParamDefKind::Lifetime, Some(hir::GenericArg::Lifetime(lifetime))) => {
self.ast_region_to_region(lifetime, None).into()
}
_ => bug!(),
}
but there's no need to change it in this PR :)
@bors try @rust-timer queue r=me with clean bill of perf |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 3b89679 with merge f8413f415838486def71cb351f259262f54358cc... |
☀️ Try build successful - checks-actions |
Queued f8413f415838486def71cb351f259262f54358cc with parent 60e70cc, future comparison URL. |
Finished benchmarking commit (f8413f415838486def71cb351f259262f54358cc): comparison url. Summary: This change led to large relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
@bors r+ rollup=never cc @rust-lang/compiler |
We're pretty clearly going to do this migration, and the regression is limited to a small percentage on a single benchmark. I'm going to approve this for now, but not mark it as triaged -- I'd like to make sure we identify the source of the regression, but don't want to block this on that. @bors r=estebank |
📌 Commit 3b89679 has been approved by |
1 similar comment
📌 Commit 3b89679 has been approved by |
@bors r=estebank rollup=never (looks like bors lost status over close & reopen) |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 3b89679 has been approved by |
☀️ Test successful - checks-actions |
Migrate in-tree crates to 2021 This replaces rust-lang#89075 (cherry picking some of the commits from there), and closes rust-lang#88637 and fixes rust-lang#89074. It excludes a migration of the library crates for now (see tidy diff) because we have some pending bugs around macro spans to fix there. I instrumented bootstrap during the migration to make sure all crates moved from 2018 to 2021 had the compatibility warnings applied first. Originally, the intent was to support cargo fix --edition within bootstrap, but this proved fairly difficult to pull off. We'd need to architect the check functionality to support running cargo check and cargo fix within the same x.py invocation, and only resetting sysroots on check. Further, it was found that cargo fix doesn't behave too well with "not quite workspaces", such as Clippy which has several crates. Bootstrap runs with --manifest-path ... for all the tools, and this makes cargo fix only attempt migration for that crate. We can't use e.g. --workspace due to needing to maintain sysroots for different phases of compilation appropriately. It is recommended to skip the mass migration of Cargo.toml's to 2021 for review purposes; you can also use `git diff d6cd2c6 -I'^edition = .20...$'` to ignore the edition = 2018/21 lines in the diff.
…Simulacrum tidy: Remove submodules from edition exception list Both style-check and date-check are now on the 2021 edition, and this PR also updates their repositories' submodules. cc rust-lang/rustc-dev-guide#1238 cc rust-lang/reference#1099 cc rust-lang#89103 (comment)
This replaces #89075 (cherry picking some of the commits from there), and closes #88637 and fixes #89074.
It excludes a migration of the library crates for now (see tidy diff) because we have some pending bugs around macro spans to fix there.
I instrumented bootstrap during the migration to make sure all crates moved from 2018 to 2021 had the compatibility warnings applied first.
Originally, the intent was to support cargo fix --edition within bootstrap, but this proved fairly difficult to pull off. We'd need to architect the check functionality to support running cargo check and cargo fix within the same x.py invocation, and only resetting sysroots on check. Further, it was found that cargo fix doesn't behave too well with "not quite workspaces", such as Clippy which has several crates. Bootstrap runs with --manifest-path ... for all the tools, and this makes cargo fix only attempt migration for that crate. We can't use e.g. --workspace due to needing to maintain sysroots for different phases of compilation appropriately.
It is recommended to skip the mass migration of Cargo.toml's to 2021 for review purposes; you can also use
git diff d6cd2c6c877110748296760aefddc21a0ea1d316 -I'^edition = .20...$'
to ignore the edition = 2018/21 lines in the diff.