Commit Graph

289161 Commits

Author SHA1 Message Date
Guillaume Gomez
442ae63257 Add regression test for 2025-05-07 16:08:54 +02:00
Adrian Friedli
4e26480c74 add armv5te-unknown-linux-gnueabi target maintainer 2025-05-07 16:01:39 +02:00
Martin Kröning
ca42f15f96
update hermit-abi to 0.5.1 2025-05-07 15:40:02 +02:00
bors
3ef8e64ce9 Auto merge of - Zoxc:thread-local-graph, r=oli-obk
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-07 12:39:54 +00:00
xizheyin
f46806fb14
Add ui test suggest-remove-deref-issue-140166
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-07 17:32:59 +08:00
bors
db0e836148 Auto merge of - GuillaumeGomez:rollup-dlhbxsg, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 -  (Stabilize precise capture syntax in style guide)
 -  (Fix backtrace for cygwin)
 -  (fix typo in autorefs lint doc example)
 -  (Update `compiler-builtins` to 0.1.158)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-07 09:31:15 +00:00
Guillaume Gomez
aca12a8216
Rollup merge of - tgross35:update-builtins, r=tgross35
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-07 10:50:50 +02:00
Guillaume Gomez
763209e422
Rollup merge of - wyfo:patch-1, r=lcnr
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-07 10:50:49 +02:00
Guillaume Gomez
6e2c39b568
Rollup merge of - Berrysoft:cygwin-backtrace, r=tgross35
Fix backtrace for cygwin

Closes 

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-07 10:50:49 +02:00
Guillaume Gomez
d396619af0
Rollup merge of - xizheyin:issue-138527, r=traviscross
Stabilize precise capture syntax in style guide

Closes 

r? `@jieyouxu`
2025-05-07 10:50:48 +02:00
ivmarkov
392880c004 Fix regression from for espidf / horizon / nuttx / vita 2025-05-07 08:04:21 +00:00
bors
f76c7367c6 Auto merge of - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format

r? `@nnethercote`
2025-05-07 06:18:39 +00:00
王宇逸
fe64184b16 Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
Nicholas Nethercote
603766cd72 Avoid some unwraps.
By using `@` patterns more.

Also, use `Symbol` more in a couple of errors to avoid some unnecessary
conversions to strings. This even removes a lifetime.
2025-05-07 12:56:44 +10:00
Nicholas Nethercote
d81472f266 Eliminate word_or_empty methods.
To get rid of the `Ident::empty` uses.

