about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-06-28Implement RTN support in rustfmtMichael Goulet-15/+29
2024-06-28Make sure we deny unimplemented RTN on qpath segmentsMichael Goulet-3/+112
2024-06-28Change RTN to use .. againMichael Goulet-163/+109
2024-06-28Auto merge of #127076 - matthiaskrgr:rollup-l01gm36, r=matthiaskrgrbors-308/+980
Rollup of 6 pull requests Successful merges: - #124741 (patchable-function-entry: Add unstable compiler flag and attribute) - #126470 (make cargo submodule optional) - #126956 (core: avoid `extern type`s in formatting infrastructure) - #126970 (Simplify `str::clone_into`) - #127022 (Support fetching `Attribute` of items.) - #127058 (Tighten `fn_decl_span` for async blocks) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-28Rollup merge of #127058 - compiler-errors:tighten-async-spans, r=oli-obkMatthias Krüger-204/+173
Tighten `fn_decl_span` for async blocks Tightens the span of `async {}` blocks in diagnostics, and subsequently async closures and async fns, by actually setting the `fn_decl_span` correctly. This is kinda a follow-up on #125078, but it fixes the problem in a more general way. I think the diagnostics are significantly improved, since we no longer have a bunch of overlapping spans. I'll point out one caveat where I think the diagnostic may get a bit more confusing, but where I don't think it matters. r? ````@estebank```` or ````@oli-obk```` or someone else on wg-diag or compiler i dont really care lol
2024-06-28Rollup merge of #127022 - adwinwhite:attrs, r=celinvalMatthias Krüger-0/+246
Support fetching `Attribute` of items. Fixes [https://github.com/rust-lang/project-stable-mir/issues/83](https://github.com/rust-lang/project-stable-mir/issues/83) `rustc_ast::ast::Attribute` doesn't impl `Hash` and `Eq`. Thus it cannot be directly used as key of `IndexMap` in `rustc_smir::rustc_smir::Tables` and we cannot define stable `Attribute` as index to `rustc_ast::ast::Attribute` like `Span` and many other stable definitions. Since an string (or tokens) and its span contain all info about an attribute, I defined a simple `Attribute` struct on stable side. I choose to fetch attributes via `tcx::get_attrs_by_path()` due to `get_attrs()` is marked as deprecated and `get_attrs_by_name()` cannot handle name of multiple segments like `rustfmt::skip`. r? `@celinval`
2024-06-28Rollup merge of #126970 - DaniPopes:simplify-str-clone_into, r=cuviperMatthias Krüger-3/+4
Simplify `str::clone_into` Removes an `unsafe` in favor of just using `String` methods.
2024-06-28Rollup merge of #126956 - joboet:fmt_no_extern_ty, r=RalfJungMatthias Krüger-55/+47
core: avoid `extern type`s in formatting infrastructure ```@RalfJung``` [said](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Use.20of.20.60extern.20type.60.20in.20formatting.20machinery/near/446552837): >How attached are y'all to using `extern type` in the formatting machinery? Seems like this was introduced a [long time ago](https://github.com/rust-lang/rust/commit/34ef8f5441d5335c4177abd622383ed34a6e9315). However, it's also [not really compatible with Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/issues/256), and only works currently because we effectively treat references-to-extern-type almost like raw pointers in Stacked Borrows -- which of course is unsound, it's not how LLVM works. I was planning to make Miri emit a warning when this happens to avoid cases like [this](https://github.com/rust-lang/rust/issues/126814#issuecomment-2183816373) where people use extern type specifically to silence Miri without realizing what happens. but with the formatting machinery using extern type, this warning would just show up everywhere... > > The "proper" way to do this in Stacked Borrows is to use raw pointers (or `NonNull`). This PR does just that. r? ```@RalfJung```
2024-06-28Rollup merge of #126470 - onur-ozkan:optional-cargo-submodule, r=KobzolMatthias Krüger-39/+32
make cargo submodule optional Right now, we fetch the cargo submodule no matter what, even if the command we are running doesn't need it (e.g., `x build compiler library`). This PR changes that to only fetch the cargo submodule when it's necessary. For more context, see the zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Why.20is.20cargo.20always.20checked.20out.3F
2024-06-28Rollup merge of #124741 - nebulark:patchable-function-entries-pr, ↵Matthias Krüger-7/+478
r=estebank,workingjubilee patchable-function-entry: Add unstable compiler flag and attribute Tracking issue: #123115 Add the -Z patchable-function-entry compiler flag and the #[patchable_function_entry(prefix_nops = m, entry_nops = n)] attribute. Rebased and adjusted the canditate implementation to match changes in the RFC.
2024-06-28Add method to get all attributes on a definitionAdwin White-30/+85
2024-06-28Support fetching `Attribute` of items.Adwin White-2/+193
2024-06-28Auto merge of #127010 - GuillaumeGomez:update-puppeteer, r=notriddlebors-3/+7
Update browser-ui-test version to `0.18.0` Should help with #126436. r? `@notriddle`
2024-06-27Updated diagnostic messagesFlorian Schmiderer-28/+49
2024-06-27Tighten spans for async blocksMichael Goulet-204/+173
2024-06-27Auto merge of #127049 - flip1995:clippy-subtree-update, r=Manishearthbors-1008/+3631
Clippy subtree update r? `@Manishearth`
2024-06-27Merge commit '68a799aea9b65e2444fbecfe32217ce7d5a3604f' into ↵Philipp Krones-1008/+3631
clippy-subtree-update
2024-06-27Auto merge of #12999 - flip1995:rustup, r=flip1995bors-1255/+1579
Rustup r? `@ghost` changelog: none
2024-06-27Bump nightly version -> 2024-06-27Philipp Krones-1/+1
2024-06-27Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1041/+3683
2024-06-27Auto merge of #12992 - klensy:lintcheck-bump, r=Alexendoobors-2/+2
bump strip-ansi-escapes This bumps `strip-ansi-escapes` to remove arrayvec from it's deps (https://github.com/luser/strip-ansi-escapes/pull/8) Should Cargo.lock be commited too to track it's working state? changelog: none
2024-06-27Auto merge of #126861 - GuillaumeGomez:migrate-run-make-invalid-library, ↵bors-7/+29
r=Kobzol Migrate `run-make/invalid-library` to `rmake.rs` Part of #121876. r? `@jieyouxu` try-job: x86_64-msvc
2024-06-27Auto merge of #126993 - petrochenkov:atvisord3, r=BoxyUwUbors-317/+389
ast: Standardize visiting order Order: ID, attributes, inner nodes in source order if possible, tokens, span. Also always use exhaustive matching in visiting infra, and visit some discovered missing nodes. Unlike https://github.com/rust-lang/rust/pull/125741 this shouldn't affect anything serious like `macro_rules` scopes.
2024-06-27Add `ar` command in `run-make-support`Guillaume Gomez-6/+19
2024-06-27Migrate `run-make/invalid-library` to `rmake.rs`Guillaume Gomez-7/+8
2024-06-27Add `ar_command` in `run_make_support`Guillaume Gomez-0/+8
2024-06-27remove unnecessary packages from `metadata::workspace_members`onur-ozkan-6/+5
Currently bootstrap doesn't use any inner paths from rust-analyzer and bootstrap with `ShouldRun::create_or_deps`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-27Auto merge of #12995 - reillysiemens:fix-doc-markdown-devops-false-positive, ↵bors-1/+2
r=blyxyas Fix doc_markdown DevOps false positive This fixes an issue where the word "DevOps" ends up as a false positive for the `doc_markdown` lint. In a doc comment like this ```rust /// Call the Azure DevOps REST API. pub fn example() {} ``` the word "DevOps" is highlighted as something which should be in backticks. ``` warning: item in documentation is missing backticks --> src/lib.rs:1:20 | 1 | /// Call the Azure DevOps REST API. | ^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown = note: requested on the command line with `-W clippy::doc-markdown` help: try | 1 | /// Call the Azure `DevOps` REST API. | ~~~~~~~~ warning: `example` (lib) generated 1 warning (run `cargo clippy --fix --lib -p example` to apply 1 suggestion) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s ``` This could be overriden with the `doc-valid-idents` configuration parameter as noted by the [documentation](https://rust-lang.github.io/rust-clippy/master/index.html#/doc_markdown), but I believe the word "DevOps" is sufficiently common to belong alongside exceptions like "GitHub" and "GitLab". changelog: [`doc_markdown`]: Fix DevOps false positive.
2024-06-27core: improve commentjoboet-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-06-27Auto merge of #126728 - onur-ozkan:stage1-rustdoc, r=Kobzolbors-12/+11
rustdoc: use current stage if download-rustc enabled When using download-rustc, using stage 1 rustdoc results in the wrong librustc_driver being used. ```sh $ ./build/host/stage1/bin/rustdoc --version ./build/host/stage1/bin/rustdoc: error while loading shared libraries: librustc_driver-7ff02ed05016d515.so: cannot open shared object file: No such file or directory ``` This change fixes that by not cutting the stage if download-rustc is enabled.
2024-06-27Auto merge of #127014 - jhpratt:rollup-45ic8f5, r=jhprattbors-399/+560
Rollup of 6 pull requests Successful merges: - #126571 (Less `maybe_whole_expr`, take 2) - #126721 (coverage: Make `#[coverage(..)]` apply recursively to nested functions) - #126928 (Some `Nonterminal` removal precursors) - #126929 (Remove `__rust_force_expr`.) - #126980 (set self.is_known_utf8 to false in extend_from_slice) - #126983 (Remove `f16` and `f128` ICE paths from smir) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-27Rollup merge of #126983 - tgross35:f16-f128-smir, r=celinvalJacob Pratt-2/+6
Remove `f16` and `f128` ICE paths from smir Just chasing down some possible ICE paths. ```@compiler-errors``` mentioned in https://github.com/rust-lang/rust/pull/121728#discussion_r1506133496 that it is okay not to support these in smir, but this change seems pretty trivial? r? ```@celinval``` since you reviewed https://github.com/rust-lang/rust/pull/114607#pullrequestreview-1771673591
2024-06-27Rollup merge of #126980 - Borgerr:fix-extendfromslice-check, r=workingjubileeJacob Pratt-1/+25
set self.is_known_utf8 to false in extend_from_slice try-job: x86_64-msvc closes #126977 Related to #126885, #126333, and [this conversation](<https://github.com/rust-lang/rust/commit/aa46a3368eb017eba41bfab956c7787d46c09935#r143539097>)
2024-06-27Rollup merge of #126929 - nnethercote:rm-__rust_force_expr, r=oli-obkJacob Pratt-17/+10
Remove `__rust_force_expr`. This was added (with a different name) to improve an error message. It is no longer needed -- removing it changes the error message, but overall I think the new message is no worse: - the mention of `#` in the first line is a little worse, - but the extra context makes it very clear what the problem is, perhaps even clearer than the old message, - and the removal of the note about the `expr` fragment (an internal detail of `__rust_force_expr`) is an improvement. Overall I think the error is quite clear and still far better than the old message that prompted #61933, which didn't even mention patterns. The motivation for this is #124141, which will cause pasted metavariables to be tokenized and reparsed instead of the AST node being cached. This change in behaviour occasionally has a non-zero perf cost, and `__rust_force_expr` causes the tokenize/reparse step to occur twice. Removing `__rust_force_expr` greatly reduces the extra overhead for the `deep-vector` benchmark. r? ```@oli-obk```
2024-06-27Rollup merge of #126928 - nnethercote:124141-pre, r=oli-obkJacob Pratt-3/+134
Some `Nonterminal` removal precursors Small things to prepare for #124141, more or less. r? ```@oli-obk```
2024-06-27Rollup merge of #126721 - Zalathar:nested-cov-attr, r=oli-obkJacob Pratt-344/+344
coverage: Make `#[coverage(..)]` apply recursively to nested functions This PR makes the (currently-unstable) `#[coverage(off)]` and `#[coverage(on)]` attributes apply recursively to all nested functions/closures, instead of just the function they are directly attached to. Those attributes can now also be applied to modules and to impl/impl-trait blocks, where they have no direct effect, but will be inherited by all enclosed functions/closures/methods that don't override the inherited value. --- Fixes #126625.
2024-06-27Rollup merge of #126571 - nnethercote:less-maybe_whole-expr-2, r=petrochenkovJacob Pratt-32/+41
Less `maybe_whole_expr`, take 2 I first tried this in #107550. I now think it's worth doing again, as a precursor to #124141. r? ```@petrochenkov```
2024-06-27Auto merge of #126907 - glaubitz:sparc-fixes, r=nagisabors-18/+25
Fixes for 32-bit SPARC on Linux This PR fixes a number of issues which previously prevented `rustc` from being built successfully for 32-bit SPARC using the `sparc-unknown-linux-gnu` triplet. In particular, it adds linking against `libatomic` where necessary, uses portable `AtomicU64` for `rustc_data_structures` and rewrites the spec for `sparc_unknown_linux_gnu` to use `TargetOptions` and replaces the previously used `-mv8plus` with the more portable `-mcpu=v9 -m32`. To make `rustc` build successfully, support for 32-bit SPARC needs to be added to the `object` crate as well as the `nix` crate which I will be sending out later as well. r? nagisa
2024-06-27Auto merge of #126692 - DianQK:nixos-patchelf, r=Nilstriebbors-13/+8
patch `rust-lld` and `ld.lld` on NixOS When `rustc` uses its self-contained lld, we also need to patch `rust-lld` and `ld.lld`. The `rpath` for `rust-lld` is `$ORIGIN/../../../:$ORIGIN/../lib`, so I use `--add-rpath` instead of `--set-rpath`, which should be easier to maintain. I also changed `src/bootstrap/src/core/download.rs`, even this doesn't fix any known issues. For the `lld-wrapper.sh` of lld, refer to: https://github.com/rust-lang/rustc-dev-guide/pull/1999.
2024-06-27Auto merge of #123918 - DianQK:clang-format, r=Kobzolbors-834/+909
Use `clang-format` in `tidy` to check the C++ code style under `llvm-wrapper` Fixes #123510. Based on the discussion at https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Enable.20.60clang-format.60.20for.20.60rustc.60.20compiler-team.23756/near/443562800, we can use clang-format from pip to achieve the code formatting. r? `@Kobzol`
2024-06-26Fix doc_markdown DevOps false positiveReilly Tucker Siemens-1/+2
2024-06-27Update browser-ui-test version to `0.18.0`Guillaume Gomez-3/+7
2024-06-26Auto merge of #120924 - xFrednet:rfc-2383-stabilization-party, r=Urgau,blyxyasbors-573/+602
Let's `#[expect]` some lints: Stabilize `lint_reasons` (RFC 2383) Let's give this another try! The [previous stabilization attempt](https://github.com/rust-lang/rust/pull/99063) was stalled by some unresolved questions. These have been discussed in a [lang team](https://github.com/rust-lang/lang-team/issues/191) meeting. The last open question, regarding the semantics of the `#[expect]` attribute was decided on in https://github.com/rust-lang/rust/issues/115980 I've just updated the [stabilization report](https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964) with the discussed questions and decisions. Luckily, the decision is inline with the current implementation. This hopefully covers everything. Let's hope that the CI will be green like the spring. fixes #115980 fixes #54503 --- r? `@wesleywiser` Tacking Issue: https://github.com/rust-lang/rust/issues/54503 Stabilization Report: https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964 Documentation Update: https://github.com/rust-lang/reference/pull/1237 <!-- For Clippy: changelog: [`allow_attributes`]: Is now available on stable, since the `lint_reasons` feature was stabilized changelog: [`allow_attributes_without_reason`]: Is now available on stable, since the `lint_reasons` feature was stabilized --> --- Roses are red, Violets are blue, Let's expect lints, With reason clues
2024-06-26Auto merge of #120924 - xFrednet:rfc-2383-stabilization-party, r=Urgau,blyxyasbors-861/+908
Let's `#[expect]` some lints: Stabilize `lint_reasons` (RFC 2383) Let's give this another try! The [previous stabilization attempt](https://github.com/rust-lang/rust/pull/99063) was stalled by some unresolved questions. These have been discussed in a [lang team](https://github.com/rust-lang/lang-team/issues/191) meeting. The last open question, regarding the semantics of the `#[expect]` attribute was decided on in https://github.com/rust-lang/rust/issues/115980 I've just updated the [stabilization report](https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964) with the discussed questions and decisions. Luckily, the decision is inline with the current implementation. This hopefully covers everything. Let's hope that the CI will be green like the spring. fixes #115980 fixes #54503 --- r? `@wesleywiser` Tacking Issue: https://github.com/rust-lang/rust/issues/54503 Stabilization Report: https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964 Documentation Update: https://github.com/rust-lang/reference/pull/1237 <!-- For Clippy: changelog: [`allow_attributes`]: Is now available on stable, since the `lint_reasons` feature was stabilized changelog: [`allow_attributes_without_reason`]: Is now available on stable, since the `lint_reasons` feature was stabilized --> --- Roses are red, Violets are blue, Let's expect lints, With reason clues
2024-06-26Clarify comment on changing to warn future breakage items Urgau-5/+5
https://github.com/rust-lang/rust/pull/120924/files#r1653512240
2024-06-26ast: Standardize visiting orderVadim Petrochenkov-317/+389
Id, attributes, inner nodes in source order if possible, tokens, span. Also always use exhaustive matching in visiting infra, and visit some missing nodes.
2024-06-26Auto merge of #126844 - scottmcm:more-ptr-cast-gvn, r=saethlinbors-160/+1573
Remove more `PtrToPtr` casts in GVN This addresses two things I noticed in MIR: 1. `NonNull::<T>::eq` does `(a as *mut T) == (b as *mut T)`, but it could just compare the `*const T`s, so this removes `PtrToPtr` casts that are on both sides of a pointer comparison, so long as they're not fat-to-thin casts. 2. `NonNull::<T>::addr` does `transmute::<_, usize>(p as *const ())`, but so long as `T: Thin` that cast doesn't do anything, and thus we can directly transmute the `*const T` instead. r? mir-opt
2024-06-26Add `cpp:fmt` to mingw-check-tidyDianQK-1/+1
2024-06-26Format C++ files in `llvm-wrapper`DianQK-821/+764
2024-06-26Add clang-format to the external tool checkDianQK-12/+124