27 Commits

Author SHA1 Message Date
ash
fa7e474f9c remove FIXME from has_significant_drop, replaced with checking non_region_infer 2025-09-15 13:55:20 -06:00
Stuart Cook
cb271d055e
Rollup merge of #144400 - Kivooeo:issue3, r=jieyouxu
`tests/ui/issues/`: The Issues Strike Back [3/N]

Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895.

r? ```@jieyouxu```
2025-08-08 12:52:49 +10:00
León Orell Valerian Liehr
02ea38cfff
Fortify generic param default checks 2025-08-06 01:26:26 +02:00
Kivooeo
b6e13e3591 comments 2025-08-05 19:34:46 +05:00
Ralf Jung
37ad0776ac
Rollup merge of #144397 - Kivooeo:issue2, r=jieyouxu
`tests/ui/issues/`: The Issues Strike Back [2/N]

Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895.

r? ``@jieyouxu``
2025-08-01 09:59:03 +02:00
Kivooeo
a4a5bf5a71 comments 2025-07-31 21:25:49 +05:00
Oneirical
a924d44115 Rehome tests/ui/issues/ tests [1/?] 2025-07-24 17:01:44 -04:00
Kivooeo
d636a6590c moved 35 tests to organized locations 2025-07-24 17:15:36 +05:00
Matthias Krüger
3d6eb225e2
Rollup merge of #143302 - Kivooeo:tf27, r=tgross35
`tests/ui`: A New Order [27/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
2025-07-11 07:35:18 +02:00
Kivooeo
3ad95cccf9 cleaned up some tests 2025-07-10 18:47:20 +05:00
Kivooeo
0f7a86bb2a cleaned up some tests 2025-07-05 00:50:51 +05:00
Kivooeo
7f2e37fc5c moved & deleted tests
opeq.rs was removed as duplicating test logic in other tests
2025-07-05 00:48:10 +05:00
Kivooeo
e9191ec57e moved tests 2025-07-01 21:42:20 +05:00
Skgland
fb8784585e
fix tidy and bless test 2025-05-05 21:09:31 +02:00
Skgland
7fc84ac964
expand comment 2025-05-05 20:40:44 +02:00
Skgland
4ba683ee52
add a test for issue rust-lang/rust#81317 2025-05-03 22:36:17 +02:00
Esteban Küber
6005619bde In "specify type" suggestion, skip type params that are already known
When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified.

This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible:

```
error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>`
  --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9
   |
LL |     let y = Err(x);
   |         ^   ------ type must be known at this point
   |
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified
   |
LL |     let y: Result<T, _> = Err(x);
   |          ++++++++++++++
```
2025-02-03 19:51:20 +00:00
Ralf Jung
9d9b55cd2b make invalid_type_param_default lint show up in cargo future-compat reports
and remove the feature gate that silenced the lint
2024-07-15 22:05:45 +02:00
Esteban Küber
796be88062 Use fn ptr signature instead of {closure@..} in infer error
When suggesting a type on inference error, do not use `{closure@..}`.
Instead, replace with an appropriate `fn` ptr.

On the error message, use `short_ty_string` and write long types to
disk.

```
error[E0284]: type annotations needed for `Select<{closure@lib.rs:2782:13}, _, Expression<'_>, _>`
  --> crates/lang/src/parser.rs:41:13
   |
41 |         let lit = select! {
   |             ^^^
42 |             Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
   |                                                                                                  ---- type must be known at this point
   |
   = note: the full type name has been written to '/home/gh-estebank/iowo/target/debug/deps/lang-e2d6e25819442273.long-type-4587393693885174369.txt'
   = note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
   |
41 |         let lit: Select<for<'a, 'b> fn(tokens::Token<'_>, &'a mut MapExtra<'_, 'b, _, _>) -> Option<Expression<'_>>, _, Expression<'_>, _> = select! {
   |                +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```

instead of

```
error[E0284]: type annotations needed for `Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _>`
  --> crates/lang/src/parser.rs:41:13
   |
41 |         let lit = select! {
   |             ^^^
42 |             Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
   |                                                                                                  ---- type must be known at this point
   |
   = note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
   |
41 |         let lit: Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _> = select! {
   |                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```

Fix #123630.
2024-04-10 00:41:27 +00:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Matthew Jasper
942e93972d Handle recursion limit for subtype and well-formed predicates 2023-12-01 17:25:02 +00:00
Nilstrieb
41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Esteban Küber
91b9ffeab0 Reorder fullfillment errors to keep more interesting ones first
In `report_fullfillment_errors` push back `T: Sized`, `T: WellFormed`
and coercion errors to the end of the list. The pre-existing
deduplication logic eliminates redundant errors better that way, keeping
the resulting output with fewer errors than before, while also having
more detail.
2023-10-04 02:04:14 +00:00
Trevor Gross
3c9a7491c2 Add a test for PartialEq across Allocators breaking inference (#113283)
Verify that `PartialEq` implementations do not break type inference
when comparing types across different allocators. This catches a
regression in current nightly introduced in 001b081cc1b (alloc: Allow
comparing `Box`s over different allocators")

`Box` is the only type that currently impelements this, but tests are
included for `Rc` and `Arc` to prevent future regresssions.
2023-07-04 05:00:46 -04:00
Michael Howell
3f374128ee diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
Esteban Küber
62ba3e70a1 Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00