about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-04-18Auto merge of #124111 - matthiaskrgr:rollup-cmmkryf, r=matthiaskrgrbors-4/+19
Rollup of 5 pull requests Successful merges: - #124041 (Fix copy path button) - #124047 (Match ergonomics 2024: miscellaneous code cleanups) - #124064 (Move confusing comment about otherwise blocks in `lower_match_tree`) - #124090 (llvm: update riscv target feature to match LLVM 19) - #124100 (fix: make `str::from_raw_parts_mut` `mut`) r? `@ghost` `@rustbot` modify labels: rollup
2024-04-18Rollup merge of #124090 - durin42:llvm-19-riscv-feature, r=cuviperMatthias Krüger-3/+3
llvm: update riscv target feature to match LLVM 19 In llvm/llvm-project@9067070d91e9d8cdd8509ffa56a076f08a3d7281 they ended up largely reverting llvm/llvm-project@e81796671890b59c110f8e41adc7ca26f8484d20. This means the change we did in rust-lang/rust@b378059e6b2573c5356423fa31d184a89a3b6029 is now only corrct for LLVM 18...so we have to adjust again. ``@rustbot`` label: +llvm-main
2024-04-18Rollup merge of #124047 - Jules-Bertholet:match-ergonomics-cleanups, r=NadrierilMatthias Krüger-1/+1
Match ergonomics 2024: miscellaneous code cleanups - Store `ByRef` instead of `BindingAnnotation` in `PatInfo` - Rename `BindingAnnotation` to `BindingMode` r? ``@Nadrieril`` cc #123076 ``@rustbot`` label A-patterns
2024-04-18Rollup merge of #124041 - GuillaumeGomez:fix-copy-path-button, r=notriddleMatthias Krüger-0/+15
Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in https://github.com/rust-lang/rust/pull/123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? ``@notriddle``
2024-04-18Auto merge of #124046 - matthiaskrgr:one_or_two_more_tests____some_on_top, ↵bors-0/+723
r=jieyouxu crashes: add even more tests?!? adds more tests that were not already added with https://github.com/rust-lang/rust/pull/124038 from the past 10 months or so. Need a couple more passes through the tracker to filter out more missing ice /fixed tests but we're slowly getting there.
2024-04-18crashes: add even more tests?!?Matthias Krüger-0/+723
2024-04-18Auto merge of #122684 - oli-obk:delay_interning_errors_to_after_validaiton, ↵bors-477/+276
r=RalfJung Delay interning errors to after validation fixes https://github.com/rust-lang/rust/issues/122398 fixes #122548 This improves diagnostics since validation errors are usually more helpful compared with interning errors that just make broad statements about the entire constant r? `@RalfJung`
2024-04-17llvm: update riscv target feature to match LLVM 19Augie Fackler-3/+3
In llvm/llvm-project@9067070d91e9d8cdd8509ffa56a076f08a3d7281 they ended up largely reverting llvm/llvm-project@e81796671890b59c110f8e41adc7ca26f8484d20. This means the change we did in rust-lang/rust@b378059e6b2573c5356423fa31d184a89a3b6029 is now only corrct for LLVM 18...so we have to adjust again. @rustbot label: +llvm-main
2024-04-17Auto merge of #123936 - Mark-Simulacrum:zst-no-alloc, r=oli-obkbors-9/+14
Codegen ZSTs without an allocation This makes sure that &[] is equivalent to unsafe code (from_raw_parts(dangling, 0)). No new stable guarantee is intended about whether or not we do this, this is just an optimization. This regressed in #67000 (no comments I can see about that regression in the PR, though it did change the test modified here). We had previously performed this optimization since #63635.
2024-04-17Auto merge of #124084 - matthiaskrgr:rollup-h42psbx, r=matthiaskrgrbors-54/+104
Rollup of 9 pull requests Successful merges: - #116957 (meta: notify #t-rustdoc Zulip stream on backport nominations) - #122201 (Document overrides of `clone_from()` in core/std) - #122723 (Use same file permissions for ar_archive_writer as the LLVM archive writer) - #124030 (interpret: pass MemoryKind to adjust_alloc_base_pointer) - #124037 (Don't ascend into parent bodies when collecting stmts for possible return suggestion) - #124049 (Stabilize `const_io_structs`) - #124062 (Add another expression to weird-exprs.rs) - #124066 (Don't error on subtyping of equal types) - #124073 (Remove libc from rust_get_test_int uses) r? `@ghost` `@rustbot` modify labels: rollup
2024-04-17Rollup merge of #124073 - saethlin:rust-get-test-int, r=wesleywiserMatthias Krüger-54/+18
Remove libc from rust_get_test_int uses `rust_test_helpers.c` has a few unfortunate signatures which have made some of our UI tests _technically_ need the `libc` crate. This is my attempt to evict the need of `libc` for `rust_get_test_int`. I've deleted `tests/ui/abi/foreign/foreign-no-abi.rs` because the test was originally written to check that `native mod` will compile without an ABI specifier. `native mod` was removed years before 1.0 and the test hasn't checked for anything for a long time.
2024-04-17Rollup merge of #124062 - allgoewer:fish-fight, r=oli-obkMatthias Krüger-0/+15
Add another expression to weird-exprs.rs I'm almost feeling bad for this but I decided I don't. Feel free to close if you don't approve.
2024-04-17Rollup merge of #124037 - compiler-errors:dont-parent-body, r=michaelwoeristerMatthias Krüger-0/+39
Don't ascend into parent bodies when collecting stmts for possible return suggestion Fixes #124022
2024-04-17Rollup merge of #122723 - bjorn3:archive_writer_fixes, r=nnethercoteMatthias Krüger-0/+32
Use same file permissions for ar_archive_writer as the LLVM archive writer This is required to switch to ar_archive_writer in the future without regressions. In addition to this PR support for reading thin archives needs to be added (https://github.com/rust-lang/rust/issues/107407) to fix all known regressions. Fixes https://github.com/rust-lang/rust/issues/107495
2024-04-17Add GUI test for copy path buttonGuillaume Gomez-0/+15
2024-04-17Auto merge of #123674 - oli-obk:bogus_note, r=estebankbors-107/+47
Silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls fixes #123292 Also removes a bunch of extra diagnostics that were introduced in https://github.com/rust-lang/rust/pull/121154 and https://github.com/rust-lang/rust/pull/120558
2024-04-17Rename `BindingAnnotation` to `BindingMode`Jules Bertholet-1/+1
2024-04-17Remove libc from rust_get_test_int usesBen Kimock-54/+18
2024-04-17Use the default file permissions when writingbjorn3-1/+10
static libraries with ar_archive_writer Fixes #107495
2024-04-17Add regression test for #107495bjorn3-0/+23
2024-04-17Validate before reporting interning errors.Oli Scherer-490/+201
validation produces much higher quality errors and already handles most of the cases
2024-04-17Validate nested static itemsOli Scherer-78/+166
2024-04-17Rollup merge of #123997 - compiler-errors:self-res, r=fmeaseMatthias Krüger-0/+47
Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}` Catch the case where `kw::Self` is recovered in the parser and causes us to subsequently resolve `&self`'s implicit type to something that's not a type. This check could be made more accurate, though I'm not sure how hard we have to try here. Fixes #123988
2024-04-16Fix broken testMark Rousskov-1/+1
Testing for ASLR by casting &ZST to *const _ is not useful, there's no guarantee that &ZST produces an ASLR'd pointer.
2024-04-16Codegen ZSTs without an allocationMark Rousskov-8/+13
This makes sure that &[] is just as efficient as indirecting through unsafe code (from_raw_parts). No new stable guarantee is intended about whether or not we do this, this is just an optimization. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-04-17Rollup merge of #124000 - compiler-errors:sugg-tweaks, r=wesleywiserGuillaume Gomez-30/+30
Use `/* value */` as a placeholder The expression `value` isn't a valid suggestion; let's use `/* value */` as a placeholder (which is also invalid) since it more clearly signals to the user that they need to fill it in with something meaningful. This parallels the suggestions we have in a couple other places, like arguments. We could also print the type name instead of `/* value */`, especially if it's suggestable, but I don't care strongly about that.
2024-04-17Rollup merge of #123975 - lqd:rust-lld-tests, r=jieyouxuGuillaume Gomez-19/+115
Port the 2 `rust-lld` run-make tests to `rmake` In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`: - `tests/run-make/rust-lld` - `tests/run-make/rust-lld-custom-target` As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library. Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`. r? `@jieyouxu`
2024-04-17Rollup merge of #123675 - oli-obk:static_wf_ice, r=compiler-errorsGuillaume Gomez-17/+58
Taint const qualifs if a static is referenced that didn't pass wfcheck It is correct to only check the signature here, as the ICE is caused by `USE_WITH_ERROR` trying to allocate memory to store the result of `WITH_ERROR` before evaluating it. fixes #123153
2024-04-17Rollup merge of #123673 - oli-obk:sig_wfcheck_ice, r=jieyouxu,estebankGuillaume Gomez-0/+63
Don't ICE for kind mismatches during error rendering fixes #123457 also some test suite cleanups to make backtraces easier to read
2024-04-16Add another expression to weird-exprs.rsMaik Allgöwer-0/+15
2024-04-16Don't proceed into parent bodies when collecting stmts for possible return ↵Michael Goulet-0/+39
suggestion
2024-04-16Rollup merge of #124023 - pacak:less-splody, r=jieyouxuGuillaume Gomez-0/+29
Allow workproducts without object files. This pull request partially reverts changes from e16c3b4a4421 Original motivation for this assert was described with "A WorkProduct without a saved file is useless" which was true at the time but now it is possible to have work products with other types of files (llvm-ir, asm, etc) and there are bugreports for this failure: For example: https://github.com/rust-lang/rust/issues/123695 Fixes https://github.com/rust-lang/rust/issues/123234 Now existing `assert` and `.unwrap_or_else` are unified into a single check that emits slightly more user friendly error message if an object files was meant to be produced but it's missing
2024-04-16Rollup merge of #123512 - Jules-Bertholet:ref-pat-eat-one-layer-2024, ↵Guillaume Gomez-0/+547
r=Nadrieril Match ergonomics 2024: Implement eat-one-layer r? `@Nadrieril` cc #123076 `@rustbot` label A-edition-2024 A-patterns
2024-04-16Rollup merge of #123535 - Jules-Bertholet:mut_dont_reset_binding_mode_2024, ↵Matthias Krüger-0/+154
r=Nadrieril Match ergonomics 2024: `mut` doesn't reset binding mode r? ``@Nadrieril`` cc https://github.com/rust-lang/rust/issues/123076 ``@rustbot`` label A-edition-2024 A-patterns
2024-04-16Rollup merge of #123501 - Urgau:stabilize-check-cfg, r=petrochenkovMatthias Krüger-195/+163
Stabilize checking of cfgs at compile-time: `--check-cfg` option This PR stabilize the `--check-cfg` CLI option of `rustc` (and `rustdoc`) :tada:. In particular this PR does two things: 1. it makes the `--check-cfg` option stable 2. and it moves the documentation to the stable books FCP: https://github.com/rust-lang/rust/issues/82450#issuecomment-1965328542 Resolves #82450 ``@rustbot`` labels +S-blocked +F-check-cfg r? ``@petrochenkov``
2024-04-16Allow workproducts without object files.Michael Baikov-0/+29
This pull request partially reverts changes from e16c3b4a4421 Original motivation for this assert was described with "A WorkProduct without a saved file is useless" which was true at the time but now it is possible to have work products with other types of files (llvm-ir, asm, etc) and there are bugreports for this failure: For example: https://github.com/rust-lang/rust/issues/123695 Fixes https://github.com/rust-lang/rust/issues/123234 Now existing `assert` and `.unwrap_or_else` are unified into a single check that emits slightly more user friendly error message if an object files was meant to be produced but it's missing
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-16Don't ICE for kind mismatches during error renderingOli Scherer-0/+63
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-16Taint const qualifs if a static is referenced that didn't pass wfcheckOli Scherer-17/+58
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-15Ensure inherited reference is never set to `&mut` behind an `&`Jules Bertholet-23/+59
2024-04-15Support `let &mut x = &&mut 0;`Jules Bertholet-3/+44
2024-04-15Properly downgrade inherited mutabilityJules Bertholet-2/+72
2024-04-15Match ergonomics 2024: Implement eat-one-layerJules Bertholet-0/+400
2024-04-15Fix testsJules Bertholet-4/+5