Commit Graph

138 Commits

Author SHA1 Message Date
im-lunex
92196db866 add regression tests for the fn sig ice
* add regression tests for the fn sig ice
* add issuelinks in on top of the tests
* regenerate stderr snapshots
2026-08-10 21:16:34 +00:00
im-lunex
0d75b8c356 fix ICE in suggest_add_reference_to_arg for non-callable items 2026-08-06 16:36:39 +06:00
Jacob Pratt
ab0ec83890 Rollup merge of #159531 - zedddie:gsoc-batch-28-meow, r=Kivooeo
Reorganize `tests/ui/issues` [28/N]

Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues)

r? Kivooeo
@Teapot4195
2026-07-23 19:18:41 -04:00
Jacob Pratt
e1d8ba6e3b Rollup merge of #159307 - TorinAsakura:fix/builtin-attribute-value-diagnostics, r=petrochenkov
Improve cross-namespace name diagnostics

Close rust-lang/rust#86290

Cross-namespace name matches now use the ordinary missing-name diagnostic while preserving its error code and suggestions. The diagnostic adds a note identifying the item found in another namespace, while same-namespace wrong-kind diagnostics remain unchanged.

The UI expectations cover cross-namespace combinations across the resolver suite, including preservation of existing suggestions.
2026-07-20 23:38:00 -04:00
Andrew Ghostuhin
30bc6d2f06 fix: improve missing value diagnostics for built-in attributes 2026-07-21 01:03:16 +03:00
zedddie
6d6092cd52 bless batch 2026-07-18 18:57:06 +02:00
zedddie
377748d283 move batch 2026-07-18 01:28:15 +02:00
zedddie
e5a03bc9c0 bless batch 2026-07-15 23:38:07 +02:00
zedddie
62fbd98dd9 move batch 2026-07-15 23:38:07 +02:00
bors
c397dae808 Auto merge of #158525 - zedddie:gsoc-batch-17-meow, r=Teapot4195
Reorganize `tests/ui/issues` [17/N]

Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues)

r? Kivooeo
@Teapot4195
2026-07-02 01:09:07 +00:00
Jonathan Pallant
804de70ca0 QNX target renaming
- aarch64-unknown-nto-qnx800 becomes simply aarch64-unknown-qnx
- x86_64-pc-nto-qnx800 becomes simply x86_64-pc-qnx
- references to QNX OS and QNX Neutrino RTOS are replaced with QNX SDP for uniformity
- various nto_qnx modules are named to qnx_sdp to match the above

The new target names are more consistent with those used by the QNX SDP 8.0 toolchain, and reflect a level on ongoing API stability similar to that for macOS and Linux (which simply have minimum supported versions record for their targets).

Once the compiler knows about the new target names, libc and backtrace can be updated to match, and then building libstd for the new targets can be fixed.

With these changes I can run:

```console
$ ./x build library/std --stage 2 --target x86_64-pc-nto-qnx710,aarch64-unknown-nto-qnx710,x86_64-pc-nto-qnx710_iosock,aarch64-unknown-nto-qnx710_iosock,aarch64-unknown-nto-qnx700
$ ./x build library/core --stage 1 --target x86_64-pc-qnx,aarch64-unknown-qnx
```
2026-06-30 09:01:03 +00:00
zedddie
120d0dfbfe bless batch 2026-06-28 16:10:41 +02:00
zedddie
5dbbf76884 move batch 2026-06-28 16:10:33 +02:00
zedddie
f6ac8642ff bless batch 2026-06-27 04:49:49 +02:00
zedddie
ca28237682 move batch 2026-06-27 04:49:48 +02:00
Oli Scherer
a88521a6f6 Reject impl const Trait since the right syntax is const impl Trait now 2026-06-17 17:42:48 +02:00
xmakro
2e128c71c8 Re-enable parallel frontend tests for post-monomorphization errors 2026-06-05 09:52:21 -07:00
León Orell Valerian Liehr
07d015e566 Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression 2026-04-23 22:28:00 +02:00
cyrgani
5bdde380cc move many tests from structs-enums to structs or enum 2026-03-28 12:38:35 +00:00
ywxt
6a0ce16654 Ignore tests for the parallel frontend 2026-03-17 17:39:59 +08:00
Esteban Küber
2e4a420db0 Explain that default field values aren't compatible with type parameters unless going through the type parameter
```
error[E0308]: mismatched types
  --> $DIR/struct-type-parameter-with-default.rs:5:12
   |
LL | struct Foo<T = String> {
   |            ---------- expected this type parameter
LL |     x: T = String::new(),
   |            ^^^^^^^^^^^^^ expected type parameter `T`, found `String`
   |
   = note: expected type parameter `T`
                      found struct `String`
   = note: the type of default fields referencing type parameters can't be assumed inside the struct defining them
```
2026-03-14 20:13:43 +00:00
Kevin Reid
072bd694ad Fix ICEs due to incomplete typechecking on struct literals with syntax errors. 2026-03-05 09:50:13 -08:00
Tony Kan
20768d802e fix(thir): Include NoneWithError in enum struct tail assertion 2026-03-04 02:11:04 -08:00
Kevin Reid
f5d3b158b9 Don’t report missing fields in struct exprs with syntax errors.
This prevents spurious errors when a field is intended to be present
but a preceding syntax error caused it not to be parsed. For example,

    StructName { foo: 1 bar: 2 }

