about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-02-28remove useless testslcnr-238/+0
they don't detect any bugs in the search graph. We instead check for these via `search_graph_fuzz`.
2025-02-28add test to reproduce #137662 (using ty decl macro fragment in an attr) and ↵Jana Dönszelmann-0/+20
fix it
2025-02-28Auto merge of #137710 - matthiaskrgr:rollup-3vmxxu9, r=matthiaskrgrbors-2/+282
Rollup of 8 pull requests Successful merges: - #136542 ([`compiletest`-related cleanups 4/7] Make the distinction between root build directory vs test suite specific build directory in compiletest less confusing) - #136579 (Fix UB in ThinVec::flat_map_in_place) - #136688 (require trait impls to have matching const stabilities as the traits) - #136846 (Make `AssocOp` more like `ExprKind`) - #137304 (add `IntoBounds::intersect` and `RangeBounds::is_empty`) - #137455 (Reuse machinery from `tail_expr_drop_order` for `if_let_rescope`) - #137480 (Return unexpected termination error instead of panicing in `Thread::join`) - #137694 (Spruce up `AttributeKind` docs) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-28Tweak incorrect ABI suggestionEsteban Küber-20/+28
Provide a better suggestion message, and make the suggestion verbose. ``` error[E0703]: invalid ABI: found `riscv-interrupt` --> $DIR/riscv-discoverability-guidance.rs:17:8 | LL | extern "riscv-interrupt" fn isr() {} | ^^^^^^^^^^^^^^^^^ invalid ABI | = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions help: there's a similarly named valid ABI `"riscv-interrupt-m"` | LL | extern "riscv-interrupt-m" fn isr() {} | ++ ```
2025-02-28Fix sized constraint for unsafe binderMichael Goulet-0/+29
2025-02-28fix: fix overflowing hex wrong suggestion11happy-4/+21
Signed-off-by: 11happy <soni5happy@gmail.com> rebase Signed-off-by: 11happy <soni5happy@gmail.com> fix: rebless Signed-off-by: 11happy <soni5happy@gmail.com>
2025-02-28Auto merge of #137669 - DianQK:fn-atts-virtual, r=saethlinbors-0/+82
Don't infer attributes of virtual calls based on the function body Fixes (after backport) #137646. Since we don't know the exact implementation of the virtual call, it might write to parameters, we can't infer the readonly attribute.
2025-02-28Remove `NtPath`.Nicholas Nethercote-5/+5
2025-02-28Remove `NtMeta`.Nicholas Nethercote-12/+12
Note: there was an existing code path involving `Interpolated` in `MetaItem::from_tokens` that was dead. This commit transfers that to the new form, but puts an `unreachable!` call inside it.
2025-02-28Remove `NtPat`.Nicholas Nethercote-17/+10
The one notable test change is `tests/ui/macros/trace_faulty_macros.rs`. This commit removes the complicated `Interpolated` handling in `expected_expression_found` that results in a longer error message. But I think the new, shorter message is actually an improvement. The original complaint was in #71039, when the error message started with "error: expected expression, found `1 + 1`". That was confusing because `1 + 1` is an expression. Other than that, the reporter said "the whole error message is not too bad if you ignore the first line". Subsequently, extra complexity and wording was added to the error message. But I don't think the extra wording actually helps all that much. In particular, it still says of the `1+1` that "this is expected to be expression". This repeats the problem from the original complaint! This commit removes the extra complexity, reverting to a simpler error message. This is primarily because the traversal is a pain without `Interpolated` tokens. Nonetheless, I think the error message is *improved*. It now starts with "expected expression, found `pat` metavariable", which is much clearer and the real problem. It also doesn't say anything specific about `1+1`, which is good, because the `1+1` isn't really relevant to the error -- it's the `$e:pat` that's important.
2025-02-27BlessBoxy-5/+181
2025-02-27Add inference constraining Copy impl testBoxy-0/+21
2025-02-28Unconditionally lower match arm even if it's unneeded for never pattern in matchMu001999-0/+48
2025-02-27Move "unused_exter_crate" test from rustdoc-ui to rustdocYotam Ofek-1/+1
2025-02-27Fix test directives that were accidentally ignoredYotam Ofek-24/+22
2025-02-27use the right feature in codegen testsFolkert de Vries-2/+2
2025-02-27make `simd_insert` and `simd_extract` `const fn`sFolkert de Vries-26/+11
2025-02-27simplify some imports with `simd::*`Folkert de Vries-9/+2
2025-02-27remove most `simd_` intrinsic declaration in testsFolkert de Vries-1007/+482
instead, we can just import the intrinsics from core
2025-02-27Delete tuple unsizingAlice Ryhl-667/+48
2025-02-27Rollup merge of #137455 - compiler-errors:drop-lint-dtor, r=oli-obkMatthias Krüger-0/+180
Reuse machinery from `tail_expr_drop_order` for `if_let_rescope` Namely, it defines its own `extract_component_with_significant_dtor` which is a bit more accurate than `Ty::has_significant_drop`, since it has a hard-coded list of types from the ecosystem which are opted out of the lint.[^a] Also, since we extract the dtors themselves, adopt the same *label* we use in `tail_expr_drop_order` to point out the destructor impl. This makes it much clear what's actually being dropped, so it should be clearer to know when it's a false positive. This conflicts with #137444, but I will rebase whichever lands first. [^a]: Side-note, it's kinda a shame that now there are two functions that presumably do the same thing. But this isn't my circus, nor are these my monkeys.
2025-02-27Rollup merge of #137304 - pitaj:rangebounds-is_empty-intersect, r=ibraheemdevMatthias Krüger-1/+2
add `IntoBounds::intersect` and `RangeBounds::is_empty` - ACP: https://github.com/rust-lang/libs-team/issues/539 - Tracking issue for `is_empty`: #137300 - Tracking issue for `IntoBounds`: #136903
2025-02-27Don't infer unwinding of virtual calls based on the function attributesDianQK-0/+19
2025-02-27Don't infer attributes of virtual calls based on the function bodyDianQK-24/+20
2025-02-27require trait impls to have matching const stabilities as the traitsDeadbeef-1/+100
2025-02-26Add run-make test for rustdoc `--emit=dep-info` optionGuillaume Gomez-1/+31
2025-02-26Bless testsGary Guo-18/+29
2025-02-26Print out destructorMichael Goulet-0/+180
2025-02-26Support raw-dylib link kind on ELFNoratrieb-7/+266
raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time.
2025-02-26Rollup merge of #137671 - meithecatte:discoverable-dump-mir, r=NadrierilLeón Orell Valerian Liehr-0/+1
Make -Z unpretty=mir suggest -Z dump-mir as well for discoverability While debugging something else, I got quite annoyed with `-Z unpretty=mir` showing me post-processed MIR instead of the one just after it is built. I ended up asking on Zulip and got pointed to `-Z dump-mir`. While this feature is documented in the rustc dev guide, I think it'd be good if the possibility of making use of it was staring you in the face while you need it.
2025-02-26Rollup merge of #137635 - compiler-errors:constrain-unstable, r=SparrowLiiLeón Orell Valerian Liehr-0/+29
Don't suggest constraining unstable associated types Fixes #137624 This could be made a bit more specific, considering the local crate's stability or nightly status or something, but I think in general we should not be suggesting associated type bounds on unstable associated items.
2025-02-26Rollup merge of #137631 - TaKO8Ki:issue-137508, r=compiler-errorsLeón Orell Valerian Liehr-0/+73
Avoid collecting associated types for undefined trait Fixes #137508 Fixes #137554
2025-02-26Rollup merge of #137201 - estebank:structured-errors-long-ty, r=oli-obkLeón Orell Valerian Liehr-9/+114
Teach structured errors to display short `Ty<'_>` Make it so that in every structured error annotated with `#[derive(Diagnostic)]` that has a field of type `Ty<'_>`, the printing of that value into a `String` will look at the thread-local storage `TyCtxt` in order to shorten to a length appropriate with the terminal width. When this happen, the resulting error will have a note with the file where the full type name was written to. ``` error[E0618]: expected function, found `((..., ..., ..., ...), ..., ..., ...)`` --> long.rs:7:5 | 6 | fn foo(x: D) { //~ `x` has type `(... | - `x` has type `((..., ..., ..., ...), ..., ..., ...)` 7 | x(); //~ ERROR expected function, found `(... | ^-- | | | call expression requires function | = note: the full name for the type has been written to 'long.long-type-14182675702747116984.txt' = note: consider using `--verbose` to print the full type name to the console ``` Follow up to and response to the comments on #136898. r? ``@oli-obk``
2025-02-26Fix Windows `Command` search path bugChris Denton-0/+72
2025-02-26Make -Z unpretty=mir suggest -Z dump-mir as wellMaja Kądziołka-0/+1
2025-02-26Add a test case for #137646DianQK-0/+67
2025-02-26Rollup merge of #137622 - jdonszelmann:fix-137589, r=compiler-errorsLeón Orell Valerian Liehr-0/+75
fix attribute-related ICE when parsing macro on the rhs of a name-value attribute r? ``@oli-obk`` Closes: #137589
2025-02-26Rollup merge of #137613 - davidtwco:const-traits-variances, r=compiler-errorsLeón Orell Valerian Liehr-0/+21
hir_analysis: skip self type of host effect preds in variances_of Discovered as part of an implementation of rust-lang/rfcs#3729 - w/out this then when introducing const trait bounds: many more interesting tests change with different output, missing errors, new errors, etc related to this but they all depend on feature flags and are much more complex than this test. r? ``@oli-obk``
2025-02-26Rollup merge of #137604 - davidtwco:host-effect-resolve-vars, r=compiler-errorsLeón Orell Valerian Liehr-0/+36
trait_sel: resolve vars in host effects In the standard library, the `Extend` impl for `Iterator` (specialised with `TrustedLen`) has a parameter which is constrained by a projection predicate. This projection predicate provides a value for an inference variable but - if the default bound is `const Sized` instead of `Sized` - host effect evaluation wasn't resolving variables first. Added a test that doesn't depend on a rust-lang/rfcs#3729 implementation. Adding the extra resolve can the number of errors in some tests when they gain host effect predicates, but this is not unexpected as calls to `resolve_vars_if_possible` can cause more error tainting to happen.
2025-02-26Rollup merge of #137559 - folkertdev:run-more-emscripten-tests, r=fmeaseLeón Orell Valerian Liehr-21/+9
run some tests on emscripten again these were ignored because of #45351, but that issue has long been fixed. Let's see if these pass, or if there is some issue lurking still I believe this is the try-job for emscripten? probably a good idea to run that first. ~~try-job: test-various~~ try-job: dist-various-1
2025-02-26Rollup merge of #137544 - petrochenkov:deritest, r=fmeaseLeón Orell Valerian Liehr-0/+172
tests: Add regression test for derive token invalidation (#81099) Closes https://github.com/rust-lang/rust/issues/81099.
2025-02-26Rollup merge of #137320 - tapanprakasht:fix-doc-version-stability, r=notriddleLeón Orell Valerian Liehr-0/+28
fix(rustdoc): Fixed stability version in rustdoc Tries to fix https://github.com/rust-lang/rust/issues/137141 Fixed by adding checks glob exports
2025-02-25tests: fix up new test for nocapture -> capture(none) changeAugie Fackler-2/+2
Same motivation as #136287, but for a newly introduced test. Rather than over-constraining here, we just match the sret and accept pretty much all other attributes. @rustbot label llvm-main r? @nikic
2025-02-25Add DWARF test case for non-C-like `repr128` enumsbeetrees-21/+119
2025-02-26fix #137508Takayuki Maeda-0/+73
rename ui tests check if res is trait def fix typo regression test for #137554
2025-02-25Don't suggest constraining unstable associated typesMichael Goulet-0/+29
2025-02-25Auto merge of #137608 - fmease:rollup-h4siso6, r=fmeasebors-201/+120
Rollup of 8 pull requests Successful merges: - #137370 (adjust_abi: make fallback logic for ABIs a bit easier to read) - #137444 (Improve behavior of `IF_LET_RESCOPE` around temporaries and place expressions) - #137464 (Fix invalid suggestion from type error for derive macro) - #137539 ( Add rustdoc-gui regression test for #137082 ) - #137576 (Don't doc-comment BTreeMap<K, SetValZST, A>) - #137595 (remove `simd_fpow` and `simd_fpowi`) - #137600 (type_ir: remove redundant part of comment) - #137602 (feature: fix typo in attribute description) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-25fix #137589Jana Dönszelmann-0/+75
2025-02-25Make E0609 a structured errorEsteban Küber-2/+5
2025-02-25Make E0614 a structured errorEsteban Küber-12/+15
``` error[E0614]: type `(..., ..., ..., ...)` cannot be dereferenced --> $DIR/long-E0614.rs:10:5 | LL | *x; | ^^ can't be dereferenced | = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt' = note: consider using `--verbose` to print the full type name to the console ```