about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-08rm `declared_features` field in resolverbohan-6/+2
2024-08-08Auto merge of #128805 - tgross35:rollup-wajzi6w, r=tgross35bors-75/+321
Rollup of 7 pull requests Successful merges: - #128520 (Skip over args when determining if async-closure's inner coroutine consumes its upvars) - #128552 (Emit an error for invalid use of the `#[no_sanitize]` attribute) - #128691 (Update `compiler-builtins` to 0.1.117) - #128702 (Add -Zmetrics-dir=PATH to save diagnostic metadata to disk) - #128797 (Fuchsia Test Runner: enable ffx repository server) - #128798 (refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessary) - #128800 (Add tracking issue to core-pattern-type) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Rollup merge of #128800 - clarfonthey:core-pattern-type, r=compiler-errorsTrevor Gross-3/+8
Add tracking issue to core-pattern-type While the actual `pattern_types` feature flag has an issue assigned, the exported macro and its module do not. cc #123646
2024-08-07Rollup merge of #128798 - futile:refactor/mbe-diagnostics, r=petrochenkovTrevor Gross-28/+28
refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessary Refactor `mbe::diagnostics::failed_to_match_macro()` to not require a full `ExtCtxt`, but only a `&ParseSess`. It hard-required the `ExtCtxt` only for a call to `cx.trace_macros_diag()`, which we move instead to the only call-site of the function. Note: This could be a potential change in observed behavior, because a call to `cx.trace_macros_diag()` now always happens after `failed_to_match_macro()` was called, where before it was only called at the end of the main return path of the function. But since `trace_macros_diag()` "flushes" out any not-yet-reported errors, it should be ok to call it for all paths, since there shouldn't be any on the non-main paths I think. However, I don't know the rest of the codebase well enough to say that with 100% confidence, but `tests/ui` still pass, which gives at least some confidence in the change. Also concretize the return type from `Box<dyn MacResult>` to `(Span, ErrorGuaranteed)`, because this function will _always_ return an error, and never any other kind of result. Was part of #128605 and #128747, but is a standalone refactoring. r? ``@petrochenkov``
2024-08-07Rollup merge of #128797 - Jeff-A-Martin:fuchsia-test-runner, r=tmandryTrevor Gross-0/+13
Fuchsia Test Runner: enable ffx repository server The default repository server setting has changed on Fuchsia (default is newly "false"). Now, in order to start the repository server, the config `repository.server.enabled` must be set to true.
2024-08-07Rollup merge of #128702 - yaahc:metrics-flag, r=estebankTrevor Gross-23/+103
Add -Zmetrics-dir=PATH to save diagnostic metadata to disk r? ``@estebank``
2024-08-07Rollup merge of #128691 - tgross35:update-builtins, r=AmanieuTrevor Gross-7/+4
Update `compiler-builtins` to 0.1.117 This includes [1] which means we can remove the (nonworking) configuration of `no-f16-f128`. Fixes https://github.com/rust-lang/rust/issues/128401. [1]: https://github.com/rust-lang/compiler-builtins/pull/652 try-job: dist-various-1
2024-08-07Rollup merge of #128552 - s7tya:check-no-sanitize-attribute-pos, r=BoxyUwUTrevor Gross-1/+95
Emit an error for invalid use of the `#[no_sanitize]` attribute fixes #128487. Currently, the use of the `#[no_sanitize]` attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it. Referenced #128458. As far as I know, the `#[no_sanitize]` attribute can only be used with functions, so I changed that part to `Fn` and `Method` using `check_applied_to_fn_or_method`. However, I couldn't find explicit documentation on this, so I could be mistaken...
2024-08-07Rollup merge of #128520 - compiler-errors:more-precisely-force-move, r=BoxyUwUTrevor Gross-13/+70
Skip over args when determining if async-closure's inner coroutine consumes its upvars #125306 implements a strategy for when we have an `async move ||` async-closure that is inferred to be `async FnOnce`, it will force the inner coroutine to also be `move`, since we cannot borrow any upvars from the parent async-closure (since `FnOnce` is not lending): https://github.com/rust-lang/rust/blob/8e86c9567154dc5a9ada15ab196d23eae2bd7d89/compiler/rustc_hir_typeck/src/upvar.rs#L211-L229 However, when this strategy was implemented, it reused the `ExprUseVisitor` data from visiting the whole coroutine, which includes additional statements due to `async`-specific argument desugaring: https://github.com/rust-lang/rust/blob/8e86c9567154dc5a9ada15ab196d23eae2bd7d89/compiler/rustc_ast_lowering/src/item.rs#L1197-L1228 Well, it turns out that we don't care about these argument desugaring parameters, because arguments to the async-closure are not the *async-closure*'s captures -- they exist for only one invocation of the closure, and they're always consumed by construction (see the argument desugaring above), so they will force the coroutine's inferred kind to `FnOnce`. (Unless they're `Copy`, because we never consider `Copy` types to be consumed): https://github.com/rust-lang/rust/blob/8e86c9567154dc5a9ada15ab196d23eae2bd7d89/compiler/rustc_hir_typeck/src/expr_use_visitor.rs#L60-L66 However, since we *were* visiting these arg exprs, this resulted in us too-aggressively applying `move` to the inner coroutine, resulting in regressions. For example, this PR fixes #128516. Fascinatingly, the note above about how we never consume `Copy` types is why this only regressed when the argument types weren't all `Copy`. I tried to leave some comments inline to make this more clear :)
2024-08-08Auto merge of #128550 - compiler-errors:shadowed-params-perf, r=petrochenkovbors-96/+105
Only walk ribs to collect possibly shadowed params if we are adding params in our new rib No need to collect params from parent ribs if we literally have no params to declare in this new rib. Attempt to win back some of the perf in https://github.com/rust-lang/rust/pull/128357#issuecomment-2262677031. Please review with whitespace *off*, the diff should be like 2 lines. r? petrochenkov
2024-08-07Add tracking issue to core-pattern-typeltdk-3/+8
2024-08-07Auto merge of #128793 - matthiaskrgr:rollup-ork16t0, r=matthiaskrgrbors-103/+511
Rollup of 4 pull requests Successful merges: - #128363 (Migrate `pdb-buildinfo-cl-cmd` and `pgo-indirect-call-promotion` `run-make` tests to rmake) - #128384 (Add tests to ensure MTE tags are preserved across FFI boundaries) - #128636 (migrate `thumb-none-cortex-m` to rmake) - #128696 (Migrate `staticlib-dylib-linkage` `run-make` test to rmake) Failed merges: - #128407 (Migrate `min-global-align` and `no-alloc-shim` `run-make` tests to rmake) - #128639 (migrate `thumb-none-qemu` to rmake) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Fuchsia Test Runner: enable ffx repository serverJeff Martin-0/+13
The default repository server setting has changed on Fuchsia (default is newly "false"). Now, in order to start the repository server, the config `repository.server.enabled` must be set to true.
2024-08-07Auto merge of #128796 - matthiaskrgr:rollup-r7l68ph, r=matthiaskrgrbors-673/+1311
Rollup of 8 pull requests Successful merges: - #128221 (Add implied target features to target_feature attribute) - #128261 (impl `Default` for collection iterators that don't already have it) - #128353 (Change generate-copyright to generate HTML, with cargo dependencies included) - #128679 (codegen: better centralize function declaration attribute computation) - #128732 (make `import.vis` is immutable) - #128755 (Integrate crlf directly into related test file instead via of .gitattributes) - #128772 (rustc_codegen_ssa: Set architecture for object crate for 32-bit SPARC) - #128782 (unused_parens: do not lint against parens around &raw) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessaryFelix Rath-28/+28
2024-08-07Rollup merge of #128782 - RalfJung:raw-addr-of-parens, r=compiler-errorsMatthias Krüger-32/+79
unused_parens: do not lint against parens around &raw Requested by `@tmandry` in https://github.com/rust-lang/rust/pull/127679: with `&raw` one somewhat regularly has to write code like `(&raw const (*myptr).field).method()`, so parentheses around the expression are often required. To avoid churn between adding and removing parentheses as method calls appear and disappear, the proposal was made to silence the lint for unnecessary parentheses around `&raw` expressions. This PR implements that.
2024-08-07Rollup merge of #128772 - glaubitz:sparc-elf-fix, r=nagisaMatthias Krüger-0/+1
rustc_codegen_ssa: Set architecture for object crate for 32-bit SPARC The `object` crate was recently updated to recognize the 32-bit SPARC ELF targets `EM_SPARC` and `EM_SPARC32PLUS`, so the proper architecture for 32-bit SPARC can now be set in `rustc_codegen_ssa`. r? nagisa
2024-08-07Rollup merge of #128755 - yaahc:jj-crlf, r=estebankMatthias Krüger-27/+27
Integrate crlf directly into related test file instead via of .gitattributes resolves https://github.com/rust-lang/rust/issues/128708 This PR seeks to resolve a contributor papercut when using jj to manage the git repo locally which does not support .gitattributes. It does so by integrating the crlf characters directly into the related test and disabling Git's end of line normalization logic across platforms for that specific file, instead of configuring git to always check out the files with alternative eol characters. related documentation: https://git-scm.com/docs/gitattributes#Documentation/gitattributes.txt-Unset-1
2024-08-07Rollup merge of #128732 - bvanjoi:immutable-import-vis, r=petrochenkovMatthias Krüger-63/+129
make `import.vis` is immutable r? `@petrochenkov`
2024-08-07Rollup merge of #128679 - RalfJung:codegen-fn-attrs, r=nikicMatthias Krüger-11/+28
codegen: better centralize function declaration attribute computation For some reason, the codegen backend has two functions that compute which attributes a function declaration gets: `apply_attrs_llfn` and `attributes::from_fn_attrs`. They are called in different places, on entirely different layers of abstraction. To me the code seems cleaner if we centralize this entirely in `apply_attrs_llfn`, so that's what this PR does.
2024-08-07Rollup merge of #128353 - ↵Matthias Krüger-56/+384
ferrocene:jonathanpallant/add-dependencies-to-copyright-file, r=Kobzol Change generate-copyright to generate HTML, with cargo dependencies included `x.py run generate-copyright` now produces `build/COPYRIGHT.html`. This includes a new format for in-tree dependencies, and also adds out-of-tree cargo dependencies. After consulting expert opinion, I have elected to include every top-level: * `*NOTICE*` * `*AUTHOR*` * `*LICENSE*` * `*LICENCE*`, and * `*COPYRIGHT*` file I can find - case-insensitive. This is because the cargo package metadata's `author` field is not a list of copyright holders and does not meet the requirements of the Apache-2.0 license (which says you must include a NOTICE file with the binary if one was supplied by the author) nor the MIT license (which says you must include 'the above copyright notice'). I believe it would be appropriate to include this file with every Rust release, in order to do an even better job of appropriately recognising the efforts of the authors of the first-party and third-party libraries we are using here. The output includes something like 524 copies of the Apache-2.0 text because they are not all identical. I think I count about 50 different variations by shasum - some differ in whitespace, while some have the boilerplate block at the bottom erroneously modified (don't modify the copy in the license, modify the copy you paste into your own source code!). Running `gzip` on the HTML file largely makes this problem go away, and the average browser is far happier with a ~6 MiB HTML file than the average Markdown viewer is with a ~6 MiB markdown file. But, if someone wants to, do they could submit a follow-up which de-dups the license text files and adds back-links to earlier identical copies (for some value of 'identical copy'). ```console $ xpy run generate-copyright $ cd build $ gzip -c COPYRIGHT.html > COPYRIGHT.gz $ xz -c COPYRIGHT.html > COPYRIGHT.xz $ ls -lh COPYRIGHT.* -rw-r--r-- 1 jonathan staff 241K 29 Jul 17:19 COPYRIGHT.gz -rw-r--r--@ 1 jonathan staff 6.6M 29 Jul 11:30 COPYRIGHT.html -rw-r--r-- 1 jonathan staff 59K 29 Jul 17:19 COPYRIGHT.xz ``` Here's an example [COPYRIGHT.gz](https://github.com/user-attachments/files/16416147/COPYRIGHT.gz).
2024-08-07Rollup merge of #128261 - clarfonthey:iter-default, r=dtolnayMatthias Krüger-0/+70
impl `Default` for collection iterators that don't already have it There is a pretty strong precedent for implementing `Default` for collection iterators, and this does so for some where this implementation was missed. I don't think this needs a separate ACP (since this precedent already exists, and these feel like they were just missed), however, it *will* need an FCP since these implementations are instantly stable.
2024-08-07Rollup merge of #128221 - calebzulawski:implied-target-features, r=AmanieuMatthias Krüger-484/+593
Add implied target features to target_feature attribute See [zulip](https://rust-lang.zulipchat.com/#narrow/stream/208962-t-libs.2Fstdarch/topic/Why.20would.20target-feature.20include.20implied.20features.3F) for some context. Adds implied target features, e.g. `#[target_feature(enable = "avx2")]` acts like `#[target_feature(enable = "avx2,avx,sse4.2,sse4.1...")]`. Fixes #128125, fixes #128426 The implied feature sets are taken from [the rust reference](https://doc.rust-lang.org/reference/attributes/codegen.html?highlight=target-fea#x86-or-x86_64), there are certainly more features and targets to add. Please feel free to reassign this to whoever should review it. r? ``@Amanieu``
2024-08-07Add -Zerror-metrics=PATH to save diagnostic metadata to diskJane Losare-Lusby-23/+103
2024-08-07codegen: better centralize function attribute computationRalf Jung-11/+28
2024-08-07Rollup merge of #128696 - Oneirical:second-linkage-rampage, r=jieyouxuMatthias Krüger-22/+37
Migrate `staticlib-dylib-linkage` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). I'm quite sure this has the same issue as the one brought up in [this discussion](https://github.com/rust-lang/rust/pull/128407#discussion_r1702439172), so I elected to keep the ignore MSVC. try-job: aarch64-apple try-job: x86_64-gnu-llvm-17 try-job: armhf-gnu
2024-08-07Rollup merge of #128636 - folkertdev:rmake-thumb-none-cortex-m, r=jieyouxuMatthias Krüger-39/+59
migrate `thumb-none-cortex-m` to rmake tracking issue: https://github.com/rust-lang/rust/issues/121876 I'll leave some comments/questions inline r? ```@jieyouxu``` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
2024-08-07Rollup merge of #128384 - dheaton-arm:mte-test, r=jieyouxuMatthias Krüger-0/+342
Add tests to ensure MTE tags are preserved across FFI boundaries Added run-make tests to verify that, between a Rust-C FFI boundary in both directions, any MTE tags included in a pointer are preserved for the following pointer types, as well as any information stored using TBI: - int - float - string - function try-job: aarch64-gnu
2024-08-07Rollup merge of #128363 - Oneirical:not-to-be-undertestimated, r=jieyouxuMatthias Krüger-42/+73
Migrate `pdb-buildinfo-cl-cmd` and `pgo-indirect-call-promotion` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw try-job: x86_64-gnu-llvm-17 try-job: aarch64-apple
2024-08-07Auto merge of #126158 - Urgau:disallow-cfgs, r=petrochenkovbors-80/+467
Disallow setting some built-in cfg via set the command-line This PR disallow users from setting some built-in cfg via set the command-line in order to prevent incoherent state, eg. `windows` cfg active but target is Linux based. This implements MCP https://github.com/rust-lang/compiler-team/issues/610, with the caveat that we disallow cfgs no matter if they make sense or not, since I don't think it's useful to allow users to set a cfg that will be set anyway. It also complicates the implementation. ------ The `explicit_builtin_cfgs_in_flags` lint detects builtin cfgs set via the `--cfg` flag. *(deny-by-default)* ### Example ```text rustc --cfg unix ``` ```rust,ignore (needs command line option) fn main() {} ``` This will produce: ```text error: unexpected `--cfg unix` flag | = note: config `unix` is only supposed to be controlled by `--target` = note: manually setting a built-in cfg can and does create incoherent behaviours = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default ``` ### Explanation Setting builtin cfgs can and does produce incoherent behaviour, it's better to the use the appropriate `rustc` flag that controls the config. For example setting the `windows` cfg but on Linux based target. ----- r? `@petrochenkov` cc `@jyn514` try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw try-job: x86_64-gnu-llvm-17 try-job: dist-various-1
2024-08-07rewrite pgo-indirect-call-promotion to rmakeOneirical-32/+46
2024-08-07rewrite pdb-buildinfo-cl-cmd to rmakeOneirical-18/+35
2024-08-07make `import.vis` is not mutablebohan-63/+129
2024-08-07Auto merge of #128783 - GuillaumeGomez:rollup-2kvpg7s, r=GuillaumeGomezbors-473/+566
Rollup of 9 pull requests Successful merges: - #128206 (Make create_dll_import_lib easier to implement) - #128424 (minor `effects` cleanups) - #128527 (More information for fully-qualified suggestion when there are multiple impls) - #128656 (Enable msvc for run-make/rust-lld) - #128683 (bootstrap: clear miri's ui test deps when rustc changes) - #128700 (Migrate `simd-ffi` `run-make` test to rmake) - #128753 (Don't arbitrarily choose one upper bound for hidden captured region error message) - #128757 (Migrate `pgo-gen-lto` `run-make` test to rmake) - #128758 (Specify a minimum supported version for VxWorks) Failed merges: - #128679 (codegen: better centralize function declaration attribute computation) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Rollup merge of #128758 - devnexen:vxworks_release_min, r=tgross35Guillaume Gomez-0/+6
Specify a minimum supported version for VxWorks Document that VxWorks 7 is the minimum supported version.
2024-08-07Rollup merge of #128757 - Oneirical:calm-before-the-sltorm, r=jieyouxuGuillaume Gomez-12/+22
Migrate `pgo-gen-lto` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). This one is so easy, I'm surprised I missed it. try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw try-job: x86_64-gnu-llvm-17
2024-08-07Rollup merge of #128753 - compiler-errors:arbitrary-upper, r=spastorinoGuillaume Gomez-36/+68
Don't arbitrarily choose one upper bound for hidden captured region error message You could argue that the error message is objectively worse, even though it's more accurate. I guess we could also add a note explaining like "cannot capture the intersection of two regions" or something, though I'm not sure if that is confusing due to being totally technical jargon. This addresses the fact that #128752 says "add `+ 'b`" even though it does nothing to fix the issue. It doesn't fix the issue's root cause, though. r? `@spastorino`
2024-08-07Rollup merge of #128700 - Oneirical:i-ffind-these-tests-quite-simdple, ↵Guillaume Gomez-48/+63
r=jieyouxu Migrate `simd-ffi` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: armhf-gnu try-job: test-various try-job: aarch64-apple try-job: x86_64-gnu-llvm-17
2024-08-07Rollup merge of #128683 - RalfJung:miri-ui-test-deps, r=onur-ozkanGuillaume Gomez-0/+8
bootstrap: clear miri's ui test deps when rustc changes `@onur-ozkan` I hope this makes sense... it's quite hard to test this, but it did at least cause one rebuild of the right files for me, and then it doesn't seem to keep rebuilding, so at first sight this look at least better than the status quo.
2024-08-07Rollup merge of #128656 - ChrisDenton:rust-lld, r=lqdGuillaume Gomez-6/+8
Enable msvc for run-make/rust-lld This is simply a matter of using the right argument for lld-link. As a bonus, I also fixed a typo. try-job: i686-msvc try-job: x86_64-msvc
2024-08-07Rollup merge of #128527 - estebank:ambiguity-suggestion, r=NadrierilGuillaume Gomez-27/+59
More information for fully-qualified suggestion when there are multiple impls ``` error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type --> $DIR/E0283.rs:30:21 | LL | fn create() -> u32; | ------------------- `Coroutine::create` defined here ... LL | let cont: u32 = Coroutine::create(); | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait | help: use a fully-qualified path to a specific available implementation | LL | let cont: u32 = <Impl as Coroutine>::create(); | ++++++++ + LL | let cont: u32 = <AnotherImpl as Coroutine>::create(); | +++++++++++++++ + ```
2024-08-07Rollup merge of #128424 - fee1-dead-contrib:fx-clean, r=oli-obkGuillaume Gomez-27/+0
minor `effects` cleanups * remove the fixme comment about not needing defaults because it turns out we do need defaults (if I made it None instead it would ice a bunch of tests) * remove the part that special cased trait args when lowering them. This is now historical because effects doesn't add host args to traits anymore (we use associated types now)
2024-08-07Rollup merge of #128206 - bjorn3:import_lib_writing_refactor, r=jieyouxuGuillaume Gomez-317/+332
Make create_dll_import_lib easier to implement This will make it easier to implement raw-dylib support in cg_clif and cg_gcc. This PR doesn't yet include an create_dll_import_lib implementation for cg_clif as I need to correctly implement dllimport in cg_clif first before raw-dylib can work at all with cg_clif. Required for https://github.com/rust-lang/rustc_codegen_cranelift/issues/1345
2024-08-07unused_parens: do not lint against parens around &rawRalf Jung-32/+79
2024-08-07bootstrap: clear miri's ui test deps when rustc changesRalf Jung-0/+8
2024-08-07Disallow setting built-in cfgs via set the command-lineUrgau-73/+436
2024-08-07Make `Span` optional in `BufferedEarlyLint`Urgau-7/+31
2024-08-07Auto merge of #128196 - Oneirical:poltergeist-manitestation, r=jieyouxubors-88/+108
Migrate `cross-lang-lto-upstream-rlibs`, `long-linker-command-lines` and `long-linker-command-lines-cmd-exe` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). The `long-linker` tests are certainly doing something... interesting - they summon `rustc` calls with obscene quantities of arguments and check that this is appropriately handled. I removed the `RUSTC_ORIGINAL` magic - it's equivalent to `RUSTC` in `tools.mk`, so what is the purpose? Making it so the massive pile of flags doesn't modify rustc itself and start leaking into other tests? Tell me what you think. Please try: try-job: x86_64-msvc try-job: i686-msvc try-job: x86_64-mingw try-job: i686-mingw try-job: aarch64-apple try-job: test-various try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-17
2024-08-07Update ar_archive_writer to 0.3.3bjorn3-13/+4
Version 0.3.1 has added support for writing import libraries. Version 0.3.2 fixed creating archives containing members of import libraries. Version 0.3.3 fixed building on big-endian systems.
2024-08-07rustc_codegen_ssa: Set architecture for object crate for 32-bit SPARCJohn Paul Adrian Glaubitz-0/+1
The object crate was recently updated to recognize the 32-bit SPARC ELF targets EM_SPARC and EM_SPARC32PLUS, so the proper architecture for 32-bit SPARC can now be set in rustc_codegen_ssa.