about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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-05Normalize when equating dyn tails in MIR borrowckMichael Goulet-17/+3
2024-08-05add test for symbol visibility of `#[naked]` functionsFolkert-0/+187
2024-08-05Auto merge of #128689 - matthiaskrgr:rollup-ukyn8wq, r=matthiaskrgrbors-0/+5
Rollup of 5 pull requests Successful merges: - #128385 (rustdoc-json: discard non-local inherent impls for primitives) - #128559 (Don't re-elaborated already elaborated caller bounds in method probe) - #128631 (handle crates when they are not specified for std docs) - #128664 (Add `Debug` impls to API types in `rustc_codegen_ssa`) - #128686 (fix the invalid argument type) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-05Rollup merge of #128385 - its-the-shrimp:fix_114039, r=aDotInTheVoidMatthias Krüger-0/+5
rustdoc-json: discard non-local inherent impls for primitives Fixes #114039 at least it should r? `@aDotInTheVoid`
2024-08-05custom MIR: add support for tail callsRalf Jung-0/+23
2024-08-05Auto merge of #124336 - compiler-errors:super-outlives, r=lcnrbors-10/+73
Enforce supertrait outlives obligations hold when confirming impl **TL;DR:** We elaborate super-predicates and apply any outlives obligations when proving an impl holds to fix a mismatch between implied bounds. Bugs in implied bounds (and implied well-formedness) occur whenever there is a mismatch between the assumptions that some code can assume to hold, and the obligations that a caller/user of that code must prove. If the former is stronger than the latter, then unsoundness occurs. Take a look at the example unsoundness: ```rust use std::fmt::Display; trait Static: 'static {} impl<T> Static for &'static T {} fn foo<S: Display>(x: S) -> Box<dyn Display> where &'static S: Static, { Box::new(x) } fn main() { let s = foo(&String::from("blah blah blah")); println!("{}", s); } ``` This specific example occurs because we elaborate obligations in `fn foo`: * `&'static S: Static` * `&'static S: 'static` <- super predicate * `S: 'static` <- elaborating outlives bounds However, when calling `foo`, we only need to prove the direct set of where clauses. So at the call site for some substitution `S = &'not_static str`, that means only proving `&'static &'not_static str: Static`. To prove this, we apply the impl, which itself holds trivially since it has no where clauses. This is the mismatch -- `foo` is allowed to assume that `S: 'static` via elaborating supertraits, but callers of `foo` never need to prove that `S: 'static`. There are several approaches to fixing this, all of which have problems due to current limitations in our type system: 1. proving the elaborated set of predicates always - This leads to issues since we don't have coinductive trait semantics, so we easily hit new cycles. * This would fix our issue, since callers of `foo` would have to both prove `&'static &'not_static str: Static` and its elaborated bounds, which would surface the problematic `'not_static: 'static` outlives obligation. * However, proving supertraits when proving impls leads to inductive cycles which can't be fixed until we get coinductive trait semantics. 2. Proving that an impl header is WF when applying that impl: * This would fix our issue, since when we try to prove `&'static &'not_static str: Static`, we'd need to prove `WF(&'static &'not_static str)`, which would surface the problematic `'not_static: 'static` outlives obligation. * However, this leads to issues since we don't have higher-ranked implied bounds. This breaks things when trying to apply impls to higher-ranked trait goals. To get around these limitations, we apply a subset of (1.), which is to elaborate the supertrait obligations of the impl but filter only the (region/type) outlives out of that set, since those can never participate in an inductive cycle. This is likely not sufficient to fix a pathological example of this issue, but it does clearly fill in a major gap that we're currently overlooking. This can also result in 'unintended' errors due to missing implied-bounds on binders. We did not encounter this in the crater run and don't expect people to rely on this code in practice: ```rust trait Outlives<'b>: 'b {} impl<'b, T> Outlives<'b> for &'b T {} fn foo<'b>() where // This bound will break due to this PR as we end up proving // `&'b &'!a (): 'b` without the implied `'!a: 'b` // bound. for<'a> &'b &'a (): Outlives<'b>, {} ``` Fixes #98117 --- Crater: https://github.com/rust-lang/rust/pull/124336#issuecomment-2209165320 Triaged: https://github.com/rust-lang/rust/pull/124336#issuecomment-2236321325 All of the fallout is due to generic const exprs, and can be ignored.
2024-08-05rewrite cdylib-dylib-linkage to rmakeOneirical-31/+41
2024-08-05rewrite redundant-libs to rmakeOneirical-27/+41
2024-08-05rewrite raw-dylib-c to rmakeOneirical-28/+29
2024-08-05rewrite raw-dylib-alt-calling-conventions to rmakeOneirical-24/+28
2024-08-05Enforce supertrait outlives obligations hold when confirming implMichael Goulet-10/+73
2024-08-05Auto merge of #127095 - Oneirical:testiary-education, r=jieyouxubors-68/+115
Migrate `reproducible-build-2` and `stable-symbol-names` `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). Needs try-jobs. try-job: x86_64-msvc try-job: armhf-gnu try-job: test-various try-job: aarch64-apple try-job: i686-msvc try-job: x86_64-mingw
2024-08-05rustdoc-json: discard non-local inherent implsschvv31n-0/+5
2024-08-05Auto merge of #117468 - daxpedda:wasm-relaxed-simd, r=alexcrichtonbors-0/+28
Stabilize Wasm relaxed SIMD This PR stabilizes [Wasm relaxed SIMD](https://github.com/WebAssembly/relaxed-simd) which has already reached [phase 4](https://github.com/WebAssembly/proposals/tree/04fa8c810e1dc99ab399e41052a6e427ee988180?tab=readme-ov-file#phase-4---standardize-the-feature-wg). Tracking issue: #111196 Implementation PR: https://github.com/rust-lang/stdarch/pull/1393 Documentation: https://github.com/rust-lang/reference/pull/1421 Stdarch: https://github.com/rust-lang/stdarch/pull/1494 Closes #111196.
2024-08-05Auto merge of #128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgrbors-44/+152
Rollup of 8 pull requests Successful merges: - #128026 (std::thread: available_parallelism implementation for vxWorks proposal.) - #128471 (rustdoc: Fix handling of `Self` type in search index and refactor its representation) - #128607 (Use `object` in `run-make/symbols-visibility`) - #128609 (Remove unnecessary constants from flt2dec dragon) - #128611 (run-make: Remove cygpath) - #128619 (Correct the const stabilization of `<[T]>::last_chunk`) - #128630 (docs(resolve): more explain about `target`) - #128660 (tests: more crashes) r? `@ghost` `@rustbot` modify labels: rollup