about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-08-07Rollup merge of #128221 - calebzulawski:implied-target-features, r=AmanieuMatthias Krüger-36/+51
Add implied target features to target_feature attribute See [zulip](https://rust-lang.zulipchat.com/#narrow/stream/208962-t-libs.2Fstdarch/topic/Why.20would.20target-feature.20include.20implied.20features.3F) for some context. Adds implied target features, e.g. `#[target_feature(enable = "avx2")]` acts like `#[target_feature(enable = "avx2,avx,sse4.2,sse4.1...")]`. Fixes #128125, fixes #128426 The implied feature sets are taken from [the rust reference](https://doc.rust-lang.org/reference/attributes/codegen.html?highlight=target-fea#x86-or-x86_64), there are certainly more features and targets to add. Please feel free to reassign this to whoever should review it. r? ``@Amanieu``
2024-08-07Rollup merge of #128757 - Oneirical:calm-before-the-sltorm, r=jieyouxuGuillaume Gomez-11/+22
Migrate `pgo-gen-lto` `run-make` test 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 one is so easy, I'm surprised I missed it. try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw try-job: x86_64-gnu-llvm-17
2024-08-07Rollup merge of #128753 - compiler-errors:arbitrary-upper, r=spastorinoGuillaume Gomez-21/+48
Don't arbitrarily choose one upper bound for hidden captured region error message You could argue that the error message is objectively worse, even though it's more accurate. I guess we could also add a note explaining like "cannot capture the intersection of two regions" or something, though I'm not sure if that is confusing due to being totally technical jargon. This addresses the fact that #128752 says "add `+ 'b`" even though it does nothing to fix the issue. It doesn't fix the issue's root cause, though. r? `@spastorino`
2024-08-07Rollup merge of #128700 - Oneirical:i-ffind-these-tests-quite-simdple, ↵Guillaume Gomez-47/+63
r=jieyouxu Migrate `simd-ffi` `run-make` test 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: x86_64-mingw try-job: i686-msvc try-job: armhf-gnu try-job: test-various try-job: aarch64-apple try-job: x86_64-gnu-llvm-17
2024-08-07Rollup merge of #128656 - ChrisDenton:rust-lld, r=lqdGuillaume Gomez-6/+8
Enable msvc for run-make/rust-lld This is simply a matter of using the right argument for lld-link. As a bonus, I also fixed a typo. try-job: i686-msvc try-job: x86_64-msvc
2024-08-07Rollup merge of #128527 - estebank:ambiguity-suggestion, r=NadrierilGuillaume Gomez-6/+10
More information for fully-qualified suggestion when there are multiple impls ``` error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type --> $DIR/E0283.rs:30:21 | LL | fn create() -> u32; | ------------------- `Coroutine::create` defined here ... LL | let cont: u32 = Coroutine::create(); | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait | help: use a fully-qualified path to a specific available implementation | LL | let cont: u32 = <Impl as Coroutine>::create(); | ++++++++ + LL | let cont: u32 = <AnotherImpl as Coroutine>::create(); | +++++++++++++++ + ```
2024-08-07Auto merge of #128196 - Oneirical:poltergeist-manitestation, r=jieyouxubors-85/+108
Migrate `cross-lang-lto-upstream-rlibs`, `long-linker-command-lines` and `long-linker-command-lines-cmd-exe` `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). The `long-linker` tests are certainly doing something... interesting - they summon `rustc` calls with obscene quantities of arguments and check that this is appropriately handled. I removed the `RUSTC_ORIGINAL` magic - it's equivalent to `RUSTC` in `tools.mk`, so what is the purpose? Making it so the massive pile of flags doesn't modify rustc itself and start leaking into other tests? Tell me what you think. Please try: try-job: x86_64-msvc try-job: i686-msvc try-job: x86_64-mingw try-job: i686-mingw try-job: aarch64-apple try-job: test-various try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-17
2024-08-07Hide implicit target features from diagnostics when possibleCaleb Zulawski-15/+13
2024-08-07Add implied features to non-target-feature functionsCaleb Zulawski-4/+4
2024-08-07Don't use LLVM to compute -Ctarget-featureCaleb Zulawski-1/+1
2024-08-07Fix codegen testsCaleb Zulawski-5/+5
2024-08-07Add test to ensure implied target features work with asm, and fix failing testsCaleb Zulawski-44/+37
2024-08-07Add implied target features to target_feature attributeCaleb Zulawski-0/+24
2024-08-06Rollup merge of #128649 - ChrisDenton:param-passing, r=jieyouxuTrevor Gross-18/+8
run-make: Enable msvc for `no-duplicate-libs` and `zero-extend-abi-param-passing` The common thing between these two tests is to use `#[link(..., kind="static")]` so that it doesn't try to do a DLL import. `zero-extend-abi-param-passing` also needs to have an optimized static library but there's only helper function for a non-optimized version. Rather than copy/pasting the code (and adding the optimization flag) I reused the same code so that it more easily be kept in sync. try-job: i686-msvc try-job: x86_64-msvc
2024-08-06Rollup merge of #128647 - ChrisDenton:link-args-order, r=jieyouxuTrevor Gross-6/+5
Enable msvc for link-args-order I could not see any reason in #70665 why this test needs to specifically use `ld`. Maybe to provide a consistent linker input line? In any case, the test does work for the MSVC linker. try-job: i686-msvc try-job: x86_64-msvc
2024-08-06Rollup merge of #128638 - ChrisDenton:link-dedup, r=jieyouxuTrevor Gross-8/+25
run-make: enable msvc for `link-dedup` This is just a case of differing style of linker arguments. I also cleaned up a bit where we were running the same command three times in a row. Instead I reused the output. One thing that confused me is why we were testing for the same lib three times in a row but not two. After figuring that out I added a note to hopefully save future readers some confusion. try-job: x86_64-msvc try-job: i686-msvc
2024-08-06Rollup merge of #128362 - folkertdev:naked-function-symbol-visibility, r=bjorn3Trevor Gross-0/+187
add test for symbol visibility of `#[naked]` functions tracking issue: #90957 This test is extracted from https://github.com/rust-lang/rust/pull/128004 That PR attempts to generated naked functions as an extern function declaration, combined with a global asm block that provides the implementation for that declaration. In order to link declaration and definition together, some flavor of external linking must be used: LLVM will error for other linkage types. Specifically the allowed options are `#[linkage = "external"]` and `#[linkage = "extern_weak"]`. That is kind of an implementation detail though: to the user, a naked function should just behave like a normal function. Hence it should be visible to the linker under the same circumstances as a normal, vanilla function and have the same attributes (Weak, External). Getting this behavior right will require some care, so I think it's a good idea to lock it in now, before making any changes, to make sure we don't regress. Are there any interesting cases that I missed here? E.g. is checking on different architectures worth it? I don't think the other binary types (rlib etc) are relevant here, but may be missing something. r? ``@bjorn3``
2024-08-06Rollup merge of #128107 - Oneirical:tomato-hartester, r=jieyouxuTrevor Gross-76/+95
Migrate `raw-dylib-alt-calling-convention`, `raw-dylib-c` and `redundant-libs` `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: x86_64-msvc // try-job: x86_64-mingw // try-job: i686-msvc try-job: x86_64-gnu-llvm-17 try-job: aarch64-apple
2024-08-07Auto merge of #128761 - matthiaskrgr:rollup-5p1mlqq, r=matthiaskrgrbors-0/+229
Rollup of 9 pull requests Successful merges: - #124944 (On trait bound mismatch, detect multiple crate versions in dep tree) - #125048 (PinCoerceUnsized trait into core) - #128406 (implement BufReader::peek) - #128539 (Forbid unused unsafe in vxworks-specific std modules) - #128687 (interpret: refactor function call handling to be better-abstracted) - #128692 (Add a triagebot mention for `library/Cargo.lock`) - #128710 (Don't ICE when getting an input file name's stem fails) - #128718 (Consider `cfg_attr` checked by `CheckAttrVisitor`) - #128751 (std::thread: set_name implementation proposal for vxWorks.) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Rollup merge of #128718 - jieyouxu:check-cfg_attr, r=nnethercoteMatthias Krüger-0/+169
Consider `cfg_attr` checked by `CheckAttrVisitor` I forgor about `cfg_attr` in #128581, it should be treated like `cfg`. Fixes #128716.
2024-08-07Rollup merge of #128710 - ChrisDenton:null, r=jieyouxuMatthias Krüger-0/+13
Don't ICE when getting an input file name's stem fails Fixes #128681 The file stem is only used as a user-friendly prefix on intermediary files. While nice to have, it's not the end of the world if it fails so there's no real reason to emit an error here. We can continue with a fixed name as we do when an anonymous string is used.
2024-08-06rewrite pgo-gen-lto to rmakeOneirical-11/+22
2024-08-06Don't arbitrarily choose one upper bound for hidden captured regionMichael Goulet-21/+48
2024-08-06fix testEsteban Küber-15/+11
2024-08-06Rollup merge of #128736 - GuillaumeGomez:fix-remap-path-prefix, r=notriddleMatthias Krüger-0/+24
Fix rustdoc missing handling of remap-path-prefix option Fixes https://github.com/rust-lang/rust/issues/69264. cc `@weihanglo` r? `@notriddle`
2024-08-06Rollup merge of #128693 - notriddle:notriddle/impl-disambiguator-2024, ↵Matthias Krüger-1/+40
r=GuillaumeGomez rustdoc-search: account for numeric disambiguators on impls Fixes #128676
2024-08-06Rollup merge of #128377 - veera-sivarajan:fix-128249, r=davidtwcoMatthias Krüger-0/+66
Fix ICE Caused by Incorrectly Delaying E0107 Fixes #128249 For the following code: ```rust trait Foo<T> {} impl Foo<T: Default> for u8 {} ``` #126054 added some logic to delay emitting E0107 as the names of associated type `T` in the impl header and generic parameter `T` in `trait Foo` match. But it failed to ensure whether such unexpected associated type bounds are coming from a impl block header. This caused an ICE as the compiler was delaying E0107 for code like: ```rust trait Trait<Type> { type Type; fn method(&self) -> impl Trait<Type: '_>; } ``` because it assumed the associated type bound `Type: '_` is for the generic parameter `Type` in `trait Trait` since the names are same. This PR adds a check to ensure that E0107 is delayed only in the context of impl block header.
2024-08-06Move test to be make instead of uiEsteban Küber-132/+47
2024-08-06Change test to be only-linux and ignore-wasm32Esteban Küber-3/+4
2024-08-06Add `help` about using `cargo tree`Esteban Küber-11/+13
2024-08-06Add test for mixing types from two incompatible crate versionsEsteban Küber-0/+133
2024-08-06rewrite long-linker-command-lines-cmd-exe to rmakeOneirical-37/+32
2024-08-06rewrite long-linker-command-lines to rmakeOneirical-22/+21
2024-08-06rewrite cross-lang-lto-upstream-rlibs to rmakeOneirical-32/+61
2024-08-06Add regression test for #69264Guillaume Gomez-0/+24
2024-08-06rustdoc-search: account for numeric disambiguators on implsMichael Howell-1/+40
Fixes #128676
2024-08-06Auto merge of #128245 - Oneirical:total-linkage-ownage, r=jieyouxubors-31/+41
Migrate `cdylib-dylib-linkage` `run-make` test 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). ~~Those sysroot tests are always fun. I'm getting local errors that don't make a lot of sense about my own sysroot not existing, so I am trying this in CI to see what happens.~~ ~~EDIT: I am getting the same error here. The strange thing is, when I try to navigate to `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib` on my personal computer, the directory does exist, but the error message is that the directory does not.~~ EDIT 2: The sysroot path just needed to be trimmed! Please try: // try-job: x86_64-msvc // passed previously try-job: x86_64-mingw try-job: x86_64-gnu-llvm-18 try-job: i686-msvc try-job: aarch64-apple
2024-08-06Auto merge of #126804 - estebank:short-error-primary-label, r=davidtwcobors-13/+13
On short error format, append primary span label to message The `error-format=short` output only displays the path, error code and main error message all in the same line. We now add the primary span label as well after the error message, to provide more context.
2024-08-06tests: add regression test to make sure `cfg_attr` isn't considered unhandled许杰友 Jieyou Xu (Joe)-0/+169
2024-08-06On short error format, append primary span label to messageEsteban Küber-13/+13
The `error-format=short` output only displays the path, error code and main error message all in the same line. We now add the primary span label as well after the error message, to provide more context.
2024-08-06Auto merge of #125558 - Amanieu:const-asm-type, r=lcnrbors-228/+217
Tweak type inference for `const` operands in inline asm Previously these would be treated like integer literals and default to `i32` if a type could not be determined. To allow for forward-compatibility with `str` constants in the future, this PR changes type inference to use an unbound type variable instead. The actual type checking is deferred until after typeck where we still ensure that the final type for the `const` operand is an integer type. <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-08-05Check staticlib name falls back to `rust_out`Chris Denton-1/+5
2024-08-05Windows: Test if `\\.\NUL` works as an input fileChris Denton-0/+9
2024-08-05Rollup merge of #128697 - RalfJung:nullary-op, r=compiler-errorsMatthias Krüger-1/+1
interpret: move nullary-op evaluation into operator.rs We call it an operator, so we might as well treat it like one. :) Also use more consistent naming for the "evaluate intrinsic" functions. "emulate" is really the wrong term, this *is* a genuine implementation of the intrinsic semantics after all.
2024-08-05Rollup merge of #128694 - compiler-errors:norm, r=WaffleLapkinMatthias Krüger-17/+3
Normalize when equating `dyn` tails in MIR borrowck See the explanation in the comment. Fixes #128621 cc `@WaffleLapkin`
2024-08-05Rollup merge of #128688 - RalfJung:custom-mir-tail-calls, r=compiler-errorsMatthias Krüger-0/+23
custom MIR: add support for tail calls Cc ``@WaffleLapkin``
2024-08-05Rollup merge of #128580 - compiler-errors:cfi-param-env, r=lcnrMatthias Krüger-0/+44
Use `ParamEnv::reveal_all` in CFI I left a huge comment for why this ICEs in the test I committed. `typeid_for_instance` should only be called on monomorphic instances during codegen, and we should just be using `ParamEnv::reveal_all()` rather than the param-env of the instance itself. I added an assertion to ensure that we only do this for fully substituted instances (this may break with polymorphization, but I kinda don't care lol). Fixes #114160 cc `@rcvalle`
2024-08-05interpret: move nullary-op evaluation into operator.rsRalf Jung-1/+1
2024-08-05rewrite simd-ffi to rmakeOneirical-47/+63
2024-08-05Normalize when equating dyn tails in MIR borrowckMichael Goulet-17/+3