about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-17Rollup merge of #128989 - s7tya:check-linkage-attribute-pos, r=petrochenkovMatthias Krüger-1/+124
Emit an error for invalid use of the linkage attribute fixes #128486 Currently, the use of the linkage 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. Related: #128552.
2024-08-17Auto merge of #126877 - GrigorenkoPV:clone_to_uninit, r=dtolnaybors-105/+290
CloneToUninit impls As per #126799. Also implements it for `Wtf8` and both versions of `os_str::Slice`. Maybe it is worth to slap `#[inline]` on some of those impls. r? `@dtolnay`
2024-08-17Auto merge of #128598 - RalfJung:float-comments, r=workingjubileebors-683/+116
float to/from bits and classify: update for float semantics RFC With https://github.com/rust-lang/rfcs/pull/3514 having been accepted, it is clear that hardware which e.g. flushes subnormal to zero is just non-conformant from a Rust perspective -- this is a hardware bug, or maybe an LLVM backend bug (where LLVM doesn't lower floating-point ops in a way that they have the standardized behavior). So update the comments here to make it clear that we don't have to do any of this, we're just being nice. Also remove the subnormal/NaN checks from the (unstable) const-version of to/from-bits; they are not needed since we decided with the aforementioned RFC that it is okay to get a different result at const-time and at run-time. r? `@workingjubilee` since I think you wrote many of the comments I am editing here.
2024-08-17more clear NAN names and fix broken_floats logicRalf Jung-12/+14
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2024-08-17disable problematic float-conv tests in i586 targetsRalf Jung-6/+13
also fix typo in const-float-bits-conv
2024-08-17Emit an error for invalid use of the linkage attributeShina-1/+124
2024-08-17Auto merge of #129178 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 8 commits in 2f738d617c6ead388f899802dd1a7fd66858a691..ba8b39413c74d08494f94a7542fe79aa636e1661 2024-08-13 10:57:52 +0000 to 2024-08-16 22:48:57 +0000 - feat(update): Report when incompatible-rust-version packages are selected (rust-lang/cargo#14401) - test: Migrate old_cargos to snapbox (rust-lang/cargo#14410) - Correct diagnostic for `TomlDebugInfo` (rust-lang/cargo#14413) - Add `--lockfile-path` flag (rust-lang/cargo#14326) - test: Migrate some json tests to snapbox (rust-lang/cargo#14402) - Implement base paths (RFC 3529) 1/n: path dep and patch support (rust-lang/cargo#14360) - doc: convert comments to rustdoc in workspace (rust-lang/cargo#14397) - Fix MSRV for workspace .package and .dependencies (rust-lang/cargo#14400) r? ghost
2024-08-17Auto merge of #106943 - mina86:exact_size_take_repeat, r=dtolnaybors-0/+147
Implement DoubleEnded and ExactSize for Take<Repeat> and Take<RepeatWith> Repeat iterator always returns the same element and behaves the same way backwards and forwards. Take iterator can trivially implement backwards iteration over Repeat inner iterator by simply doing forwards iteration. DoubleEndedIterator is not currently implemented for Take<Repeat<T>> because Repeat doesn’t implement ExactSizeIterator which is a required bound on DEI implementation for Take. Similarly, since Repeat is an infinite iterator which never stops, Take can trivially know how many elements it’s going to return. This allows implementing ExactSizeIterator on Take<Repeat<T>>. While at it, observe that ExactSizeIterator can also be implemented for Take<RepeatWhile<F>> so add that implementation too. Since in contrast to Repeat, RepeatWhile doesn’t guarante to always return the same value, DoubleEndedIterator isn’t implemented. Those changes render core::iter::repeat_n somewhat redundant. Issue: https://github.com/rust-lang/rust/issues/104434 Issue: https://github.com/rust-lang/rust/issues/104729 - [ ] ACP: https://github.com/rust-lang/libs-team/issues/120 (this is actually ACP for repeat_n but this is nearly the same functionality so hijacking it so both approaches can be discussed in one place)
2024-08-16Update cargoWeihang Lo-0/+0
2024-08-16Auto merge of #116528 - daxpedda:stabilize-ready-into-inner, r=dtolnaybors-2/+1
Stabilize `Ready::into_inner()` This PR stabilizes `Ready::into_inner()`. Tracking issue: #101196. Implementation PR: #101189. Closes #101196.
2024-08-16Auto merge of #129162 - matthiaskrgr:rollup-r0oxdev, r=matthiaskrgrbors-71/+76
Rollup of 6 pull requests Successful merges: - #128990 (Re-enable more debuginfo tests on freebsd) - #129042 (Special-case alias ty during the delayed bug emission in `try_from_lit`) - #129086 (Stabilize `is_none_or`) - #129149 (Migrate `validate_json.py` script to rust in `run-make/rustdoc-map-file` test) - #129154 (Fix wrong source location for some incorrect macro definitions) - #129161 (Stabilize std::thread::Builder::spawn_unchecked) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-16Rollup merge of #129161 - dtolnay:spawnunck, r=NoratriebMatthias Krüger-3/+1
Stabilize std::thread::Builder::spawn_unchecked Closes #55132.
2024-08-16Rollup merge of #129154 - wafarm:fix-95463, r=estebankMatthias Krüger-12/+19
Fix wrong source location for some incorrect macro definitions Fixes #95463 Currently the code will consume the next token tree after `var` when trying to parse `$var:some_type` even when it's not a `:` (e.g. a `$` when input is `($foo $bar:tt) => {}`). Additionally it will return the wrong span when it's not a `:`. This PR fixes these problems.
2024-08-16Rollup merge of #129149 - GuillaumeGomez:migrate-python-script, r=jieyouxuMatthias Krüger-44/+47
Migrate `validate_json.py` script to rust in `run-make/rustdoc-map-file` test This PR fixes the FIXME I added for future-me who become present-me. :') Since there are multiple `run-make` tests using python scripts, I suppose more of them will migrate to Rust, hence why I added the `jzon` public reexport to the `run-make-support` crate. cc `@jieyouxu` r? `@Kobzol`
2024-08-16Rollup merge of #129086 - slanterns:is_none_or, r=dtolnayMatthias Krüger-7/+2
Stabilize `is_none_or` Closes: https://github.com/rust-lang/rust/issues/126383. `@rustbot` label: +T-libs-api r? libs-api
2024-08-16Rollup merge of #129042 - Jaic1:fix-116308, r=BoxyUwUMatthias Krüger-1/+7
Special-case alias ty during the delayed bug emission in `try_from_lit` This PR tries to fix #116308. A delayed bug in `try_from_lit` will not be emitted so that the compiler will not ICE when it sees the pair `(ast::LitKind::Int, ty::TyKind::Alias)` in `lit_to_const` (called from `try_from_lit`). This PR is related to an unstable feature `adt_const_params` (#95174). r? ``@BoxyUwU``
2024-08-16Rollup merge of #128990 - saethlin:freebsd-debuginfo-tests, r=compiler-errorsMatthias Krüger-4/+0
Re-enable more debuginfo tests on freebsd These ignores are _ancient_, we don't run freebsd tests in CI, and even if we did they'd probably pass because the test suite passes with the latest gdb release on Linux.
2024-08-16Auto merge of #128456 - Oneirical:clantestine-operations, r=jieyouxubors-141/+240
Migrate `reproducible-build` `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 will likely fail. Locally, rustc errors with `linker 'linker' not found` on line 36 while the file exists according to the dir-debug statement before it. If this gets fixed and the test passes, further developments may include: - [x] There may be some leftovers from each test - `test_in_tmpdir` may therefore be required. - [ ] Try jobs on all ignored architectures. - [x] A potential refactor with a struct and a custom function like #128410 so this isn't just a huge stream of `rfs` and `rustc`. This is a little bit harder to do in this test considering the variability present in each test case. // try-job: x86_64-msvc // windows jobs passed in a prior run // try-job: x86_64-mingw // try-job: i686-msvc // try-job: i686-mingw try-job: aarch64-apple try-job: aarch64-gnu try-job: armhf-gnu try-job: test-various try-job: dist-various-1
2024-08-16Stabilize std::thread::Builder::spawn_uncheckedDavid Tolnay-3/+1
2024-08-16Re-enable debuginfo tests on freebsdBen Kimock-4/+0
2024-08-16Reexport `serde_json` crate from run-make-support to give it access to ↵Guillaume Gomez-39/+38
`run-make` tests
2024-08-16Migrate `validate_json.py` script to rust in `run-make/rustdoc-map-file` testGuillaume Gomez-44/+48
2024-08-16Auto merge of #129068 - cuviper:llvm19rc2, r=compiler-errorsbors-0/+0
Re-update to LLVM 19 rc2 The update in #128677 was accidentally reverted in #128962. Fixes #129064 r? nikic
2024-08-16massive refactor of reproducible-build testOneirical-161/+179
2024-08-16rewrite reproducible-build to rmakeOneirical-141/+222
2024-08-16Fix wrong source location for some incorrect macro definitionsWafarm-12/+19
2024-08-16Auto merge of #129052 - onur-ozkan:better-incompatibility-check, r=Kobzolbors-98/+164
detect incompatible CI rustc options more precisely Previously, the logic here was simply checking whether the option was set in `config.toml`. This approach was not manageable in our CI runners as we set so many options in config.toml. In reality, those values are not incompatible since they are usually the same value used to generate the CI rustc. Now, the new logic compares the configuration values with the values used to generate the CI rustc, so we get more precise results and make the process more manageable. r? Kobzol Blocker for https://github.com/rust-lang/rust/pull/122709
2024-08-16Auto merge of #128977 - jieyouxu:writable-file, r=Kobzolbors-11/+45
Only try to modify file times of a writable file on Windows Introduces a `set_file_times` helper which opens a given path as a file in r+w mode on Windows and then sets file times. Previously the file was open as read-only for Windows which caused permission errors locally. This should hopefully make setting file times less error prone, since trying to set file times on read-only file on Windows also happened in #127850. try-job: dist-loongarch64-musl try-job: x86_64-msvc
2024-08-16float to/from bits and classify: update comments regarding non-conformant ↵Ralf Jung-683/+107
hardware
2024-08-16bootstrap: fix trying to modify file times on read-only file on Windows许杰友 Jieyou Xu (Joe)-11/+45
2024-08-16Auto merge of #128913 - saethlin:unignore-debuginfo-tests, r=compiler-errorsbors-72/+48
Enable debuginfo tests that have been "temporarily disabled" for the past 6 years The PR history is a bit of a mess because I had to test this a lot with try-jobs, so I'll try to summarize the non-obvious changes here. A number of tests now have `min-lldb-version: 1800`. Those tests should have gotten an lldb version jump either in https://github.com/rust-lang/rust/pull/124781 or long ago. Note that all such tests with that lldb version requirement do not run in Apple CI. `tests/debuginfo/drop-locations.rs` is staying disabled for now because gdb doesn't know to stop on the drop calls produced by a `}`: https://github.com/rust-lang/rust/issues/128971 `tests/debuginfo/function-arg-initialization.rs` now has `-Zmir-enable-passes=-SingleUseConsts`; without that we initialize the const before the function prelude: https://github.com/rust-lang/rust/issues/128945 `tests/debuginfo/by-value-non-immediate-argument.rs` fails because we don't generate a function prelude for unused non-immediate arguments, even with all optimizations disabled, and this seems to confuse debuggers on aarch64: https://github.com/rust-lang/rust/issues/128973 `tests/debuginfo/pretty-std.rs` is staying disabled on windows-gnu because our test harness doesn't know how to load our pretty-printers on that target: https://github.com/rust-lang/rust/issues/128981 `tests/debuginfo/method-on-enum.rs` and `tests/debuginfo/option-like-enum.rs` encounter some kind of gdb bug on i686-pc-windows-gnu. I don't know enough about that situation to write a good issue. I plan on doing more work on this test suite. There's clearly a lot more basic cleanup work to do here.
2024-08-16Auto merge of #129143 - workingjubilee:rollup-h0hzumu, r=workingjubileebors-350/+564
Rollup of 9 pull requests Successful merges: - #128064 (Improve docs for Waker::noop and LocalWaker::noop) - #128922 (rust-analyzer: use in-tree `pattern_analysis` crate) - #128965 (Remove `print::Pat` from the printing of `WitnessPat`) - #129018 (Migrate `rlib-format-packed-bundled-libs` and `native-link-modifier-bundle` `run-make` tests to rmake) - #129037 (Port `run-make/libtest-json` and `run-make/libtest-junit` to rmake) - #129078 (`ParamEnvAnd::fully_perform`: we have an `ocx`, use it) - #129110 (Add a comment explaining the return type of `Ty::kind`.) - #129111 (Port the `sysroot-crates-are-unstable` Python script to rmake) - #129135 (crashes: more tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-15Rollup merge of #129135 - matthiaskrgr:ITKEEPSCRASHINGAAAAAAAAHH, ↵Jubilee-0/+131
r=compiler-errors crashes: more tests r? ````@jieyouxu````
2024-08-15Rollup merge of #129111 - Zalathar:python-sysroot, r=jieyouxuJubilee-77/+99
Port the `sysroot-crates-are-unstable` Python script to rmake New version of #126231, and a follow-up to #129071. One major difference is that the new version no longer tries to report *all* accidentally-stable crates, because the `run_make_support` helpers tend to halt the test as soon as something goes wrong. That's unfortunate, but I think it won't matter much in practice, and preserving the old behaviour doesn't seem worth the extra effort. --- Part of #110479 (Python purge), with this being one of the non-trivial Python scripts that actually seems feasible and worthwhile to remove. This is *not* part of #121876 (Makefile purge), because the underlying test is already using rmake; this PR just modifies the existing rmake recipe to do all the work itself instead of delegating to Python. So there's no particular urgency here. r? ````@jieyouxu```` try-job: aarch64-gnu try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: x86_64-msvc try-job: i686-mingw
2024-08-15Rollup merge of #129110 - nnethercote:Ty-kind-ret-ty-comment, r=jieyouxuJubilee-0/+4
Add a comment explaining the return type of `Ty::kind`. At least we'll get a useful comment out of #126069 :) r? ````@lcnr````
2024-08-15Rollup merge of #129078 - lcnr:scrape_region_constraints-use-ocx, ↵Jubilee-35/+3
r=compiler-errors `ParamEnvAnd::fully_perform`: we have an `ocx`, use it cc #123669 r? ``@compiler-errors``
2024-08-15Rollup merge of #129037 - Zalathar:rmake-libtest, r=jieyouxuJubilee-44/+64
Port `run-make/libtest-json` and `run-make/libtest-junit` to rmake Unlike #126773, this is just a straightforward port to `rmake`, without attempting to switch to compiletest or get rid of the (trivial) Python scripts. Part of #121876. r? ````@jieyouxu```` try-job: x86_64-msvc try-job: i686-mingw try-job: test-various try-job: aarch64-gnu try-job: aarch64-apple
2024-08-15Rollup merge of #129018 - Oneirical:nmemonic-artifice, r=jieyouxuJubilee-79/+180
Migrate `rlib-format-packed-bundled-libs` and `native-link-modifier-bundle` `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: test-various (ATTEMPTED: IGNORE RESTORED) try-job: x86_64-msvc try-job: aarch64-apple try-job: aarch64-gnu try-job: x86_64-mingw try-job: i686-mingw
2024-08-15Rollup merge of #128965 - Zalathar:no-pat, r=NadrierilJubilee-112/+60
Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in #128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? ```@Nadrieril```
2024-08-15Rollup merge of #128922 - Nadrieril:r-a-use-upstream-pat-ana, r=VeykrilJubilee-2/+4
rust-analyzer: use in-tree `pattern_analysis` crate r? ```@Veykril```
2024-08-15Rollup merge of #128064 - ijackson:noop-waker-doc, r=workingjubileeJubilee-1/+19
Improve docs for Waker::noop and LocalWaker::noop * Add a warning about a likely misuse. (See my commit message for longer rationale.) * Apply some probably-accidentally-omitted changes to `LocalWaker`'s docs * Add a comment about the clone-and-hack of the docs I have used [semantic linefeeds](https://rhodesmill.org/brandon/2012/one-sentence-per-line/) for the docs formatting.
2024-08-16Auto merge of #128725 - nnethercote:fix-assoc-expr-collect-problems, ↵bors-298/+483
r=petrochenkov Fix problems with assoc expr token collection There are several cases involving assoc exprs and attributes where the current code does the wrong thing. This PR adds some tests that demonstrate the problems and then fixes them. r? `@petrochenkov`
2024-08-16Special-case alias ty in `try_from_lit`Jaic1-1/+7
2024-08-16Overhaul token collection.Nicholas Nethercote-291/+413
This commit does the following. - Renames `collect_tokens_trailing_token` as `collect_tokens`, because (a) it's annoying long, and (b) the `_trailing_token` bit is less accurate now that its types have changed. - In `collect_tokens`, adds a `Option<CollectPos>` argument and a `UsePreAttrPos` in the return type of `f`. These are used in `parse_expr_force_collect` (for vanilla expressions) and in `parse_stmt_without_recovery` (for two different cases of expression statements). Together these ensure are enough to fix all the problems with token collection and assoc expressions. The changes to the `stringify.rs` test demonstrate some of these. - Adds a new test. The code in this test was causing an assertion failure prior to this commit, due to an invalid `NodeRange`. The extra complexity is annoying, but necessary to fix the existing problems.
2024-08-16Add some attribute `stringify!` tests.Nicholas Nethercote-2/+53
A couple of these are marked `FIXME` because they demonstrate existing bugs with token collection.
2024-08-16Add an assertion to `NodeRange::new`.Nicholas Nethercote-0/+1
2024-08-16Convert a bool to `Trailing`.Nicholas Nethercote-40/+52
This pre-existing type is suitable for use with the return value of the `f` parameter in `collect_tokens_trailing_token`. The more descriptive name will be useful because the next commit will add another boolean value to the return value of `f`.
2024-08-16Make visibilities minimal and consistent in `attr_wrapper.rs`.Nicholas Nethercote-6/+6
2024-08-16Remove size assertion on `AttrWrapper`.Nicholas Nethercote-1/+0
It's not an important type when it comes to memory use.
2024-08-15Auto merge of #128787 - Oneirical:infohazardous-deprogram, r=jieyouxubors-66/+37
Coalesce `dep-info`, `dep-info-spaces` and `dep-info-doesnt-run-much` `run-make` tests into `dep-info` rmake.rs 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 is one of the most ancient tests in the `run-make` directory and its Makefile does some unexpected things, like creating and deleting a `done` directory over and over, sleeping at certain times (this is the [commit](https://github.com/rust-lang/rust/pull/13288/commits/0d9fd8e2a1f8aa43b4cf66272eaa3cf695bbdcd9) that added the `sleep`). I tried to preserve the intent of the test, which is smoke-testing that `dep-info` works. try-job: x86_64-msvc try-job: i686-mingw try-job: aarch64-gnu try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-various-1