about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-06-30Migrate tests to use `-Znext-solver`Deadbeef-428/+503
2024-06-30Make `feature(effects)` require `-Znext-solver`Deadbeef-0/+24
2024-06-30Auto merge of #127024 - cjgillot:jump-prof, r=oli-obkbors-1/+2
Avoid cloning jump threading state when possible The current implementation of jump threading passes most of its time cloning its state. This PR attempts to avoid such clones by special-casing the last predecessor when recursing through a terminator. This is not optimal, but a first step while I refactor the state data structure to be sparse. The two other commits are drive-by. Fixes https://github.com/rust-lang/rust/issues/116721 r? `@oli-obk`
2024-06-30Auto merge of #127133 - matthiaskrgr:rollup-jxkp3yf, r=matthiaskrgrbors-41/+183
Rollup of 9 pull requests Successful merges: - #123237 (Various rustc_codegen_ssa cleanups) - #126960 (Improve error message in tidy) - #127002 (Implement `x perf` as a separate tool) - #127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel) - #127106 (Improve unsafe extern blocks diagnostics) - #127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.) - #127114 (fix: prefer `(*p).clone` to `p.clone` if the `p` is a raw pointer) - #127118 (Show `used attribute`'s kind for user when find it isn't applied to a `static` variable.) - #127122 (Remove uneccessary condition in `div_ceil`) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-30Auto merge of #126869 - matthiaskrgr:kaboom, r=jieyouxubors-0/+142
crashes: add more tests
2024-06-29Rollup merge of #127118 - surechen:fix_126789, r=jieyouxuMatthias Krüger-0/+24
Show `used attribute`'s kind for user when find it isn't applied to a `static` variable. For example : ```rust extern "C" { #[used] //~ ERROR attribute must be applied to a `static` variable static FOO: i32; // show the kind of this item to help user understand why the error is reported. } ``` fixes #126789
2024-06-29Rollup merge of #127114 - linyihai:issue-126863, r=NadrierilMatthias Krüger-24/+6
fix: prefer `(*p).clone` to `p.clone` if the `p` is a raw pointer Fixes https://github.com/rust-lang/rust/issues/126863 I wonder if there is a better way to solve the regression problem of this test case: `tests/ui/borrowck/issue-20801.rs`. It's okay to drop the dereference symbol in this scenario. But it's not correct in https://github.com/rust-lang/rust/issues/126863 ``` help: consider removing the dereference here | 5 - let inner: String = *p; 5 + let inner: String = p; ``` I haven't found out how to tell if clone pointer is allowed, i.e. no type mismatch occurs
2024-06-29Rollup merge of #127110 - surechen:fix_125488_06, r=compiler-errorsMatthias Krüger-10/+109
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ``` fixes #125488 r? ``@pnkfelix``
2024-06-29Rollup merge of #127106 - ↵Matthias Krüger-5/+12
spastorino:improve-unsafe-extern-blocks-diagnostics, r=compiler-errors Improve unsafe extern blocks diagnostics Closes #126327 For this code: ```rust extern { pub fn foo(); pub safe fn bar(); } ``` We get ... ``` error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ | help: add unsafe to this `extern` block | 1 | unsafe extern { | ++++++ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. ``` And then making the extern block unsafe, we get ... ``` error: extern block cannot be declared unsafe --> test.rs:1:1 | 1 | unsafe extern { | ^^^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. ``` r? ``@compiler-errors``
2024-06-29Rollup merge of #127081 - Kobzol:lld-test, r=onur-ozkanMatthias Krüger-2/+32
Add a run-make test that LLD is not being used by default on the x64 beta/stable channel https://github.com/rust-lang/rust/pull/126701 showed that the handling of `lld` in bootstrap is currently not ideal. While it would be nice to refactor it eventually, we should also make sure that we have a test that checks that `lld` is not used (yet!) by default on the x64 Linux stable channel. CC ``@lqd`` r? ``@onur-ozkan``
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-1333/+1401
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-29Auto merge of #126801 - Oneirical:seek-and-testroy, r=Kobzolbors-75/+151
Migrate `remap-path-prefix`, `debug-assertions` and `emit-stack-sizes` `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 OSX/MSVC try jobs. try-job: aarch64-apple try-job: x86_64-msvc
2024-06-29Avoid suggesting to add unsafe when the extern block is already unsafeSantiago Pastorino-5/+0
2024-06-29Rollup merge of #127116 - GuillaumeGomez:run-make-return-non-c-like-enum, ↵Guillaume Gomez-8/+18
r=Kobzol,jieyouxu Migrate `run-make/return-non-c-like-enum` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@Kobzol`
2024-06-29Rollup merge of #127041 - GuillaumeGomez:run-make-override-aliased-flags, ↵Guillaume Gomez-23/+24
r=Kobzol Migrate `run-make/override-aliased-flags` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. I voluntarily didn't use the helper methods to make it obvious what's tested. r? `@jieyouxu`
2024-06-29Rollup merge of #126995 - Oneirical:test-friends-forever, r=KobzolGuillaume Gomez-28/+75
Migrate `pretty-print-with-dep-file`, `pretty-print-to-file` and `libtest-padding` `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).
2024-06-29Rollup merge of #126805 - Oneirical:weaves-of-testiny, r=KobzolGuillaume Gomez-40/+67
Migrate `pdb-alt-path`, `mismatching-target-triples` and `mingw-export-call-convention` `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 MSVC try jobs. try-job: x86_64-mingw try-job: x86_64-msvc
2024-06-29fix: prefer `(*p).clone` to `p.clone` if the `p` is a raw pointerLin Yihai-24/+6
2024-06-29Show `used attribute`'s kind for user when find it isn't applied to a ↵surechen-0/+24
`static` variable. fixes #126789
2024-06-29Move crash test.Camille GILLOT-1/+2
2024-06-29Migrate `run-make/return-non-c-like-enum` to `rmake.rs`Guillaume Gomez-8/+18
2024-06-29Migrate `run-make/override-aliased-flags` to `rmake.rs`Guillaume Gomez-23/+24
2024-06-29Auto merge of #127111 - matthiaskrgr:rollup-ybzkuuv, r=matthiaskrgrbors-93/+208
Rollup of 9 pull requests Successful merges: - #126822 (Bootstrap command refactoring: port more `Command` usages to `BootstrapCmd` (step 2)) - #126835 (Simplifications in match lowering) - #126953 (std: separate TLS key creation from TLS access) - #127045 (Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated) - #127075 (rustc_data_structures: Explicitly check for 64-bit atomics support) - #127101 (remove redundant match statement from dataflow const prop) - #127102 (Rename fuchsia builder and bump Fuchsia) - #127103 (Move binder and polarity parsing into `parse_generic_ty_bound`) - #127108 (unify `dylib` and `bin_helpers` and create `shared_helpers::parse_value_from_args`) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-29Add a run-make test that LLD is not being used by default on the x64 ↵Jakub Beránek-2/+32
beta/stable channel
2024-06-29crashes: add more testsMatthias Krüger-0/+142
2024-06-29Rollup merge of #127103 - compiler-errors:tighten-trait-bound-parsing, r=fmeaseMatthias Krüger-0/+142
Move binder and polarity parsing into `parse_generic_ty_bound` Let's pull out the parts of #127054 which just: 1. Make the parsing code less confusing 2. Fix `?use<>` (to correctly be denied) 3. Improve `T: for<'a> 'a` diagnostics This should have no user-facing effects on stable parsing. r? fmease
2024-06-29Rollup merge of #126835 - Nadrieril:reify-decision-tree, r=matthewjasperMatthias Krüger-93/+66
Simplifications in match lowering A series of small simplifications and deduplications in the MIR lowering of patterns. r? ````@matthewjasper````
2024-06-29Auto merge of #126698 - Oneirical:tessteract, r=Kobzolbors-57/+113
Migrate `unknown-mod-stdin`, `issue-68794-textrel-on-minimal-lib`, `raw-dylib-cross-compilation` and `used-cdylib-macos` `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). Seriously needs OSX/Windows try-jobs. If it fails, restore `only-linux` in `textrel-on-minimal-lib` and try again. try-job: x86_64-mingw try-job: x86_64-msvc
2024-06-29Fix a error suggestion for E0121 when using placeholder _ as return types on ↵surechen-10/+109
function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ```
2024-06-29Auto merge of #127096 - matthiaskrgr:rollup-kh7e0rh, r=matthiaskrgrbors-94/+746
Rollup of 11 pull requests Successful merges: - #123714 (Add test for fn pointer duplication.) - #124091 (Update AST validation module docs) - #127015 (Switch back `non_local_definitions` lint to allow-by-default) - #127016 (docs: check if the disambiguator matches its suffix) - #127029 (Fix Markdown tables in platform-support.md) - #127032 (Enable const casting for `f16` and `f128`) - #127055 (Mark Hasher::finish as #[must_use]) - #127068 (Stall computing instance for drop shim until it has no unsubstituted const params) - #127070 (add () to the marker_impls macro for ConstParamTy) - #127071 (Remove (deprecated & unstable) {to,from}_bits pointer methods) - #127078 (Enable full tools and profiler for LoongArch Linux targets) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-28Add feature diagnostic for unsafe_extern_blocksSantiago Pastorino-0/+12
2024-06-28Auto merge of #127099 - lqd:revert-126938, r=compiler-errorsbors-0/+9
Revert "miri: make sure we can find link_section statics even for the local crate" This PR reverts #126938 as [requested by its author](https://github.com/rust-lang/rust/issues/127052#issuecomment-2196793473), to fix the #127052 regression. Fixes #127052 We should probably improve the [`used` rmake test(s)](https://github.com/rust-lang/rust/blob/57931e50409f9365791f7923a68f9ae1ec301c4c/tests/run-make/used/rmake.rs#L7) in the future, but this should do for now.
2024-06-28Move binder and polarity parsing into parse_generic_ty_boundMichael Goulet-0/+142
2024-06-28add non-regression test for issue 127052Rémy Rakic-0/+9
2024-06-28rmeta_contains functions for remap-path-prefixOneirical-11/+40
2024-06-28rewrite used-cdylib-macos to rmakeOneirical-15/+21
2024-06-28rewrite raw-dylib-cross-compilation to rmakeOneirical-20/+41
2024-06-28rewrite and slightly rename issue-68794-textrel-on-minimal-libOneirical-18/+30
2024-06-28rewrite unknown-mod-stdin to rmakeOneirical-8/+25
2024-06-28Rollup merge of #127068 - compiler-errors:stall-drop, r=BoxyUwUMatthias Krüger-0/+18
Stall computing instance for drop shim until it has no unsubstituted const params Do not inline the drop shim for types that still have unsubstituted const params. ## Why? #127030 ICEs because it tries to inline the drop shim for a type with an unsubstituted const param. In order to generate this shim, this requires calling the drop shim builder, which invokes the trait solver to compute whether constituent types need drop (since we compute if a type is copy to disqualify any `Drop` behavior): https://github.com/rust-lang/rust/blob/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/compiler/rustc_mir_dataflow/src/elaborate_drops.rs#L378 However, since we don't keep the param-env of the instance we resolved the item for, we use the wrong param-env: https://github.com/rust-lang/rust/blob/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/compiler/rustc_mir_transform/src/shim.rs#L278 (which is the param-env of `std::ptr::drop_in_place`) This param-env is notably missing `ConstParamHasTy` predicates, and since we removed the type from consts in https://github.com/rust-lang/rust/pull/125958, we literally cannot prove these predicates in this (relatively) empty param-env. This currently happens in places like the MIR inliner, but may happen elsewhere such as in lints that resolve terminators. ## What? We force the inliner to not consider calls for `drop_in_place` for types that have unsubstituted const params. ## So what? This may negatively affect MIR inlining, but I doubt this matters in practice, and fixes a beta regression, so let's fix it. I will look into approaches for fixing this in a more maintainable way, perhaps delaying the creation of drop shim bodies until codegen (like how intrinsics work).
2024-06-28Rollup merge of #127016 - bvanjoi:fix-126986, r=GuillaumeGomezMatthias Krüger-0/+528
docs: check if the disambiguator matches its suffix Fixes #126986 This PR makes it will not continue resolving when its disambiguator doesn't match the suffix format.
2024-06-28Rollup merge of #127015 - Urgau:non_local_def-tmp-allow, r=lqdMatthias Krüger-94/+168
Switch back `non_local_definitions` lint to allow-by-default This PR switch back (again) the `non_local_definitions` lint to allow-by-default as T-lang is requesting some (major) changes in the lint inner workings in https://github.com/rust-lang/rust/issues/126768#issuecomment-2192634762. This PR will need to be beta-backported, as the lint is currently warn-by-default in beta.
2024-06-28Rollup merge of #123714 - cjgillot:static-fnptr, r=wesleywiserMatthias Krüger-0/+32
Add test for fn pointer duplication. I managed to make it fail when removing provenance checks in GVN. cc https://github.com/rust-lang/rust/issues/123670 r? ``````@oli-obk``````
2024-06-28Auto merge of #126701 - onur-ozkan:build-lld-if-enabled, r=Kobzolbors-1/+3
ignore `llvm::Lld` if lld is not enabled People are having trouble ([ref. zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/MSVC.20Runtime.20mismatch.20when.20building.20LLD)) when they don't want to build `lld` for their custom distribution tarballs even with `lld = false` in their config.toml. This is because it is not controlled by `lld_enabled` flag. This change ensures that `llvm:Lld` is controlled by lld configuration. Additionally, `lld = true` is set by default for dist profile, because we have been building it all along and this maintains that behavior. try-job: x86_64-mingw
2024-06-28Auto merge of #127000 - Oneirical:no-test-for-the-wicked, r=Kobzolbors-72/+79
Migrate `use-suggestions-rust-2018`, `overwrite-input`, `lto-dylib-dep` and `many-crates-but-no-match` `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).
2024-06-28update `run-make/windows-safeseh` compiletest headeronur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28address review commentsDeadbeef-15/+9
2024-06-28rewrite emit-stack-sizes to rmakeOneirical-12/+24
2024-06-28rewrite debug-assertions to rmakeOneirical-33/+40
2024-06-28rewrite remap-path-prefix to rmakeOneirical-30/+58