about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-08rustdoc: fixed #101105schvv31n-1/+14
modules are now stripped based on the same logic that's used to strip other item kinds
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-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-07codegen: better centralize function attribute computationRalf Jung-11/+28
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-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.
2024-08-07Specify a minimum supported version for VxWorksDavid Carlier-0/+6
2024-08-07Auto merge of #128768 - tgross35:rollup-aaq1ny7, r=tgross35bors-226/+4514
Rollup of 7 pull requests Successful merges: - #128107 (Migrate `raw-dylib-alt-calling-convention`, `raw-dylib-c` and `redundant-libs` `run-make` tests to rmake) - #128362 (add test for symbol visibility of `#[naked]` functions) - #128417 (Add `f16` and `f128` math functions) - #128638 (run-make: enable msvc for `link-dedup`) - #128647 (Enable msvc for link-args-order) - #128649 (run-make: Enable msvc for `no-duplicate-libs` and `zero-extend-abi-param-passing`) - #128766 (Trivial grammar fix in const keyword docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Disallow enabling features without their implied featuresCaleb Zulawski-23/+11
2024-08-07Fix typoCaleb Zulawski-1/+1
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2024-08-07Hide implicit target features from diagnostics when possibleCaleb Zulawski-43/+89
2024-08-07Add implied features to non-target-feature functionsCaleb Zulawski-9/+25
2024-08-07Remove redundant implied featuresCaleb Zulawski-36/+6
2024-08-07Don't use LLVM to compute -Ctarget-featureCaleb Zulawski-112/+120
2024-08-07Don't use LLVM's target featuresCaleb Zulawski-39/+84
2024-08-07Refactor and fill out target feature listsCaleb Zulawski-360/+293
2024-08-07Bless testsCaleb Zulawski-5/+5
2024-08-07Add +sse4.2 due to #128426Caleb Zulawski-4/+4
2024-08-07Add missing featuresCaleb Zulawski-0/+26
2024-08-07Fix codegen testsCaleb Zulawski-5/+5
2024-08-07Add test to ensure implied target features work with asm, and fix failing testsCaleb Zulawski-49/+44
2024-08-07Add implied target features to target_feature attributeCaleb Zulawski-31/+113
2024-08-07Auto merge of #128763 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 3 commits in fa646583675d7c140482bd906145c71b7fb4fc2b..94977cb1fab003d45eb5bb108cb5e2fa0149672a 2024-08-02 16:08:06 +0000 to 2024-08-06 21:42:10 +0000 - Don't specify the depedency name in the `cargo add` inferred name test (rust-lang/cargo#14357) - Fix renamed disallowed cfg lint name (rust-lang/cargo#14352) - fix(build-std): remove hack on creating virtual std workspace (rust-lang/cargo#14358) r? ghost
2024-08-06Rollup merge of #128766 - Monadic-Cat:patch-1, r=tgross35Trevor Gross-1/+1
Trivial grammar fix in const keyword docs This PR makes a trivial fix to the wording of a sentence in the `const` keyword docs. > `const` items looks remarkably similar to `static` items, [...] Either this should be written as > A `const` items looks remarkably similar to a `static` item, [...] or "looks" should be changed to "look". I have selected the smaller diff.
2024-08-06Rollup merge of #128649 - ChrisDenton:param-passing, r=jieyouxuTrevor Gross-24/+42
run-make: Enable msvc for `no-duplicate-libs` and `zero-extend-abi-param-passing` The common thing between these two tests is to use `#[link(..., kind="static")]` so that it doesn't try to do a DLL import. `zero-extend-abi-param-passing` also needs to have an optimized static library but there's only helper function for a non-optimized version. Rather than copy/pasting the code (and adding the optimization flag) I reused the same code so that it more easily be kept in sync. try-job: i686-msvc try-job: x86_64-msvc
2024-08-06Rollup merge of #128647 - ChrisDenton:link-args-order, r=jieyouxuTrevor Gross-6/+5
Enable msvc for link-args-order I could not see any reason in #70665 why this test needs to specifically use `ld`. Maybe to provide a consistent linker input line? In any case, the test does work for the MSVC linker. try-job: i686-msvc try-job: x86_64-msvc