about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-07-09Auto merge of #127378 - Oneirical:cetestial-meteorite, r=jieyouxubors-45/+56
Migrate `issue-37839`, `track-path-dep-info` and `track-pgo-dep-info` `run-make` tests 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: try-job: test-various try-job: dist-x86_64-musl
2024-07-08Auto merge of #127328 - Oneirical:yield-to-petestrians, r=jieyouxubors-28/+155
Migrate `pass-linker-flags-flavor`, `pass-linker-flags-from-dep` and `pass-linker-flags` `run-make` tests 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 test on i686-msvc. Expected to fail. try-job: aarch64-apple
2024-07-08Rollup merge of #127482 - compiler-errors:closure-two-par-sig-inference, ↵Guillaume Gomez-0/+27
r=oli-obk Infer async closure signature from (old-style) two-part `Fn` + `Future` bounds When an async closure is passed to a function that has a "two-part" `Fn` and `Future` trait bound, like: ```rust use std::future::Future; fn not_exactly_an_async_closure(_f: F) where F: FnOnce(String) -> Fut, Fut: Future<Output = ()>, {} ``` The we want to be able to extract the signature to guide inference in the async closure, like: ```rust not_exactly_an_async_closure(async |string| { for x in string.split('\n') { ... } //~^ We need to know that the type of `string` is `String` to call methods on it. }) ``` Closure signature inference will see two bounds: `<?F as FnOnce<Args>>::Output = ?Fut`, `<?Fut as Future>::Output = String`. We need to extract the signature by looking through both projections. ### Why? I expect the ecosystem's move onto `async Fn` trait bounds (which are not affected by this PR, and already do signature inference fine) to be slow. In the mean time, I don't see major overhead to supporting this "old–style" of trait bounds that were used to model async closures. r? oli-obk Fixes #127468 Fixes #127425
2024-07-08Rollup merge of #127325 - Oneirical:gothic-testhetic, r=jieyouxuGuillaume Gomez-37/+101
Migrate `target-cpu-native`, `target-specs` and `target-without-atomic-cas` `run-make` tests 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 test on i686-msvc. try-job: i686-msvc
2024-07-08Rollup merge of #127237 - GuillaumeGomez:improve-run-make-llvm-ident, r=KobzolGuillaume Gomez-14/+8
Improve code of `run-make/llvm-ident` Follow-up of https://github.com/rust-lang/rust/pull/126941. r? `@Kobzol`
2024-07-08Rollup merge of #126427 - Oneirical:oktobertest, r=jieyouxuGuillaume Gomez-48/+75
Rewrite `intrinsic-unreachable`, `sepcomp-cci-copies`, `sepcomp-inlining` and `sepcomp-separate` `run-make` tests to rmake.rs Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-07-08Improve code of `run-make/llvm-ident`Guillaume Gomez-14/+8
2024-07-08Infer async closure signature from old-style two-part Fn + Future boundsMichael Goulet-0/+27
2024-07-08Auto merge of #127486 - matthiaskrgr:rollup-lvv018b, r=matthiaskrgrbors-93/+557
Rollup of 5 pull requests Successful merges: - #120248 (Make casts of pointers to trait objects stricter) - #127355 (Mark format! with must_use hint) - #127399 (Verify that allocations output by GVN are sufficiently aligned.) - #127460 (clarify `sys::unix::fd::FileDesc::drop` comment) - #127467 (bootstrap: once_cell::sync::Lazy -> std::sync::LazyLock) Failed merges: - #127357 (Remove `StructuredDiag`) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-08rewrite track-pgo-dep-info to rmakeOneirical-31/+25
2024-07-08Rollup merge of #127399 - cjgillot:issue-127396, r=oli-obkMatthias Krüger-0/+8
Verify that allocations output by GVN are sufficiently aligned. Fixes #127396 r? `@oli-obk`
2024-07-08Rollup merge of #127355 - aceArt-GmbH:126475, r=oli-obkMatthias Krüger-61/+62
Mark format! with must_use hint Uses unstable feature https://github.com/rust-lang/rust/issues/94745 Part of #126475 First contribution to rust, please let me know if the blessing of tests is correct Thanks `@bjorn3` for the help
2024-07-08Rollup merge of #120248 - WaffleLapkin:bonk-ptr-object-casts, ↵Matthias Krüger-32/+487
r=compiler-errors,oli-obk,lnicola Make casts of pointers to trait objects stricter This is an attempt to `fix` https://github.com/rust-lang/rust/issues/120222 and https://github.com/rust-lang/rust/issues/120217. This is done by adding restrictions on casting pointers to trait objects. Before this PR the rules were as follows: > When casting `*const X<dyn A>` -> `*const Y<dyn B>`, principal traits in `A` and `B` must refer to the same trait definition (or no trait). With this PR the rules are changed to > When casting `*const X<dyn Src>` -> `*const Y<dyn Dst>` > - if `Dst` has a principal trait `DstP`, > - `Src` must have a principal trait `SrcP` > - `dyn SrcP` and `dyn DstP` must be the same type (modulo the trait object lifetime, `dyn T+'a` -> `dyn T+'b` is allowed) > - Auto traits in `Dst` must be a subset of auto traits in `Src` > - Not adhering to this is currently a FCW (warn-by-default + `FutureReleaseErrorReportInDeps`), instead of an error > - if `Src` has a principal trait `Dst` must as well > - this restriction will be removed in a follow up PR This ensures that 1. Principal trait's generic arguments match (no `*const dyn Tr<A>` -> `*const dyn Tr<B>` casts, which are a problem for [#120222](https://github.com/rust-lang/rust/issues/120222)) 2. Principal trait's lifetime arguments match (no `*const dyn Tr<'a>` -> `*const dyn Tr<'b>` casts, which are a problem for [#120217](https://github.com/rust-lang/rust/issues/120217)) 3. No auto traits can be _added_ (this is a problem for arbitrary self types, see [this comment](https://github.com/rust-lang/rust/pull/120248#discussion_r1463835350)) Some notes: - We only care about the metadata/last field, so you can still cast `*const dyn T` to `*const WithHeader<dyn T>`, etc - The lifetime of the trait object itself (`dyn A + 'lt`) is not checked, so you can still cast `*mut FnOnce() + '_` to `*mut FnOnce() + 'static`, etc - This feels fishy, but I couldn't come up with a reason it must be checked The diagnostics are currently not great, to say the least, but as far as I can tell this correctly fixes the issues. cc `@oli-obk` `@compiler-errors` `@lcnr`
2024-07-08rewrite target-without-atomic-cas to rmakeOneirical-9/+18
2024-07-08rewrite sepcomp-inlining and -separate to rmake.rsOneirical-46/+48
2024-07-08rewrite sepcomp-separate to rmakeOneirical-14/+32
2024-07-08rewrite intrinsic-unreachable to rmakeOneirical-12/+19
2024-07-08coverage: Extract hole spans from HIR instead of MIRZalathar-140/+113
This makes it possible to treat more kinds of nested item/code as holes, instead of being restricted to closures.
2024-07-08coverage: Test for handling of nested item spansZalathar-0/+179
2024-07-08Auto merge of #127476 - jieyouxu:rollup-16wyb0b, r=jieyouxubors-92/+508
Rollup of 10 pull requests Successful merges: - #126841 ([`macro_metavar_expr_concat`] Add support for literals) - #126881 (Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024) - #126921 (Give VaList its own home) - #127367 (Run alloc sync tests) - #127431 (Use field ident spans directly instead of the full field span in diagnostics on local fields) - #127437 (Uplift trait ref is knowable into `rustc_next_trait_solver`) - #127439 (Uplift elaboration into `rustc_type_ir`) - #127451 (Improve `run-make/output-type-permutations` code and improve `filename_not_in_denylist` API) - #127452 (Fix intrinsic const parameter counting with `effects`) - #127459 (rustdoc-json: add type/trait alias tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-08Rollup merge of #127459 - its-the-shrimp:rustdocjson_add_alias_tests, ↵许杰友 Jieyou Xu (Joe)-0/+33
r=aDotInTheVoid rustdoc-json: add type/trait alias tests Not sure if this tests everything there is to test in them though. Updates #81359
2024-07-08Rollup merge of #127452 - fee1-dead-contrib:fx-intrinsic-counting, r=fmease许杰友 Jieyou Xu (Joe)-25/+114
Fix intrinsic const parameter counting with `effects` r? project-const-traits
2024-07-08Rollup merge of #127451 - GuillaumeGomez:improve-output-type-permutations, ↵许杰友 Jieyou Xu (Joe)-3/+2
r=kobzol Improve `run-make/output-type-permutations` code and improve `filename_not_in_denylist` API r? ``@Kobzol``
2024-07-08Rollup merge of #127431 - oli-obk:feed_item_attrs, r=compiler-errors许杰友 Jieyou Xu (Joe)-8/+8
Use field ident spans directly instead of the full field span in diagnostics on local fields This improves diagnostics and avoids having to store the `DefId`s of fields
2024-07-08Rollup merge of #126881 - ↵许杰友 Jieyou Xu (Joe)-23/+159
WaffleLapkin:unsafe-code-affected-by-fallback-hard-in-2024, r=compiler-errors Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024 I don't actually really care about this, but ``@traviscross`` asked me to do this, because lang team briefly discussed this before. (TC here:) Specifically, our original FCPed plan included this step: - Add a lint against fallback affecting a generic that is passed to an `unsafe` function. - Perhaps make this lint `deny-by-default` or a hard error in Rust 2024. That is, we had left as an open question strengthening this in Rust 2024, and had marked it as an open question on the tracking issue. We're nominating here to address the open question. (Closing the remaining open question helps us to fully mark this off for Rust 2024.) r? ``@compiler-errors`` Tracking: - https://github.com/rust-lang/rust/issues/123748
2024-07-08Rollup merge of #126841 - c410-f3r:concat-again, r=petrochenkov许杰友 Jieyou Xu (Joe)-33/+192
[`macro_metavar_expr_concat`] Add support for literals Adds support for things like `${concat($variable, 123)}` or `${concat("hello", "_world")}` . cc #124225
2024-07-08Auto merge of #113128 - WaffleLapkin:become_trully_unuwuable, r=oli-obk,RalfJungbors-35/+1662
Support tail calls in mir via `TerminatorKind::TailCall` This is one of the interesting bits in tail call implementation — MIR support. This adds a new `TerminatorKind` which represents a tail call: ```rust TailCall { func: Operand<'tcx>, args: Vec<Operand<'tcx>>, fn_span: Span, }, ``` *Structurally* this is very similar to a normal `Call` but is missing a few fields: - `destination` — tail calls don't write to destination, instead they pass caller's destination to the callee (such that eventual `return` will write to the caller of the function that used tail call) - `target` — similarly to `destination` tail calls pass the caller's return address to the callee, so there is nothing to do - `unwind` — I _think_ this is applicable too, although it's a bit confusing - `call_source` — `become` forbids operators and is not created as a lowering of something else; tail calls always come from HIR (at least for now) It might be helpful to read the interpreter implementation to understand what `TailCall` means exactly, although I've tried documenting it too. ----- There are a few `FIXME`-questions still left, ideally we'd be able to answer them during review ':) ----- r? `@oli-obk` cc `@scottmcm` `@DrMeepster` `@JakobDegen`
2024-07-07Auto merge of #127172 - compiler-errors:full-can_eq-everywhere, r=lcnrbors-80/+60
Make `can_eq` process obligations (almost) everywhere Move `can_eq` to an extension trait on `InferCtxt` in `rustc_trait_selection`, and change it so that it processes obligations. This should strengthen it to be more accurate in some cases, but is most important for the new trait solver which delays relating aliases to `AliasRelate` goals. Without this, we always basically just return true when passing aliases to `can_eq`, which can lead to weird errors, for example #127149. I'm not actually certain if we should *have* `can_eq` be called on the good path. In cases where we need `can_eq`, we probably should just be using a regular probe. Fixes #127149 r? lcnr
2024-07-07Allow casting `*mut dyn T`->`*mut (dyn T + Send)` if `T` has `Send` super traitMaybe Lapkin-0/+9
2024-07-07doc fixups from reviewMaybe Waffle-1/+1
2024-07-07Fix unconditional recursion lint wrt tail callsMaybe Waffle-0/+42
2024-07-07Support tail calls in the interpreterMaybe Waffle-0/+210
2024-07-07Properly handle drops for tail callsDrMeepster-0/+1336
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-35/+74
2024-07-07rustdoc-json: add trait/type alias testsschvv31n-0/+33
2024-07-07Rollup merge of #127409 - gurry:127332-ice-with-expr-not-struct, r=oli-obkMatthias Krüger-9/+24
Emit a wrap expr span_bug only if context is not tainted Fixes #127332 The ICE occurs because of this `span_bug`: https://github.com/rust-lang/rust/blob/51917e2e69702e5752bce6a4f3bfd285d0f4ae39/compiler/rustc_hir_typeck/src/expr_use_visitor.rs#L732-L738 which is triggered by the fact that we're trying to use an `enum` in a `with` expression instead of a `struct`. The issue originates in commit https://github.com/rust-lang/rust/pull/127202/commits/814bfe9335fd7c941169e0ef15ae2cffeacc78eb from PR #127202. As per the title of that commit the ICEing code should not be reachable any more, but looks like it still is. This PR changes the code so that the `span_bug` will be emitted only if the context is not tainted by a previous error.
2024-07-07Fix intrinsic const parameter counting with `effects`Deadbeef-25/+114
2024-07-07Improve `run-make/output-type-permutations` code and improve ↵Guillaume Gomez-3/+2
`filename_not_in_denylist` API
2024-07-07Move a span_bug under a condition that cx is taintedGurinder Singh-9/+24
Fixes an ICE caused when a with expression is not a struct
2024-07-07Auto merge of #127404 - compiler-errors:rpitit-entailment-false-positive, ↵bors-24/+224
r=oli-obk Don't try to label `ObligationCauseCode::CompareImplItem` for an RPITIT, since it has no name The old (current) trait solver has a limitation that when a where clause in param-env must be normalized using the same where clause, then we get spurious errors in `normalize_param_env_or_error`. I don't think there's an issue tracking it, but it's the root cause for many of the "fixed-by-next-solver" labeled issues. Specifically, these errors may occur when checking predicate entailment of the GAT that comes out of desugaring RPITITs. Since we use `ObligationCauseCode::CompareImplItem` for these predicates, we try calling `item_name` on an RPITIT which fails, since the RPITIT has no name. We simply suppress this logic when we're reporting a predicate entailment error for an RPITIT. RPITITs should never have predicate entailment errors, *by construction*, but they may due to this bug in the old solver. Addresses the ICE in #127331, though doesn't fix the underlying issue (which is fundamental to the old solver). r? types
2024-07-07Auto merge of #127335 - Oneirical:put-on-a-petestal, r=jieyouxubors-83/+136
Migrate `emit-shared-files` and `emit-path-unhashed` `run-make` tests 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). try-job: x86_64-msvc try-job: aarch64-apple try-job: armhf-gnu try-job: test-various
2024-07-06Auto merge of #126987 - petrochenkov:atvisord2, r=pnkfelixbors-0/+10
out_of_scope_macro_calls: Detect calls inside attributes more precisely Fixes https://github.com/rust-lang/rust/issues/126984.
2024-07-06Add support for literalsCaio-33/+192
2024-07-06Use field ident spans directly instead of the full field span in diagnostics ↵Oli Scherer-8/+8
on local fields
2024-07-06Don't try to label ObligationCauseCode::CompareImplItem for an RPITIT, since ↵Michael Goulet-24/+224
it has no name
2024-07-06Rollup merge of #127417 - chenyukang:yukang-method-output-diff, r=oli-obkMichael Goulet-11/+44
Show fnsig's unit output explicitly when there is output diff in diagnostics Fixes #127263
2024-07-06show fnsig's output when there is differenceyukang-7/+7
2024-07-06Uplift push_outlives_componentsMichael Goulet-12/+12
2024-07-06show unit output when there is only output diff in diagnosticsyukang-4/+37
2024-07-06out_of_scope_macro_calls: Detect calls inside attributes more preciselyVadim Petrochenkov-0/+10