about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-08-27Rollup merge of #128935 - lqd:needs-zstd, r=KobzolTrevor Gross-39/+42
More work on `zstd` compression r? ``@Kobzol`` as we've discussed this. This is a draft to show the current approach of supporting zstd in compiletest, and making the tests using it unconditional. Knowing whether llvm/lld was built with `LLVM_ENABLE_ZSTD` is quite hard, so there are two strategies. There are details in the code, and we can discuss this approach. Until we know the config used to build CI artifacts, it seems our options are somewhat limited in any case. zlib compression seems always enabled, so we only check this in its dedicated test, allowing the test to ignore errors due to zstd not being supported. The zstd test is made unconditional in what it tests, by relying on `needs-llvm-zstd` to be ignored when `llvm.libzstd` isn't enabled in `config.toml`. try-job: x86_64-gnu try-job: x86_64-msvc try-job: x86_64-gnu-distcheck
2024-08-27Rollup merge of #128731 - RalfJung:simd-shuffle-vector, r=workingjubileeTrevor Gross-2/+25
simd_shuffle intrinsic: allow argument to be passed as vector See https://github.com/rust-lang/rust/issues/128738 for context. I'd like to get rid of [this hack](https://github.com/rust-lang/rust/blob/6c0b89dfac65be9a5be12f938f23098ebc36c635/compiler/rustc_codegen_ssa/src/mir/block.rs#L922-L935). https://github.com/rust-lang/rust/pull/128537 almost lets us do that since constant SIMD vectors will then be passed as immediate arguments. However, simd_shuffle for some reason actually takes an *array* as argument, not a vector, so the hack is still required to ensure that the array becomes an immediate (which then later stages of codegen convert into a vector, as that's what LLVM needs). This PR prepares simd_shuffle to also support a vector as the `idx` argument. Once this lands, stdarch can hopefully be updated to pass `idx` as a vector, and then support for arrays can be removed, which finally lets us get rid of that hack.
2024-08-27Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwcoTrevor Gross-0/+72
Implement `-Z embed-source` (DWARFv5 source code embedding extension) Implement https://github.com/rust-lang/compiler-team/issues/764 MCP which adds an unstable flag that exposes LLVM's [DWARFv5 source code embedding](https://dwarfstd.org/issues/180201.1.html) support.
2024-08-27Rollup merge of #129560 - GuillaumeGomez:impl-assoc-type-source-link, ↵Matthias Krüger-1/+27
r=notriddle [rustdoc] Generate source link on impl associated types Currently, impl associated types are generated but don't get a source link. This PR fixes that. Before: ![image](https://github.com/user-attachments/assets/3a22adb5-8b66-4124-9267-7c26eed1aa5e) After: ![Screenshot from 2024-08-25 16-31-36](https://github.com/user-attachments/assets/6e9b35e7-4357-4ecf-8c49-1d8294051283) r? `@notriddle`
2024-08-27Rollup merge of #129340 - stephen-lazaro:u/slazaro/issue-129274, ↵Matthias Krüger-0/+28
r=compiler-errors Remove Duplicate E0381 Label Aims to resolve https://github.com/rust-lang/rust/issues/129274, and adds a test for the case. Essentially, we are duplicating this span for some reason. For now, I'm just using a set to collect the spans rather than the vec. I imagine there's probably no real reason to inspect duplicates in this area, but if I'm wrong I can adjust to collect "seen spans" in just the point where this label is applied. I'm not sure why it's producing duplicate spans. Looks like this has been this way for a while? I think it gives the duplicate label on 1.75.0 for example.
2024-08-27Rollup merge of #129250 - estebank:issue-129205, r=compiler-errorsMatthias Krüger-17/+25
Do not ICE on non-ADT rcvr type when looking for crate version collision When looking for multiple versions of the same crate, do not blindly construct the receiver type. Follow up to #128786. Fixes #129205 Fixes #129216
2024-08-27Rollup merge of #129032 - jswrenn:transmute-method, r=compiler-errorsMatthias Krüger-17/+17
Document & implement the transmutation modeled by `BikeshedIntrinsicFrom` Documents that `BikeshedIntrinsicFrom` models transmute-via-union, which is slightly more expressive than the transmute-via-cast implemented by `transmute_copy`. Additionally, we provide an implementation of transmute-via-union as a method on the `BikeshedIntrinsicFrom` trait with additional documentation on the boundary between trait invariants and caller obligations. Whether or not transmute-via-union is the right kind of transmute to model remains up for discussion [1]. Regardless, it seems wise to document the present behavior. [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967 Tracking Issue: https://github.com/rust-lang/rust/issues/99571 r? `@compiler-errors` cc `@scottmcm,` `@Lokathor`
2024-08-26Remove crashes from type_of on resolution that doesn't have a type_ofMichael Goulet-17/+0
2024-08-26Do not ICE on non-ADT rcvr type when looking for crate version collisionEsteban Küber-0/+25
When looking for multiple versions of the same crate, do not blindly construct the receiver type. Follow up to #128786. Fix #129205.
2024-08-26Rollup merge of #129600 - ↵Matthias Krüger-6/+22
traviscross:TC/tie-impl_trait_overcaptures-to-rust-2024, r=compiler-errors Tie `impl_trait_overcaptures` lint to Rust 2024 The `impl_trait_overcaptures` lint is part of the migration to Rust 2024 and the Lifetime Capture Rules 2024. Now that we've stabilized precise capturing (RFC 3617), let's tie this lint to the `rust_2024_compatibility` lint group. Tracking: - https://github.com/rust-lang/rust/issues/117587 r? `@compiler-errors`
2024-08-26Rollup merge of #129190 - rezwanahmedsami:master, r=tgross35Matthias Krüger-1/+69
Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs Fixes #129163 try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw
2024-08-26Tie `impl_trait_overcaptures` lint to Rust 2024Travis Cross-6/+22
The `impl_trait_overcaptures` lint is part of the migration to Rust 2024 and the Lifetime Capture Rules 2024. Now that we've stabilized precise capturing (RFC 3617), let's tie this lint to the `rust_2024_compatibility` lint group.
2024-08-26Rollup merge of #129553 - RalfJung:const-stability, r=compiler-errorsMatthias Krüger-8/+16
add back test for stable-const-can-only-call-stable-const This got accidentally removed in https://github.com/rust-lang/rust/pull/128596 (file `tests/ui/internal/internal-unstable-const.rs`). The test has little to do with "allow internal unstable" though, so add it in a file that already tests various const stability things. Also tweak the help that suggests to add `rustc_allow_const_fn_unstable` to make it clear that this needs team approval, since it is a fairly big gun.
2024-08-26Rollup merge of #129525 - notriddle:notriddle/fake-variadic-tuple-array, ↵Matthias Krüger-0/+17
r=GuillaumeGomez rustdoc: clean up tuple <-> primitive conversion docs This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-26Rollup merge of #129519 - compiler-errors:lowering-flags, r=fmeaseMatthias Krüger-0/+28
Remove redundant flags from `lower_ty_common` that can be inferred from the HIR ...and then get rid of `lower_ty_common`. r? ``@fmease`` or re-roll if you're busy!
2024-08-26Rollup merge of #129405 - surechen:fix_span_x, r=cjgillotMatthias Krüger-29/+12
Fixing span manipulation and indentation of the suggestion introduced by #126187 According to comments: https://github.com/rust-lang/rust/pull/128084#issuecomment-2295254576 https://github.com/rust-lang/rust/pull/126187/files#r1634897691
2024-08-26Rollup merge of #129288 - compiler-errors:unsafe-fn-coercion, r=lcnrMatthias Krüger-0/+14
Use subtyping for `UnsafeFnPointer` coercion, too I overlooked this in #129059, which changed MIR typechecking to use subtyping for other fn pointer coercions. Fixes #129285
2024-08-25expand zstd debuginfo compression testRémy Rakic-10/+23
it now checks zlib and zstd, via rustc and rust-lld
2024-08-25prepare test for expanding scopeRémy Rakic-0/+0
2024-08-25mark `rust-lld-compress-debug-sections` test as needing zstdRémy Rakic-14/+4
also make it fail if there's a compression issue
2024-08-25Remove redundant flags that can be inferred from the HIRMichael Goulet-0/+28
2024-08-25Rollup merge of #129487 - ↵Matthias Krüger-0/+73
GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors repr_transparent_external_private_fields: special-case some std types Fixes #129470 ```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
2024-08-25Add regression test for impl associated types source linkGuillaume Gomez-0/+26
2024-08-25Generate missing source link on impl associated typesGuillaume Gomez-1/+1
2024-08-25Fixing span manipulation and indentation of the suggestion introduced by #126187surechen-29/+12
According to comments: https://github.com/rust-lang/rust/pull/128084#issuecomment-2295254576 https://github.com/rust-lang/rust/pull/126187/files#r1634897691
2024-08-25tweak rustc_allow_const_fn_unstable hint, and add back test for ↵Ralf Jung-8/+16
stable-const-can-only-call-stable-const
2024-08-25Auto merge of #129521 - matthiaskrgr:rollup-uigv77m, r=matthiaskrgrbors-409/+455
Rollup of 9 pull requests Successful merges: - #128596 (stabilize const_fn_floating_point_arithmetic) - #129199 (make writes_through_immutable_pointer a hard error) - #129246 (Retroactively feature gate `ConstArgKind::Path`) - #129290 (Pin `cc` to 1.0.105) - #129323 (Implement `ptr::fn_addr_eq`) - #129500 (remove invalid `TyCompat` relation for effects) - #129501 (panicking: improve hint for Miri's RUST_BACKTRACE behavior) - #129505 (interpret: ImmTy: tighten sanity checks in offset logic) - #129510 (Fix `elided_named_lifetimes` in code) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-24Rollup merge of #129430 - lolbinarycat:rustdoc-search-exact-case, r=notriddleTrevor Gross-0/+7
rustdoc: show exact case-sensitive matches first fixes #119480
2024-08-24Rollup merge of #129429 - cjgillot:named-variance, r=compiler-errorsTrevor Gross-132/+134
Print the generic parameter along with the variance in dumps. This allows to make sure we are testing what we think we are testing. While the tests are correct, I discovered that opaque duplicated args are in the reverse declaration order.
2024-08-24Rollup merge of #128735 - jieyouxu:pr-120176-revive, r=cjgillotTrevor Gross-6/+126
Add a special case for `CStr`/`CString` in the `improper_ctypes` lint Revives #120176. Just needed to bless a test and fix an argument, but seemed reasonable to me otherwise. Instead of saying to "consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct", we now tell users to "Use `*const ffi::c_char` instead, and pass the value from `CStr::as_ptr()`" when the type involved is a `CStr` or a `CString`. The suggestion is not made for `&mut CString` or `*mut CString`. r? ``````@cjgillot`````` (since you were the reviewer of the original PR #120176, but feel free to reroll)
2024-08-24Rollup merge of #128524 - ↵Trevor Gross-41/+28
chenyukang:yukang-fix-127930-invalid-outer-style-sugg, r=cjgillot Don't suggest turning crate-level attributes into outer style Fixes #127930
2024-08-24Rollup merge of #128467 - estebank:unsized-args, r=cjgillotTrevor Gross-0/+139
Detect `*` operator on `!Sized` expression The suggestion is new: ``` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/unsized-str-in-return-expr-arg-and-local.rs:15:9 | LL | let x = *""; | ^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` = note: all local variables must have a statically known size = help: unsized locals are gated as an unstable feature help: references to `!Sized` types like `&str` are `Sized`; consider not dereferencing the expression | LL - let x = *""; LL + let x = ""; | ``` Fix #128199.
2024-08-24rustdoc: clean up tuple <-> primitive conversion docsMichael Howell-0/+17
This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-24Rollup merge of #129500 - fee1-dead-contrib:fxrel, r=compiler-errorsMatthias Krüger-2/+13
remove invalid `TyCompat` relation for effects if the current impl uses `Maybe` (`impl const`), the parent impl must use `Maybe` (`impl const`) as well. I'd like to rename `TyCompat` to `Sub` which is probably clearer. But it would conflict with my other PR. r? ``@rust-lang/project-const-traits``
2024-08-24Rollup merge of #129246 - BoxyUwU:feature_gate_const_arg_path, r=cjgillotMatthias Krüger-184/+383
Retroactively feature gate `ConstArgKind::Path` This puts the lowering introduced by #125915 under a feature gate until we fix the regressions introduced by it. Alternative to whole sale reverting the PR since it didn't seem like a very clean revert and I think this is generally a step in the right direction and don't want to get stuck landing and reverting the PR over and over :) cc #129137 ``@camelid,`` tests taken from there. beta is branching soon so I think it makes sense to not try and rush that fix through since it wont have much time to bake and if it has issues we can't simply revert it on beta. Fixes #128016
2024-08-24Rollup merge of #129199 - RalfJung:writes_through_immutable_pointer, ↵Matthias Krüger-52/+11
r=compiler-errors make writes_through_immutable_pointer a hard error This turns the lint added in https://github.com/rust-lang/rust/pull/118324 into a hard error. This has been reported in cargo's future-compat reports since Rust 1.76 (released in February). Given that const_mut_refs is still unstable, it should be impossible to even hit this error on stable: we did accidentally stabilize some functions that can cause this error, but that got reverted in https://github.com/rust-lang/rust/pull/117905. Still, let's do a crater run just to be sure. Given that this should only affect unstable code, I don't think it needs an FCP, but let's Cc ``@rust-lang/lang`` anyway -- any objection to making this unambiguous UB into a hard error during const-eval? This can be viewed as part of https://github.com/rust-lang/rust/pull/129195 which is already nominated for discussion.
2024-08-24Rollup merge of #128596 - RalfJung:const_fn_floating_point_arithmetic, ↵Matthias Krüger-171/+48
r=nnethercote stabilize const_fn_floating_point_arithmetic Part of https://github.com/rust-lang/rust/issues/128288 Fixes https://github.com/rust-lang/rust/issues/57241 The existing test `tests/ui/consts/const_let_eq_float.rs` ([link](https://github.com/RalfJung/rust/blob/const_fn_floating_point_arithmetic/tests/ui/consts/const_let_eq_float.rs)) covers the basics, and also Miri has extensive tests covering the interpreter's float machinery. Also, that machinery can already be used on stable inside `const`/`static` initializers, just not inside `const fn`. This was explicitly called out in https://github.com/rust-lang/rfcs/pull/3514 so in a sense t-lang just recently already FCP'd this, but let's hear from them whether they want another FCP for the stabilization here or whether that was covered by the FCP for the RFC. Cc ``@rust-lang/lang`` ### Open items - [x] Update the Reference: https://github.com/rust-lang/reference/pull/1566
2024-08-24repr_transparent_external_private_fields: treat `rustc_pub_transparent` ↵Pavel Grigorenko-0/+25
types as local
2024-08-24New `#[rustc_pub_transparent]` attributePavel Grigorenko-0/+48
2024-08-24remove invalid `TyCompat` relation for effectsDeadbeef-2/+13
2024-08-23Print the generic parameter along with the variance in dumps.Camille GILLOT-132/+134
2024-08-23Auto merge of #128507 - Oneirical:testart-from-scratch, r=jieyouxubors-8/+70
Migrate `libtest-thread-limit` `run-make` test 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, but **only if normal CI is green**: // try-job: armhf-gnu // <- failed on this try-job: aarch64-gnu
2024-08-23rustdoc: show exact case-sensitive matches firstbinarycat-0/+7
fixes #119480
2024-08-23document & impl the transmutation modeled by `BikeshedIntrinsicFrom`Jack Wrenn-17/+17
Documents that `BikeshedIntrinsicFrom` models transmute-via-union, which is slightly more expressive than the transmute-via-cast implemented by `transmute_copy`. Additionally, we provide an implementation of transmute-via-union as a method on the `BikeshedIntrinsicFrom` trait with additional documentation on the boundary between trait invariants and caller obligations. Whether or not transmute-via-union is the right kind of transmute to model remains up for discussion [1]. Regardless, it seems wise to document the present behavior. [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967
2024-08-23rewrite libtest-thread-limit to rmakeOneirical-8/+70
2024-08-23Auto merge of #129464 - GuillaumeGomez:rollup-ckfqd7h, r=GuillaumeGomezbors-23/+87
Rollup of 9 pull requests Successful merges: - #128511 (Document WebAssembly target feature expectations) - #129243 (do not build `cargo-miri` by default on stable channel) - #129263 (Add a missing compatibility note in the 1.80.0 release notes) - #129276 (Stabilize feature `char_indices_offset`) - #129350 (adapt integer comparison tests for LLVM 20 IR changes) - #129408 (Fix handling of macro arguments within the `dropping_copy_types` lint) - #129426 (rustdoc-search: use tighter json for names and parents) - #129437 (Fix typo in a help diagnostic) - #129457 (kobzol vacation) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-23Rollup merge of #129437 - gurry:fix-diagnostic-typo, r=jieyouxuGuillaume Gomez-1/+1
Fix typo in a help diagnostic Replaced "**the your** dependency graph" with "**in the** dependency graph".
2024-08-23Rollup merge of #129408 - Urgau:macro-arg-drop_copy, r=compiler-errorsGuillaume Gomez-0/+45
Fix handling of macro arguments within the `dropping_copy_types` lint This PR fixes the handling of spans with different context (aka macro arguments) than the primary expression within the different `{drop,forget}ing_copy_types` and `{drop,forget}ing_references` lints. <details> <summary>Before</summary> ``` warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing --> drop_writeln.rs:5:5 | 5 | drop(writeln!(&mut msg, "test")); | ^^^^^--------------------------^ | | | argument has type `Result<(), std::fmt::Error>` | = note: `#[warn(dropping_copy_types)]` on by default help: use `let _ = ...` to ignore the expression or result --> /home/[..]/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/macros/mod.rs:688:9 | 68| let _ = | ~~~~~~~ ``` </details> <details> <summary>With this PR</summary> ``` warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing --> drop_writeln.rs:5:5 | 5 | drop(writeln!(&mut msg, "test")); | ^^^^^--------------------------^ | | | argument has type `Result<(), std::fmt::Error>` | = note: `#[warn(dropping_copy_types)]` on by default help: use `let _ = ...` to ignore the expression or result | 5 - drop(writeln!(&mut msg, "test")); 5 + let _ = writeln!(&mut msg, "test"); | ``` </details> ``````@rustbot`````` label +L-dropping_copy_types
2024-08-23Rollup merge of #129350 - krasimirgg:llvm20, r=nikicGuillaume Gomez-22/+41
adapt integer comparison tests for LLVM 20 IR changes The LLVM commit https://github.com/llvm/llvm-project/commit/abf69a167bbc99054871e3f9cc8810bbebcb6747 changed the IR in a few comparison tests: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/30500#01917017-26fe-4a4d-956b-725a2903e5a8 Adapted accordingly. ````@rustbot```` label: +llvm-main r? ````@nikic````
2024-08-23Rollup merge of #129417 - compiler-errors:refine-err, r=lqdMatthias Krüger-19/+24
Don't trigger refinement lint if predicates reference errors Fixes #129404