about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-08Remove unused dependency from opt-distJakub Beránek-1/+0
2025-05-08Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrierilbors-25/+480
allow deref patterns to participate in exhaustiveness analysis Per [this proposal](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Exhaustiveness), this PR allows deref patterns to participate in exhaustiveness analysis. Currently all deref patterns enforce `DerefPure` bounds on their scrutinees, so this assumes all patterns it's analyzing are well-behaved. This also doesn't support [mixed exhaustiveness](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Mixed-exhaustiveness), and instead emits an error if deref patterns are used together with normal constructors. I think mixed exhaustiveness would be nice to have (especially if we eventually want to support arbitrary `Deref` impls[^1]), but it'd require more work to get reasonable diagnostics[^2]. Tracking issue for deref patterns: #87121 r? `@Nadrieril` [^1]: Regardless of whether we support limited exhaustiveness checking for untrusted `Deref` or always require other arms to be exhaustive, I think it'd be useful to allow mixed matching for user-defined smart pointers. And it'd be strange if it worked there but not for `Cow`. [^2]: I think listing out witnesses of non-exhaustiveness can be confusing when they're not necessarily disjoint, and when you only need to cover some of them, so we'd probably want special formatting and/or explanatory subdiagnostics. And if it's implemented similarly to unions, we'd probably also want some way of merging witnesses; the way witnesses for unions can appear duplicated is pretty unfortunate. I'm not sure yet how the diagnostics should look, especially for deeply nested patterns.
2025-05-07Auto merge of #140751 - GuillaumeGomez:rollup-eahw4ta, r=GuillaumeGomezbors-292/+643
Rollup of 8 pull requests Successful merges: - #140234 (Separate dataflow analysis and results) - #140614 (Correct warning message in restricted visibility) - #140671 (Parser: Recover error from named params while parse_path) - #140700 (Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 ) - #140706 ([rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed) - #140734 (Fix regression from #140393 for espidf / horizon / nuttx / vita) - #140741 (add armv5te-unknown-linux-gnueabi target maintainer) - #140745 (run-make-support: set rustc dylib path for cargo wrapper) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-07Auto merge of #140590 - lcnr:closure-in-dead-code, r=compiler-errorsbors-64/+135
borrowck nested items in dead code fixes https://github.com/rust-lang/rust/issues/140583 r? `@compiler-errors`
2025-05-07Rollup merge of #140745 - jchecahi:run-make-support-cargo-rustc-dylib, ↵Guillaume Gomez-1/+4
r=jieyouxu run-make-support: set rustc dylib path for cargo wrapper Some run-make tests invoke Cargo via run_make_support::cargo(), but fail to execute correctly when rustc is built without rpath. In these setups, runtime loading of rustc’s shared libraries fails unless the appropriate dynamic library path is set manually. This commit updates the cargo() wrapper to call set_host_compiler_dylib_path(), aligning its behavior with the existing rustc() wrapper: https://github.com/rust-lang/rust/blob/f76c7367c6363d33ddb5a93b5de0d158b2d827f6/src/tools/run-make-support/src/external_deps/rustc.rs#L39-L43 This ensures that Cargo invocations during tests inherit the necessary dylib paths, avoiding errors related to missing shared libraries in rpath-less builds. Fixes part of #140738
2025-05-07Rollup merge of #140741 - husqvarnagroup:af/armv5te-target-maintainer, ↵Guillaume Gomez-1/+31
r=jieyouxu add armv5te-unknown-linux-gnueabi target maintainer My employer is interested in having this target maintained and we already have some tests in our CI running for it. armv5te-unknown-linux-gnueabi can be ticket off in #113739.
2025-05-07Rollup merge of #140734 - ivmarkov:master, r=joboetGuillaume Gomez-0/+1
Fix regression from #140393 for espidf / horizon / nuttx / vita #140393 introduced changes to the layout of the `std::sys::process` code. As a result, the Tier 3 ESP-IDF (and I suspect Horizon, Nuttx and Vita targets as well) no longer build. A `pub use unsupported::output` is all that was missing - for the above OSes specifically. This explicit `pub use` is now necessary, because #140393 moved the `output` function to module-level, where it was previously part of `Command` and was thus re-exported automatically, as part of the `imp::Command` re-export further down the file containing the one-liner fix. Note that - with the change introduced by #140393 - we **can't** anymore just do an unconditional `pub use imp::output` as this function simply does not exist anymore anywhere else but in the `unsupported` module. r? `@joboet`
2025-05-07Rollup merge of #140706 - GuillaumeGomez:fix-missing-temp-dir-cleanup, ↵Guillaume Gomez-3/+73
r=notriddle [rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed Fixes #139899. The bug was due to the fact that if any doctest fails for any reason, we call `exit` (or it's called inside `libtest` if not edition 2024), meaning that `TempDir`'s destructor isn't called, and therefore the temporary folder isn't cleaned up. Took me a while to figure out how to reproduce but finally I was able to reproduce the bug with: `````rust #![doc(test(attr(deny(warnings))))] //! ``` //! let a = 12; //! ``` ````` And then I ensured that panicking doctests were cleaned up as well: `````rust //! ``` //! panic!(); //! ``` ````` And finally I checked if it was fixed for merged doctests too (`--edition 2024`). To make this work, I needed to add a new public function in `libtest` too which would call a function once all tests have been run. So only issue is: I have absolutely no idea how we can add a regression test for this fix. If anyone has an idea... r? `@notriddle`
2025-05-07Rollup merge of #140700 - Kivooeo:new-fix-six, r=davidtwco,fmeaseGuillaume Gomez-0/+75
Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 removed panic in case where we do `--explain > 9999` and added check for it now error looks like this instead of ICE ``` $ rustc.exe --explain E10000 error: E10000 is not a valid error code ``` fixes #140647 r? `@fmease`
2025-05-07Rollup merge of #140671 - xizheyin:issue-140169, r=petrochenkovGuillaume Gomez-58/+167
Parser: Recover error from named params while parse_path Fixes #140169 I added test to the first commit and the second added the code and changes to test. r? `@petrochenkov`
2025-05-07Rollup merge of #140614 - yuk1ty:fix-invalid-module-name-visibility, r=davidtwcoGuillaume Gomez-2/+57
Correct warning message in restricted visibility Fixes #131220
2025-05-07Rollup merge of #140234 - nnethercote:separate-Analysis-and-Results, r=davidtwcoGuillaume Gomez-227/+235
Separate dataflow analysis and results `Analysis` gets put into `Results` with `EntryStates`, by `iterate_to_fixpoint`. This has two problems: - `Results` is passed various places where only `Analysis` is needed. - `EntryStates` is passed around mutably everywhere even though it is immutable. This commit mostly separates `Analysis` from `Results` and fixes these two problems. r? `@davidtwco`
2025-05-07Use `parse_param_general` when parsing `(T, U)->R` in `parse_path_segment`xizheyin-75/+158
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2025-05-07run-make-support: set rustc dylib path for cargo wrapperJesus Checa Hidalgo-1/+4
Some run-make tests invoke Cargo via run_make_support::cargo(), but fail to execute correctly when rustc is built without rpath. In these setups, runtime loading of rustc’s shared libraries fails unless the appropriate dynamic library path is set manually. This commit updates the cargo() wrapper to call set_host_compiler_dylib_path(), aligning its behavior with the existing rustc() wrapper: https://github.com/rust-lang/rust/blob/f76c7367c6363d33ddb5a93b5de0d158b2d827f6/src/tools/run-make-support/src/external_deps/rustc.rs#L39 This ensures that Cargo invocations during tests inherit the necessary dylib paths, avoiding errors related to missing shared libraries in rpath-less builds. Fixes part of #140738
2025-05-07Add regression test for #139899Guillaume Gomez-0/+42
2025-05-07add armv5te-unknown-linux-gnueabi target maintainerAdrian Friedli-1/+31
2025-05-07Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obkbors-184/+299
Use thread local dep graph encoding This adds thread local encoding of dep graph nodes. Each thread has a `MemEncoder` that gets flushed to the global `FileEncoder` when it exceeds 64 kB. Each thread also has a local cache of dep indices. This means there can now be empty gaps in `SerializedDepGraph`. Indices are marked green and also allocated by the new atomic operation `DepNodeColorMap::try_mark_green` as the encoder lock is removed.
2025-05-07Auto merge of #140735 - GuillaumeGomez:rollup-dlhbxsg, r=GuillaumeGomezbors-24/+25
Rollup of 4 pull requests Successful merges: - #139518 (Stabilize precise capture syntax in style guide) - #140398 (Fix backtrace for cygwin) - #140719 (fix typo in autorefs lint doc example) - #140724 (Update `compiler-builtins` to 0.1.158) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-07Rollup merge of #140724 - tgross35:update-builtins, r=tgross35Guillaume Gomez-4/+4
Update `compiler-builtins` to 0.1.158 Includes the following changes: * Require `target_has_atomic = "ptr"` for runtime feature detection [1] [1]: https://github.com/rust-lang/compiler-builtins/pull/909
2025-05-07Rollup merge of #140719 - wyfo:patch-1, r=lcnrGuillaume Gomez-7/+7
fix typo in autorefs lint doc example The documentation is talking about other way using only raw pointers, but the example was use `std::slice::from_raw_parts_mut` which also create a reference. `std::ptr::slice_from_raw_parts_mut` should be used instead, and it also highlights the benefit of raw pointer manipulation compared to dereference, as the function doesn't need to be unsafe anymore. Moreover, [`unsafe_op_in_unsafe_fn`](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html) warning has been enabled since Edition 2024, so I've updated the examples to use unsafe blocks.
2025-05-07Rollup merge of #140398 - Berrysoft:cygwin-backtrace, r=tgross35Guillaume Gomez-1/+2
Fix backtrace for cygwin Closes #140304 Depends on: - [x] https://github.com/rust-lang/backtrace-rs/pull/704 This PR could not be merged until the above PR is merged. I'll update the submodule then. EDIT: submodule updated.
2025-05-07Rollup merge of #139518 - xizheyin:issue-138527, r=traviscrossGuillaume Gomez-12/+12
Stabilize precise capture syntax in style guide Closes #138527 r? `@jieyouxu`
2025-05-07Fix regression from #140393 for espidf / horizon / nuttx / vitaivmarkov-0/+1
2025-05-07Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercotebors-552/+453
Remove duplicate impl of string unescape from parse_format r? `@nnethercote`
2025-05-07Fix backtrace for cygwin王宇逸-1/+2
2025-05-06add stubbed-out cases for rust-analyzerdianne-0/+3
rust-analyzer doesn't construct `DerefPattern(_)` constructors, so these shouldn't crash. It looks like this is how slice patterns are implemented too.
2025-05-06error early when mixing deref patterns with normal constructorsdianne-1/+161
Without adding proper support for mixed exhaustiveness, mixing deref patterns with normal constructors would either violate `ConstructorSet::split`'s invariant 4 or 7. We'd either be ignoring rows with normal constructors or we'd have problems in unspecialization from non-disjoint constructors. Checking mixed exhaustivenss similarly to how unions are currently checked should work, but the diagnostics for unions are confusing. Since mixing deref patterns with normal constructors is pretty niche (currently it only makes sense for `Cow`), emitting an error lets us avoid committing to supporting mixed exhaustiveness without a good answer for the diagnostics.
2025-05-06add exhaustiveness/usefulness tests for deref patternsdianne-0/+269
2025-05-06let deref patterns participate in usefulness/exhaustivenessdianne-24/+47
This does not yet handle the case of mixed deref patterns with normal constructors; it'll ICE in `Constructor::is_covered_by`. That'll be fixed in a later commit.
2025-05-07Auto merge of #140726 - jhpratt:rollup-b6oxopx, r=jhprattbors-770/+602
Rollup of 9 pull requests Successful merges: - #134273 (de-stabilize bench attribute) - #139534 (Added support for `apxf` target feature) - #140419 (Move `in_external_macro` to `SyntaxContext`) - #140483 (Comment on `Rc` abort-guard strategy without naming unrelated fn) - #140607 (support duplicate entries in the opaque_type_storage) - #140656 (collect all Fuchsia bindings into the `fuchsia` module) - #140668 (Implement `VecDeque::truncate_front()`) - #140709 (rustdoc: remove unportable markdown lint and old parser) - #140713 (Structurally resolve in `check_ref_cast` in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-07Rollup merge of #140713 - compiler-errors:check_ref_cast, r=lcnrJacob Pratt-8/+29
Structurally resolve in `check_ref_cast` in new solver Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/203 r? lcnr
2025-05-07Rollup merge of #140709 - notriddle:rm-unportable-markdown, r=GuillaumeGomezJacob Pratt-258/+3
rustdoc: remove unportable markdown lint and old parser Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-07Rollup merge of #140668 - vkrivopalov:vecdeque-truncate-front, r=jhprattJacob Pratt-0/+137
Implement `VecDeque::truncate_front()` Tracking issue: #140667
2025-05-07Rollup merge of #140656 - joboet:fuchsia_pal, r=workingjubileeJacob Pratt-282/+122
collect all Fuchsia bindings into the `fuchsia` module The Fuchsia bindings are currently spread out across multiple modules in `sys/pal/unix` leading to unnecessary duplication. This PR moves all of these definitions into `sys::pal::unix::fuchsia` and additionally: * deduplicates the definitions * makes the error names consistent * marks `zx_thread_self` and `zx_clock_get_monotonic` as safe extern functions * removes unused items (there's no need to maintain these bindings if we're not going to use them) * removes the documentation for the definitions (contributors should always consult the platform documentation, duplicating that here is just an extra maintenance burden) `@rustbot` ping fuchsia
2025-05-07Rollup merge of #140607 - lcnr:opaque-type-storage, r=compiler-errorsJacob Pratt-82/+207
support duplicate entries in the opaque_type_storage Necessary for the new solver as we may unify keys when eagerly resolving for canonical queries. See the relevant comment when instantiating query responses: ```rust // We eagerly resolve inference variables when computing the query response. // This can cause previously distinct opaque type keys to now be structurally equal. // // To handle this, we store any duplicate entries in a separate list to check them // at the end of typeck/borrowck. We could alternatively eagerly equate the hidden // types here. However, doing so is difficult as it may result in nested goals and // any errors may make it harder to track the control flow for diagnostics. if let Some(prev) = prev { self.delegate.add_duplicate_opaque_type(key, prev, self.origin_span); } ``` This will be far more relevant with #140497. r? `@compiler-errors`
2025-05-07Rollup merge of #140483 - baumanj:patch-1, r=workingjubileeJacob Pratt-5/+5
Comment on `Rc` abort-guard strategy without naming unrelated fn `wrapped_add` is used, not `checked_add`, so avoid mentioning specific fn calls that may vary slightly based on "whatever produces the best code" and focus on things that will remain constant into the future.
2025-05-07Rollup merge of #140419 - Jarcho:ctxt_external, r=NadrierilJacob Pratt-18/+28
Move `in_external_macro` to `SyntaxContext` There are a few places in clippy where spans are passed solely to use the context, but we can't pass just the context around because of this function.
2025-05-07Rollup merge of #139534 - madhav-madhusoodanan:apx-target-feature-addition, ↵Jacob Pratt-17/+55
r=workingjubilee Added support for `apxf` target feature
2025-05-07Rollup merge of #134273 - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscrossJacob Pratt-100/+16
de-stabilize bench attribute This has been soft-unstable since forever (https://github.com/rust-lang/rust/pull/64066), and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274). The feature covering `bench` itself is tracked in https://github.com/rust-lang/rust/issues/50297, which has been closed despite still having active feature gates referencing it. Cc `@rust-lang/libs-api`
2025-05-06Update `compiler-builtins` to 0.1.158Trevor Gross-4/+4
Includes the following changes: * Require `target_has_atomic = "ptr"` for runtime feature detection [1]: https://github.com/rust-lang/compiler-builtins/pull/909
2025-05-07fix typo in autorefs lint doc exampleJoseph Perez-7/+7
The documentation is talking about other way using only raw pointers, but the example was use `std::slice::from_raw_parts_mut` which also create a reference. `std::ptr::slice_from_raw_parts_mut` should be used instead, and it also highlights the benefit of raw pointer manipulation compared to dereference, as the function doesn't need to be unsafe anymore. Moreover, [`unsafe_op_in_unsafe_fn`](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html) warning has been enabled since Edition 2024, so I've updated the examples to use unsafe blocks.
2025-05-06Auto merge of #140514 - m-ou-se:proc-macro-span-file, r=Amanieubors-4/+4
Stabilize proc_macro::Span::{file, local_file}. Stabilizes this part of https://github.com/rust-lang/rust/issues/54725: ```rust impl Span { pub fn file(&self) -> String; // Mapped/artificial file name, for display purposes. pub fn local_file(&self) -> Option<PathBuf>; // Real file name as it exists on the local file system. } ``` See also the naming discussion in https://github.com/rust-lang/rust/issues/139903
2025-05-06Update rc.rs docsJon Bauman-5/+5
Update comment per review feedback
2025-05-06Structurally resolve in check_ref_castMichael Goulet-8/+29
2025-05-06Auto merge of #140708 - GuillaumeGomez:rollup-egt3nl9, r=GuillaumeGomezbors-2111/+3166
Rollup of 4 pull requests Successful merges: - #136183 (Update iterator.rs to use arrays by value) - #139966 (coverage: Only merge adjacent coverage spans) - #140692 (Rename `graph::implementation::Graph` to `LinkedGraph`) - #140703 (Handle PR not found in post-merge workflow) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-06added error handle for error code > 9999Kivooeo-0/+75
2025-05-06Added apxf target feature testMadhav Madhusoodanan-0/+20
2025-05-06Added `apxf` target feature support, under flag `apx_target_feature`Madhav Madhusoodanan-0/+15
2025-05-06rustdoc: remove unportable markdown lint and old parserMichael Howell-258/+3
Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-06Ensure that temporary doctest folder is correctly removed even if doctests ↵Guillaume Gomez-3/+21
failed