about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-05-26Rollup merge of #125508 - scottmcm:fix-125506, r=NilstriebMatthias Krüger-0/+19
Stop SRoA'ing `DynMetadata` in MIR Fixes #125506
2024-05-26Auto merge of #124661 - RalfJung:only-structural-consts-in-patterns, r=pnkfelixbors-1018/+164
Turn remaining non-structural-const-in-pattern lints into hard errors This completes the implementation of https://github.com/rust-lang/rust/issues/120362 by turning our remaining future-compat lints into hard errors: indirect_structural_match and pointer_structural_match. They have been future-compat lints for a while (indirect_structural_match for many years, pointer_structural_match since Rust 1.75 (released Dec 28, 2023)), and have shown up in dependency breakage reports since Rust 1.78 (just released on May 2, 2024). I don't expect a lot of code will still depend on them, but we will of course do a crater run. A lot of cleanup is now possible in const_to_pat, but that is deferred to a later PR. Fixes https://github.com/rust-lang/rust/issues/70861
2024-05-26Auto merge of #125518 - saethlin:check-arguments-new-in-const, r=joboetbors-76/+68
Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: https://github.com/rust-lang/rust/pull/117804#discussion_r1612964362
2024-05-25Rollup merge of #124080 - oli-obk:define_opaque_types10, r=compiler-errorsMatthias Krüger-119/+361
Some unstable changes to where opaque types get defined None of these can be reached from stable afaict. r? ``@compiler-errors`` cc https://github.com/rust-lang/rust/issues/116652
2024-05-25Rollup merge of #121377 - pitaj:lazy_cell_fn_pointer, r=dtolnayMatthias Krüger-25/+24
Stabilize `LazyCell` and `LazyLock` Closes #109736 This stabilizes the [`LazyLock`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html) and [`LazyCell`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html) types: ```rust static HASHMAP: LazyLock<HashMap<i32, String>> = LazyLock::new(|| { println!("initializing"); let mut m = HashMap::new(); m.insert(13, "Spica".to_string()); m.insert(74, "Hoyten".to_string()); m }); let lazy: LazyCell<i32> = LazyCell::new(|| { println!("initializing"); 92 }); ``` r? libs-api
2024-05-25Auto merge of #121571 - clarfonthey:unchecked-math-preconditions, r=saethlinbors-154/+130
Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods (Old PR is haunted, opening a new one. See #117494 for previous discussion.) This ensures that these preconditions are actually checked in debug mode, and hopefully should let people know if they messed up. I've also replaced the calls (I could find) in the code that use these intrinsics directly with those that use these methods, so that the asserts actually apply. More discussions on people misusing these methods in the tracking issue: https://github.com/rust-lang/rust/issues/85122.
2024-05-25Rollup merge of #125527 - programmerjake:patch-2, r=workingjubileeMatthias Krüger-0/+35
Add manual Sync impl for ReentrantLockGuard Fixes: #125526 Tracking Issue: #121440 this impl is even shown in the summary in the tracking issue, but apparently was forgotten in the actual implementation
2024-05-25Rollup merge of #125514 - compiler-errors:builtin-index, r=lcnrMatthias Krüger-0/+13
Structurally resolve before `builtin_index` in EUV r? lcnr
2024-05-25Rollup merge of #125513 - compiler-errors:impossible-drop, r=jackh726Matthias Krüger-0/+18
Don't eagerly monomorphize drop for types that are impossible to instantiate Self-explanatory title I think Fixes #125509
2024-05-25Rollup merge of #125498 - zmodem:avx512er, r=workingjubileeMatthias Krüger-2/+2
Stop using the avx512er and avx512pf x86 target features They are no longer supported by LLVM 19. Fixes #125492
2024-05-25Rollup merge of #125451 - oli-obk:const_type_mismatch, r=compiler-errorsMatthias Krüger-118/+121
Fail relating constants of different types fixes #121585 fixes #121858 fixes #124151 I gave this several attempts before, but we lost too many important diagnostics until I managed to make compilation never bail out early. We have reached this point, so now we can finally fix all those ICEs by bubbling up an error instead of continueing when we encounter a bug.
2024-05-25Stop SRoA'ing `DynMetadata` in MIRScott McMurray-0/+19
2024-05-24Don't eagerly monomorphize drop for types that are impossible to instantiateMichael Goulet-0/+18
2024-05-24Stabilize the runtime of libtest-paddingBen Kimock-6/+2
The body of these benchmarks is close to empty but not literally empty. This was making the runtime of the benchmarks (which are compiled without optimizations!) flicker between 9 ns and 10 ns runtime, which changes the padding and breaks the test. Recent changes to the standard library have pushed the runtime closer to 10 ns when unoptimized, which is why we haven't seen such failures before in CI. Contributors can also induce such failures before this PR by running the run-make tests while the system is under heavy load.
2024-05-25Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkovbors-82/+86
Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned https://github.com/rust-lang/rust/pull/117246#discussion_r1374648388. This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of https://github.com/rust-lang/rust/pull/117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
2024-05-24Move the checks for Arguments constructors to inline constBen Kimock-76/+68
2024-05-24Add manual Sync impl for ReentrantLockGuardJacob Lifshay-0/+35
Fixes: #125526
2024-05-24Rollup merge of #125503 - aDotInTheVoid:rdj-keyword-attr, r=GuillaumeGomezMatthias Krüger-0/+20
rustdoc-json: Add test for keywords with `--document-private-items` Turns out this does work as-expected. I was worried that the rustdoc's clean would produce a `ItemKind::KeywordItem` for the module, and loose the module itself. But turns out we get this right. Prompted by [this discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Where.20to.20find.20keyword.20entries.20in.20JSON.20rustdoc) r? `@GuillaumeGomez`
2024-05-24Rollup merge of #125501 - compiler-errors:opaque-opaque-anon-ct, r=BoxyUwUMatthias Krüger-22/+24
Resolve anon const's parent predicates to direct parent instead of opaque's parent When an anon const is inside of an opaque, #99801 added a hack to resolve the anon const's parent predicates *not* to the opaque's predicates, but to the opaque's *parent's* predicates. This is insufficient when considering nested opaques. This means that the `predicates_of` an anon const might reference duplicated lifetimes (installed by `compute_bidirectional_outlives_predicates`) when computing known outlives in MIR borrowck, leading to these ICEs: Fixes #121574 Fixes #118403 ~~Instead, we should be using the `OpaqueTypeOrigin` to acquire the owner item (fn/type alias/etc) of the opaque, whose predicates we're fine to mention.~~ ~~I think it's a bit sketchy that we're doing this at all, tbh; I think it *should* be fine for the anon const to inherit the predicates of the opaque it's located inside. However, that would also mean that we need to make sure the `generics_of` that anon const line up in the same way.~~ ~~None of this is important to solve right now; I just want to fix these ICEs so we can land #125468, which accidentally fixes these issues in a different and unrelated way.~~ edit: We don't need this special case anyways because we install the right parent item in `generics_of` anyways: https://github.com/rust-lang/rust/blob/213ad10c8f0fc275648552366275dc4e07f97462/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L150 r? `@BoxyUwU`
2024-05-24Rollup merge of #125485 - GuillaumeGomez:migrate-rmake-rustdoc, r=jieyouxuMatthias Krüger-8/+16
Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
2024-05-24Rollup merge of #125467 - compiler-errors:binop-in-bool-expectation, r=estebankMatthias Krüger-0/+43
Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement Similar to #123722, we are currently too aggressive when delaying a binop error with the expectation that we'll emit another error elsewhere. This adjusts that heuristic to be more accurate, at the cost of some possibly poorer suggestions. Fixes #125458
2024-05-24Structurally resolve before builtin_index in EUVMichael Goulet-0/+13
2024-05-24Stop using the avx512er and avx512pf x86 target featuresHans Wennborg-2/+2
They are no longer supported by LLVM 19. Fixes #125492
2024-05-24Actually just remove the special case altogetherMichael Goulet-22/+24
2024-05-24rustdoc-json: Add test for keywords with `--document-private-items`Alona Enraght-Moony-0/+20
2024-05-24Add regression testsOli Scherer-22/+136
2024-05-24Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs`Guillaume Gomez-8/+16
2024-05-24Use regular type equating instead of a custom queryOli Scherer-7/+42
2024-05-24Fail relating constants of different typesOli Scherer-111/+79
2024-05-24Auto merge of #125457 - fmease:gacs-diag-infer-plac-missing-ty, ↵bors-10/+69
r=compiler-errors Properly deal with missing/placeholder types inside GACs Fixes #124833. r? oli-obk (#123130)
2024-05-23Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methodsltdk-148/+128
2024-05-23Only suppress binop error in favor of semicolon suggestion if we're in an ↵Michael Goulet-0/+43
assignment statement
2024-05-24Handle trait/impl GAC mismatches when inferring missing/placeholder typesLeón Orell Valerian Liehr-15/+25
2024-05-24Properly deal with missing/placeholder types inside GACsLeón Orell Valerian Liehr-0/+49
2024-05-23Rollup merge of #125445 - GuillaumeGomez:rustdoc-migrate-short-out-dir, ↵Guillaume Gomez-8/+16
r=jieyouxu Migrate `run-make/rustdoc-with-short-out-dir-option` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
2024-05-23Rollup merge of #125412 - Urgau:check-cfg-less-build-rs, r=wesleywiserGuillaume Gomez-0/+65
Don't suggest adding the unexpected cfgs to the build-script it-self This PR adds a check to avoid suggesting to add the unexpected cfgs inside the build-script when building the build-script it-self, as it won't have any effect, since build-scripts applies to their descended target. Fixes #125368
2024-05-23Rollup merge of #125401 - ↵León Orell Valerian Liehr-19/+64
GuillaumeGomez:migrate-rustdoc-scrape-examples-macros, r=jieyouxu Migrate `run-make/rustdoc-scrape-examples-macros` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `````@jieyouxu`````
2024-05-23Rollup merge of #125336 - momvart:smir-77-intrinsic, r=celinvalLeón Orell Valerian Liehr-17/+37
Add dedicated definition for intrinsics Closes rust-lang/project-stable-mir#77
2024-05-23Rollup merge of #125227 - Oneirical:seventh, r=jieyouxuLeón Orell Valerian Liehr-36/+38
Migrate `run-make/issue-30063` 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). (Sorry about the [inconvenience](https://github.com/rust-lang/rust/pull/125224#issuecomment-2118340932) of all these PRs, this is the last one batched for today. I will discuss how we can cut these down a bit.) The last check was previously commented out in the Makefile, and I have readded it. If it fails the CI, this can be reconsidered.
2024-05-23Rollup merge of #125224 - Oneirical:sixth, r=jieyouxuLeón Orell Valerian Liehr-5/+12
Migrate `run-make/issue-53964` 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). This is extremely similar to #125146. Could it be interesting to merge the two in some way? This one seems to do the same thing as the #125146, but with an added check that a useless lint is not shown.
2024-05-23Rollup merge of #122382 - mu001999:dead_code/enhance, r=petrochenkovLeón Orell Valerian Liehr-1/+51
Detect unused structs which implement private traits Fixes #122361
2024-05-23Support constraining opaque types while trait upcasting with bindersOli Scherer-10/+2
2024-05-23Allow defining opaque types during trait object upcasting.Oli Scherer-19/+2
No stable code is affected, as this requires the `trait_upcasting` feature gate.
2024-05-23When checking whether an impl applies, constrain hidden types of opaque types.Oli Scherer-115/+126
We already handle this case this way on the coherence side, and it matches the new solver's behaviour. While there is some breakage around type-alias-impl-trait (see new "type annotations needed" in tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs), no stable code breaks, and no new stable code is accepted.
2024-05-23Add more testsOli Scherer-6/+262
2024-05-23Add conversion from IntrinsicDef to FnDefMohammad Omidvar-6/+10
2024-05-23Auto merge of #116123 - joboet:rewrite_native_tls, r=m-ou-sebors-81/+0
Rewrite native thread-local storage (part of #110897) The current native thread-local storage implementation has become quite messy, uses indescriptive names and unnecessarily adds code to the macro expansion. This PR tries to fix that by using a new implementation that also allows more layout optimizations and potentially increases performance by eliminating unnecessary TLS accesses. This does not change the recursive initialization behaviour I described in [this comment](https://github.com/rust-lang/rust/issues/110897#issuecomment-1525705682), so it should be a library-only change. Changing that behaviour should be quite easy now, however. r? `@m-ou-se` `@rustbot` label +T-libs
2024-05-23Rollup merge of #125421 - Oneirical:bundle-them-yet-again, r=jieyouxuMatthias Krüger-26/+69
Rewrite `core-no-oom-handling`, `issue-24445` and `issue-38237` `run-make` tests to new `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). The test which is now called `non-pie-thread-local` has an unexplained "only-linux" flag. Could it be worth trying to remove it and changing the CI to test non-Linux platforms on it?
2024-05-23Rollup merge of #125416 - compiler-errors:param-env-missing-copy, r=lcnrMatthias Krüger-0/+21
Use correct param-env in `MissingCopyImplementations` We shouldn't assume the param-env is empty for this lint, since although we check the struct has no parameters, there still may be trivial where-clauses. fixes #125394
2024-05-23Rollup merge of #125210 - fmease:fix-up-some-diags, r=davidtwcoMatthias Krüger-20/+25
Cleanup: Fix up some diagnostics Several diagnostics contained their error code inside their primary message which is no bueno. This PR moves them out of the message and turns them into structured error codes. Also fixes another occurrence of `->` after a selector in a Fluent message which is not correct. I've fixed two other instances of this issue in #104345 (2022) but didn't update all instances as I've noted here: https://github.com/rust-lang/rust/pull/104345#issuecomment-1312705977 (“the future is now!”).