-
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
Rollup of 7 pull requests #132815
Rollup of 7 pull requests #132815
Conversation
Signed-off-by: onur-ozkan <[email protected]>
"whenever possible" means applying it if `download-rustc` isn't explicitly set and the source is Git-managed. Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
On arm64, Cranelift used to produce object files that don't work with lld. This has since been fixed. The GCC backend should always produce object files that work with lld unless lld for whatever reason drops GCC support. Most of the other more niche backends don't use cg_ssa's linker code at all. If they do and don't work with lld, they can always disable lld usage using a cli argument. Without this commit using cg_clif is by default in a non-trivial amount of cases a perf regression on Linux due to ld.bfd being a fair bit slower than lld. It is possible to explicitly enable it without this commit, but most users are unlikely to do this.
Signed-off-by: onur-ozkan <[email protected]>
…r=chenyukang Reject raw lifetime followed by `'`, like regular lifetimes do See comment. We want to reject cases like `'r#long'id`, which currently gets interpreted as a raw lifetime (`'r#long`) followed by a lifetime (`'id`). This could have alternative lexes, such as an overlong char literal (`'r#long'`) followed by an identifier (`id`). To avoid committing to this in any case, let's reject the whole thing. `@mattheww,` is this what you were looking for in rust-lang/reference#1603 (comment)? I'd say ignore the details about the specific error message (the fact that this gets reinterpreted as a char literal is 🤷), just that because this causes a lexer error we're effectively saving syntactical space like you wanted.
…=wesleywiser Enforce that raw lifetimes must be valid raw identifiers Make sure that the identifier part of a raw lifetime is a valid raw identifier. This precludes `'r#_` and all module segment paths for now. I don't believe this is compelling to support. This was raised by `@ehuss` in rust-lang/reference#1603 (comment) (well, specifically the `'r#_` case), but I don't see why we shouldn't just make it consistent with raw identifiers.
…heVoid add regression test for rust-lang#90781 closes rust-lang#90781
…eyouxu Simplify the internal API for declaring command-line options The internal APIs for declaring command-line options are old, and intimidatingly complex. This PR replaces them with a single function that takes explicit `stability` and `kind` arguments, making it easier to see how each option is handled, and whether it is treated as stable or unstable. We also don't appear to have any tests for the output of `rustc --help` and similar, so I've added a run-make test to verify that this PR doesn't change any output. (There is already a similar run-make test for rustdoc's help output.) --- The librustdoc changes are simply adjusting to updated compiler APIs; no functional change intended. --- A side-effect of these changes is that rustfmt can once again format the entirety of these option declaration lists, which it was not doing before.
… r=jieyouxu use `download-rustc="if-unchanged"` as a global default If `download-rustc` isn't explicitly set and the source is Git-managed, it should be totally okay to utilize "if-unchanged" behaviour. The "dist" profile already sets `download-rustc` to `false`, so this shouldn’t impact anything on CI. This also resolves an unhandled case where `bootstrap` unexpectedly panics if `"if-unchanged"` was used with a non-Git source. Now we exits gracefully with an error message pointing the problem.
Use lld with non-LLVM backends On arm64, Cranelift used to produce object files that don't work with lld. This has since been fixed. The GCC backend should always produce object files that work with lld unless lld for whatever reason drops GCC support. Most of the other more niche backends don't use cg_ssa's linker code at all. If they do and don't work with lld, they can always disable lld usage using a cli argument. Without this commit using cg_clif is by default in a non-trivial amount of cases a perf regression on Linux due to ld.bfd being a fair bit slower than lld. It is possible to explicitly enable it without this commit, but most users are unlikely to do this.
…mpiler-errors Make `Ty::primitive_symbol` recognize `str` Make `Ty::primitive_symbol` recognize `str`, which makes `str` eligible for the "expected primitive, found local type" (and vice versa) [diagnostic](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs#L1430-L1437) that already exists for other primitives. <details><summary> diagnostic difference</summary> ```rs #[allow(non_camel_case_types)] struct str; fn foo() { let _: &str = "hello"; let _: &core::primitive::str = &str; } ``` `rustc --crate-type lib --edition 2021 a.rs` Current nightly: ```rs error[E0308]: mismatched types --> a.rs:5:19 | 5 | let _: &str = "hello"; | ---- ^^^^^^^ expected `str`, found a different `str` | | | expected due to this | = note: expected reference `&str` found reference `&'static str` error[E0308]: mismatched types --> a.rs:6:36 | 6 | let _: &core::primitive::str = &str; | --------------------- ^^^^ expected `str`, found a different `str` | | | expected due to this | = note: expected reference `&str` (`str`) found reference `&str` (`str`) error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. ``` With this patch: ```rs error[E0308]: mismatched types --> a.rs:5:19 | 5 | let _: &str = "hello"; | ---- ^^^^^^^ expected `str`, found a different `str` | | | expected due to this | = note: str and `str` have similar names, but are actually distinct types = note: str is a primitive defined by the language note: `str` is defined in the current crate --> a.rs:2:1 | 2 | struct str; | ^^^^^^^^^^ error[E0308]: mismatched types --> a.rs:6:36 | 6 | let _: &core::primitive::str = &str; | --------------------- ^^^^ expected `str`, found a different `str` | | | expected due to this | = note: str and `str` have similar names, but are actually distinct types = note: str is a primitive defined by the language note: `str` is defined in the current crate --> a.rs:2:1 | 2 | struct str; | ^^^^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. ``` </details>
@bors r+ rollup=never p=7 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: b026d85107 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (4adafcf): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.3%, secondary -0.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.1%, secondary -0.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 780.559s -> 780.925s (0.05%) |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#132341 (Reject raw lifetime followed by `'`, like regular lifetimes do) - rust-lang#132363 (Enforce that raw lifetimes must be valid raw identifiers) - rust-lang#132744 (add regression test for rust-lang#90781) - rust-lang#132754 (Simplify the internal API for declaring command-line options) - rust-lang#132772 (use `download-rustc="if-unchanged"` as a global default) - rust-lang#132774 (Use lld with non-LLVM backends) - rust-lang#132799 (Make `Ty::primitive_symbol` recognize `str`) r? `@ghost` `@rustbot` modify labels: rollup
Successful merges:
'
, like regular lifetimes do #132341 (Reject raw lifetime followed by'
, like regular lifetimes do)--document-hidden-items
#90781)download-rustc="if-unchanged"
as a global default #132772 (usedownload-rustc="if-unchanged"
as a global default)Ty::primitive_symbol
recognizestr
#132799 (MakeTy::primitive_symbol
recognizestr
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup