about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-04-16Auto merge of #124015 - GuillaumeGomez:rollup-s46ksxa, r=GuillaumeGomezbors-71/+131
Rollup of 14 pull requests Successful merges: - #120781 (Correct usage note on OpenOptions::append()) - #121694 (sess: stabilize `-Zrelro-level` as `-Crelro-level`) - #122521 (doc(bootstrap): add top-level doc-comment to utils/tarball.rs) - #123491 (Fix ICE in `eval_body_using_ecx`) - #123574 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 6)) - #123687 (Update ar_archive_writer to 0.2.0) - #123721 (Various visionOS fixes) - #123797 (Better graphviz output for SCCs and NLL constraints) - #123990 (Make `suggest_deref_closure_return` more idiomatic/easier to understand) - #123995 (Make `thir_tree` and `thir_flat` into hooks) - #123998 (Opaque types have no namespace) - #124001 (Fix docs for unstable_features lint.) - #124006 (Move size assertions for `mir::syntax` types into the same file) - #124011 (rustdoc: update the module-level docs of `rustdoc::clean`) r? `@ghost` `@rustbot` modify labels: rollup
2024-04-16Rollup merge of #123574 - notriddle:notriddle/issue-d, r=fmeaseGuillaume Gomez-33/+69
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 6) Follow up * https://github.com/rust-lang/rust/pull/116214 * https://github.com/rust-lang/rust/pull/116432 * https://github.com/rust-lang/rust/pull/116824 * https://github.com/rust-lang/rust/pull/118105 * https://github.com/rust-lang/rust/pull/119561
2024-04-16Rollup merge of #123491 - gurry:123154-ice-unsized-struct-eval, r=oli-obkGuillaume Gomez-34/+58
Fix ICE in `eval_body_using_ecx` Ensures `TypeckResults` is tainted by failing candidate assembly for types with error Fixes #123154
2024-04-16Rollup merge of #121694 - davidtwco:stabilize-relro-level, r=Mark-SimulacrumGuillaume Gomez-4/+4
sess: stabilize `-Zrelro-level` as `-Crelro-level` Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
2024-04-16Auto merge of #123468 - compiler-errors:precise-capturing, r=oli-obkbors-0/+427
Implement syntax for `impl Trait` to specify its captures explicitly (`feature(precise_capturing)`) Implements `impl use<'a, 'b, T, U> Sized` syntax that allows users to explicitly list the captured parameters for an opaque, rather than inferring it from the opaque's bounds (or capturing *all* lifetimes under 2024-edition capture rules). This allows us to exclude some implicit captures, so this syntax may be used as a migration strategy for changes due to #117587. We represent this list of captured params as `PreciseCapturingArg` in AST and HIR, resolving them between `rustc_resolve` and `resolve_bound_vars`. Later on, we validate that the opaques only capture the parameters in this list. We artificially limit the feature to *require* mentioning all type and const parameters, since we don't currently have support for non-lifetime bivariant generics. This can be relaxed in the future. We also may need to limit this to require naming *all* lifetime parameters for RPITIT, since GATs have no variance. I have to investigate this. This can also be relaxed in the future. r? `@oli-obk` Tracking issue: - https://github.com/rust-lang/rust/issues/123432
2024-04-16Auto merge of #123963 - lqd:gdb15-failures, r=Kobzolbors-0/+4
Disable two debuginfo tests failing under the future GDB 15 release As seen in #123960, it seems two of our debuginfo tests started failing on gdb 15, which is also already in use in the `x86_64-gnu-llvm-18` builder: CI will randomly start to fail whenever this cached docker image expires. This PR disables the following two tests under gdb 15+, to prevent future CI failures. - `tests/debuginfo/include_string.rs` - `tests/debuginfo/vec-slices.rs` This seems very much related to https://sourceware.org/bugzilla/show_bug.cgi?id=30330 and https://sourceware.org/bugzilla/show_bug.cgi?id=31517 -- and I just now saw #122751 as well, where one of these bugzilla issues and one of the two test failures here was previously mentioned. I don't know whether these are unexpected gdb changes, or if we need to change our tests as it seems some of the gdb changes are definitely intentional, so I'll just cc `@rust-lang/wg-debugging` and `@tromey.` (In the same area, `tests/debuginfo/unsized.rs` was previously disabled due to https://sourceware.org/bugzilla/show_bug.cgi?id=30330. This issue has been fixed but I don't believe our test passes, so it's in the same boat as the 2 above regarding whether this test is expected to work or needs changes as well) r? wg-debugging I've confirmed this is enough to have CI pass on gdb 15 with the llvm 18 builder.
2024-04-16Fail candidate assembly for erroneous typesGurinder Singh-34/+58
Trait predicates for types which have errors may still evaluate to OK leading to downstream ICEs. Now we return a selection error for such types in candidate assembly and thereby prevent such issues
2024-04-16Rollup merge of #123973 - matthiaskrgr:crashs_fix_cmt, r=fmeaseLeón Orell Valerian Liehr-0/+7
crashes: readme: add reminder to add Fixes #abcde to prs to automatically close issues.
2024-04-16Rollup merge of #123926 - compiler-errors:no-ann, r=estebankLeón Orell Valerian Liehr-3/+22
Fix pretty HIR for anon consts in diagnostics This removes the `NoAnn` printer which skips over nested bodies altogether, which is confusing, and requires users of `{ty|qpath|pat}_to_string` to pass in `&tcx` which now impleemnts `hir_pretty::PpAnn`. There's one case where this "regresses" by actually printing out the body of the anon const -- we could suppress that, but I don't expect people to actually get anon consts like that unless they're fuzzing, tbh. r? estebank
2024-04-16Rollup merge of #123603 - compiler-errors:no-intrinsic, r=estebankLeón Orell Valerian Liehr-67/+56
Don't even parse an intrinsic unless the feature gate is enabled Don't return true in `tcx.is_intrinsic` if the function is defined locally and `#![feature(intrinsics)]` is not enabled. This is a slightly more general fix than #123526, since #123587 shows that we have simplifying assumptions about intrinsics elsewhere in the compiler. This will make the code ICE again if the user **enables** `#[feature(intrinsics)]`, but I kind of feel like if we want to fix that, we should make the `INTERNAL_FEATURES` lint `Deny` again. Perhaps we could do that on non-nightly compilers. Or we should just stop compilation altogether if they have `#![feature]` enabled on a non-nightly compiler. As for the UX of *real* cases of hitting these ICEs, I believe pretty strongly that if a compiler/stdlib dev is modifying internal intrinsics (intentionally, like when making a change to rustc) we have no guarantee to make the ICE better looking for them. Honestly, *not* spitting out a stack trace is probably a disservice to the people who hit those ICEs in that case. r? `@Nilstrieb` `@estebank`
2024-04-15Add testMichael Goulet-0/+17
2024-04-15Fix pretty hir for anon consts in diagnosticsMichael Goulet-3/+5
2024-04-15rustdoc: move tests into applicable subdirectoriesMichael Howell-0/+0
2024-04-15rustdoc: rename `issue-\d+.rs` tests to have meaningful namesMichael Howell-0/+0
2024-04-15Move ice tests to rustdoc-uiMichael Howell-1/+3
2024-04-15Add URL and crate_name to test casesMichael Howell-16/+50
2024-04-15More polishingMichael Goulet-1/+53
2024-04-15Use a path instead of an ident (and stop manually resolving)Michael Goulet-14/+24
2024-04-15Some ordering and duplication checksMichael Goulet-0/+70
2024-04-15Add hir::Node::PreciseCapturingNonLifetimeArgMichael Goulet-31/+68
2024-04-15Validation and other thingsMichael Goulet-1/+203
2024-04-15Begin AST lowering for precise capturesMichael Goulet-0/+56
2024-04-15crashes: readme: add reminder to add Fixes #abcde to prs to automatically ↵Matthias Krüger-0/+7
close issues.
2024-04-15Rollup merge of #123943 - saethlin:less-sysroot-libc, r=workingjubileeMichael Goulet-125/+88
Use the rustc_private libc less in tests I started looking into our use of `rustc_private` + `extern crate libc;` in tests because of https://github.com/rust-lang/rust/pull/123938 and it looks like some fraction of the users of libc simply don't need the libc crate anymore.
2024-04-15Rollup merge of #123924 - compiler-errors:tuple-sugg, r=estebankMichael Goulet-0/+58
Fix various bugs in `ty_kind_suggestion` Consolidates two implementations of `ty_kind_suggestion` Fixes some misuse of the empty param-env Fixes a problem where we suggested `(42)` instead of `(42,)` for tuple suggestions Suggest a value when `return;`, making it consistent with `break;` Fixes #123906
2024-04-15Rollup merge of #123931 - compiler-errors:variance-unnameables, r=fmease许杰友 Jieyou Xu (Joe)-0/+25
Don't leak unnameable types in `-> _` recover Fixes #123899
2024-04-15Rollup merge of #123919 - RalfJung:discriminant, r=compiler-errors许杰友 Jieyou Xu (Joe)-47/+47
builtin-derive: tag → discriminant As far as I can tell, all of this operates on the discriminant, not the tag. After all, with something like `Option<&T>`, the "tag" of the `Some` variant is basically just the reference value, which is never what you want to compare when figuring out which variant the enum is in. See [here](https://rustc-dev-guide.rust-lang.org/appendix/glossary.html) for an explanation of the difference between tag and discriminant.
2024-04-15Use the rustc_private libc less in testsBen Kimock-125/+88
2024-04-15disable two debuginfo tests under gdb 15Rémy Rakic-0/+4
it seems gdb 15 regresses some of our debuginfo tests. disable them temporarily so that CI doesn't randomly start failing soon.
2024-04-15Auto merge of #115717 - jsgf:stablize-json-unused-externs, r=oli-obkbors-3/+3
Stabilize --json unused-externs(-silent) Implement https://github.com/rust-lang/compiler-team/issues/674 ~~(pending its approval)~~
2024-04-15Auto merge of #122917 - saethlin:atomicptr-to-int, r=nikicbors-0/+38
Add the missing inttoptr when we ptrtoint in ptr atomics Ralf noticed this here: https://github.com/rust-lang/rust/pull/122220#discussion_r1535172094 Our previous codegen forgot to add the cast back to integer type. The code compiles anyway, because of course all locals are in-memory to start with, so previous codegen would do the integer atomic, store the integer to a local, then load a pointer from that local. Which is definitely _not_ what we wanted: That's an integer-to-pointer transmute, so all pointers returned by these `AtomicPtr` methods didn't have provenance. Yikes. Here's the IR for `AtomicPtr::fetch_byte_add` on 1.76: https://godbolt.org/z/8qTEjeraY ```llvm define noundef ptr `@atomicptr_fetch_byte_add(ptr` noundef nonnull align 8 %a, i64 noundef %v) unnamed_addr #0 !dbg !7 { start: %0 = alloca ptr, align 8, !dbg !12 %val = inttoptr i64 %v to ptr, !dbg !12 call void `@llvm.lifetime.start.p0(i64` 8, ptr %0), !dbg !28 %1 = ptrtoint ptr %val to i64, !dbg !28 %2 = atomicrmw add ptr %a, i64 %1 monotonic, align 8, !dbg !28 store i64 %2, ptr %0, align 8, !dbg !28 %self = load ptr, ptr %0, align 8, !dbg !28 call void `@llvm.lifetime.end.p0(i64` 8, ptr %0), !dbg !28 ret ptr %self, !dbg !33 } ``` r? `@RalfJung` cc `@nikic`
2024-04-15Auto merge of #122997 - matthiaskrgr:compiletest_ices, r=oli-obkbors-0/+3284
compiletest ice tracking see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/where.20to.20mass-add.20known.20ices.20.2F.20merging.20glacier.20into.20rust/near/429082963 This will allow us to sunset most of https://github.com/rust-lang/glacier The rustc ices will be tracked directly inside the rust testsuite There are a couple of .sh tests remaining that I have not ported over yet. This adds `tests/crashes`, a file inside this directory MUST ice, otherwise it is considered test-fail. This will be used to track ICEs from glacier and the bugtracker. When someones pr accidentally fixes one of these ICEs, they can move the test from `crashes` into `ui` for example. I also added a new tidy lint that warns when a test inside `tests/crashes` does not have a `//@ known-bug: ` line the env var `COMPILETEST_VERBOSE_CRASHES` can be set to get exit code, stderr and stdout of a crash-test to aid debugging/adding tests.
2024-04-14crashes: limit a couple tests to only run on x86_64 and/or not on windowsMatthias Krüger-10/+6
2024-04-14Rollup merge of #123905 - notriddle:notriddle/redundant-explicit-link-hunks, ↵Guillaume Gomez-0/+14
r=GuillaumeGomez rustdoc: check redundant explicit links with correct itemid Fixes #123677 (a regression caused by #120702)
2024-04-14Rollup merge of #123618 - compiler-errors:overflow-ambig, r=spastorinoGuillaume Gomez-0/+37
Discard overflow obligations in `impl_may_apply` Hacky fix for #123493. Throws away obligations that are overflowing in `impl_may_apply` when we recompute if an impl applies, since those will lead to fatal overflow if processed during fulfillment. Something about #114811 (I think it's the predicate reordering) caused us to evaluate predicates differently in error reporting leading to fatal overflow, though I believe the underlying overflow is possible to hit since this code was rewritten to use fulfillment. Fixes #123493
2024-04-14Stabilize --json unused-externs(-silent)Jeremy Fitzhardinge-3/+3
Implement https://github.com/rust-lang/compiler-team/issues/674
2024-04-14Don't leak unnameable types in -> _ recoverMichael Goulet-0/+25
2024-04-14Fix 1-tuple value suggestionMichael Goulet-2/+2
2024-04-14Suggest value on bare returnMichael Goulet-0/+32
2024-04-14Fix value suggestion for array in generic contextMichael Goulet-0/+26
2024-04-14builtin-derive: tag → discriminantRalf Jung-47/+47
2024-04-14update README and add COMPILETEST_VERBOSE_CRASHES env var which when set ↵Matthias Krüger-1/+4
print stdout, stderr and exit code of "crashes" tests, useful for debugging or adding new tests
2024-04-14crashes: fix ice detection which did not trigger if code compiled without ↵Matthias Krüger-1/+14
error by accident
2024-04-14tests/crashes: add ICEs from matthiaskrgr/glacier2Matthias Krüger-39/+2620
2024-04-14add .rs crashes from https://github.com/rust-lang/glacierMatthias Krüger-1/+664
2024-04-14tidy: add tidy check agains \.rs files inside tests/crashes that are missing ↵Matthias Krüger-4/+0
"//@ known-bug: "
2024-04-14crashes: add another test showing that everything works fine when we need ↵Matthias Krüger-1/+28
compile-flags to repro an ice and add README
2024-04-14bootstrap/compiletest: implement "crashes" tests that fail if no ice is ↵Matthias Krüger-0/+1
reproduced
2024-04-14add initial ice as testMatthias Krüger-0/+4
2024-04-14Rollup merge of #123898 - fmease:gci-cmp-impl-item-lt-params, r=compiler-errorsMatthias Krüger-17/+29
Generic associated consts: Check regions earlier when comparing impl with trait item def Fixes #123836. r? compiler-errors or compiler