summary refs log tree commit diff
path: root/tests/ui/rfcs
AgeCommit message (Collapse)AuthorLines
2024-03-14eagerly instantiate binders to avoid relying on `sub`lcnr-12/+10
2024-03-12Rollup merge of #122343 - compiler-errors:rando, r=fmeaseMatthias Krüger-11/+5
Remove some unnecessary `allow(incomplete_features)` in the test suite A useless change, but I like things to be clean.
2024-03-12Auto merge of #122036 - alexcrichton:test-wasm-with-wasi, r=oli-obkbors-2/+0
Test wasm32-wasip1 in CI, not wasm32-unknown-unknown This commit changes CI to no longer test the `wasm32-unknown-unknown` target and instead test the `wasm32-wasip1` target. There was some discussion of this in a [Zulip thread], and the motivations for this PR are: * Runtime failures on `wasm32-unknown-unknown` print nothing, meaning all you get is "something failed". In contrast `wasm32-wasip1` can print to stdout/stderr. * The unknown-unknown target is missing lots of pieces of libstd, and while `wasm32-wasip1` is also missing some pieces (e.g. threads) it's missing fewer pieces. This means that many more tests can be run. Overall my hope is to improve the debuggability of wasm failures on CI and ideally be a bit less of a maintenance burden. This commit specifically removes the testing of `wasm32-unknown-unknown` and replaces it with testing of `wasm32-wasip1`. Along the way there were a number of other archiectural changes made as well, including: * A new `target.*.runtool` option can now be specified in `config.toml` which is passed as `--runtool` to `compiletest`. This is used to reimplement execution of WebAssembly in a less-wasm-specific fashion. * The default value for `runtool` is an ambiently located WebAssembly runtime found on the system, if any. I've implemented logic for Wasmtime. * Existing testing support for `wasm32-unknown-unknown` and Emscripten has been removed. I'm not aware of Emscripten testing being run any time recently and otherwise `wasm32-wasip1` is in theory the focus now. * I've added a new `//@ needs-threads` directive for `compiletest` and classified a bunch of wasm-ignored tests as needing threads. In theory these tests can run on `wasm32-wasi-preview1-threads`, for example. * I've tried to audit all existing tests that are either `ignore-emscripten` or `ignore-wasm*`. Many now run on `wasm32-wasip1` due to being able to emit error messages, for example. Many are updated with comments as to why they can't run as well. * The `compiletest` output matching for `wasm32-wasip1` automatically uses "match a subset" mode implemented in `compiletest`. This is because WebAssembly runtimes often add extra information on failure, such as the `unreachable` instruction in `panic!`, which isn't able to be matched against the golden output from native platforms. * I've ported most existing `run-make` tests that use custom Node.js wrapper scripts to the new run-make-based-in-Rust infrastructure. To do this I added `wasmparser` as a dependency of `run-make-support` for the various wasm tests to use that parse wasm files. The one test that executed WebAssembly now uses `wasmtime`-the-CLI to execute the test instead. I have not ported over an exception-handling test as Wasmtime doesn't implement this yet. * I've updated the `test` crate to print out timing information for WASI targets as it can do that (gets a previously ignored test now passing). * The `test-various` image now builds a WASI sysroot for the WASI target and additionally downloads a fixed release of Wasmtime, currently the latest one at 18.0.2, and uses that for testing. [Zulip thread]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Have.20wasm.20tests.20ever.20caused.20problems.20on.20CI.3F/near/424317944
2024-03-11Remove some unnecessary allow(incomplete_features)Michael Goulet-11/+5
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-2/+0
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-03-10Ignore tests w/ current/next revisions from compare-mode=next-solverMichael Goulet-2/+3
2024-03-07Merge collect_mod_item_types query into check_well_formedOli Scherer-25/+25
2024-03-07Use the same collection order as check_mod_type_wfOli Scherer-2/+2
2024-03-07Merge `check_mod_impl_wf` and `check_mod_type_wf`Oli Scherer-4/+41
2024-03-05Rollup merge of #121894 - RalfJung:const_eval_select, r=oli-obkMatthias Krüger-1/+2
const_eval_select: make it safe but be careful with what we expose on stable for now As this is all still nightly-only I think `````@rust-lang/wg-const-eval````` can do that without involving t-lang. r? `````@oli-obk````` Cc `````@Nilstrieb````` -- the updated version of your RFC would basically say that we can remove these comments about not making behavior differences visible in stable `const fn`
2024-03-03Use root obligation on E0277 for some casesEsteban Küber-2/+2
When encountering trait bound errors that satisfy some heuristics that tell us that the relevant trait for the user comes from the root obligation and not the current obligation, we use the root predicate for the main message. This allows to talk about "X doesn't implement Pattern<'_>" over the most specific case that just happened to fail, like "char doesn't implement Fn(&mut char)" in `tests/ui/traits/suggest-dereferences/root-obligation.rs` The heuristics are: - the type of the leaf predicate is (roughly) the same as the type from the root predicate, as a proxy for "we care about the root" - the leaf trait and the root trait are different, so as to avoid talking about `&mut T: Trait` and instead remain talking about `T: Trait` instead - the root trait is not `Unsize`, as to avoid talking about it in `tests/ui/coercion/coerce-issue-49593-box-never.rs`. ``` error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) | -------- ^ the trait `Fn<(char,)>` is not implemented for `&char`, which is required by `&char: Pattern<'_>` | | | required by a bound introduced by this call | = note: required for `&char` to implement `FnOnce<(char,)>` = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) | + ``` Fix #79359, fix #119983, fix #118779, cc #118415 (the suggestion needs to change).
2024-03-02const_eval_select: make it safe but be careful with what we expose on stable ↵Ralf Jung-1/+2
for now
2024-02-27rename RPITIT from opaque to syntheticMichael Goulet-2/+2
2024-02-23Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errorsMatthias Krüger-6/+6
mark `min_exhaustive_patterns` as complete This is step 1 and 2 of my [proposal](https://github.com/rust-lang/rust/issues/119612#issuecomment-1918097361) to move `min_exhaustive_patterns` forward. The vast majority of in-tree use cases of `exhaustive_patterns` are covered by `min_exhaustive_patterns`. There are a few cases that still require `exhaustive_patterns` in tests and they're all behind references. r? ``@ghost``
2024-02-23Rollup merge of #121434 - nnethercote:fix-121208-fallout, r=lcnrMatthias Krüger-0/+35
Fix #121208 fallout #121208 converted lots of delayed bugs to bugs. Unsurprisingly, there were a few invalid conversion found via fuzzing. r? `@lcnr`
2024-02-23Revert some `span_bug`s to `span_delayed_bug`.Nicholas Nethercote-0/+35
Fixes #121410. Fixes #121414. Fixes #121418. Fixes #121431.
2024-02-22Rollup merge of #121386 - oli-obk:no_higher_ranked_opaques, r=lcnrMatthias Krüger-0/+249
test that we do not support higher-ranked regions in opaque type inference We already do all the right checks in `check_opaque_type_parameter_valid`, and we have done so since at least 2 years. I collected the tests from https://github.com/rust-lang/rust/pull/116935 and https://github.com/rust-lang/rust/pull/100503 and added some more cc https://github.com/rust-lang/rust/issues/96146 r? `@lcnr`
2024-02-22Remove some annotations that just specify the defaultOli Scherer-17/+13
2024-02-22Avoid emitting type mismatches against `{type error}`Oli Scherer-53/+14
2024-02-21test that we do not support higher-ranked regions in opaque type inferenceAli MJ Al-Nasrawy-0/+292
2024-02-20Support async trait bounds in macrosMichael Goulet-19/+34
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-36/+164
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-400/+400
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-2/+12
2024-02-13Prefer `min_exhaustive_patterns` in testsNadrieril-6/+6
2024-02-08Rollup merge of #120775 - Nadrieril:more-min_exh_pats, r=compiler-errorsMatthias Krüger-3/+3
Make `min_exhaustive_patterns` match `exhaustive_patterns` better Split off from https://github.com/rust-lang/rust/pull/120742. There remained two edge cases where `min_exhaustive_patterns` wasn't behaving like `exhaustive_patterns`. This fixes them, and tests the feature in a bunch more cases. I essentially went through all uses of `exhaustive_patterns` to see which ones would be interesting to compare between the two features. r? `@compiler-errors`
2024-02-08Test `min_exhaustive_patterns` in more casesNadrieril-3/+3
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-47/+213
2024-02-07Update testsr0cky-1/+31
2024-02-05update the tracking issue for structural match violationsRalf Jung-36/+36
and bless a test I missed
2024-02-05show indirect_structural_match and pointer_structural_match in future compat ↵Ralf Jung-0/+242
reports
2024-02-05get rid of nontrivial_structural_match lint and custom_eq const qualifRalf Jung-2/+2
2024-02-05Rollup merge of #116284 - RalfJung:no-nan-match, r=cjgillotMatthias Krüger-46/+132
make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern These arms would never be hit anyway, so the pattern makes little sense. We have had a future-compat lint against float matches in general for a *long* time, so I hope we can get away with immediately making this a hard error. This is part of implementing https://github.com/rust-lang/rfcs/pull/3535. Closes https://github.com/rust-lang/rust/issues/41620 by removing the lint. https://github.com/rust-lang/reference/pull/1456 updates the reference to match.
2024-02-04Rollup merge of #120556 - fmease:improve-unused-generic-param-diags, r=oli-obkMatthias Krüger-2/+2
Improve the diagnostics for unused generic parameters * Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases * Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense * Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable * Still keep the error codes distinct (for now) * Naturally leads to better diagnostics for E0091 r? ```@oli-obk``` (to ballast your review load :P) or compiler
2024-02-01Improve the diagnostics for unused generic parametersLeón Orell Valerian Liehr-2/+2
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-3/+3
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-26add test checking behavior of matching on floats, and NaNs in constsRalf Jung-11/+30
2024-01-26remove illegal_floating_point_literal_pattern lintRalf Jung-11/+10
2024-01-26make matching on NaN a hard errorRalf Jung-46/+114
2024-01-26Auto merge of #116167 - RalfJung:structural-eq, r=lcnrbors-120/+31
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good. Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-24remove StructuralEq traitRalf Jung-120/+31
2024-01-23Remove track_errors entirelyOli Scherer-12/+2
2024-01-22Rollup merge of #120104 - Nadrieril:never-pat-diverges, r=compiler-errorsMatthias Krüger-0/+262
never_patterns: Count `!` bindings as diverging A binding that is a never pattern is not reachable, hence counts as diverging code. This allows in particular `fn foo(!: Void) -> SomeType {}` to typecheck. r? ``@compiler-errors``
2024-01-22Auto merge of #120242 - matthiaskrgr:rollup-a93yj3i, r=matthiaskrgrbors-0/+75
Rollup of 10 pull requests Successful merges: - #117910 (Refactor uses of `objc_msgSend` to no longer have clashing definitions) - #118639 (Undeprecate lint `unstable_features` and make use of it in the compiler) - #119801 (Fix deallocation with wrong allocator in (A)Rc::from_box_in) - #120058 (bootstrap: improvements for compiler builds) - #120059 (Make generic const type mismatches not hide trait impls from the trait solver) - #120097 (Report unreachable subpatterns consistently) - #120137 (Validate AggregateKind types in MIR) - #120164 (`maybe_lint_impl_trait`: separate `is_downgradable` from `is_object_safe`) - #120181 (Allow any `const` expression blocks in `thread_local!`) - #120218 (rustfmt: Check that a token can begin a nonterminal kind before parsing it as a macro arg) r? `@ghost` `@rustbot` modify labels: rollup
2024-01-22Rollup merge of #120097 - Nadrieril:consistent_unreachable_subpats, ↵Matthias Krüger-0/+75
r=compiler-errors Report unreachable subpatterns consistently We weren't reporting unreachable subpatterns in function arguments and `let` expressions. This wasn't very important, but never patterns make it more relevant: a user might write `let (Ok(x) | Err(!)) = ...` in a case where `let Ok(x) = ...` is accepted, so we should report the `Err(!)` as redundant. r? ```@compiler-errors```
2024-01-22Test async fnNadrieril-0/+34
2024-01-22Use `-> !` to test divergenceNadrieril-5/+8
2024-01-22Rollup merge of #119948 - asquared31415:unsafe_op_in_unsafe_fn_fix, r=TaKO8KiMatthias Krüger-0/+1
Make `unsafe_op_in_unsafe_fn` migrated in edition 2024 fixes rust-lang/rust#119823
2024-01-22Never pattern in `let` statement divergesNadrieril-15/+27
2024-01-22Never pattern in function arguments divergesNadrieril-0/+213