will not successfully parse a field `bar`, and we will report the syntax
error but not the missing field.
2026-02-28 20:32:20 -08:00
delta17920
158410457f renamed few tests 2026-02-04 04:45:52 +00:00
delta17920
ddd8f92c8d moved 8 tests to organized locations 2026-02-04 03:33:25 +00:00
delta17920
a7dea5504b rename various regression tests 2026-02-01 04:09:25 +00:00
delta17920
85ae47f83e moved 7 tests to organized locations 2026-01-31 06:44:24 +00:00
Esteban Küber
9750d22c17 Silence unused type param and inference errors on struct parse error 2026-01-15 21:16:48 +00:00
Kivooeo
84f2854bc3 remove fixme & update stderr files 2025-12-16 13:23:48 +00:00
Matthias Krüger
b826d06771 Rollup merge of #149791 - clubby789:cfg-bool-lints, r=jdonszelmann
Remove uses of `cfg({any()/all()})`

~~This implements the followup warning suggested in https://github.com/rust-lang/rfcs/pull/3695~~
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
https://github.com/rust-lang/rust/pull/149791#issuecomment-3638624348

Tracking issue: https://github.com/rust-lang/rust/issues/131204
2025-12-12 12:19:09 +01:00
Jamie Hill-Daniel
c96ff2d429 Remove uses of cfg(any()/all()) 2025-12-10 23:41:19 +00:00
Esteban Küber
6cd44a472c Make typo in field and name suggestions verbose 2025-12-09 17:29:23 +00:00
xonx4l
4b000cfacd Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
Stuart Cook
06b18db01b Rollup merge of #148735 - chenyukang:yukang-fix-ice-148732, r=nnethercote
Fix ICE caused by invalid spans for shrink_file

Fixes rust-lang/rust#148732

There are two issues in this function:
1. the original issue is caused by a typo error, which is fixed in the first commit
2. another different ice(Patch span `7..7` is beyond the end of buffer `0`) will be reported after fixing the first one, is caused by spans cross file boundaries due to macro expansion. It is fixed in the second commit.

r? `@nnethercote`

edited: also fixes rust-lang/rust#148684, added a new testcase for it in the last commit.
2025-11-13 11:57:07 +11:00
yukang
4a2c9a11d5 skip invalid span in error emitter 2025-11-12 17:47:15 +08:00
yukang
725b213606 add regression test for 148684 2025-11-10 09:23:11 +08:00
León Orell Valerian Liehr
c262920059 Remove #[const_trait] 2025-11-08 07:37:15 +01:00
yukang
c00b4ba5ef Fix ICE caused by associated_item_def_ids on wrong type in resolve diag 2025-10-14 22:39:10 +08:00
Jacob Pratt
82bb6d523b Rollup merge of #145896 - Oneirical:uncountable-integer-10, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-09-13 03:26:02 -04:00
Oneirical
957fa10d50 Add test batch 3 2025-09-12 14:45:12 -04:00
Matthias Krüger
47f1df5ca3 Rollup merge of #145676 - Oneirical:uncountable-integer-9, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-29 12:37:30 +02:00
Oneirical
2dc4638c46 Add test batch 2 2025-08-27 15:06:05 -04:00
Oneirical
2e659f5894 Add test batch 1 2025-08-27 00:23:26 -04:00
Oneirical
75e0263af9 Rehome tests/ui/issues/ tests [5/?] 2025-08-17 13:01:02 -04:00
Esteban Küber
caadc8df35 Do not ICE on private type in field of unresolved struct 2025-08-14 15:59:32 +00:00
bors
21a19c297d Auto merge of #135846 - estebank:non-exhaustive-dfv-ctor-2, r=BoxyUwU
Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
2025-08-10 23:47:25 +00:00
Jacob Pratt
5bd4e832d3 Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxu
Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-10 15:43:52 -04:00
Esteban Küber
464a6b1b4a Detect struct construction with private field in field with default
When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor.rs:25:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the field `field1` you're trying to set has a default value, you can use `..` to use it
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
2025-08-10 19:15:18 +00:00
Oneirical
aa543963c6 Rehome tests/ui/issues/ tests [4/?] 2025-08-10 11:54:15 -04:00