about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-28Don't store `thir::Pat` in error structsZalathar-40/+32
In several cases this avoids the need to clone the underlying pattern, and then print the clone later.
2024-07-28Auto merge of #128079 - Oneirical:testiges-of-civilization, r=jieyouxubors-73/+94
Migrate `static-dylib-by-default`, `sanitizer-dylib-link`, `sanitizer-cdylib-link` and `sanitizer-staticlib-link` `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: armhf-gnu try-job: test-various try-job: i686-msvc try-job: x86_64-mingw try-job: x86_64-gnu-llvm-18
2024-07-27Auto merge of #128270 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 14 commits in 5f6b9a92201d78af75dc24f14662c3e2dacbbbe1..b5d44db1daf0469b227a6211b987162a39a54730 2024-07-19 18:09:17 +0000 to 2024-07-26 21:27:12 +0000 - Package workspaces (rust-lang/cargo#13947) - test: migrate messages to snapbox (rust-lang/cargo#14242) - chore: Update dependencies (rust-lang/cargo#14299) - fix: remove rustc probe for `--check-cfg` support (rust-lang/cargo#14302) - Misc test clean up (rust-lang/cargo#14297) - Don't downgrade on prerelease `VersionReq` when update with --breaking. (rust-lang/cargo#14250) - test: Migrate some json tests to snapbox (rust-lang/cargo#14293) - Revert "fix: Ensure dep/feature activates the dependency on 2024" (rust-lang/cargo#14295) - chore: bump cargo-test-support to 0.4.0 (rust-lang/cargo#14286) - Bump to 0.83.0; update changelog (rust-lang/cargo#14285) - Improved error message when `update --breaking` invalid spec. (rust-lang/cargo#14279) - docs(test): Expand documentation of cargo-test-support (rust-lang/cargo#14272) - test: Fix some test based on rustc version (rust-lang/cargo#14282) - Use `Rc` instead of `Arc` for storing rustflags (rust-lang/cargo#14273) r? ghost
2024-07-27Auto merge of #128278 - tgross35:rollup-zv7q0h5, r=tgross35bors-587/+501
Rollup of 8 pull requests Successful merges: - #125897 (from_ref, from_mut: clarify documentation) - #128207 (improve error message when `global_asm!` uses `asm!` options) - #128241 (Remove logic to suggest clone of function output) - #128259 ([illumos/solaris] set MSG_NOSIGNAL while writing to sockets) - #128262 (Delete `SimplifyArmIdentity` and `SimplifyBranchSame` tests) - #128266 (update `rust.channel` default value documentation) - #128267 (Add rustdoc GUI test to check title with and without search) - #128271 (Disable jump threading of float equality) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-27Rollup merge of #128271 - ↵Trevor Gross-0/+137
Nilstrieb:jump-into-a-can-of-worms-called-float-equality, r=compiler-errors Disable jump threading of float equality Jump threading stores values as `u128` (`ScalarInt`) and does its comparisons for equality as integer comparisons. This works great for integers. Sadly, not everything is an integer. Floats famously have wonky equality semantcs, with `NaN!=NaN` and `0.0 == -0.0`. This does not match our beautiful integer bitpattern equality and therefore causes things to go horribly wrong. While jump threading could be extended to support floats by remembering that they're floats in the value state and handling them properly, it's signficantly easier to just disable it for now. fixes #128243
2024-07-27Rollup merge of #128267 - GuillaumeGomez:gui-test-title, r=notriddleTrevor Gross-0/+24
Add rustdoc GUI test to check title with and without search Follow-up of https://github.com/rust-lang/rust/pull/128210. r? `@notriddle`
2024-07-27Rollup merge of #128266 - onur-ozkan:update-channel-doc, r=dtolnayTrevor Gross-1/+9
update `rust.channel` default value documentation self-explanatory Resolves #128258 r? dtolnay
2024-07-27Rollup merge of #128262 - DianQK:remove-unused-tests, r=saethlinTrevor Gross-436/+0
Delete `SimplifyArmIdentity` and `SimplifyBranchSame` tests These two passes have already been deleted in #107256. I'm not sure why tidy didn't catch it. As regression tests, I didn't delete `tests/ui/mir/issue-66851.rs` and `tests/ui/mir/simplify-branch-same.rs`. r? compiler
2024-07-27Rollup merge of #128259 - sunshowers:msg-nosignal, r=Mark-SimulacrumTrevor Gross-0/+5
[illumos/solaris] set MSG_NOSIGNAL while writing to sockets Both these platforms have MSG_NOSIGNAL available, and we should set it for socket writes in the event that the SIGPIPE handler has been reset to SIG_DFL (i.e. terminate the process). I've verified via a quick program at https://github.com/sunshowers/msg-nosignal-test/ that even when the SIGPIPE handler is reset to SIG_DFL, writes to closed TCP sockets now error out with EPIPE. (Under ordinary circumstances UDP writes won't cause MSG_NOSIGNAL.) However, I couldn't find any existing tests which verified the MSG_NOSIGNAL behavior.
2024-07-27Rollup merge of #128241 - compiler-errors:clone-sugg, r=jieyouxuTrevor Gross-37/+14
Remove logic to suggest clone of function output I can't exactly tell, but I believe that this suggestion is operating off of a heuristic that the lifetime of a function's input is correlated with the lifetime of a function's output in such a way that cloning would fix an error. I don't think that actually manages to hit the bar of "actually provides useful suggestions" most of the time. Specifically, I've hit false-positives due to this suggestion *twice* when fixing ICEs in the compiler, so I don't think it's worthwhile having this logic around. Neither of the two affected UI tests are actually fixed by the suggestion.
2024-07-27Rollup merge of #128207 - folkertdev:asm-parser-generalize, r=AmanieuTrevor Gross-105/+224
improve error message when `global_asm!` uses `asm!` options specifically, what was error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags` --> $DIR/bad-options.rs:45:25 | LL | global_asm!("", options(preserves_flags)); | ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw` is now error: the `preserves_flags` option cannot be used with `global_asm!` --> $DIR/bad-options.rs:45:25 | LL | global_asm!("", options(preserves_flags)); | ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly mirroring the phrasing of the [reference](https://doc.rust-lang.org/reference/inline-assembly.html#options). This is also a bit of a refactor for a future `naked_asm!` macro (for use in `#[naked]` functions). Currently this sort of error can come up when switching from inline to global asm, or when a user just isn't that experienced with assembly. With `naked_asm!` added to the mix hitting this error is more likely.
2024-07-27Rollup merge of #125897 - RalfJung:from-ref, r=AmanieuTrevor Gross-8/+88
from_ref, from_mut: clarify documentation This was brought up [here](https://github.com/rust-lang/rust/issues/56604#issuecomment-2143193486). The domain of quantification is generally always constrained by the type in the type signature, and I am not sure it's always worth spelling that out explicitly as that makes things exceedingly verbose. But since this was explicitly brought up, let's clarify.
2024-07-27add `needs-asm-support` to `tests/ui/asm/unsupported-option.rs`Folkert-3/+5
2024-07-27update aarch64 asm testsFolkert-47/+61
2024-07-27Auto merge of #128091 - heiher:xz-only, r=Mark-Simulacrumbors-1/+1
build-manifest: Allow building manifests for formats that only have xz compression
2024-07-27Disable jump threading of float equalityNilstrieb-0/+137
Jump threading stores values as `u128` (`ScalarInt`) and does its comparisons for equality as integer comparisons. This works great for integers. Sadly, not everything is an integer. Floats famously have wonky equality semantcs, with `NaN!=NaN` and `0.0 == -0.0`. This does not match our beautiful integer bitpattern equality and therefore causes things to go horribly wrong. While jump threading could be extended to support floats by remembering that they're floats in the value state and handling them properly, it's signficantly easier to just disable it for now.
2024-07-27Update cargoWeihang Lo-0/+0
2024-07-27Auto merge of #128006 - tgross35:missing-fragment-specifier-e2024, ↵bors-25/+114
r=petrochenkov Make `missing_fragment_specifier` an error in edition 2024 `missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout. Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`. Fixes <https://github.com/rust-lang/rust/issues/40107> --- It is rather late for the edition but since this change is relatively small, it seems worth at least bringing up. This follows a brief [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/268952-edition/topic/.60.20DBD.20-.3E.20hard.20error) (cc `@tmandry).` Making this an edition-dependent lint has come up before but there was not a strong motivation. I am proposing it at this time because this would simplify the [named macro capture groups](https://github.com/rust-lang/rfcs/pull/3649) RFC, which has had mildly positive response, and makes use of new `$` syntax in the matcher. The proposed syntax currently parses as metavariables without a fragment specifier; this warning is raised, but there are no errors. It is obviously not known that this specific RFC will eventually be accepted, but forbidding `missing_fragment_specifier` should make it easier to support any new syntax in the future that makes use of `$` in different ways. The syntax conflict is also not impossible to overcome, but making it clear that unnamed metavariables are rejected makes things more straightforward and should allow for better diagnostics. `@Mark-Simulacrum` suggested making this forbid-by-default instead of an error at https://github.com/rust-lang/rust/issues/40107#issuecomment-761727885, but I don't think this would allow the same level of syntax flexibility. It is also possible to reconsider making this an unconditional error since four years have elapsed since the previous attempt, but this seems likely to hit the same pitfalls. (Possibly worth a crater run?) Tracking: - https://github.com/rust-lang/rust/issues/128143
2024-07-27Add rustdoc GUI test to check title with and without searchGuillaume Gomez-0/+24
2024-07-27Auto merge of #124905 - reitermarkus:u32-from-char-opt, r=scottmcmbors-57/+114
Allow optimizing `u32::from::<char>`. Extracted from https://github.com/rust-lang/rust/pull/124307. This allows optimizing the panicking branch in the `escape_unicode` function, see https://rust.godbolt.org/z/61YhKrhvP.
2024-07-27Make `missing_fragment_specifier` an error in edition 2024Trevor Gross-25/+114
`missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout. Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`. Fixes <https://github.com/rust-lang/rust/issues/40107>
2024-07-27add change entry for `rust.channel` defaultsonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27update `rust.channel` documentationonur-ozkan-1/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27Auto merge of #128255 - stepancheg:doc-shl, r=scottmcmbors-0/+13
Document 0x10.checked_shl(BITS - 1) does not overflow Not obvious.
2024-07-27Delete `SimplifyArmIdentity` and `SimplifyBranchSame` testsDianQK-436/+0
2024-07-27Auto merge of #127946 - tgross35:fmt-builders-set-result, r=cuviperbors-4/+8
Always set `result` during `finish()` in debug builders Most functions for format builders set `self.result` after writing strings. This ensures that any further writing fails immediately rather than trying to write again. A few `.finish()` methods and the `.finish_non_exhaustive` did have this same behavior, so update the remaining `.finish()` methods to make it consistent here.
2024-07-27[illumos/solaris] set MSG_NOSIGNAL while writing to socketsRain-0/+5
Both these platforms have MSG_NOSIGNAL available, and we should set it for socket writes in the event that the SIGPIPE handler has been reset to SIG_DFL (i.e. terminate the process). I've verified via a quick program at https://github.com/sunshowers/msg-nosignal-test/ that even when the SIGPIPE handler is reset to SIG_DFL, writes to closed sockets now error out with EPIPE. (Under ordinary circumstances UDP writes won't cause MSG_NOSIGNAL.)
2024-07-27Auto merge of #128253 - tgross35:rollup-rpmoebz, r=tgross35bors-133/+265
Rollup of 9 pull requests Successful merges: - #124941 (Stabilize const `{integer}::from_str_radix` i.e. `const_int_from_str`) - #128201 (Implement `Copy`/`Clone` for async closures) - #128210 (rustdoc: change title of search results) - #128223 (Refactor complex conditions in `collect_tokens_trailing_token`) - #128224 (Remove unnecessary range replacements) - #128226 (Remove redundant option that was just encoding that a slice was empty) - #128227 (CI: do not respect custom try jobs for unrolled perf builds) - #128229 (Improve `extern "<abi>" unsafe fn()` error message) - #128235 (Fix `Iterator::filter` docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-27Document int.checked_shl(BITS - 1)Stepan Koltsov-0/+13
Not obvious.
2024-07-26Rollup merge of #128235 - harryscholes:fix-iterator-filter-docs, r=tgross35Trevor Gross-1/+1
Fix `Iterator::filter` docs Small fix to add code formatting around `Iterator::filter` `true` return type
2024-07-26Rollup merge of #128229 - tdittr:unsafe-extern-abi-error, r=compiler-errorsTrevor Gross-11/+47
Improve `extern "<abi>" unsafe fn()` error message These errors were already reported in #87217, and fixed by #87235 but missed the case of an explicit ABI. This PR does not cover multiple keywords like `extern "C" pub const unsafe fn()`, but I don't know what a good way to cover this would be. It also seems rarer than `extern "C" unsafe` which I saw happen a few times in workshops.
2024-07-26Rollup merge of #128227 - Kobzol:ci-unrolled-perf-build-matrix, r=tgross35Trevor Gross-2/+8
CI: do not respect custom try jobs for unrolled perf builds Before this PR, if a pull request merged in a rollup had some `try-job` annotations, the unrolled perf builds were running the custom try jobs instead of the default job, which was wrong. Found out [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/try-perf.20jobs.20respect.20try-job.20annotations).
2024-07-26Rollup merge of #128226 - oli-obk:option_vs_empty_slice, r=petrochenkovTrevor Gross-6/+6
Remove redundant option that was just encoding that a slice was empty There is already a sanity check ensuring we don't put empty attribute lists into the HIR: https://github.com/rust-lang/rust/blob/6ef11b81c2c02c3c4b7556d1991a98572fe9af87/compiler/rustc_ast_lowering/src/lib.rs#L661-L667
2024-07-26Rollup merge of #128224 - nnethercote:fewer-replace_ranges, r=petrochenkovTrevor Gross-25/+21
Remove unnecessary range replacements This PR removes an unnecessary range replacement in `collect_tokens_trailing_token`, and does a couple of other small cleanups. r? ````@petrochenkov````
2024-07-26Rollup merge of #128223 - nnethercote:refactor-collect_tokens, r=petrochenkovTrevor Gross-45/+43
Refactor complex conditions in `collect_tokens_trailing_token` More readability improvements for this complicated function. r? ````@petrochenkov````
2024-07-26Rollup merge of #128210 - lolbinarycat:rustdoc-search-title, ↵Trevor Gross-1/+1
r=notriddle,GuillaumeGomez rustdoc: change title of search results the current title is too similar to that of the page for std::result::Result, which is a problem both for navigating to the Result docs via browser autocomplete, and for being able to tell which tab is which when the width of tabs is small.
2024-07-26Rollup merge of #128201 - compiler-errors:closure-clone, r=oli-obkTrevor Gross-21/+120
Implement `Copy`/`Clone` for async closures We can do so in the same cases that regular closures do. For the purposes of cloning, coroutine-closures are actually precisely the same as regular closures, specifically in the aspect that `Clone` impls care about which is the upvars. The only difference b/w coroutine-closures and regular closures is the type that they *return*, but this type has not been *created* yet, so we don't really have a problem. IDK why I didn't add this impl initially -- I went back and forth a bit on the internal representation for coroutine-closures before settling on a design which largely models regular closures. Previous (not published) iterations of coroutine-closures used to be represented as a special (read: cursed) kind of coroutine, which would probably suffer from the pitfalls that coroutines have that oli mentioned below in https://github.com/rust-lang/rust/pull/128201#issuecomment-2251230274. r? oli-obk
2024-07-26Rollup merge of #124941 - Skgland:stabilize-const-int-from-str, r=dtolnayTrevor Gross-21/+18
Stabilize const `{integer}::from_str_radix` i.e. `const_int_from_str` This PR stabilizes the feature `const_int_from_str`. - ACP Issue: rust-lang/libs-team#74 - Implementation PR: rust-lang/rust#99322 - Part of Tracking Issue: rust-lang/rust#59133 API Change Diff: ```diff impl {integer} { - pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; + pub const fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>; } impl ParseIntError { - pub fn kind(&self) -> &IntErrorKind; + pub const fn kind(&self) -> &IntErrorKind; } ``` This makes it easier to parse integers at compile-time, e.g. the example from the Tracking Issue: ```rust env!("SOMETHING").parse::<usize>().unwrap() ``` could now be achived with ```rust match usize::from_str_radix(env!("SOMETHING"), 10) { Ok(val) => val, Err(err) => panic!("Invalid value for SOMETHING environment variable."), } ``` rather than having to depend on a library that implements or manually implement the parsing at compile-time. --- Checklist based on [Libs Stabilization Guide - When there's const involved](https://std-dev-guide.rust-lang.org/development/stabilization.html#when-theres-const-involved) I am treating this as a [partial stabilization](https://std-dev-guide.rust-lang.org/development/stabilization.html#partial-stabilizations) as it shares a tracking issue (and is rather small), so directly opening the partial stabilization PR for the subset (feature `const_int_from_str`) being stabilized. - [x] ping Constant Evaluation WG - [x] no unsafe involved - [x] no `#[allow_internal_unstable]` - [ ] usage of `intrinsic::const_eval_select` rust-lang/rust#124625 in `from_str_radix_assert` to change the error message between compile-time and run-time - [ ] [rust-labg/libs-api FCP](https://github.com/rust-lang/rust/pull/124941#issuecomment-2207021921)
2024-07-26Auto merge of #121676 - Bryanskiy:polarity, r=petrochenkovbors-83/+364
Support ?Trait bounds in supertraits and dyn Trait under a feature gate This patch allows `maybe` polarity bounds under a feature gate. The only language change here is that corresponding hard errors are replaced by feature gates. Example: ```rust #![feature(allow_maybe_polarity)] ... trait Trait1 : ?Trait { ... } // ok fn foo(_: Box<(dyn Trait2 + ?Trait)>) {} // ok fn bar<T: ?Sized + ?Trait>(_: &T) {} // ok ``` Maybe bounds still don't do anything (except for `Sized` trait), however this patch will allow us to [experiment with default auto traits](https://github.com/rust-lang/rust/pull/120706#issuecomment-1934006762). This is a part of the [MCP: Low level components for async drop](https://github.com/rust-lang/compiler-team/issues/727)
2024-07-26Remove logic to suggest clone of function outputMichael Goulet-37/+14
2024-07-26Always set `result` during `finish()` in debug buildersTrevor Gross-4/+8
Most functions for format builders set `self.result` after writing strings. This ensures that any further writing fails immediately rather than trying to write again. A few `.finish()` methods did have this same behavior, so make it consistent here.
2024-07-26Suppress useless clone suggestionMichael Goulet-5/+5
2024-07-26Make coroutine-closures possible to be clonedMichael Goulet-21/+120
2024-07-26Auto merge of #128065 - Oneirical:great-testilence, r=jieyouxubors-62/+84
Migrate `c-unwind-abi-catch-lib-panic`, `foreign-rust-exceptions` and `export-executable-symbols` `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: aarch64-apple try-job: i686-mingw
2024-07-26rewrite sanitizer-staticlib-link to rmakeOneirical-24/+39
2024-07-26Fix docsharryscholes-1/+1
2024-07-26rewrite export-executable-symbols to rmakeOneirical-17/+30
2024-07-26rewrite foreign-rust-exceptions to rmakeOneirical-14/+23
2024-07-26rewrite c-unwind-abi-catch-lib-panic to rmakeOneirical-36/+36
2024-07-26Forbid `?Trait` bounds repetitionsBryanskiy-11/+72