about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-09-18Add TestsVeera-0/+82
2024-09-10Auto merge of #130200 - matthiaskrgr:rollup-2g4ijc5, r=matthiaskrgrbors-41/+63
Rollup of 5 pull requests Successful merges: - #130143 (miri-test-libstd: add missing BOOTSTRAP_ARGS) - #130173 (rustdoc: add two regression tests) - #130175 (`rustc_mir_transform` cleanups 3) - #130184 (coverage: Clean up terminology in counter creation) - #130185 (abi/compatibility test: remove tests inside repr(C) wrappers) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-10Rollup merge of #130185 - RalfJung:abi-compat-repr-c-wrappers, r=compiler-errorsMatthias Krüger-41/+11
abi/compatibility test: remove tests inside repr(C) wrappers When I wrote the test I assumed we'd guarantee ABI compatibility to be "structural" wrt `repr(C)` types, i.e. if two `repr(C)` types have all their fields be pairwise ABI-compatible then the types are ABI-compatible. That got removed from the ABI compatibility docs before they landed, though, so let's also remove it from this test.
2024-09-10Rollup merge of #130173 - fmease:rustdoc-regression-tests, r=notriddleMatthias Krüger-0/+52
rustdoc: add two regression tests They were basically copy/pasted from `tests/ui/` to `tests/rustdoc-ui/`. Not sure if it's worth adding these, I can just close these issues as is if you want. This brings the number of https://github.com/rust-lang/rust/labels/T-rustdoc + https://github.com/rust-lang/rust/labels/E-needs-test from 3 down to 1. The remaining one – #103004 — is a nasty one to retroactively find a proper(!) test for. Fixes #98250. Fixes #107872. r? rustdoc
2024-09-10Auto merge of #130025 - Urgau:missing_docs-expect, r=petrochenkovbors-0/+33
Also emit `missing_docs` lint with `--test` to fulfil expectations This PR removes the "test harness" suppression of the `missing_docs` lint to be able to fulfil `#[expect]` (expectations) as it is now "relevant". I think the goal was to maybe avoid false-positive while linting on public items under `#[cfg(test)]` but with effective visibility we should no longer have any false-positive. Another possibility would be to query the lint level and only emit the lint if it's of expect level, but that is even more hacky. Fixes https://github.com/rust-lang/rust/issues/130021 try-job: x86_64-gnu-aux
2024-09-10abi/compatibility test: remove tests inside repr(C) wrappersRalf Jung-41/+11
2024-09-10Auto merge of #129337 - EtomicBomb:rfc, r=notriddlebors-0/+518
rustdoc rfc#3662 changes under unstable flags * All new functionality is under unstable options * Adds `--merge=shared|none|finalize` flags * Adds `--parts-out-dir=<crate specific directory>` for `--merge=none` to write cross-crate info file for a single crate * Adds `--include-parts-dir=<previously specified directory>` for `--merge=finalize` to write cross-crate info files * `tests/rustdoc/` tests for the new flags
2024-09-09Rollup merge of #130152 - krasimirgg:nsan, r=nikicJubilee-0/+1
adapt a test for llvm 20 No functional changes intended. ``@rustbot`` label: +llvm-main r? ``@nikic``
2024-09-09Rollup merge of #130146 - folkertdev:bootstrap-naked-asm, r=AmanieuJubilee-6/+6
bootstrap `naked_asm!` for `compiler-builtins` tracking issue: https://github.com/rust-lang/rust/issues/90957 parent PR: https://github.com/rust-lang/rust/pull/128651 in this PR, `naked_asm!` is added as an alias for `asm!` with one difference: `options(noreturn)` is always enabled by `naked_asm!`. That makes it future-compatible for when `naked_asm!` starts disallowing `options(noreturn)` later. The `naked_asm!` macro must be introduced first so that we can upgrade `compiler-builtins` to use it, and can then change the implementation of `naked_asm!` in https://github.com/rust-lang/rust/pull/128651 I've added some usages for `naked_asm!` in the tests, so we can be confident that it works, but I've left upgrading the whole test suite to the parent PR. r? ``@Amanieu``
2024-09-09Rollup merge of #130094 - workingjubilee:concurrency-is-real, r=lcnrJubilee-0/+51
Inform the solver if evaluation is concurrent Parallel compilation of a program can cause unexpected event sequencing. Inform the solver when this is true so it can skip invalid asserts.
2024-09-09Rollup merge of #129529 - lqd:stable-new-solver, r=KobzolJubilee-0/+36
Add test to build crates used by r-a on stable r? ````````@Kobzol```````` I've opened other PRs for this one to work and they've landed already. I cherry-picked your commit, and added the last remaining pieces we needed I think.
2024-09-09rustdoc: add two regression testsLeón Orell Valerian Liehr-0/+52
2024-09-09compiler: Inform the solver of concurrencyJubilee Young-0/+51
Parallel compilation of a program can cause unexpected event sequencing. Inform the solver when this is true so it can skip invalid asserts, then assert replaced solutions are equal if Some
2024-09-09Rollup merge of #130137 - gurry:master, r=cjgillotMatthias Krüger-0/+59
Fix ICE caused by missing span in a region error Fixes #130012 The ICE occurs on line 634 in this error handling code: https://github.com/rust-lang/rust/blob/085744b7ad8b227239bcee0a44cd78dcd0310ab9/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs#L617-L637 It is caused by the span being a dummy span and `!span.is_dummy()` on line 628 evaluating to `false`. A dummy span, however, is expected here thanks to the `Self: Trait` predicate from `predicates_of` (see line 61): https://github.com/rust-lang/rust/blob/085744b7ad8b227239bcee0a44cd78dcd0310ab9/compiler/rustc_hir_analysis/src/collect/predicates_of.rs#L61-L69 This PR changes the error handling code to omit the note which needed the span instead of ICE'ing in the presence of a dummy span.
2024-09-09Rollup merge of #130064 - folkertdev:fix-issue-129983, r=compiler-errorsMatthias Krüger-8/+62
fix ICE in CMSE type validation fixes #129983 tracking issue: https://github.com/rust-lang/rust/issues/81391 r? ``@compiler-errors``
2024-09-09adapt a test for llvm 20Krasimir Georgiev-0/+1
No functional changes intended.
2024-09-09Add test about missing docs at crate levelUrgau-0/+14
2024-09-09Allow `missing_docs` lint on the generated test harnessUrgau-0/+6
2024-09-09bootstrap `naked_asm!` for `compiler-builtins`Folkert de Vries-6/+6
in this commit, `naked_asm!` is an alias for `asm!` with one difference: `options(noreturn)` is always enabled by `naked_asm!`. That makes it future-compatible for when `naked_asm!` starts disallowing `options(noreturn)` later.
2024-09-09Rollup merge of #130107 - RalfJung:const-ptr-is-null, r=oli-obkJubilee-0/+39
const: make ptr.is_null() stop execution on ambiguity This seems better than saying `false` -- saying `false` is in fact actively unsound if `NonNull` then uses this to permit putting this pointer inside of it, but at runtime it turns out to be null. Part of https://github.com/rust-lang/rust/issues/74939 Cc ```@rust-lang/wg-const-eval```
2024-09-09Rollup merge of #130068 - madsmtm:deployment-target-test, r=jieyouxuJubilee-25/+158
Test codegen when setting deployment target Test our codegen in different scenarios when setting the deployment target. There are many places here where this is still incorrect, these will be fixed in https://github.com/rust-lang/rust/pull/129342, https://github.com/rust-lang/rust/pull/129367 and https://github.com/rust-lang/rust/pull/129369. See https://github.com/rust-lang/rust/issues/129432 for the bigger picture. Tested locally using: ```console ./x test tests/run-make/apple-deployment-target --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin" ``` The only Apple targets that aren't tested by the above command are: - `arm64e-apple-darwin`, failed to build, see https://github.com/rust-lang/cc-rs/issues/1205. - `armv7k-apple-watchos`, failed to link, see https://github.com/rust-lang/rust/issues/130071. - `arm64e-apple-ios`, failed to link, see https://github.com/rust-lang/rust/issues/130085. - `i686-apple-darwin`, requires a bit of setup and an older machine, see [the docs](https://doc.rust-lang.org/nightly/rustc/platform-support/i686-apple-darwin.html). - `i386-apple-ios` requires you to set `IPHONEOS_DEPLOYMENT_TARGET=10.0` for the test helpers to work, will be fixed by https://github.com/rust-lang/cc-rs/issues/1030. But all of this is as it was before this PR. Fixes https://github.com/rust-lang/rust/issues/47825, since we now have a test that compiles a `dylib` for `aarch64-apple-ios`. Split out from https://github.com/rust-lang/rust/pull/129342, see that for a little bit of the review that this has gone through already. r? petrochenkov ```@rustbot``` label O-apple
2024-09-09Rollup merge of #128667 - its-the-shrimp:rustdoc_json_types_rename, ↵Jubilee-245/+245
r=aDotInTheVoid rustdoc: normalise type/field names Updates #100961 - `Import` -> `Use`, to better reflect the terminology of Rust & its syntax - `TypeBinding` -> `AssocItemConstraint`, to sync up with `clean` - `FnDecl` -> `FunctionSignature`, because that's what it is - `Header` -> `FunctionHeader`, because `Header` is a very word that's very heavily loaded with different meanings - `ItemEnum::AssocType`: `default` -> `type`, because those items appear in `impl` blocks as well, where they're _not_ the "default" - `ItemEnum::AssocConst`: `default` -> `value`, see the previous point - `ForeignType` -> `ExternType`, because "foreign" is not the right word there - boolean fields' names made to consistently be a phrase that can be a yes/no answer, e.g. `async` -> `is_async` The docs of `ItemEnum::AssocType::type_` & of `ItemEnum::AssocConst::value` are also updated to be up to date with the clarification of the name of the fields
2024-09-09Rollup merge of #128345 - sthibaul:hurd-amd64, r=UrgauJubilee-0/+3
added support for GNU/Hurd on x86_64
2024-09-09Rollup merge of #119229 - mati865:update-mingw-toolchain, ↵Jubilee-0/+3
r=jieyouxu,petrochenkov Update mingw-w64 + GNU toolchain The list of packaged tools and their versions is available at: https://github.com/niXman/mingw-builds-binaries/releases/tag/14.1.0-rt_v12-rev0 Fixes: https://github.com/rust-lang/rust/issues/112368
2024-09-09Fix ICE caused by missing span in a region errorGurinder Singh-0/+59
2024-09-08added support for GNU/Hurd on x86_64Samuel Thibault-0/+3
2024-09-08const: make ptr.is_null() stop execution on ambiguityRalf Jung-0/+39
2024-09-08Auto merge of #129346 - nnethercote:fix-double-handling-in-collect_tokens, ↵bors-117/+106
r=petrochenkov Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after #124141. This PR fixes some double handling cases that cause problems, including #129166. r? `@petrochenkov`
2024-09-08Auto merge of #129313 - RalfJung:coroutine-niches, r=compiler-errorsbors-26/+29
Supress niches in coroutines to avoid aliasing violations As mentioned [here](https://github.com/rust-lang/rust/issues/63818#issuecomment-2264915918), using niches in fields of coroutines that are referenced by other fields is unsound: the discriminant accesses violate the aliasing requirements of the reference pointing to the relevant field. This issue causes [Miri errors in practice](https://github.com/rust-lang/miri/issues/3780). The "obvious" fix for this is to suppress niches in coroutines. That's what this PR does. However, we have several tests explicitly ensuring that we *do* use niches in coroutines. So I see two options: - We guard this behavior behind a `-Z` flag (that Miri will set by default). There is no known case of these aliasing violations causing miscompilations. But absence of evidence is not evidence of absence... - (What this PR does right now.) We temporarily adjust the coroutine layout logic and the associated tests until the proper fix lands. The "proper fix" here is to wrap fields that other fields can point to in [`UnsafePinned`](https://github.com/rust-lang/rust/issues/125735) and make `UnsafePinned` suppress niches; that would then still permit using niches of *other* fields (those that never get borrowed). However, I know that coroutine sizes are already a problem, so I am not sure if this temporary size regression is acceptable. `@compiler-errors` any opinion? Also who else should be Cc'd here?
2024-09-07add tests for behavior in rfc#3662EtomicBomb-0/+501
* Adds tests for the behavior from rfc#3662 in `tests/rustdoc/`
2024-09-07rfc#3662 changes under unstable flagsEtomicBomb-0/+17
* All new functionality is under unstable options * Adds `--merge=shared|none|finalize` flags * Adds `--parts-out-dir=<crate specific directory>` for `--merge=none` to write cross-crate info file for a single crate * Adds `--include-parts-dir=<previously specified directory>` for `--merge=finalize` to write cross-crate info files * update tests/run-make/rustdoc-default-output/rmake.rs golden
2024-09-07Rollup merge of #130009 - notriddle:notriddle/trailing-arrow, ↵Matthias Krüger-9/+75
r=lolbinarycat,GuillaumeGomez rustdoc-search: allow trailing `Foo ->` arg search Fixes #129710
2024-09-07Rollup merge of #129869 - cyrgani:master, r=Mark-SimulacrumMatthias Krüger-0/+80
add a few more crashtests Added them for #123629, #127033 and #129372.
2024-09-07Rollup merge of #129847 - compiler-errors:async-cycle, r=davidtwcoMatthias Krüger-0/+19
Do not call query to compute coroutine layout for synthetic body of async closure There is code in the MIR validator that attempts to prevent query cycles when inlining a coroutine into itself, and will use the coroutine layout directly from the body when it detects that's the same coroutine as the one that's being validated. After #128506, this logic didn't take into account the fact that the coroutine def id will differ if it's the "by-move body" of an async closure. This PR implements that. Fixes #129811
2024-09-07Rollup merge of #129677 - compiler-errors:by-move-body-err, r=cjgillotMatthias Krüger-0/+27
Don't build by-move body when async closure is tainted Fixes #129676 See explanation in the ui test.
2024-09-07Rollup merge of #129555 - RalfJung:const_float_bits_conv, r=dtolnayMatthias Krüger-5/+3
stabilize const_float_bits_conv This stabilizes `const_float_bits_conv`, and thus fixes https://github.com/rust-lang/rust/issues/72447. With https://github.com/rust-lang/rust/pull/128596 having landed, this is entirely a libs-only question now. ```rust impl f32 { pub const fn to_bits(self) -> u32; pub const fn from_bits(v: u32) -> Self; pub const fn to_be_bytes(self) -> [u8; 4]; pub const fn to_le_bytes(self) -> [u8; 4] pub const fn to_ne_bytes(self) -> [u8; 4]; pub const fn from_be_bytes(bytes: [u8; 4]) -> Self; pub const fn from_le_bytes(bytes: [u8; 4]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self; } impl f64 { pub const fn to_bits(self) -> u64; pub const fn from_bits(v: u64) -> Self; pub const fn to_be_bytes(self) -> [u8; 8]; pub const fn to_le_bytes(self) -> [u8; 8] pub const fn to_ne_bytes(self) -> [u8; 8]; pub const fn from_be_bytes(bytes: [u8; 8]) -> Self; pub const fn from_le_bytes(bytes: [u8; 8]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self; } ```` Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-09-07Rollup merge of #126452 - compiler-errors:raw-lifetimes, r=spastorinoMatthias Krüger-2/+154
Implement raw lifetimes and labels (`'r#ident`) This PR does two things: 1. Reserve lifetime prefixes, e.g. `'prefix#lt` in edition 2021. 2. Implements raw lifetimes, e.g. `'r#async` in edition 2021. This PR additionally extends the `keyword_idents_2024` lint to also check lifetimes. cc `@traviscross` r? parser
2024-09-07Auto merge of #126161 - Bryanskiy:delegation-generics-4, r=petrochenkovbors-325/+417
Delegation: support generics in associated delegation items This is a continuation of https://github.com/rust-lang/rust/pull/125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
2024-09-07Test codegen when setting deployment targetMads Marquart-25/+158
2024-09-07Don't build by-move body when async closure is taintedMichael Goulet-0/+27
2024-09-07Rollup merge of #130054 - cuishuang:master, r=chenyukangMichael Goulet-1/+1
Add missing quotation marks
2024-09-07Rollup merge of #129940 - liushuyu:s390x-target-features, r=RalfJungMichael Goulet-0/+46
s390x: Fix a regression related to backchain feature In #127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes #129927. r? `@RalfJung`
2024-09-07Rollup merge of #129899 - veera-sivarajan:fix-97793-pr-final, r=chenyukangMichael Goulet-8/+573
Add Suggestions for Misspelled Keywords Fixes #97793 This PR detects misspelled keywords using two heuristics: 1. Lowercasing the unexpected identifier. 2. Using edit distance to find a keyword similar to the unexpected identifier. However, it does not detect each and every misspelled keyword to minimize false positives and ambiguities. More details about the implementation can be found in the comments.
2024-09-07Rollup merge of #129891 - nikic:naked-no-san, r=jackh726Michael Goulet-0/+22
Do not request sanitizers for naked functions Naked functions can only contain inline asm, so any instrumentation inserted by sanitizers is illegal. Don't request it. Fixes https://github.com/rust-lang/rust/issues/129224.
2024-09-07Rollup merge of #129840 - GrigorenkoPV:elided-named-lifetimes-suggestion, ↵Michael Goulet-0/+31
r=cjgillot Implement suggestions for `elided_named_lifetimes` A follow-up to #129207, as per https://github.com/rust-lang/rust/pull/129207#issuecomment-2308992849. r? cjgillot I will probably squash this a bit, but later. `@rustbot` label +A-lint
2024-09-07Rollup merge of #129468 - Rajveer100:hack-to-avoid-function-merging, ↵Michael Goulet-126/+12
r=Mark-Simulacrum [testsuite][cleanup] Remove all usages of `dont_merge` hack to avoid function merging Resolves #129438 The `-Zmerge-functions=disabled` compile flag exists for this purpose.
2024-09-07fix ICE in CMSE type validationFolkert de Vries-8/+62
2024-09-06Add Suggestions for Misspelled KeywordsVeera-13/+169
This PR detects misspelled keywords using two heuristics: 1. Lowercasing the unexpected identifier. 2. Using edit distance to find a keyword similar to the unexpected identifier. However, it does not detect each and every misspelled keyword to minimize false positives and ambiguities. More details about the implementation can be found in the comments.
2024-09-07Add missing quotation markscuishuang-1/+1
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-06Lint against keyword lifetimes in keyword_identsMichael Goulet-2/+25