This requires introducing `PathParser::word_sym`, as an alternative to
`PathParser::word`.
2025-05-07 12:56:41 +10:00
dianne
09fed2d2f4 add stubbed-out cases for rust-analyzer
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-06 18:53:55 -07:00
dianne
fb261a179d error early when mixing deref patterns with normal constructors
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-06 18:53:55 -07:00
dianne
cf43bba1e5 add exhaustiveness/usefulness tests for deref patterns 2025-05-06 18:53:55 -07:00
dianne
b41d8bde00 let deref patterns participate in usefulness/exhaustiveness
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-06 18:53:55 -07:00
bors
891b852547 Auto merge of - jhpratt:rollup-b6oxopx, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 -  (de-stabilize bench attribute)
 -  (Added support for `apxf` target feature)
 -  (Move `in_external_macro` to `SyntaxContext`)
 -  (Comment on `Rc` abort-guard strategy without naming unrelated fn)
 -  (support duplicate entries in the opaque_type_storage)
 -  (collect all Fuchsia bindings into the `fuchsia` module)
 -  (Implement `VecDeque::truncate_front()`)
 -  (rustdoc: remove unportable markdown lint and old parser)
 -  (Structurally resolve in `check_ref_cast` in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-07 01:16:08 +00:00
Jacob Pratt
3d8ef7afca
Rollup merge of - compiler-errors:check_ref_cast, r=lcnr
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-07 00:29:25 +00:00
Jacob Pratt
8984d650e1
Rollup merge of - notriddle:rm-unportable-markdown, r=GuillaumeGomez
rustdoc: remove unportable markdown lint and old parser

Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-07 00:29:25 +00:00
Jacob Pratt
5b165aab89
Rollup merge of - vkrivopalov:vecdeque-truncate-front, r=jhpratt
Implement `VecDeque::truncate_front()`

Tracking issue: 
2025-05-07 00:29:24 +00:00
Jacob Pratt
fe97fe45f8
Rollup merge of - joboet:fuchsia_pal, r=workingjubilee
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-07 00:29:24 +00:00
Jacob Pratt
bda326f40c
Rollup merge of - lcnr:opaque-type-storage, r=compiler-errors
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 .

r? `@compiler-errors`
2025-05-07 00:29:23 +00:00
Jacob Pratt
25631ff093
Rollup merge of - baumanj:patch-1, r=workingjubilee
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-07 00:29:22 +00:00
Jacob Pratt
b7199a69d6
Rollup merge of - Jarcho:ctxt_external, r=Nadrieril
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-07 00:29:22 +00:00
Jacob Pratt
4a8dbe0537
Rollup merge of - madhav-madhusoodanan:apx-target-feature-addition, r=workingjubilee
Added support for `apxf` target feature
2025-05-07 00:29:21 +00:00
Jacob Pratt
60a4b939a3
Rollup merge of - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscross
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-07 00:29:20 +00:00
Trevor Gross
4de822c3d2 Update compiler-builtins to 0.1.158
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-06 23:40:50 +00:00
Joseph Perez
49ac393688
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-07 00:11:05 +02:00
bors
669c1ab967 Auto merge of - m-ou-se:proc-macro-span-file, r=Amanieu
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-06 22:03:11 +00:00
Jon Bauman
6a4af821b0
Update rc.rs docs
Update comment per review feedback
2025-05-06 13:19:42 -07:00
Michael Goulet
636a138cda Structurally resolve in check_ref_cast 2025-05-06 19:30:55 +00:00
bors
27d6200a70 Auto merge of - GuillaumeGomez:rollup-egt3nl9, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 -  (Update iterator.rs to use arrays by value)
 -  (coverage: Only merge adjacent coverage spans)
 -  (Rename `graph::implementation::Graph` to `LinkedGraph`)
 -  (Handle PR not found in post-merge workflow)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-06 18:40:50 +00:00
Kivooeo
3c1c0726ad added error handle for error code > 9999 2025-05-06 23:02:47 +05:00
Madhav Madhusoodanan
c32dc2dbda Added apxf target feature test 2025-05-06 23:28:28 +05:30
Madhav Madhusoodanan
43357b4a64 Added apxf target feature support, under flag apx_target_feature 2025-05-06 23:28:27 +05:30
Michael Howell
e648e5b710 rustdoc: remove unportable markdown lint and old parser
Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-06 10:33:04 -07:00
Guillaume Gomez
173cdafea6 Ensure that temporary doctest folder is correctly removed even if doctests failed 2025-05-06 19:32:20 +02:00
Guillaume Gomez
ee0d68fcab
Rollup merge of - Kobzol:post-merge-race-fix, r=marcoieni
Handle PR not found in post-merge workflow

Should hopefully fix errors like [these](https://github.com/rust-lang/rust/pull/140561#issuecomment-2854636223).

r? `@marcoieni`
2025-05-06 19:27:40 +02:00
Guillaume Gomez
74e5184f9b
Rollup merge of - Zalathar:linked-graph, r=wesleywiser
Rename `graph::implementation::Graph` to `LinkedGraph`

One of the more confusing parts of the `rustc_data_structures::graph` module is this mysteriously-named “Graph” type, which turns out to be an older standalone graph implementation that predates the traits used by the rest of the graph module.

This graph type is still used in a couple of places (for reporting certain lifetime errors, and by certain debugging/test-only checks of the query dependency graph), but hasn't had much attention in years.

This PR renames that old graph type from `implementation::Graph` to `linked_graph::LinkedGraph` to give it a more distinct identity (and make existing uses easier to find), and adds some notes to gently discourage any further use in new code.

No functional change.
2025-05-06 19:27:39 +02:00
Guillaume Gomez
3b82d4640a
Rollup merge of - Zalathar:span-merge, r=oli-obk
coverage: Only merge adjacent coverage spans

For a long time, coverage instrumentation has automatically “merged” spans with the same control-flow into a smaller number of larger spans, even when the spans being merged are not overlapping or adjacent. This causes any source text between the original spans to be included in the merged span, which is then associated with an execution count when shown in coverage reports.

That approach causes a number of problems:
- The intervening source text can contain all sorts of things that shouldn't really be marked as executable code (e.g. nested items, parts of macro invocations, long comments). In some cases we have complicated workarounds (e.g. bucketing to avoid merging spans across nested items), but in other cases there isn't much we can do.
- Merging can have aesthetically weird effects, such as including unbalanced parentheses, because the merging process doesn't really understand what it's doing at a source code level.
- It generally leads to an accumulation of piled-on heuristics and special cases that give decent-looking results, but are fiendishly difficult to modify or replace.

Therefore, this PR aims to abolish the merging of non-adjacent coverage spans.

The big tradeoff here is that the resulting coverage metadata (embedded in the instrumented binary) tends to become larger, because the overall number of distinct spans has increased. That's unfortunate, but I see it as the inevitable cost of cleaning up the messes and inaccuracies that were caused by the old approach. And the resulting spans do tend to be more accurate to the program's actual control-flow.

---

The `.coverage` snapshot changes give an indication of how this PR will affect user-visible coverage reports. In many cases the changes to reporting are minor or even nonexistent, despite substantial changes to the metadata (as indicated by `.cov-map` snapshots).

---

try-job: aarch64-gnu
2025-05-06 19:27:39 +02:00
Guillaume Gomez
8929f8a180
Rollup merge of - hkBst:patch-25, r=Amanieu
Update iterator.rs to use arrays by value

Update examples to no longer avoid iterating arrays for 
2025-05-06 19:27:38 +02:00
John Kåre Alsaker
cdd104922d Use the portable AtomicU64 2025-05-06 18:36:14 +02:00
Jakub Beránek
a84a946a3d
Handle PR not found in post-merge workflow 2025-05-06 18:35:05 +02:00
Guillaume Gomez
14782ad687 Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
lcnr
431f02d531 support duplicates in the opaque_types_storage 2025-05-06 14:59:09 +00:00
bors
1a95cc6f9d Auto merge of - GuillaumeGomez:rollup-rpyxs20, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 -  (Unify sidebar buttons to use the same image)
 -  (add a test for issue )
 -  (`deref_patterns`: let string and byte string literal patterns peel references and smart pointers before matching)
 -  (Don't ignore compiler stderr in `lib-defaults.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-06 13:42:09 +00:00
Guillaume Gomez
9d05497ff6
Rollup merge of - jieyouxu:test_helpers, r=petrochenkov
Don't ignore compiler stderr in `lib-defaults.rs`

Closes .

- Don't ignore compiler stderr.
- Document test intent.
- Move under `tests/ui/link-native-libs/` instead.

This was previously discussed on https://web.archive.org/web/20181028094402/https://botbot.me/mozilla/rust-tools/2017-02-21/?page=1.

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
try-job: x86_64-apple-1
2025-05-06 14:50:47 +02:00