about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-11-02Add `--print host-triple`Noratrieb-1/+7
People often parse `-vV` output to get to the host triple, which is annoying to do. It's easier to just get it directly.
2024-11-02move deployment-target tests to print-requestNilstrieb-0/+0
2024-11-02Rollup merge of #132481 - lukas-code:doc-stab3, r=GuillaumeGomezMatthias Krüger-14/+100
rustdoc: skip stability inheritance for some item kinds For some item kinds it's incorrect to inherit their parent's stability, because they might be accessible without referring to the parent directly -- This PR removes the stability inheritance for these items and reverts their displayed stability to that before https://github.com/rust-lang/rust/pull/130798. Impl items, both inherent and trait impls, have a stability, but it is ignored when checking for enabled features. However, impl items are automatically unstable if they're nested inside an unstable module -- this caused the children of impl to inherit the instability and lead to https://github.com/rust-lang/rust/issues/132440. Furthermore, for associated items only the stability of the associated item itself is checked and not that of its parent impl. This is true even for trait impls and we have [relied on this behavior in the standard library in the past](https://doc.rust-lang.org/1.37.0/std/slice/trait.SliceConcatExt.html#tymethod.concat), so these also shouldn't inherit the impl's stability. I've also removed the stability inheritance for primitives and keywords so that viewing e.g. [the `i32` docs on `core`](https://doc.rust-lang.org/nightly/core/primitive.i32.html) will no longer show "since 1.6.0". Note that we currently don't annotate stability for the keyword docs, but if we start doing so in the future then this is probably more correct. fixes (after backport) https://github.com/rust-lang/rust/issues/132440
2024-11-02Auto merge of #132497 - matthiaskrgr:rollup-gaskcn0, r=matthiaskrgrbors-16/+147
Rollup of 11 pull requests Successful merges: - #131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`) - #132170 (Add a Few Codegen Tests) - #132333 (rust_analyzer_helix.toml: add library/ manifest) - #132398 (Add a couple of intra-doc links to str) - #132411 (CI: switch dist-x86_64-musl to free runner) - #132453 (Also treat `impl` definition parent as transparent regarding modules) - #132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test) - #132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`) - #132466 (Account for late-bound depth when capturing all opaque lifetimes.) - #132471 (Add a bunch of mailmap entries) - #132488 (Remove or fix some more `FIXME(async_closure)`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-02Rollup merge of #132488 - compiler-errors:more-fixmes-bye, r=jieyouxuMatthias Krüger-15/+24
Remove or fix some more `FIXME(async_closure)` Self-explanatory
2024-11-02Rollup merge of #132466 - cjgillot:opaque-late, r=compiler-errorsMatthias Krüger-0/+13
Account for late-bound depth when capturing all opaque lifetimes. Fixes https://github.com/rust-lang/rust/issues/132429 r? ````@compiler-errors````
2024-11-02Rollup merge of #132457 - taiki-e:needless-feature, r=workingjubileeMatthias Krüger-1/+1
Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test inline assembly is already stable on this architecture.
2024-11-02Rollup merge of #132453 - Urgau:non_local_defs-impl-mod-transparent, r=jieyouxuMatthias Krüger-0/+64
Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. ``````@rustbot`````` label +L-non_local_definitions Fixes *(after beta-backport)* #132427 cc ``````@leighmcculloch`````` r? ``````@jieyouxu``````
2024-11-02Rollup merge of #132170 - veera-sivarajan:codegen-tests, r=jieyouxuMatthias Krüger-0/+45
Add a Few Codegen Tests Closes #86109 Closes #64219 Those issues somehow got fixed over time. So, this PR adds a couple of codegen tests to ensure we don't regress in the future.
2024-11-02Add a Few Codegen TestsVeera-0/+45
2024-11-02Auto merge of #132352 - DianQK:llvm/19.1.3, r=nikicbors-0/+12
Update LLVM to 19.1.3 Closes #131031. r? nikic
2024-11-02Remove or fix some FIXME(async_closure)Michael Goulet-15/+24
2024-11-02rustdoc: skip stability inheritance for some item kindsLukas Markeffsky-14/+100
2024-11-01Auto merge of #132470 - GuillaumeGomez:rollup-1a1mkmp, r=GuillaumeGomezbors-52/+400
Rollup of 14 pull requests Successful merges: - #131829 (Remove support for `-Zprofile` (gcov-style coverage instrumentation)) - #132369 (style-guide: Only use the new binop heuristic for assignments) - #132383 (Implement suggestion for never type fallback lints) - #132413 (update offset_of! docs to reflect the stabilization of nesting) - #132438 (Remove unncessary option for default rust-analyzer setting) - #132439 (Add `f16` and `f128` to `invalid_nan_comparison`) - #132444 (rustdoc: Directly use rustc_abi instead of reexports) - #132445 (Cleanup attributes around unchecked shifts and unchecked negation in const) - #132448 (Add missing backtick) - #132450 (Show actual MIR when MIR building forgot to terminate block) - #132451 (remove some unnecessary rustc_allow_const_fn_unstable) - #132455 (make const_alloc_layout feature gate only about functions that are already stable) - #132456 (Move remaining inline assembly test files into asm directory) - #132459 (feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-02Rollup merge of #132456 - taiki-e:test-asm-dir, r=jieyouxuGuillaume Gomez-0/+0
Move remaining inline assembly test files into asm directory Before: ``` tests/assembly/asm/* tests/assembly/asm-comments.rs tests/codegen/asm-target-clobbers.rs tests/codegen/asm-goto.rs tests/codegen/asm-maybe-uninit.rs tests/codegen/asm-msp430-clobbers.rs tests/codegen/asm-options.rs tests/codegen/asm-clobbers.rs tests/codegen/asm-may_unwind.rs tests/codegen/asm-arm64ec-clobbers.rs tests/codegen/asm-powerpc-clobbers.rs tests/codegen/asm-sanitize-llvm.rs tests/codegen/asm-s390x-clobbers.rs tests/codegen/asm-clobber_abi.rs tests/codegen/asm-multiple-options.rs tests/codegen/global_asm.rs tests/codegen/global_asm_include.rs tests/codegen/global_asm_x2.rs tests/ui/asm/* ``` After: ``` tests/assembly/asm/* tests/codegen/asm/* tests/ui/asm/* ``` I moved the remaining standalone test files into the asm directory, and then either removed the "asm-" suffix or for x86-specific registers tests replaced the "asm-" suffix with the "x86-" suffix. (Then I noticed that there is no test for clobber_abi for already stabilized aarch64, arm, riscv, and loongarch64 asm... I don't believe there is a problem like https://github.com/rust-lang/rust/pull/131332, but I plan to add tests for them later.) r? ``@Amanieu`` ``@rustbot`` label +A-inline-assembly
2024-11-02Rollup merge of #132448 - chengehe:master, r=NoratriebGuillaume Gomez-1/+1
Add missing backtick
2024-11-02Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxuGuillaume Gomez-29/+295
Add `f16` and `f128` to `invalid_nan_comparison` Currently `f32_nan` and `f64_nan` are used to provide the `invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`, hook these up so the new float types get the same lints.
2024-11-02Rollup merge of #132383 - compiler-errors:never-type-fallback-sugg, ↵Guillaume Gomez-0/+104
r=WaffleLapkin Implement suggestion for never type fallback lints r? ```@WaffleLapkin``` Just opening this up for vibes; it's not done yet. I'd still like to make this suggestable in a few more cases before merge: - [x] Try to annotate `_` -> `()` - [x] Try to annotate local variables if they're un-annotated: `let x = ...` -> `let x: () = ...` - [x] Try to annotate the self type of a `Trait::method()` -> `<() as Trait>::method()`. The only other case we may want to suggest is a missing turbofish, like `f()` -> `f::<()>()`. That may be possible, but seems overly annoying. This partly addresses https://github.com/rust-lang/rust/issues/132358; the other half of fixing that would be to make the error message a bit better, perhaps just special casing the `?` operator 🤔 I don't think I'll do that part.
2024-11-02Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukangGuillaume Gomez-22/+0
Remove support for `-Zprofile` (gcov-style coverage instrumentation) Tracking issue: #42524 MCP: https://github.com/rust-lang/compiler-team/issues/798 --- This PR removes the unstable `-Zprofile` flag, which enables ”gcov-style” coverage instrumentation, along with its associated `-Zprofile-emit` configuration flag. (The profile flag predates and is almost entirely separate from the stable `-Cinstrument-coverage` flag.) Notably, the `-Zprofile` flag: - Is largely untested in-tree, having only one run-make test that does not check whether its output is correct or useful. - Has no known maintainer. - Has seen no push towards stabilization. - Has at least one severe regression reported in 2022 that apparently remains unaddressed. - #100125 - Is confusingly named, since it appears to be more about coverage than performance profiling, and has nothing to do with PGO. - Is fundamentally limited by relying on counters auto-inserted by LLVM, with no knowledge of Rust beyond debuginfo.
2024-11-01Use more minimized test.Camille GILLOT-38/+6
2024-11-01Account for late-bound depth when capturing all opaque lifetimes.Camille GILLOT-0/+45
2024-11-01Completely deny calling functions with const conditions in MIR const check ↵Michael Goulet-23/+107
unless const_trait_impl is enabled This will help us make sure that we never leak any conditionally const functions into stable.
2024-11-01Double-check conditional constness in MIRMichael Goulet-3/+10
To prevent any conditional constness from leaking through during MIR lowering
2024-11-01Also treat `impl` definition parent as transparent regarding modulesUrgau-0/+64
2024-11-01Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline ↵Taiki Endo-1/+1
assembly test
2024-11-01Move remaining inline assembly test files into asm directoryTaiki Endo-0/+0
2024-11-01Add missing backtickchengehe-1/+1
2024-10-31Add `f16` and `f128` to `invalid_nan_comparison`Trevor Gross-29/+295
Currently `f32_nan` and `f64_nan` are used to provide the `invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`, hook these up so the new float types get the same lints.
2024-11-01And also suggest for qpathsMichael Goulet-0/+72
2024-11-01And locals tooMichael Goulet-6/+14
2024-11-01Suggest adding self type to methodMichael Goulet-0/+12
2024-11-01Suggest annotations for never type fallbackMichael Goulet-0/+12
2024-10-31Rollup merge of #132357 - m-ou-se:explicit-abi, r=compiler-errorsJubilee-6/+3
Improve missing_abi lint This is for the migration lint for https://github.com/rust-lang/rfcs/pull/3722 It is not yet marked as an edition migration lint, because `Edition2027` doesn't exist yet. The lint now includes a machine applicable suggestion: ``` warning: extern declarations without an explicit ABI are deprecated --> src/main.rs:3:1 | 3 | extern fn a() {} | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` | ```
2024-10-31Rollup merge of #132209 - compiler-errors:modifiers, r=fmeaseJubilee-38/+84
Fix validation when lowering `?` trait bounds Pass the unlowered (`rustc_hir`) polarity to `lower_poly_trait_ref`. This allows us to actually *validate* that generic args are actually valid on `?Trait` paths. This actually regressed in #113671 because that PR changed the behavior where we were inadvertently re-lowering paths as `BoundPolarity::Positive`, which was also coincidentally the only place we were enforcing the generics on `?Trait` paths were correct.
2024-10-31Rollup merge of #131168 - madsmtm:target-info-psx-os, r=davidtwcoJubilee-3/+3
Fix `target_os` for `mipsel-sony-psx` Previously set to `target_os = "none"` and `target_env = "psx"` in [the PR introducing the target](https://github.com/rust-lang/rust/pull/102689/), but although the Playstation 1 is _close_ to a bare metal target in some regards, it's still very much an operating system, so we should instead set `target_os = "psx"`. This also matches the `mipsel-sony-psp` target, which sets `target_os = "psp"`. CC target maintainer ``@ayrtonm.`` If there's any code out there that uses `cfg(target_env = "psx")`, they can use `cfg(any(target_os = "psx", target_env = "psx"))` until they bump their MSRV to a version where this is fully fixed.
2024-10-31Auto merge of #132356 - jieyouxu:unsound-simplify_aggregate_to_copy, ↵bors-42/+189
r=cjgillot,DianQK Mark `simplify_aggregate_to_copy` mir-opt as unsound Mark the `simplify_aggregate_to_copy` mir-opt added in #128299 as unsound as it seems to miscompile the MCVE reported in https://github.com/rust-lang/rust/issues/132353. The mir-opt can be re-enabled once this case is fixed. ```rs fn pop_min(mut score2head: Vec<Option<usize>>) -> Option<usize> { loop { if let Some(col) = score2head[0] { score2head[0] = None; return Some(col); } } } fn main() { let min = pop_min(vec![Some(1)]); println!("min: {:?}", min); // panic happens here on beta in release mode // but not in debug mode min.unwrap(); } ``` This MCVE is included as a `run-pass` ui regression test in the first commit. I built the ui test with a nightly manually, and can reproduce the behavioral difference with `-C opt-level=0` and `-C opt-level=1`. Locally, this ui test will fail unless it was run on a compiler built with the second commit marking the mir-opt as unsound thus disabling it by default. This PR **partially reverts** commit e7386b3, reversing changes made to 02b1be1. The mir-opt implementation is just marked as unsound but **not** reverted to make reland reviews easier. Test changes are **reverted if they were not pure additions**. Tests added by the original PR received `-Z unsound-mir-opts` compile-flags. cc `@DianQK` `@cjgillot` (PR author and reviewer of #128299)
2024-10-31tests: use minicore in `tests/ui/abi/compatibility.rs` as an example许杰友 Jieyou Xu (Joe)-74/+28
2024-10-31tests/ui: add `minicore` compiletest self-test许杰友 Jieyou Xu (Joe)-0/+20
2024-10-31tests/codegen: add `minicore` compiletest self-test许杰友 Jieyou Xu (Joe)-0/+20
2024-10-31tests/assembly: add `minicore` compiletest self-test许杰友 Jieyou Xu (Joe)-0/+5
Check that `minicore` cannot be used with `run-{pass,fail}` tests.
2024-10-31minicore: add minimal minicore test auxiliary许杰友 Jieyou Xu (Joe)-0/+77
The initial `minicore` is intentionally super minimal and contains an incomplete subset of `core` items, and explicitly not items from `alloc` or `std`-only items.
2024-10-31Update tests.Mara Bos-6/+3
2024-10-31Auto merge of #132384 - matthiaskrgr:rollup-0ze5wc4, r=matthiaskrgrbors-34/+68
Rollup of 4 pull requests Successful merges: - #132347 (Remove `ValueAnalysis` and `ValueAnalysisWrapper`.) - #132365 (pass `RUSTC_HOST_FLAGS` at once without the for loop) - #132366 (Do not enforce `~const` constness effects in typeck if `rustc_do_not_const_check`) - #132376 (Annotate `input` reference tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-31Add a mir-opt GVN test for #128299许杰友 Jieyou Xu (Joe)-0/+104
Co-authored-by: DianQK <dianqk@dianqk.net>
2024-10-31Mark `simplify_aggregate_to_copy` mir-opt as unsound许杰友 Jieyou Xu (Joe)-42/+60
Co-authored-by: DianQK <dianqk@dianqk.net>
2024-10-31Add a regression test for #132353许杰友 Jieyou Xu (Joe)-0/+25
To catch at least one pattern that was miscompiled. The test is a minimization of the MCVE reported in <https://github.com/rust-lang/rust/issues/132353>.
2024-10-31Rollup merge of #132376 - ehuss:reference-input, r=traviscrossMatthias Krüger-33/+55
Annotate `input` reference tests This adds test annotations for rules in the [input chapter](https://doc.rust-lang.org/nightly/reference/input-format.html) of the reference.
2024-10-31Rollup merge of #132366 - compiler-errors:do-not-const-check, r=fee1-deadMatthias Krüger-1/+13
Do not enforce `~const` constness effects in typeck if `rustc_do_not_const_check` Fixes a slight inconsistency between HIR and MIR enforcement of `~const` :D r? `@rust-lang/project-const-traits`
2024-10-31Auto merge of #131186 - compiler-errors:precise-capturing-borrowck, r=estebankbors-0/+521
Try to point out when edition 2024 lifetime capture rules cause borrowck issues Lifetime capture rules in 2024 are modified to capture more lifetimes, which sometimes lead to some non-local borrowck errors. This PR attempts to link these back together with a useful note pointing out the capture rule changes. This is not a blocking concern, but I'd appreciate feedback (though, again, I'd like to stress that I don't want to block this PR on this): I'm worried about this note drowning in the sea of other diagnostics that borrowck emits. I was tempted to change the level of the note to `.span_warn` just so it would show up in a different color. Thoughts? Fixes #130545 Opening as a draft first since it's stacked on #131183. r? `@ghost`
2024-10-31Try to point out when edition 2024 lifetime capture rules cause borrowck issuesMichael Goulet-0/+521