about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-12-01Auto merge of #133499 - nikic:no-backend-verify, r=Mark-Simulacrumbors-10/+2
Respect verify-llvm-ir option in the backend We are currently unconditionally verifying the LLVM IR in the backend (twice), ignoring the value of the verify-llvm-ir option. This has substantial compile-time impact for debug builds.
2024-12-01Auto merge of #133365 - compiler-errors:compare-impl-item, r=lcnrbors-170/+53
Make `compare_impl_item` into a query Turns `compare_impl_item` into a query (generalizing the existing query for `compare_impl_const`), and uses that in `Instance::resolve` to fail resolution when an implementation is incompatible with the trait it comes from. Fixes #119701 Fixes #121127 Fixes #121411 Fixes #129075 Fixes #129127 Fixes #129214 Fixes #131294
2024-11-30Auto merge of #133684 - RalfJung:rollup-j2tmrg7, r=RalfJungbors-1/+45
Rollup of 6 pull requests Successful merges: - #131698 (use stores of the correct size to set discriminants) - #133571 (Mark visionOS as supporting `std`) - #133655 (Eliminate print_expr_maybe_paren function from pretty printers) - #133667 (Remove unused code) - #133670 (bump hashbrown version) - #133673 (replace hard coded error id with `ErrorKind::DirectoryNotEmpty`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-30Rollup merge of #133667 - sunwxg:xiaoguang/remove-unused-code, r=clubby789Ralf Jung-1/+0
Remove unused code
2024-11-30Rollup merge of #131698 - the8472:remove-set-discriminant-hack, r=RalfJungRalf Jung-0/+45
use stores of the correct size to set discriminants Resolves an old HACK /FIXME. Note that I haven't worked much with codegen so I'm not sure if I'm using the functions correctly and I was surprised seeing out-of-range values being fed into `const_uint_big` but apparently they're wrapped implicitly? By making it explicit we can pass in-range values instead.
2024-11-30Auto merge of #133659 - jieyouxu:rollup-576gh4p, r=jieyouxubors-340/+641
Rollup of 6 pull requests Successful merges: - #131551 (Support input/output in vector registers of PowerPC inline assembly) - #132515 (Fix and undeprecate home_dir()) - #132721 (CI: split x86_64-mingw job) - #133106 (changes old intrinsic declaration to new declaration) - #133496 (thread::available_parallelism for wasm32-wasip1-threads) - #133548 (Add `BTreeSet` entry APIs to match `HashSet`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-30Move refinement check out of compare_impl_itemMichael Goulet-0/+26
2024-11-30Make compare_impl_item into a queryMichael Goulet-170/+27
2024-11-30add tests for niches in pointersThe 8472-0/+45
2024-11-30Remove unused codeXiaoguang Wang-1/+0
2024-11-30Rollup merge of #133106 - BLANKatGITHUB:intrinsic, r=RalfJung许杰友 Jieyou Xu (Joe)-1/+1
changes old intrinsic declaration to new declaration This pr is for issue #132735 It changes old `extern "intrinsic"` code block with new declaration. There are other blocks that use old declaration but as the changes needed in single block is quite large I do them in parts
2024-11-30Rollup merge of #131551 - taiki-e:ppc-asm-vreg-inout, r=Amanieu许杰友 Jieyou Xu (Joe)-339/+640
Support input/output in vector registers of PowerPC inline assembly This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types as input/output. | Architecture | Register class | Target feature | Allowed types | | ------------ | -------------- | -------------- | -------------- | | PowerPC | `vreg` | `altivec` | `i8x16`, `i16x8`, `i32x4`, `f32x4` | | PowerPC | `vreg` | `vsx` | `f32`, `f64`, `i64x2`, `f64x2` | In addition to floats and `core::simd` types listed above, `core::arch` types and custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types and relevant target features are currently unstable. r? `@Amanieu` `@rustbot` label +O-PowerPC +A-inline-assembly
2024-11-30Rollup merge of #133625 - RalfJung:custom-mir-debug-info, r=compiler-errors许杰友 Jieyou Xu (Joe)-3/+38
custom MIR: add doc comment for debuginfo This is a revival of https://github.com/rust-lang/rust/pull/117015
2024-11-30Rollup merge of #133620 - ↵许杰友 Jieyou Xu (Joe)-11/+66
dev-ardi:simplify-hir_typeck_pass_to_variadic_function, r=compiler-errors Simplify hir_typeck_pass_to_variadic_function r? ``@compiler-errors`` This reworks a bit how the diagnostic is generated so that it does the same as #133538 The `help` is useless now so I removed it
2024-11-30Rollup merge of #133587 - taiki-e:loongarch-asm-freg, r=Amanieu许杰友 Jieyou Xu (Joe)-0/+145
Fix target_feature handling in freg of LoongArch inline assembly In LoongArch inline assembly, freg currently always accepts f32/f64 as input/output. https://github.com/rust-lang/rust/blob/9b4d7c6a40b328d212095c28670c629facf1557d/compiler/rustc_target/src/asm/loongarch.rs#L41 However, these types actually require f/d target features as in RISC-V. Otherwise, an (ugly) compile error will occur: https://godbolt.org/z/K61Gq1E9E f32/f64 without f: ``` error: couldn't allocate output register for constraint '{$f1}' --> <source>:12:11 | 12 | asm!("", in("$f1") x, lateout("$f1") y); | ^ ``` f64 with f but without d: ``` error: scalar-to-vector conversion failed, possible invalid constraint for vector type --> <source>:19:11 | 19 | asm!("", in("$f1") x, lateout("$f1") y); | ^ ``` cc ``@heiher`` r? ``@Amanieu`` ``@rustbot`` label +O-LoongArch +A-inline-assembly
2024-11-30Rollup merge of #133585 - estebank:issue-133563, r=jieyouxu许杰友 Jieyou Xu (Joe)-76/+231
Do not call `extern_crate` on current trait on crate mismatch errors When we encounter an error caused by traits/types of different versions of the same crate, filter out the current crate when collecting spans to add to the context so we don't call `extern_crate` on the `DefId` of the current crate, which is meaningless and ICEs. Produced output with this filter: ``` error[E0277]: the trait bound `foo::Struct: Trait` is not satisfied --> y.rs:13:19 | 13 | check_trait::<foo::Struct>(); | ^^^^^^^^^^^ the trait `Trait` is not implemented for `foo::Struct` | note: there are multiple different versions of crate `foo` in the dependency graph --> y.rs:7:1 | 4 | extern crate foo; | ----------------- one version of crate `foo` is used here, as a direct dependency of the current crate 5 | 6 | pub struct Struct; | ----------------- this type implements the required trait 7 | pub trait Trait {} | ^^^^^^^^^^^^^^^ this is the required trait | ::: x.rs:4:1 | 4 | pub struct Struct; | ----------------- this type doesn't implement the required trait 5 | pub trait Trait {} | --------------- this is the found trait = note: two types coming from two different versions of the same crate are different types even if they look the same = help: you can use `cargo tree` to explore your dependency tree note: required by a bound in `check_trait` --> y.rs:10:19 | 10 | fn check_trait<T: Trait>() {} | ^^^^^ required by this bound in `check_trait` ``` Fix #133563.
2024-11-30Rollup merge of #133488 - Enselic:recurse-2, r=BoxyUwU许杰友 Jieyou Xu (Joe)-0/+19
tests: Add regression test for self referential structs with cow as last field Making compilation pass for this code was retroactively stabilized via FCP in 1.79. The code does not compile in 1.78. See https://github.com/rust-lang/rust/issues/129541 for details. Closes #107481
2024-11-30Rollup merge of #116161 - Soveu:varargs2, r=cjgillot许杰友 Jieyou Xu (Joe)-78/+5
Stabilize `extended_varargs_abi_support` I think that is everything? If there is any documentation regarding `extern` and/or varargs to correct, let me know, some quick greps suggest that there might be none. Tracking issue: https://github.com/rust-lang/rust/issues/100189
2024-11-29simplify how the `hir_typeck_pass_to_variadic_function` diagnostic is createdOrion Gonzalez-11/+66
2024-11-29Move the `crate-loading` test to use `diff` outputEsteban Küber-76/+146
2024-11-29Use rmake `diff` output in testEsteban Küber-13/+46
2024-11-29Fix tests that rely on LLVM IR verificationNikita Popov-10/+2
Pass -Z verify-llvm-ir to tests that rely on it, to make sure they pass regardless of the value of verify-llvm-ir in config.toml. Also remove the 109681.rs test, because it is a duplicat of common-linkage-non-zero-init.rs.
2024-11-29Rollup merge of #133584 - ehuss:more-2024-unstable-options, r=compiler-errorsMatthias Krüger-177/+136
Update more 2024 tests to remove -Zunstable-options This removes `-Zunsable-options` from more tests that I missed in https://github.com/rust-lang/rust/pull/133349.
2024-11-29Rollup merge of #131718 - GuillaumeGomez:impl-items-indent, r=rustdocMatthias Krüger-13/+18
[rustdoc] Change impl items indent Fixes https://github.com/rust-lang/rust/issues/131704. | before | after | |-|-| | ![image](https://github.com/user-attachments/assets/67679827-6aef-4bdb-93dd-e1a4784566b3) | ![image](https://github.com/user-attachments/assets/8a0e9fbc-794a-4b98-abc6-bbbe178736b1) | Can be tested [here](https://rustdoc.crud.net/imperio/impl-items-indent/bar/struct.Bar.html). r? `@notriddle`
2024-11-29Rollup merge of #131323 - jfrimmel:avr-inline-asm-clobber-abi, r=AmanieuMatthias Krüger-0/+43
Support `clobber_abi` in AVR inline assembly This PR implements the `clobber_abi` part necessary to eventually stabilize the inline assembly for AVR. This is tracked in #93335. This is heavily inspired by the sibling-PR #131310 for the MSP430. I've explained my reasoning in the first commit message in detail, which is reproduced below for easier reviewing: This follows the [ABI documentation] of AVR-GCC: > The [...] call-clobbered general purpose registers (GPRs) are registers that might be destroyed (clobbered) by a function call. > > - **R18–R27, R30, R31** > > These GPRs are call clobbered. An ordinary function may use them without restoring the contents. [...] > > - **R0, T-Flag** > > The temporary register and the T-flag in SREG are also call-clobbered, but this knowledge is not exposed explicitly to the compiler (R0 is a fixed register). Therefore this commit lists the aforementioned registers `r18–r27`, `r30` and `r31` as clobbered registers. Since the `r0` register (listed above as well) is not available in inline assembly at all (potentially because the AVR-GCC considers it a fixed register causing the register to never be used in register allocation and LLVM adopting this), there is no need to list it in the clobber list (the `r0`-variant is not even available). A comment was added to ensure, that the `r0` gets added to the clobber-list once the register gets usable in inline ASM. Since the SREG is normally considered clobbered anyways (unless the user supplies the `preserve_flags`-option), there is no need to explicitly list a bit in this register (which is not possible to list anyways). Note, that this commit completely ignores the case of interrupts (that are described in the ABI-specification), since every register touched in an ISR need to be saved anyways. [ABI documentation]: https://gcc.gnu.org/wiki/avr-gcc#Call-Used_Registers r? ``@Amanieu`` ``@rustbot`` label +O-AVR
2024-11-29Auto merge of #133619 - matthiaskrgr:rollup-7ywaheb, r=matthiaskrgrbors-20/+160
Rollup of 7 pull requests Successful merges: - #132782 (improvements on initial sysroot and libdir finding logics) - #133466 (Fix typos in pin.rs) - #133492 (bootstrap: allow skipping steps with start of path) - #133501 (support revealing defined opaque post borrowck) - #133530 (Use consistent wording in docs, use is zero instead of is 0) - #133538 (Better diagnostic for fn items in variadic functions) - #133590 (Rename `-Zparse-only`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-29Doc comment custom MIR debuginfo.Camille GILLOT-3/+38
and add a test for the constant case
2024-11-29Rollup merge of #133590 - nnethercote:rename-parse-only, r=estebankMatthias Krüger-11/+11
Rename `-Zparse-only` It's a misleading name. r? ````@estebank````
2024-11-29Rollup merge of #133538 - dev-ardi:69232-better-diag, r=compiler-errorsMatthias Krüger-9/+49
Better diagnostic for fn items in variadic functions closes #69232
2024-11-29Rollup merge of #133501 - lcnr:post-borrowck-analysis, r=compiler-errorsMatthias Krüger-0/+100
support revealing defined opaque post borrowck By adding a new `TypingMode::PostBorrowckAnalysis`. Currently only supported with the new solver and I didn't look into the way we replace `ReErased`. ``@compiler-errors`` mentioned that always using existentials may be unsound. r? ``@compiler-errors``
2024-11-29Auto merge of #133431 - nnethercote:rm-HybridBitSet, r=Mark-Simulacrumbors-6/+6
Remove `HybridBitSet` `HybridBitSet` was introduced under the name `HybridIdxSetBuf` way back in #53383 where it was a big win for NLL borrow checker performance. In #93984 the more flexible `ChunkedBitSet` was added. Uses of `HybridBitSet` have gradually disappeared (e.g. #116152) and there are now few enough that they can be replaced with `BitSet` or `ChunkedBitSet`, and `HybridBitSet` can be removed, cutting more than 700 lines of code. r? `@Mark-Simulacrum`
2024-11-29Remove last vestiges of `HybridBitSet`.Nicholas Nethercote-6/+6
This is in a test where the arrangement of backticks matters, but the exact words do not.
2024-11-29Auto merge of #133608 - Zalathar:spans-revert, r=jieyouxubors-22/+22
Revert #133418 (Store coverage source regions as `Span`) due to regression #133606 This reverts commit adf9b5fcd1de43eaf0a779e10612caee8b47bede, reversing changes made to af1ca153d4aed5ffe22445273aa388a8d3f8f4ae. Reverting #133418 due to regressions reported at #133606. r? jieyouxu
2024-11-29Revert "Rollup merge of #133418 - Zalathar:spans, r=jieyouxu"Zalathar-22/+22
This reverts commit adf9b5fcd1de43eaf0a779e10612caee8b47bede, reversing changes made to af1ca153d4aed5ffe22445273aa388a8d3f8f4ae. Reverting due to <https://github.com/rust-lang/rust/issues/133606>.
2024-11-29Auto merge of #133409 - RalfJung:target-consistency, r=lcnrbors-2/+2
ensure JSON-defined targets are consistent We have a `check_consistency` check that ensures some invariants which (presumably) the rest of the compiler relies on. However, JSON targets can easily be written in a way that violates those invariants. So this PR applies the same consistency check to JSON targets that we already enforce for built-in targets. I have converted many of the assertions in that function to new macros that show a nice error instead of a panic; if people are okay with the general approach here, I can do that for the rest of the checks as well.
2024-11-29bless the tests and add a new oneOrion Gonzalez-9/+49
2024-11-28Update more 2024 tests to remove -Zunstable-optionsEric Huss-177/+136
2024-11-28Auto merge of #123244 - Mark-Simulacrum:share-inline-never-generics, r=saethlinbors-32/+48
Enable -Zshare-generics for inline(never) functions This avoids inlining cross-crate generic items when possible that are already marked inline(never), implying that the author is not intending for the function to be inlined by callers. As such, having a local copy may make it easier for LLVM to optimize but mostly just adds to binary bloat and codegen time. In practice our benchmarks indicate this is indeed a win for larger compilations, where the extra cost in dynamic linking to these symbols is diminished compared to the advantages in fewer copies that need optimizing in each binary. It might also make sense it expand this with other heuristics (e.g., `#[cold]`) in the future, but this seems like a good starting point. FWIW, I expect that doing cleanup in where we make the decision what should/shouldn't be shared is also a good idea. Way too much code needed to be tweaked to check this. But I'm hoping to leave that for a follow-up PR rather than blocking this on it.
2024-11-29Rename `-Zparse-only`.Nicholas Nethercote-11/+11
I was surprised to find that running with `-Zparse-only` only parses the crate root file. Other files aren't parsed because that happens later during expansion. This commit renames the option and updates the help message to make this clearer.
2024-11-28Auto merge of #133540 - ehuss:compiletest-proc-macro, r=jieyouxubors-1084/+425
Compiletest: add proc-macro header This adds a `proc-macro` header to simplify using proc-macros, and to reduce boilerplate. This header works similar to the `aux-build` header where you pass a path for a proc-macro to be built. This allows the `force-host`, `no-prefer-dynamic` headers, and `crate_type` attribute to be removed. Additionally it uses `--extern` like `aux_crate` (allows implicit `extern crate` in 2018) and `--extern proc_macro` (to place in the prelude in 2018). ~~This also includes a secondary change which defaults the edition of proc-macros to 2024. This further reduces boilerplate (removing `extern crate proc_macro;`), and allows using modern Rust syntax. I was a little on the fence including this. I personally prefer it, but I can imagine it might be confusing to others.~~ EDIT: Removed Some tests were changed so that when there is a chain of dependencies A→B→C, that the `@ proc-macro` is placed in `B` instead of `A` so that the `--extern` flag works correctly (previously it depended on `-L` to find `C`). I think this is better to make the dependencies more explicit. None of these tests looked like the were actually testing this behavior. There is one test that had an unexplained output change: `tests/ui/macros/same-sequence-span.rs`. I do not know why it changed, but it didn't look like it was particularly important. Perhaps there was a normalization issue? This is currently not compatible with the rustdoc `build-aux-docs` header. It can probably be fixed, I'm just not feeling motivated to do that right now. ### Implementation steps - [x] Document this new behavior in rustc-dev-guide once we figure out the specifics. https://github.com/rust-lang/rustc-dev-guide/pull/2149
2024-11-28Share inline(never) generics across cratesMark Rousskov-32/+48
This reduces code sizes and better respects programmer intent when marking inline(never). Previously such a marking was essentially ignored for generic functions, as we'd still inline them in remote crates.
2024-11-29Support floats in input/output in vector registers of PowerPC inline assemblyTaiki Endo-9/+75
2024-11-29Fix target_feature handling in freg of LoongArch inline assemblyTaiki Endo-0/+145
2024-11-28Do not call `extern_crate` on current trait on crate mismatch errorsEsteban Küber-0/+52
When we encounter an error caused by traits/types of different versions of the same crate, filter out the current crate when collecting spans to add to the context so we don't call `extern_crate` on the `DefId` of the current crate, which is meaningless and ICEs. Produced output with this filter: ``` error[E0277]: the trait bound `foo::Struct: Trait` is not satisfied --> y.rs:13:19 | 13 | check_trait::<foo::Struct>(); | ^^^^^^^^^^^ the trait `Trait` is not implemented for `foo::Struct` | note: there are multiple different versions of crate `foo` in the dependency graph --> y.rs:7:1 | 4 | extern crate foo; | ----------------- one version of crate `foo` is used here, as a direct dependency of the current crate 5 | 6 | pub struct Struct; | ----------------- this type implements the required trait 7 | pub trait Trait {} | ^^^^^^^^^^^^^^^ this is the required trait | ::: x.rs:4:1 | 4 | pub struct Struct; | ----------------- this type doesn't implement the required trait 5 | pub trait Trait {} | --------------- this is the found trait = note: two types coming from two different versions of the same crate are different types even if they look the same = help: you can use `cargo tree` to explore your dependency tree note: required by a bound in `check_trait` --> y.rs:10:19 | 10 | fn check_trait<T: Trait>() {} | ^^^^^ required by this bound in `check_trait` ``` Fix #133563.
2024-11-28Auto merge of #133468 - lcnr:uwu4, r=BoxyUwUbors-39/+355
always create `DefId`s for anon consts but don't use them anywhere, we intentionally don't encode them in the crate metadata. best reviewed by disabling whitespace. This pretty much reimplements #133285 while adding the tests of #133455. Fixes #133064 r? `@BoxyUwU` `@compiler-errors`
2024-11-29Support #[repr(simd)] types in input/output of PowerPC inline assemblyTaiki Endo-339/+574
2024-11-28Move & rename test case to match naming of #132456Julian Frimmel-0/+0
2024-11-28Add test case for the clobber optionsJulian Frimmel-0/+43
2024-11-28always create `DefId`s when lowering anon-constslcnr-3/+3
2024-11-28add testslcnr-36/+352