about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-11-28Rollup merge of #118299 - frewsxcv:patch-2, r=cuviperMatthias Krüger-9/+41
Update `OnceLock` documentation to give a concrete 'lazy static' example, and expand on the existing example.
2023-11-28Rollup merge of #118236 - ksw2000:update_mod_comment, r=cuviperMatthias Krüger-3/+3
Update mod comment The comment of `ASCII_CASE_MASK` on line 477 is `If 6th bit is set ascii is lower case.` but the original comment of `*self ^ ((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)` was `Toggle the fifth bit if this is a lowercase letter`
2023-11-28Rollup merge of #115331 - the8472:chars_advance, r=cuviperMatthias Krüger-0/+80
optimize str::iter::Chars::advance_by ``` OLD: str::iter::chars_advance_by_0001 0.00ns/iter +/- 0.00ns str::iter::chars_advance_by_0010 13.00ns/iter +/- 1.00ns str::iter::chars_advance_by_1000 1.20µs/iter +/- 15.00ns NEW: str::iter::chars_advance_by_0001 0.00ns/iter +/- 0.00ns str::iter::chars_advance_by_0010 6.00ns/iter +/- 0.00ns str::iter::chars_advance_by_1000 75.00ns/iter +/- 1.00ns ```
2023-11-28Auto merge of #118395 - compiler-errors:rollup-c8yqlmw, r=compiler-errorsbors-103/+510
Rollup of 9 pull requests Successful merges: - #111133 (Detect Python-like slicing and suggest how to fix) - #114708 (Allow setting `rla` labels via `rustbot`) - #117526 (Account for `!` arm in tail `match` expr) - #118172 (Add `pretty_terminator` to pretty stable-mir) - #118202 (Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim) - #118374 (QueryContext: rename try_collect_active_jobs -> collect_active_jobs, change return type from Option<QueryMap> to QueryMap) - #118381 (rustc_span: Use correct edit distance start length for suggestions) - #118382 (Address unused tuple struct fields in the compiler) - #118384 (Address unused tuple struct fields in rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-27Rollup merge of #118384 - ↵Michael Goulet-6/+3
shepmaster:unused-tuple-struct-field-cleanup-rustdoc, r=GuillaumeGomez Address unused tuple struct fields in rustdoc
2023-11-27Rollup merge of #118382 - shepmaster:unused-tuple-struct-field-cleanup, ↵Michael Goulet-9/+8
r=compiler-errors Address unused tuple struct fields in the compiler r? `@compiler-errors`
2023-11-27Rollup merge of #118381 - Enselic:edit-dist-len, r=WaffleLapkinMichael Goulet-1/+18
rustc_span: Use correct edit distance start length for suggestions Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`. Closes https://github.com/rust-lang/rust/issues/72553.
2023-11-27Rollup merge of #118374 - klensy:collect_active_jobs, r=compiler-errorsMichael Goulet-20/+14
QueryContext: rename try_collect_active_jobs -> collect_active_jobs, change return type from Option<QueryMap> to QueryMap As there currently always Some(...) inside.
2023-11-27Rollup merge of #118202 - azhogin:azhogin/link_args_wrapping, r=petrochenkovMichael Goulet-34/+49
Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim https://github.com/rust-lang/rust/issues/99427#issuecomment-1234443468 > here's one possible improvement to -l link-arg making it more portable between linkers and useful - befriending it with the verbatim modifier (https://github.com/rust-lang/rust/issues/99425). > > -l link-arg:-verbatim=-foo would add -Wl,-foo (or equivalent) when C compiler is used as a linker, and just -foo when bare linker is used. > -l link-arg:+verbatim=-bar on the other hand would always pass just -bar.
2023-11-27Rollup merge of #118172 - ouz-a:improve_emit_stable1, r=celinvalMichael Goulet-18/+286
Add `pretty_terminator` to pretty stable-mir ~Because we don't have successors in `stable_mir` this is somewhat lacking but it's better than nothing~, also fixed bug(?) with `Opaque` which printed extra `"` when we try to print opaqued `String`. **Edit**: Added successors so this covers Terminators as a whole. r? `@celinval`
2023-11-27Rollup merge of #117526 - estebank:issue-24157, r=b-naberMichael Goulet-4/+78
Account for `!` arm in tail `match` expr On functions with a default return type that influences the coerced type of `match` arms, check if the failing arm is actually of type `!`. If so, suggest changing the return type so the coercion against the prior arms is successful. ``` error[E0308]: `match` arms have incompatible types --> $DIR/match-tail-expr-never-type-error.rs:9:13 | LL | fn bar(a: bool) { | - help: try adding a return type: `-> i32` LL | / match a { LL | | true => 1, | | - this is found to be of type `{integer}` LL | | false => { LL | | never() | | ^^^^^^^ | | | | | expected integer, found `()` | | this expression is of type `!`, but it get's coerced to `()` due to its surrounding expression LL | | } LL | | } | |_____- `match` arms have incompatible types ``` Fix #24157.
2023-11-27Rollup merge of #114708 - tgross35:tgross35-patch-1, r=Mark-SimulacrumMichael Goulet-0/+1
Allow setting `rla` labels via `rustbot` https://github.com/rust-lang/rust-log-analyzer/pull/75 adds a `rla-silenced` label flag that will turn off RLA updates for non-bors tests. Allow setting that labels and others via `rustbot`.
2023-11-27Rollup merge of #111133 - hkmatsumoto:handle-python-slicing, r=TaKO8KiMichael Goulet-11/+53
Detect Python-like slicing and suggest how to fix Fix #108215
2023-11-27Auto merge of #117947 - Dirbaio:drop-llvm-15, r=cuviperbors-251/+42
Update the minimum external LLVM to 16. With this change, we'll have stable support for LLVM 16 and 17. For reference, the previous increase to LLVM 15 was #114148 [Relevant zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/riscv.20forced-atomics)
2023-11-27optimize str::iter::Chars::advance_byThe 8472-0/+61
this avoids part of the char decoding work by not looking at utf8 continuation bytes
2023-11-27benchmarks for Chars::advance_byThe 8472-0/+19
2023-11-27Auto merge of #117200 - rmehri01:repeated_help, r=WaffleLapkinbors-35/+76
Don't add redundant help for object safety violations Fixes #117186 r? WaffleLapkin
2023-11-27Address unused tuple struct fields in rustdocJake Goulding-6/+3
2023-11-27Address unused tuple struct fields in the compilerJake Goulding-9/+8
2023-11-27add otherwise into targetsouz-a-3/+5
2023-11-27rustc_span: Use correct edit distance start length for suggestionsMartin Nordholts-1/+18
Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`.
2023-11-27Auto merge of #118118 - spastorino:do-not-erase-late-bound-regions-on-iat, ↵bors-117/+128
r=compiler-errors Do not erase late bound regions when selecting inherent associated types In the fix for #97156 we would want the following code: ```rust #![feature(inherent_associated_types)] #![allow(incomplete_features)] struct Foo<T>(T); impl Foo<fn(&'static ())> { type Assoc = u32; } trait Other {} impl Other for u32 {} // FIXME(inherent_associated_types): Avoid emitting two diagnostics (they only differ in span). // FIXME(inherent_associated_types): Enhancement: Spruce up the diagnostic by saying something like // "implementation is not general enough" as is done for traits via // `try_report_trait_placeholder_mismatch`. fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {} //~^ ERROR mismatched types //~| ERROR mismatched types fn main() {} ``` to fail with ... ``` error[E0220]: associated type `Assoc` not found for `Foo<for<'a> fn(&'a ())>` in the current scope --> tests/ui/associated-inherent-types/issue-109789.rs:18:36 | 4 | struct Foo<T>(T); | ------------- associated item `Assoc` not found for this struct ... 18 | fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {} | ^^^^^ associated item not found in `Foo<for<'a> fn(&'a ())>` | = note: the associated type was found for - `Foo<fn(&'static ())>` error: aborting due to previous error For more information about this error, try `rustc --explain E0220`. ``` This PR fixes the ICE we are currently getting "was a subtype of Foo<Binder(fn(&ReStatic ()), [])> during selection but now it is not" Also fixes #112631 r? `@lcnr`
2023-11-27Account for `!` arm in tail `match` exprEsteban Küber-4/+78
On functions with a default return type that influences the coerced type of `match` arms, check if the failing arm is actually of type `!`. If so, suggest changing the return type so the coercion against the prior arms is successful. ``` error[E0308]: `match` arms have incompatible types --> $DIR/match-tail-expr-never-type-error.rs:9:13 | LL | fn bar(a: bool) { | - help: try adding a return type: `-> i32` LL | / match a { LL | | true => 1, | | - this is found to be of type `{integer}` LL | | false => { LL | | never() | | ^^^^^^^ | | | | | expected integer, found `()` | | this expression is of type `!`, but it get's coerced to `()` due to its surrounding expression LL | | } LL | | } | |_____- `match` arms have incompatible types ``` Fix #24157.
2023-11-27QueryContext: rename try_collect_active_jobs -> collect_active_jobs and ↵klensy-20/+14
change it's return type from Option<QueryMap> to QueryMap As there currently always Some(...) inside
2023-11-27Auto merge of #118370 - TaKO8Ki:rollup-qfilq2w, r=TaKO8Kibors-244/+182
Rollup of 4 pull requests Successful merges: - #118095 (Enable the Arm Cortex-A53 errata mitigation on aarch64-unknown-none) - #118340 (Use helper functions in `pretty.rs` instead of accessing the `Cell`s manually) - #118358 (make const tests independent of std debug assertions) - #118359 (Suggest swapping the order of `ref` and `box`) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-27Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," ↵Andrew Zhogin-34/+49
for cc-like linker args and not verbatim
2023-11-27Rollup merge of #118359 - hkmatsumoto:suggest-box-ref, r=TaKO8KiTakayuki Maeda-2/+55
Suggest swapping the order of `ref` and `box` It is not valid grammar to write `ref box <ident>` in patterns, but `box ref <ident>` is. This patch adds a diagnostic to suggest swapping them, analogous to what we do for `mut let`.
2023-11-27Rollup merge of #118358 - RalfJung:const-tests, r=WaffleLapkinTakayuki Maeda-232/+112
make const tests independent of std debug assertions Fixes some fallout from https://github.com/rust-lang/rust/pull/110303: `ignore-debug` is bad since it makes it very annoying to develop rustc with debug assertions enabled. These tests do not really provide any interesting test coverage, we already got plenty of other tests that check that we detect invalid enums. So we can just remove them.
2023-11-27Rollup merge of #118340 - compiler-errors:tweaks, r=lqdTakayuki Maeda-10/+10
Use helper functions in `pretty.rs` instead of accessing the `Cell`s manually Pulled this out of another PR that I never landed.
2023-11-27Rollup merge of #118095 - ferrocene:apply-cortex-a53-fix, r=davidtwcoTakayuki Maeda-0/+5
Enable the Arm Cortex-A53 errata mitigation on aarch64-unknown-none Arm Cortex-A53 CPUs have an errata related to a specific sequence of instructions - errata number 843419 (https://documentation-service.arm.com/static/5fa29fddb209f547eebd361d). There is a mitigation that can be applied at link-time which detects the when sequence of instructions exists at a specific alignment. When detected, the linker re-writes those instructions and either changes an ADRP to an ADR, or bounces to a veneer to break the sequence. The linker argument to enable the mitigation is "--fix-cortex-a53-843419", and this is supported by GNU ld and LLVM lld. The gcc argument to enable the flag is "-mfix-cortex-a53-843419". Because the aarch64-unknown-none target uses rust-lld directly, this patch causes rustc to emit the "--fix-cortex-a53-843419" argument when calling the linker, just like aarch64-linux-gnu-gcc on Ubuntu 22.04 does. Failure to enable this mitigation in the linker can cause the production of instruction sequences that do not execute correctly on Arm Cortex-A53.
2023-11-27Change help message to make some sense in broader contextHirochika Matsumoto-3/+3
2023-11-27Address review feedbacksHirochika Matsumoto-23/+18
Also addressed merge conflicts upon rebasing.
2023-11-27Make tidy test happyHirochika Matsumoto-2/+2
2023-11-27Detect Python-like slicing and suggest how to fixHirochika Matsumoto-0/+47
Fix #108215
2023-11-27Suggest swapping the order of `ref` and `box`Hirochika Matsumoto-2/+55
2023-11-27Auto merge of #118365 - lnicola:sync-from-ra, r=lnicolabors-309/+1150
Subtree update of `rust-analyzer`
2023-11-27Remove instant from EXCEPTIONS_RUST_ANALYZERLaurențiu Nicola-1/+0
2023-11-27Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-raLaurențiu Nicola-308/+1150
2023-11-27Auto merge of #118352 - Zalathar:llvm-hash, r=onur-ozkanbors-5/+9
bootstrap: Memoize the LLVM rebuild hash to avoid very slow `x check` Recently I've encountered a massive regression in the performance of re-running `x check` after making no changes. It used to take around 2 seconds, and now it takes 20-30 seconds. That's quite a hassle when r-a runs it every time I save. After some poking around, what I've found is that each individual call to `generate_smart_stamp_hash` doesn't take a particularly long time (around 0.5 sec), but it gets called dozens of times during `x check`, and that seems to be what's adding up to 20-30 seconds. --- https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Massive.20regression.20in.20no-op.20.60x.20check.60 cc `@onur-ozkan`
2023-11-27Auto merge of #118353 - matthiaskrgr:rollup-sf1booi, r=matthiaskrgrbors-10/+17
Rollup of 3 pull requests Successful merges: - #118322 (skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only`) - #118325 (Fix Rustdoc search docs link) - #118338 (Backticks fixes) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-27make const tests independent of std debug assertionsRalf Jung-232/+112
2023-11-27bootstrap: Memoize the LLVM rebuild hash to avoid very slow `x check`Zalathar-5/+9
2023-11-27Rollup merge of #118338 - nnethercote:backticks, r=compiler-errorsMatthias Krüger-7/+7
Backticks fixes r? `@lqd`
2023-11-27Rollup merge of #118325 - clubby789:rustdoc-search-link, r=fmeaseMatthias Krüger-2/+1
Fix Rustdoc search docs link This link has been outdated since #112725 moved the search docs to their own page
2023-11-27Rollup merge of #118322 - onur-ozkan:if-only-doctests-skip-compiletest, ↵Matthias Krüger-1/+9
r=clubby789 skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only` As use of `--doc` with `x test` is intended for running doc-tests only, executing compiletest, tidy or rustdoc-gui based tests considered as an incorrect behavior from bootstrap. This change fixes that.
2023-11-27Auto merge of #118321 - WaffleLapkin:unspace-fn-pointer-fake-variadic, ↵bors-2/+2
r=notriddle rustdoc: Remove space from fake-variadic fn ptr impls before: `for fn (T₁, T₂, …, Tₙ) -> Ret` after: `for fn(T₁, T₂, …, Tₙ) -> Ret` I don't think we usually have spaces there, so it looks weird. cc `@notriddle` since you added the space in https://github.com/rust-lang/rust/pull/98180 (or rather, added the feature with a space included).
2023-11-27Auto merge of #118313 - WaffleLapkin:fixup_comments_in_some_nonzero_ops, ↵bors-14/+44
r=thomcc Improve some comments for non-zero ops This makes them a bit more explicit/correct.
2023-11-27Auto merge of #118327 - WaffleLapkin:mailmap-wl-tsk, r=Mark-Simulacrumbors-1/+2
Add my work email to the mailmap (my employer asks me to commit upstreaming under my work email)
2023-11-27Auto merge of #117584 - bjorn3:eager_output_filenames, r=b-naberbors-53/+46
Eagerly compute output_filenames It can be computed before creating TyCtxt. Previously the query would also write the dep info file, which meant that the output filenames couldn't be accessed before macro expansion is done. The dep info file writing is now done as a separate non-query function. The old query was always executed again anyways due to depending on the HIR. Also encode the output_filenames in rlink files to ensure `#![crate_name]` affects the linking stage when doing separate compiling and linking using `-Zno-link`/`-Zlink-only`.
2023-11-26Use helpersMichael Goulet-10/+10