summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-08-23Disable MIR SROA optimization by defaultWesley Wiser-212/+292
Turn off the MIR SROA optimization by default to prevent incorrect debuginfo generation and rustc ICEs caused by invalid LLVM IR being created. Related to #115113
2023-08-17Monomorphize constants before inspecting themOli Scherer-1/+4
(cherry picked from commit c7428d50520446ccd44ca89bbbf4ff7a4725570e)
2023-08-17Permit pre-evaluated constants in simd_shuffleOli Scherer-0/+19
(cherry picked from commit 9e5a67e57f715ec5eda915db1261cdf4c4a04642)
2023-08-17Upgrade std to gimli 0.28.0Josh Stone-1/+10
2023-08-12Auto merge of #114726 - DianQK:beta, r=cuviperbors-0/+27
[beta] Update LLVM to resolve a miscompilation found in 114312. Related issue: #114312 . After the master updates the LLVM, we will add the same test cases. In the meantime, close the issue.
2023-08-12[beta-1.72] Update LLVM to resolve a miscompilation found in 114312.DianQK-3/+3
2023-08-12[beta-1.72] Pre-commit test for issue 114312.DianQK-0/+27
We show this miscompilation in this commit.
2023-08-11fix proc-macro test added here to solely be exercised as a build product for ↵Felix S. Klock II-0/+4
the host. thus we should no longer see test failures for e.g. wasm32 target. (cherry picked from commit a2a7f27fd2548874b203f1f577f64cf61627e0a5)
2023-08-11Update tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rsFelix S Klock II-1/+1
fix to test as proposed by wesleywiser Co-authored-by: Wesley Wiser <wwiser@gmail.com> (cherry picked from commit 5881e5f88d9245ef9259ca600b32af80d5972a7f)
2023-08-11regression test for issue 111888.Felix S. Klock II-0/+29
(cherry picked from commit 7a0e2ee133dacf4e2dbda64a316a95746a469c58)
2023-08-11lint/ctypes: only try normalizeDavid Wood-0/+12
Now that this lint runs on any external-ABI fn-ptr, normalization won't always succeed, so use `try_normalize_erasing_regions` instead. Signed-off-by: David Wood <david@davidtw.co> (cherry picked from commit 09434a2575cee12b241c516ad91f21d4b4f9c3fd)
2023-08-11lint/ctypes: allow `()` within typesDavid Wood-51/+72
Consider `()` within types to be FFI-safe, and `()` to be FFI-safe as a return type (incl. when in a transparent newtype). Signed-off-by: David Wood <david@davidtw.co> (cherry picked from commit 24f90fdd2654e9c5437a684d3a72a4e70826a985)
2023-08-11lint: refactor `check_variant_for_ffi`David Wood-8/+4
Simplify this function a bit, it was quite hard to reason about. Signed-off-by: David Wood <david@davidtw.co> (cherry picked from commit 99b1897cf640d5f6dac74416761c9b3c75e1ef7a)
2023-08-11lint/ctypes: stricter `()` return type checksDavid Wood-0/+80
`()` is normally FFI-unsafe, but is FFI-safe when used as a return type. It is also desirable that a transparent newtype for `()` is FFI-safe when used as a return type. In order to support this, when an type was deemed FFI-unsafe, because of a `()` type, and was used in return type - then the type was considered FFI-safe. However, this was the wrong approach - it didn't check that the `()` was part of a transparent newtype! The consequence of this is that the presence of a `()` type in a more complex return type would make it the entire type be considered safe (as long as the `()` type was the first that the lint found) - which is obviously incorrect. Instead, this logic is removed, and a unit return type or a transparent wrapper around a unit is checked for directly for functions and fn-ptrs. Signed-off-by: David Wood <david@davidtw.co> (cherry picked from commit f53cef31f5ea41c9a5ab8e5335637a6873b9f0b5)
2023-08-11Temporarily switch invalid_reference_casting lint to allow-by-defaultUrgau-22/+18
(cherry picked from commit f25ad54a4d0febbcb2b7e951835228b7b2320b49)
2023-08-11Rename cast_ref_to_mut lint to invalid_reference_castingUrgau-12/+12
(cherry picked from commit 3dbbf23e29516218863bda29d2983bd503e6b7fd)
2023-07-21allow opaques to be defined by trait queriesAli MJ Al-Nasrawy-0/+31
2023-07-08Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgrbors-243/+768
Rollup of 6 pull requests Successful merges: - #113005 (Don't call `query_normalize` when reporting similar impls) - #113064 (std: edit [T]::swap docs) - #113138 (Add release notes for 1.71.0) - #113217 (resolve typerelative ctors to adt) - #113254 (Use consistent formatting in Readme) - #113482 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-08Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, r=notriddleMatthias Krüger-6/+6
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle``
2023-07-08Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, ↵Matthias Krüger-1/+497
r=cjgillot resolve typerelative ctors to adt Associated issue: #110508 r? ``@spastorino``
2023-07-08Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillotMatthias Krüger-236/+265
Don't call `query_normalize` when reporting similar impls Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well. The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions: ``` error[E0277]: the trait bound `[X; 35]: Default` is not satisfied --> /home/gh-compiler-errors/test.rs:4:5 | 4 | <[X; 35] as Default>::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]` | = help: the following other types implement trait `Default`: &[T] &mut [T] [T; 32] [T; core::::array::{impl#30}::{constant#0}] [T; core::::array::{impl#31}::{constant#0}] [T; core::::array::{impl#32}::{constant#0}] [T; core::::array::{impl#33}::{constant#0}] [T; core::::array::{impl#34}::{constant#0}] and 27 others ``` So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
2023-07-08Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgrbors-47/+87
Rollup of 7 pull requests Successful merges: - #112931 (Enable zlib in LLVM on aarch64-apple-darwin) - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test) - #113173 (CI: include workflow name in concurrency group) - #113335 (Reveal opaques in new solver) - #113390 (CGU formation tweaks) - #113399 (Structurally normalize again for byte string lit pat checking) - #113412 (Add basic types to SMIR) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-08Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obkMatthias Krüger-0/+36
Add basic types to SMIR Still incomplete but I think this can be merged and we can keep iterating over it. r? ``@oli-obk``
2023-07-08Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obkMatthias Krüger-12/+1
Structurally normalize again for byte string lit pat checking We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic. Fixes rust-lang/trait-system-refactor-initiative#38 [^1]: #112428 [^2]: #112993 [^3]: #113086
2023-07-08Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnrMatthias Krüger-35/+49
Reveal opaques in new solver We were testing against the wrong reveal mode :fearful: Also a couple of misc commits that I don't want to really put in separate prs r? ``@lcnr``
2023-07-08Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiserMatthias Krüger-0/+1
tests: unset `RUSTC_LOG_COLOR` in a test Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output.
2023-07-08Auto merge of #113376 - ↵bors-70/+70
Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane. This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing. r? oli-obk
2023-07-08Migrate GUI colors test to original CSS color formatGuillaume Gomez-6/+6
2023-07-08Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errorsbors-0/+165
Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-07Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errorsMichael Goulet-0/+83
Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors``
2023-07-07Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errorsMichael Goulet-0/+51
Remove unused from_method from rustc_on_unimplemented Fixes #113439 `on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed. r? ``@compiler-errors``
2023-07-07Don't ICE in resolve_bound_vars when associated return-type bounds are in ↵Michael Goulet-0/+31
bad positions
2023-07-07Avoid calling report_forbidden_specialization for RPITITsSantiago Pastorino-0/+83
2023-07-07Add regression test for RPITITsSantiago Pastorino-0/+51
2023-07-07Add Float ty to SMIRSantiago Pastorino-2/+8
2023-07-07Add Uint ty to SMIRSantiago Pastorino-2/+6
2023-07-07Add Int ty to SMIRSantiago Pastorino-2/+6
2023-07-07Add Char ty to SMIRSantiago Pastorino-2/+6
2023-07-07Add rustc_ty_to_ty basic testsSantiago Pastorino-0/+18
2023-07-07Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`Nilstrieb-70/+70
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-07Normalize opaques during codegen in new solverMichael Goulet-3/+45
2023-07-07Mark more hanging new-solver testsMichael Goulet-2/+4
2023-07-07Remove an AFIT test that isn't an AFIT testMichael Goulet-30/+0
2023-07-07Treat closures as part of their parentOli Scherer-16/+9
2023-07-07Fix one layer of closures not being able to constrain opaque typesOli Scherer-15/+1
2023-07-07Add regression testOli Scherer-0/+38
2023-07-07Remove normalization from `opaque_types_defined_by`Oli Scherer-17/+62
2023-07-07Require TAITs to be mentioned in the signatures of functions that register ↵Oli Scherer-147/+574
hidden types for them
2023-07-06Rollup merge of #113421 - spastorino:new-rpitit-29, r=compiler-errorsMichael Goulet-0/+38
Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys Fixes #113403 Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types. r? `@compiler-errors`
2023-07-06Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errorsMichael Goulet-0/+97
Avoid calling item_name for RPITIT Fixes #113405 r? `@compiler-errors`