about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-01-13Auto merge of #135352 - notriddle:notriddle/stability-shown, r=camelidbors-0/+18
rustdoc: use import stability marker in display Fixes #135078
2025-01-13Assert that Instance::try_resolve is only used on body-like thingsMichael Goulet-2/+3
2025-01-12Rollup merge of #135401 - joshtriplett:empty-expected, r=lqdGuillaume Gomez-0/+0
Remove some empty expected files to fix blessing https://github.com/rust-lang/rust/pull/134808 made --bless remove empty expected files. Remove some empty files that were causing noise in unrelated `--bless` invocations.
2025-01-12Rollup merge of #135348 - aDotInTheVoid:pathspathspaths, r=GuillaumeGomezGuillaume Gomez-0/+11
rustdoc-json: Include items in stripped modules in `Crate::paths`. Closes #135309 When we're running rustdoc-json, we should err on the side of adding more items to `Cache::paths`, as that directly becomes `Crate::paths` in the output. r? ``@GuillaumeGomez.`` Best reviewed commit-by-commit.
2025-01-12Fix ICE-130779Shunpoco-0/+45
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Remove solved crashesShunpoco-27/+0
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Fix ICE-133117Shunpoco-0/+48
If all subcandidates have never-pattern, we should assign false_edge_start_block to the parent candidate if it doesn't have. merge_trivial_subcandidates does so, but if the candidate has guard it returns before the assignment. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Fix ICE-133063Shunpoco-0/+58
If all subcandidates have never-pattern, the parent candidate should have otherwise_block because some methods expect the candidate has the block. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Auto merge of #135402 - matthiaskrgr:rollup-cz7hs13, r=matthiaskrgrbors-118/+285
Rollup of 6 pull requests Successful merges: - #129259 (Add inherent versions of MaybeUninit methods for slices) - #135374 (Suggest typo fix when trait path expression is typo'ed) - #135377 (Make MIR cleanup for functions with impossible predicates into a real MIR pass) - #135378 (Remove a bunch of diagnostic stashing that doesn't do anything) - #135397 (compiletest: add erroneous variant to `string_enum`s conversions error) - #135398 (add more crash tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12on Windows, consistently pass ZST by-refRalf Jung-7/+7
2025-01-12Suggest the smallest fitting type insteadspore-2/+2
Changes the behavior of the `overflowing_literals` suggestion so that it always suggest the smallest type regardless of the original type size.
2025-01-12Add comment on case to mark the original issuespore-2/+2
2025-01-12Rollup merge of #135398 - matthiaskrgr:crash, r=lqdMatthias Krüger-0/+56
add more crash tests try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl
2025-01-12Rollup merge of #135378 - compiler-errors:unnecessary-stashing, r=chenyukangMatthias Krüger-118/+159
Remove a bunch of diagnostic stashing that doesn't do anything #121669 removed a bunch of conditional diagnostic stashing/canceling, but left around the `steal` calls which just emitted the error eagerly instead of canceling the diagnostic. I think that these no-op `steal` calls don't do much and are confusing to encounter, so let's remove them. The net effect is: 1. We emit more duplicated errors, since stashing has the side effect of duplicating diagnostics. This is not a big deal, since outside of `-Zdeduplicate-diagnostics=no`, the errors are already being deduplicated by the compiler. 2. It changes the order of diagnostics, since we're no longer stashing and then later stealing the errors. I don't think this matters much for the changes that the UI test suite manifests, and it makes these errors less order dependent.
2025-01-12Rollup merge of #135377 - compiler-errors:impossible-step, r=oli-obkMatthias Krüger-0/+40
Make MIR cleanup for functions with impossible predicates into a real MIR pass It's a bit jarring to see the body of a function with an impossible-to-satisfy where clause suddenly go to a single `unreachable` terminator when looking at the MIR dump output in order, and I discovered it's because we manually replace the body outside of a MIR pass. Let's make it into a fully flegded MIR pass so it's more clear what it's doing and when it's being applied.
2025-01-12Rollup merge of #135374 - compiler-errors:typo-trait-method, r=fee1-deadMatthias Krüger-0/+30
Suggest typo fix when trait path expression is typo'ed When users write something like `Default::defualt()` (notice the typo), failure to resolve the erroneous `defualt` item will cause resolution + lowering to interpret this as a type-dependent path whose self type is `Default` which is a trait object without `dyn`, rather than a trait function like `<_ as Default>::default()`. Try to provide a bit of guidance in this situation when we can detect the typo. Fixes https://github.com/rust-lang/rust/issues/135349
2025-01-12Remove some empty expected files to fix blessingJosh Triplett-0/+0
https://github.com/rust-lang/rust/pull/134808 made --bless remove empty expected files. Remove some empty files that were causing noise in unrelated `--bless` invocations.
2025-01-12add more crash testsMatthias Krüger-0/+56
2025-01-12Auto merge of #135396 - matthiaskrgr:rollup-zublg1c, r=matthiaskrgrbors-2/+44
Rollup of 5 pull requests Successful merges: - #135266 (Remove emsdk version update from 1.84.0 relnotes) - #135364 (Cleanup `suggest_binding_for_closure_capture_self` diag in borrowck) - #135375 (allow rustdoc-js tests to be run at stage0) - #135379 (Make (unstable API) `UniqueRc` invariant for soundness) - #135389 (compiletest: include stage0-sysroot libstd dylib in recipe dylib search path) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Rollup merge of #135379 - steffahn:uniquerc-invariant, r=Mark-SimulacrumMatthias Krüger-0/+42
Make (unstable API) `UniqueRc` invariant for soundness Add test case from https://github.com/rust-lang/rust/pull/133572#issuecomment-2543007164 (comment in review of `UniqueArc`), and fix the issue for `UniqueRc`.
2025-01-12Rollup merge of #135364 - yotamofek:borrowck-diag-fix, r=compiler-errorsMatthias Krüger-2/+2
Cleanup `suggest_binding_for_closure_capture_self` diag in borrowck Mostly grammar fix/improvement, but also a small cleanup to use iterators instead of for loops for collecting into a vector.
2025-01-12remove location-insensitive ICE testRémy Rakic-14/+0
2025-01-12re-added regression test for #122638Ross Sullivan-0/+78
2025-01-11Address PR feedbackScott McMurray-4/+43
2025-01-11[mir-opt] simplify `Repeat`s that don't actually repeat the operandScott McMurray-12/+72
2025-01-11rustdoc: use import stability marker in displayMichael Howell-0/+18
2025-01-11Make UniqueRc invariant for soundnessFrank Steffahn-0/+42
2025-01-11Make MIR cleanup for functions with impossible predicates into a real MIR passMichael Goulet-0/+40
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-118/+159
2025-01-11Suggest typos when trait path expression is typodMichael Goulet-0/+30
2025-01-11re-add --disable-minification to rustdocbinarycat-1/+1
this also makes the rust.docs-minification option work as advertised in config.toml nothing fancy this time, this is intended to be perma-unstable. it's only really here for the benefit of rustdoc devs. mitegates https://github.com/rust-lang/rust/issues/135345
2025-01-11Rollup merge of #135314 - compiler-errors:eagerly-mono-closures, r=wesleywiserMatthias Krüger-3/+16
Eagerly collect mono items for non-generic closures This allows users to use `-Zprint-mono-items=eager` to eagerly monomorphize closures and coroutine bodies, in case they want to inspect the LLVM or ASM for those items. `-Zprint-mono-items`, which used to be called `-Zprint-trans-items`, was originally added in https://github.com/rust-lang/rust/pull/30900: > Eager mode is meant to be used in conjunction with incremental compilation > where a stable set of translation items is more important than a minimal > one. Thus, eager mode will instantiate drop-glue for every drop-able type > in the crate, even of no drop call for that type exists (yet). It will > also instantiate default implementations of trait methods, something that > otherwise is only done on demand. Although it remains an unstable option, its purpose has somewhat expanded since then, and as far as I can tell it's generally useful for cases when you want to monomorphize as many items as possible, even if they're unreachable. Specifically, it's useful for debugging since you can look at the codegen'd body of a function, since we don't emit items that are not reachable in monomorphization. And even more specifically, it would be very to monomorphize the coroutine body of an async fn, since those you can't easily call those without a runtime. This PR enables this usecase since we now monomorphize `DefKind::Closure`.
2025-01-11Rollup merge of #134776 - estebank:vanilla-ice, r=lcnrMatthias Krüger-0/+28
Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Slight tweak to output to remove unnecessary context as a drive-by. Fix #134764.
2025-01-11Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubileeMatthias Krüger-0/+87
add `-Zmin-function-alignment` tracking issue: https://github.com/rust-lang/rust/issues/82232 This PR adds the `-Zmin-function-alignment=<align>` flag, that specifies a minimum alignment for all* functions. ### Motivation This feature is requested by RfL [here](https://github.com/rust-lang/rust/issues/128830): > i.e. the equivalents of `-fmin-function-alignment` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fmin-function-alignment_003dn), Clang does not support it) / `-falign-functions` ([GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-falign-functions), [Clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-falign-functions)). > > For the Linux kernel, the behavior wanted is that of GCC's `-fmin-function-alignment` and Clang's `-falign-functions`, i.e. align all functions, including cold functions. > > There is [`feature(fn_align)`](https://github.com/rust-lang/rust/issues/82232), but we need to do it globally. ### Behavior The `fn_align` feature does not have an RFC. It was decided at the time that it would not be necessary, but maybe we feel differently about that now? In any case, here are the semantics of this flag: - `-Zmin-function-alignment=<align>` specifies the minimum alignment of all* functions - the `#[repr(align(<align>))]` attribute can be used to override the function alignment on a per-function basis: when `-Zmin-function-alignment` is specified, the attribute's value is only used when it is higher than the value passed to `-Zmin-function-alignment`. - the target may decide to use a higher value (e.g. on x86_64 the minimum that LLVM generates is 16) - The highest supported alignment in rust is `2^29`: I checked a bunch of targets, and they all emit the `.p2align 29` directive for targets that align functions at all (some GPU stuff does not have function alignment). *: Only with `build-std` would the minimum alignment also be applied to `std` functions. --- cc `@ojeda` r? `@workingjubilee` you were active on the tracking issue
2025-01-11improve clunky grammar in borrowck diagnosticYotam Ofek-2/+2
2025-01-11Auto merge of #135357 - jhpratt:rollup-gs00yt3, r=jhprattbors-22/+49
Rollup of 6 pull requests Successful merges: - #134074 (bootstrap: `std::io::ErrorKind::CrossesDevices` is finally stable) - #135236 (Update a bunch of library types for MCP807) - #135301 (re-add a warning for old master branch, but with much simpler logic) - #135324 (Initial fs module for uefi) - #135326 (support target specific `optimized-compiler-builtins`) - #135347 (Use `NonNull::without_provenance` within the standard library) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-11Rollup merge of #135236 - scottmcm:more-mcp807-library-updates, r=ChrisDentonJacob Pratt-22/+49
Update a bunch of library types for MCP807 This greatly reduces the number of places that actually use the `rustc_layout_scalar_valid_range_*` attributes down to just 3: ``` library/core\src\ptr\non_null.rs 68:#[rustc_layout_scalar_valid_range_start(1)] library/core\src\num\niche_types.rs 19: #[rustc_layout_scalar_valid_range_start($low)] 20: #[rustc_layout_scalar_valid_range_end($high)] ``` Everything else -- PAL Nanoseconds, alloc's `Cap`, niched FDs, etc -- all just wrap those `niche_types` types. r? ghost
2025-01-11Auto merge of #135274 - saethlin:array-repeats, r=compiler-errorsbors-0/+146
Add an InstSimplify for repetitive array expressions I noticed in https://github.com/rust-lang/rust/pull/135068#issuecomment-2569955426 that GVN's implementation of this same transform was quite profitable on the deep-vector benchmark. But of course GVN doesn't run in unoptimized builds, so this is my attempt to write a version of this transform that benefits the deep-vector case and is fast enough to run in InstSimplify. The benchmark suite indicates that this is effective.
2025-01-11Bless new test output (new trait impls in lists of suggestions)Josh Triplett-14/+26
2025-01-11Auto merge of #135258 - oli-obk:push-ktzskvxuwnlt, r=saethlinbors-0/+26
Use llvm.memset.p0i8.* to initialize all same-bytes arrays Similar to #43488 debug builds can now handle `0x0101_u16` and other multi-byte scalars that have all the same bytes (instead of special casing just `0`)
2025-01-11review comments and make test `run-rustfix`Esteban Küber-10/+36
2025-01-11On unused assign lint, detect `mut arg: &Ty` meant to be `arg: &mut Ty`Esteban Küber-1/+6
``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5 | LL | object = &object2; | ^^^^^^ | note: the lint level is defined here --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9 | LL | #![deny(unused_assignments, unused_variables)] | ^^^^^^^^^^^^^^^^^^ help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object2(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` This might be the first thing someone tries to write to mutate the value *behind* an argument, trying to avoid an E0308.
2025-01-11On E0308, detect `mut arg: &Ty` meant to be `arg: &mut Ty`Esteban Küber-3/+5
``` error[E0308]: mismatched types --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14 | LL | fn change_object(mut object: &Object) { | ------- expected due to this parameter type LL | let object2 = Object; LL | object = object2; | ^^^^^^^ expected `&Object`, found `Object` | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` This might be the first thing someone tries to write to mutate the value *behind* an argument. We avoid suggesting `object = &object2;`, as that is less likely to be what was intended.
2025-01-11Add test for `mut arg: &Ty` meant to be `arg: &mut Ty`Esteban Küber-0/+80
This is a mistake I've seen newcomers make where they want to express an "out" argument.
2025-01-11Avoid unnecessary note when type has escaping boundsEsteban Küber-1/+0
2025-01-11Avoid duplicated noteEsteban Küber-1/+0
2025-01-11Account for `for<'a>` types when checking for non-structural type in ↵Esteban Küber-0/+30
constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Fix #134764.
2025-01-10rustdoc-json: Include items in stripped modules in `Crate::paths`.Alona Enraght-Moony-0/+11
2025-01-10add `-Zmin-function-alignment`Folkert de Vries-0/+87
2025-01-10mir_build: check annotated functions w/out callersDavid Wood-53/+112