about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-01-21Treat undef bytes as equal to any other byteOli Scherer-5/+5
2025-01-21Ensure we always get a constant, even without mir optsOli Scherer-1/+1
2025-01-21Also generate undef scalars and scalar pairsOli Scherer-2/+0
2025-01-20rename tests' revisions to allow testing multiple editionsdianne-93/+93
2025-01-20"structural" ruleset: match against the inherited ref when a reference ↵dianne-62/+61
pattern doesn't match the mutability of an inner reference This is the `Deref(EatInner, FallbackToOuter)` rule in Typing Rust Patterns.
2025-01-20"structural" ruleset: use the "classic" ruleset's diagnostic and fallback ↵dianne-355/+120
for inherited ref mutability mismatches I think the diagnostic could use some work, but it's more helpful than the alternative. The previous error was misleading, since it ignored the inherited reference altogether.
2025-01-20"structural" ruleset: account for dbm mutability cap in Deref(EatInner) rulesdianne-12/+106
2025-01-20add more tests where the rulesets disagreedianne-6/+659
These come directly from the "Compare" tab of Typing Rust Patterns, though they had to be split across multiple files. They're not comprehensive, but they do provide some previously-missing coverage and are easier to check against the spec. Possibly they should be split up some more, since `pattern-errors.rs` is getting a bit unwieldy, but I'm not sure how best to go about that.
2025-01-20remove Rule 3 from `ref_pat_eat_one_layer_2024`dianne-31/+17
The debug assertion ensuring that the pattern mutability cap holds assumes the presence of Rule 3, so it now checks for that. I considered going back to only tracking the mutability cap when Rule 3 is present, but since the mutability cap is used in Rule 5's implementation too, the debug assertion would still need to check which typing rules are present. This also required some changes to tests: - `ref_pat_eat_one_layer_2021.rs` had a test for Rule 3; I'll be handling tests for earlier editions in a later commit, so as a stopgap I've #[cfg]ed it out. - One test case had to be moved from `well-typed-edition-2024.rs` to `borrowck-errors.rs` in order to get borrowck to run on it and emit an error.
2025-01-20Don't require `--verbose` to show linker stdoutjyn-21/+8
2025-01-20don't ICE when emitting linker errors during `-Z link-only`jyn-0/+29
note that this still ICEs when passed `-Z link-only --error-format json` because i can't be bothered to fix it right now
2025-01-20warn on unused linker_messages warning attributesjyn-0/+37
2025-01-20show linker warnings even if it returns 0jyn-24/+51
2025-01-20Add tests for windows-gnu split-debuginfo optionsWesley Wiser-0/+143
2025-01-20on s390x, use `PassMode::Direct` for vector typesFolkert de Vries-0/+143
2025-01-20Rollup merge of #133695 - x17jiri:hint_likely, r=AmanieuMatthias Krüger-4/+219
Reexport likely/unlikely in std::hint Since `likely`/`unlikely` should be working now, we could reexport them in `std::hint`. I'm not sure if this is already approved or if it requires approval Tracking issue: #26179
2025-01-20handle global trait bounds defining assoc typelcnr-0/+21
2025-01-20account for `c_enum_min_bits` in `multiple-reprs` UI testJorge Aparicio-1/+11
fixes #135777
2025-01-20work around the `wasm32-unknown-unknown` ABI being brokenFolkert de Vries-8/+9
2025-01-20support wasm inline assembly in naked functionsFolkert de Vries-0/+198
2025-01-20Auto merge of #135643 - khuey:135332, r=jieyouxubors-0/+76
When LLVM's location discriminator value limit is exceeded, emit locations with dummy spans instead of dropping them entirely Dropping them fails `-Zverify-llvm-ir`. Fixes #135332. r? `@jieyouxu`
2025-01-20Auto merge of #135754 - jieyouxu:rollup-j4q1hpr, r=jieyouxubors-11/+118
Rollup of 7 pull requests Successful merges: - #135542 (Add the concrete syntax for precise capturing to 1.82 release notes.) - #135700 (Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy) - #135722 (make it possible to use ci-rustc on tarball sources) - #135729 (Add debug assertions to compiler profile) - #135736 (rustdoc: Fix flaky doctest test) - #135738 (Replace usages of `map_or(bool, ...)` with `is_{some_and|none_or|ok_and}`) - #135747 (Rename FileName::QuoteExpansion to CfgSpec) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-20Add NuttX support for AArch64 and ARMv7-A targetsHuang Qi-0/+15
This patch adds tier 3 support for AArch64 and ARMv7-A targets in NuttX, including: - AArch64 target: aarch64-unknown-nuttx - ARMv7-A target: armv7a-nuttx-eabi, armv7a-nuttx-eabihf - Thumbv7-A target: thumbv7a-nuttx-eabi, thumbv7a-nuttx-eabihf Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-20Rollup merge of #135237 - dianne:match-2024-cleanup, r=Nadrieril许杰友 Jieyou Xu (Joe)-688/+626
Match Ergonomics 2024: document and reorganize the currently-implemented feature gates The hope here is to make it easier to adjust, understand, and test the experimental pattern typing rules implemented in the compiler. This PR doesn't (or at isn't intended to) change any behavior or add any new tests; I'll be handling that later. I've also included some reasoning/commentary on the more involved changes in the commit messages. Relevant tracking issue: #123076 r? `@Nadrieril`
2025-01-20Rollup merge of #134276 - RalfJung:destabilize-custom-inner-attr, r=SparrowLii许杰友 Jieyou Xu (Joe)-55/+31
fully de-stabilize all custom inner attributes `#![test]` and `#![rustfmt::skip]` were accidentally accepted in more places than they should. These have been marked as soft-unstable since forever (https://github.com/rust-lang/rust/pull/82399) and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274). Cc `@rust-lang/lang` `@petrochenkov`
2025-01-20Rollup merge of #135736 - fmease:rustdoc-fix-flaky-test, r=GuillaumeGomez许杰友 Jieyou Xu (Joe)-1/+2
rustdoc: Fix flaky doctest test Fixes #135660.
2025-01-20Rollup merge of #135700 - estebank:priv-field-dfv, r=wesleywiser许杰友 Jieyou Xu (Joe)-10/+116
Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy Add test ensuring that struct with default field values is not constructable if the fields are not accessible. Collect all unreachable fields in a single struct literal struct and emit a single error, instead of one error per private field. ``` error[E0451]: fields `beta` and `gamma` of struct `Alpha` are private --> $DIR/visibility.rs:18:13 | LL | let _x = Alpha { | ----- in this type LL | beta: 0, | ^^^^^^^ private field LL | .. | ^^ field `gamma` is private ```
2025-01-19rustdoc: Fix flaky doctest testLeón Orell Valerian Liehr-1/+2
2025-01-19fully de-stabilize all custom inner attributesRalf Jung-55/+31
2025-01-19When LLVM's location discriminator value limit is exceeded, emit locations ↵Kyle Huey-0/+76
with dummy spans instead of dropping them entirely Revert most of #133194 (except the test and the comment fixes). Then refix not emitting locations at all when the correct location discriminator value exceeds LLVM's capacity.
2025-01-19Rollup merge of #135685 - GuillaumeGomez:rm-unused-css-class, r=notriddleGuillaume Gomez-2/+2
Remove unused `item-row` CSS class Seems like a CSS class we forgot to remove at some point. r? `@notriddle`
2025-01-19Rollup merge of #134858 - estebank:issue-81370, r=NoratriebGuillaume Gomez-13/+52
Provide structured suggestion for `#![feature(..)]` in more cases Fix #81370.
2025-01-19Remove unused `item-row` CSS classGuillaume Gomez-2/+2
2025-01-19Auto merge of #135709 - lqd:bring-back-len, r=compiler-errorsbors-1389/+1737
Temporarily bring back `Rvalue::Len` r? `@compiler-errors` as requested in https://github.com/rust-lang/rust/issues/135671#issuecomment-2599580364 > However, in the mean time, I'd rather we not crunch trying to find and more importantly validate the soundness of a solution 🤔 Agreed. To fix the IMO P-critical #135671 for which we somehow didn't have test coverage, this PR temporarily reverts: - https://github.com/rust-lang/rust/pull/133734 - its bugfix https://github.com/rust-lang/rust/pull/134371 - https://github.com/rust-lang/rust/pull/134330 cc `@scottmcm` I added the few samples from that issue as a test, but we can add more in the future, in particular it seems `@steffahn` [will work on that](https://github.com/rust-lang/rust/issues/135671#issuecomment-2599714354). Fixes #135671. And if we want to land this, it should also be nominated for beta backport.
2025-01-19Auto merge of #135715 - matthiaskrgr:rollup-9a18sxj, r=matthiaskrgrbors-163/+189
Rollup of 4 pull requests Successful merges: - #135641 ([rustdoc] Replace module list items `ul`/`li` with `dl`/`dd`/`dt` elements) - #135703 (Disallow `A { .. }` if `A` has no fields) - #135705 (Consolidate ad-hoc MIR lints into real pass-manager-based MIR lints) - #135708 (Some random compiler nits) Failed merges: - #135685 (Remove unused `item-row` CSS class) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-18Update tests for std::simd subtree syncCaleb Zulawski-15/+15
2025-01-19Rollup merge of #135705 - compiler-errors:lint, r=estebankMatthias Krüger-1/+1
Consolidate ad-hoc MIR lints into real pass-manager-based MIR lints It feels much cleaner to do all MIR-related things using the pass manager.
2025-01-19Rollup merge of #135703 - estebank:empty-dfv, r=compiler-errorsMatthias Krüger-0/+47
Disallow `A { .. }` if `A` has no fields ``` error: `A` has no fields, `..` needs at least one default field in the struct definition --> $DIR/empty-struct.rs:16:17 | LL | let _ = A { .. }; | - ^^ | | | this type has no fields ```
2025-01-19Rollup merge of #135641 - GuillaumeGomez:items-list, r=notriddleMatthias Krüger-162/+141
[rustdoc] Replace module list items `ul`/`li` with `dl`/`dd`/`dt` elements `@hywan` suggested that rustdoc should use `dl`,`dt` and `dd` HTML tags for listing items on module pages as it matches better what this is (an item and optionally its description). This is a very good idea so here is the implementation. Also nice side-effect of this change: it reduces a bit the generated HTML since we go from: This PR shouldn't impact page appearance. ```html <ul class="item-table"> <li> <div class="item-name">NAME</div> <div class="desc docblock-short">THE DOC</div> </li> </ul> ``` to: ```html <dl class="item-table"> <dt>NAME</dt> <dd>THE DOC</dd> </dl> ``` You can test it [here](https://rustdoc.crud.net/imperio/items-list/std/index.html). r? `@notriddle`
2025-01-19Rollup merge of #135663 - frank-king:fix/135614, r=compiler-errorsMatthias Krüger-0/+107
Fix ICE in resolving associated items as non-bindings Fixes #135614 so that imported associated functions of traits can be shadowed by local bindings and associated constants of traits can be used in patterns.
2025-01-18Do not ICE on default_field_value const with lifetimesEsteban Küber-0/+29
Fix #135649.
2025-01-18add tests for issue 135671Rémy Rakic-0/+30
2025-01-18Revert "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, ↵Rémy Rakic-1330/+1626
r=davidtwco,RalfJung" This reverts commit b57d93d8b9525fa261404b4cd9c0670eeb1264b8, reversing changes made to 0aeaa5eb22180fdf12a8489e63c4daa18da6f236.
2025-01-18Revert "Rollup merge of #134371 - scottmcm:fix-134352, r=oli-obk"Rémy Rakic-23/+0
This reverts commit 7c301ecdf5e806b7aa3c44e4a185049fabbc4381, reversing changes made to dffaad83327454430129802f240121f8c7866208.
2025-01-18Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"Rémy Rakic-36/+81
This reverts commit e108481f74ff123ad98a63bd107a18d13035b275, reversing changes made to 303e8bd768526a5812bb1776e798e829ddb7d3ca.
2025-01-18Consolidate ad-hoc MIR lints into real pass-manager-based MIR lintsMichael Goulet-1/+1
2025-01-18Provide suggestion for `#![feature(default_field_values)]`Esteban Küber-10/+40
``` error[E0797]: base expression required after `..` --> $DIR/feature-gate-default-field-values.rs:62:21 | LL | let x = Foo { .. }; | ^ | help: add `#![feature(default_field_values)]` to the crate attributes to enable default values on `struct` fields | LL + #![feature(default_field_values)] | help: add a base expression here | LL | let x = Foo { ../* expr */ }; | ++++++++++ ```
2025-01-18Structured suggestion for "missing `feature` intrinsic"Esteban Küber-2/+8
``` error: `size_of_val` is not yet stable as a const intrinsic --> $DIR/const-unstable-intrinsic.rs:17:9 | LL | unstable_intrinsic::size_of_val(&x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(unstable)]` to the crate attributes to enable help: add `#![feature(unstable)]` to the crate attributes to enable | LL + #![feature("unstable")] | ```
2025-01-18Structured suggestion for "missing `feature` in unstable fn call"Esteban Küber-1/+4
When encountering a call corresponding to an item marked as unstable behind a feature flag, provide a structured suggestion pointing at where in the crate the `#![feature(..)]` needs to be written. ``` error: `foobar` is not yet stable as a const fn --> $DIR/const-stability-attribute-implies-no-feature.rs:12:5 | LL | foobar(); | ^^^^^^^^ | help: add `#![feature(const_foobar)]` to the crate attributes to enable | LL + #![feature(const_foobar)] | ``` Fix #81370.
2025-01-18Disallow `A { .. }` if `A` has no fieldsEsteban Küber-0/+47
``` error: `A` has no fields, `..` needs at least one default field in the struct definition --> $DIR/empty-struct.rs:16:17 | LL | let _ = A { .. }; | - ^^ | | | this type has no fields ```