Skip to content

Conversation

@Unique-Usman
Copy link
Contributor

@Unique-Usman Unique-Usman commented Jan 18, 2026

Based on earlier work by León Orell Valerian Liehr.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2026

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Unique-Usman
Copy link
Contributor Author

r? @estebank

@rustbot rustbot assigned estebank and unassigned SparrowLii Jan 18, 2026
@Unique-Usman
Copy link
Contributor Author

Unique-Usman commented Jan 18, 2026

@estebank as discussed last week monday, I have retrieved the issue previous pr by @fmease from #122288 and I will be updating and adding the changes here. Thank you.

@Unique-Usman
Copy link
Contributor Author

r? @estebank

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2026

Requested reviewer is already assigned to this pull request.

Please choose another assignee.

@Unique-Usman Unique-Usman marked this pull request as draft January 18, 2026 08:19
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2026
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier comments are still relevant.

Run ./x.py test tests/ui --bless to update all the .stderr files.

View changes since this review

@Unique-Usman Unique-Usman force-pushed the ua/nostruct branch 2 times, most recently from 93bfefa to f1a6ede Compare January 19, 2026 16:26
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, lets do the parser changes first and the resolve changes in a separate PR.

View changes since this review

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Unique-Usman Unique-Usman marked this pull request as ready for review January 19, 2026 16:57
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 19, 2026
@rust-log-analyzer

This comment has been minimized.

@Unique-Usman
Copy link
Contributor Author

As discussed, lets do the parser changes first and the resolve changes in a separate PR.

View changes since this review

yep, noted.

@Unique-Usman Unique-Usman force-pushed the ua/nostruct branch 2 times, most recently from 4c612ea to a79669d Compare January 20, 2026 13:27
@Unique-Usman Unique-Usman changed the title Recover from struct literals with placeholder path Recover from struct literals with placeholder or empty path Jan 20, 2026
@Unique-Usman
Copy link
Contributor Author

Unique-Usman commented Jan 20, 2026

With this pr.

This

fn main() {
    let _ = {foo: (), bar: {} };
    let _ = _ {foo: (), bar: {} };
    let _ = {foo: ()};
    let _ = _ {foo: ()};
}

previous

error: struct literal body without path
 --> src/main.rs:2:13
  |
2 |     let _ = {foo: (), bar: {} };
  |             ^^^^^^^^^^^^^^^^^^^
  |
help: you might have forgotten to add the struct literal inside the block
  |
2 |     let _ = { SomeStruct {foo: (), bar: {} } };
  |             ++++++++++++                     +

error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{`
 --> src/main.rs:3:15
  |
3 |     let _ = _ {foo: (), bar: {} };
  |               ^ expected one of `.`, `;`, `?`, `else`, or an operator

error: could not compile `playground` (bin "playground") due to 2 previous errors

current

error: struct literal body without path
 --> testing.rs:2:12
  |
2 |     let _ = {foo: (), bar: {} };
  |            ^^^^^^^^^^^^^^^^^^^^
  |            |
  |            absent of struct name for this struct literals
  |            help: add the correct type: `/*Type*/`

error: the placeholder `_` is not allowed for the path in struct literals
 --> testing.rs:3:13
  |
3 |     let _ = _ {foo: (), bar: {} };
  |             ^^^^^^^^^^^^^^^^^^^^^
  |             |
  |             not allowed in struct literals
  |             help: replace it with the correct type: `/*Type*/`

error: struct literal body without path
 --> testing.rs:4:12
  |
4 |     let _ = {foo: ()};
  |            ^^^^^^^^^^
  |            |
  |            absent of struct name for this struct literals
  |            help: add the correct type: `/*Type*/`

error: the placeholder `_` is not allowed for the path in struct literals
 --> testing.rs:5:13
  |
5 |     let _ = _ {foo: ()};
  |             ^^^^^^^^^^^
  |             |
  |             not allowed in struct literals
  |             help: replace it with the correct type: `/*Type*/`

error: aborting due to 4 previous errors

@Unique-Usman Unique-Usman requested a review from estebank January 20, 2026 13:33
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 26, 2026
@estebank
Copy link
Contributor

CC #98282 and #105398. We still need to rely on resolve to get the appropriate type path when possible.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
Recover from struct literals with placeholder or empty path

Based on earlier work by León Orell Valerian Liehr.
@JonathanBrouwer
Copy link
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 26, 2026

Auto build cancelled. Cancelled workflows:

The next pull request likely to be tested is #151701.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #151290 (Recover from struct literals with placeholder or empty path)
 - #148187 (Remove uses of `&mut CmResolver`)
 - #151368 (Rustdoc performance improvements)
 - #151374 (some more rustc_borrowck cleanups)
 - #151536 (Fix sanitizer target builds on CI)
 - #151626 (Remove `Deref<Target = TyCtxt>` from `QueryCtxt`)
 - #151661 (Suggest changing `iter`/`into_iter` when the other was meant)
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
Recover from struct literals with placeholder or empty path

Based on earlier work by León Orell Valerian Liehr.
@JonathanBrouwer
Copy link
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 26, 2026

Auto build cancelled. Cancelled workflows:

The next pull request likely to be tested is #151701.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #151290 (Recover from struct literals with placeholder or empty path)
 - #148187 (Remove uses of `&mut CmResolver`)
 - #151368 (Rustdoc performance improvements)
 - #151374 (some more rustc_borrowck cleanups)
 - #151536 (Fix sanitizer target builds on CI)
 - #151626 (Remove `Deref<Target = TyCtxt>` from `QueryCtxt`)
 - #151661 (Suggest changing `iter`/`into_iter` when the other was meant)
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
Recover from struct literals with placeholder or empty path

Based on earlier work by León Orell Valerian Liehr.
@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 26, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 26, 2026

💔 Test for 6dd470c failed: CI. Failed job:

@JonathanBrouwer
Copy link
Contributor

@bors retry
Spurious

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 26, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #151290 (Recover from struct literals with placeholder or empty path)
 - #148187 (Remove uses of `&mut CmResolver`)
 - #151368 (Rustdoc performance improvements)
 - #151374 (some more rustc_borrowck cleanups)
 - #151536 (Fix sanitizer target builds on CI)
 - #151626 (Remove `Deref<Target = TyCtxt>` from `QueryCtxt`)
 - #151661 (Suggest changing `iter`/`into_iter` when the other was meant)
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[error]Could not find a part of the path 'D:\a'.

@estebank
Copy link
Contributor

@bors retry
Spurious

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 26, 2026

❗ You can only retry pull requests that are approved and have a previously failed auto build.

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[error]Could not find a part of the path 'D:\a'.

rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #151290 (Recover from struct literals with placeholder or empty path)
 - #148187 (Remove uses of `&mut CmResolver`)
 - #151368 (Rustdoc performance improvements)
 - #151374 (some more rustc_borrowck cleanups)
 - #151536 (Fix sanitizer target builds on CI)
 - #151626 (Remove `Deref<Target = TyCtxt>` from `QueryCtxt`)
 - #151661 (Suggest changing `iter`/`into_iter` when the other was meant)
@rust-bors rust-bors bot merged commit 6ff5bb3 into rust-lang:main Jan 27, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 27, 2026
rust-timer added a commit that referenced this pull request Jan 27, 2026
Rollup merge of #151290 - Unique-Usman:ua/nostruct, r=estebank

Recover from struct literals with placeholder or empty path

Based on earlier work by León Orell Valerian Liehr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants