about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-11-04Rollup merge of #132559 - bvanjoi:fix-132534, r=compiler-errorsMatthias Krüger-0/+58
find the generic container rather than simply looking up for the assoc with const arg Fixes #132534 This issue is caused by mismatched generic parameters. Previously, it tried to find `T` in `trait X`, but after this change, it will find `T` in `fn a`. r? `@compiler-errors` as this assertion was introduced by you.
2024-11-04Rollup merge of #132544 - dianne:unstable-library-feature-backticks, ↵Matthias Krüger-427/+429
r=compiler-errors Use backticks instead of single quotes for library feature names in diagnostics This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since `DiagSymbolList` also displays symbols using backticks.
2024-11-04Auto merge of #132275 - compiler-errors:deref-effects, r=fee1-deadbors-129/+97
Register `~const` preds for `Deref` adjustments in HIR typeck This doesn't *do* anything yet, since `Deref` and `DerefMut` aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing `~const` in HIR typeck. r? fee1-dead
2024-11-04Fix minicore, add tests based off of itMichael Goulet-129/+97
2024-11-04find the generic container rather than simply looking up for the assoc with ↵bohan-0/+58
const arg
2024-11-03Rollup merge of #132565 - bjorn3:less_target_name_dependence, r=workingjubileeJubilee-12/+0
Reduce dependence on the target name The target name can be anything with custom target specs. Matching on fields inside the target spec is much more robust than matching on the target name. Also remove the unused is_builtin target spec field.
2024-11-03Rollup merge of #132516 - taiki-e:asm-ui, r=workingjubileeJubilee-50/+1387
Add bad-reg inline assembly ui test for RISC-V and s390x https://github.com/rust-lang/rust/pull/131341#discussion_r1826555431 > Btw, such unsupported registers are present in most architectures, but only aarch64/arm64ec, x86_64, and not yet merged [sparc/sparc64](https://github.com/rust-lang/rust/pull/132472/files#diff-02aebda3376c2b020265137f9ce2c387669ca5cfecd7d60494275c2387db5114) (and powerpc/powerpc64 by this PR) currently have ui tests for them. I plan to add tests for other arches later. Starting with RISC-V and s390x, which I'm familiar with and relatively easy to check for correctness. (Relevant rustc code are supported_types/def_regs/overlapping_regs in [compiler/rustc_target/src/asm/riscv.rs](https://github.com/rust-lang/rust/blob/588a4203508ed7c76750c96b482641261630ed36/compiler/rustc_target/src/asm/riscv.rs) and [compiler/rustc_target/src/asm/s390x.rs](https://github.com/rust-lang/rust/blob/588a4203508ed7c76750c96b482641261630ed36/compiler/rustc_target/src/asm/s390x.rs).) r? workingjubilee `@rustbot` label +A-inline-assembly
2024-11-03Don't test new error messages with the stage 0 compilerdianne-6/+8
This commit can be reverted once the error message changes are in the stage 0 compiler.
2024-11-03use backticks instead of single quotes when reporting "use of unstable ↵dianne-421/+421
library feature" This is consistent with all other diagnostics I could find containing features and enables the use of `DiagSymbolList` for generalizing diagnostics for unstable library features to multiple features.
2024-11-03Remove is_builtin target spec fieldbjorn3-12/+0
It is unused.
2024-11-03Rename the FIXMEs, remove a few that dont matter anymoreMichael Goulet-26/+24
2024-11-03Yeet effects featureMichael Goulet-764/+283
2024-11-03Gate checking ~const bounds on const_trait_implMichael Goulet-181/+22
2024-11-03Auto merge of #132555 - matthiaskrgr:rollup-2d79661, r=matthiaskrgrbors-13/+131
Rollup of 15 pull requests Successful merges: - #129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - #131377 (Add LowerExp and UpperExp implementations to NonZero) - #132393 (Docs: added brief colon explanation) - #132437 (coverage: Regression test for inlining into an uninstrumented crate) - #132499 (unicode_data.rs: show command for generating file) - #132503 (better test for const HashMap; remove const_hash leftovers) - #132511 (stabilize const_arguments_as_str) - #132520 (NFC add known bug nr to test) - #132522 (make codegen help output more consistent) - #132523 (Added regression test for generics index out of bounds) - #132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - #132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - #132540 (Do not format generic consts) - #132543 (add and update some crashtests) - #132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-03Auto merge of #132514 - Zalathar:print-target-cpus, r=jieyouxubors-0/+39
Port most of `--print=target-cpus` to Rust The logic and formatting needed by `--print=target-cpus` has historically been carried out in C++ code. Originally it used `printf` to write directly to the console, but later it switched over to writing to a `std::ostringstream` and then passing its buffer to a callback function pointer. This PR replaces that C++ code with a very simple function that writes a list of CPU names to a `&RustString`, with the rest of the logic and formatting being handled by ordinary safe Rust code.
2024-11-03Rollup merge of #132543 - cyrgani:master, r=compiler-errorsMatthias Krüger-12/+28
add and update some crashtests Adds tests for #126268 and #132126, updates it for #131050.
2024-11-03Rollup merge of #132528 - compiler-errors:fallback-sugg-opt, r=jieyouxuMatthias Krüger-0/+13
Use `*_opt` typeck results fns to not ICE in fallback suggestion Self-explanatory. Fixes #132517.
2024-11-03Rollup merge of #132523 - ranger-ross:test-issue-117446, r=compiler-errorsMatthias Krüger-0/+57
Added regression test for generics index out of bounds Added a regression test for #117446 This ICE was fixed in Rust 1.75 but a regression test was never added. This PR adds a UI test with a reduced version of the original bug report that does not rely on external crates.
2024-11-03Rollup merge of #132520 - matthiaskrgr:knobu, r=jieyouxuMatthias Krüger-1/+1
NFC add known bug nr to test r? ```````@jieyouxu```````
2024-11-03Rollup merge of #132437 - Zalathar:inline-mixed-regression, r=jieyouxuMatthias Krüger-0/+32
coverage: Regression test for inlining into an uninstrumented crate Regression test for #132395, after I was able to figure out a simple way to reproduce it. See also #132436. In addition to confirming that there is no ICE, this test also demonstrates that the affected code is undercounted, because executing the inlined copy doesn't increment coverage counters.
2024-11-03Move tests/ui/abi/riscv32e-registers.rs to tests/ui/asm/riscvTaiki Endo-162/+168
This also adds comments explaining the difference to bad-reg.rs.
2024-11-03Fix typo in tests/auxiliary/minicore.rsTaiki Endo-1/+1
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2024-11-02Auto merge of #125579 - Noratrieb:print-host, r=davidtwcobors-1/+7
Add `--print host-tuple` to print host target tuple People often parse `-vV` output to get to the host tuple, which is annoying to do. It's easier to just get it directly. I called it "host-tuple" instead of "host" because it's clearer that it's just the target name. I'm open to different names, but I think this one is fine. a quick GitHub search for `'^host` reveals many instances of people doing the parsing, for example: https://github.com/japaric/xargo/blob/68e0ca57cd90837fe02f262f074182f9cfeb6227/README.md?plain=1#L369 https://github.com/taiki-e/setup-cross-toolchain-action/blob/0e38473b0c562d6db19a98d3ec20a80f7ac189ae/main.sh#L96 https://github.com/taiki-e/cargo-llvm-cov/blob/8a3553b86551eabf9c30c060b1f72a5bbccb98c6/README.md?plain=1#L625 https://github.com/SiliconLabs/cpc-nvm3/blob/43f3ec39709b30700ef7f39d91fa647974323bf1/do.sh#L35 needs a compiler FCP. I could also do an MCP but I think just an FCP here makes the most sense.
2024-11-02add and update some crashtestscyrgani-12/+28
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-02Auto merge of #132147 - estebank:long-types-2, r=davidtwcobors-197/+292
Tweak E0277 output when a candidate is available *Follow up to #132086.* Go from ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>`, which is required by `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` | = help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>` = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console ``` to ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound ... 11 | ws.then(parser.map(|_| ())) | --------------------------- return type was inferred to be `Then<Ignored<..., ...>, ..., ..., ..., ...>` here | = help: the trait `ParserSealed<'_, &_, (), Full<_, _, _>>` is not implemented for `Then<Ignored<..., ...>, ..., ..., ..., ...>` but trait `ParserSealed<'_, &'a _, ((), ()), Full<_, _, _>>` is implemented for it = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-df9d52be87eada65.long-type-1337037744507305372.txt' = note: consider using `--verbose` to print the full type name to the console ``` * Remove redundant wording * Introduce trait diff highlighting logic and use it * Fix incorrect "long type written to path" logic (can be split off) * Point at tail expression in more cases in E0277 * Avoid long primary span labels in E0277 by moving them to a `help` Fix #132013. There are individual commits that can be their own PR. If the review load is too big, happy to split them off.
2024-11-02fix testsEsteban Küber-10/+11
Paths in CI can be longer than in devs' machines.
2024-11-02Use opt functions to not ICE in fallback suggestionMichael Goulet-0/+13
2024-11-02Adjust tests to use minicore and reblessJieyou Xu-194/+178
2024-11-02Add more core stubs to `minicore`Jieyou Xu-2/+11
`f32`, `f64` and `asm!` macro.
2024-11-02Add bad-reg inline assembly ui test for RISC-V and s390xTaiki Endo-0/+1338
2024-11-02Added regression test for 117446ranger-ross-0/+57
2024-11-02Add a run-make test for same-arch `--print=target-cpus`Zalathar-0/+39
2024-11-02NFC add known bug nr to testMatthias Krüger-1/+1
2024-11-02coverage: Regression test for inlining into an uninstrumented crateZalathar-0/+32
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-02Account for negative bounds in E0277 note and suggestionEsteban Küber-18/+0
Do not suggest `#[derive(Copy)]` when we wanted a `!Copy` type. Do not say "`Copy` is not implemented for `T` but `Copy` is". Do not talk about `Trait` having no implementations when `!Trait` was desired.
2024-11-02On long E0277 primary span label, move it to a `help`Esteban Küber-78/+88
Long span labels don't read well.
2024-11-02Point at tail expression on rpit E0277Esteban Küber-21/+93
``` error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}: Coroutine` is not satisfied --> $DIR/gen_block_is_coro.rs:6:13 | LL | fn foo() -> impl Coroutine<Yield = u32, Return = ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` LL | gen { yield 42 } | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` here ``` The secondary span label is new.
2024-11-02Trim output of E0277 in some casesEsteban Küber-32/+0
Remove default note for "trait is not implemented" in favor of the more colorful diff output from the previous commit. Removes duplicated output.