Skip to content

Provide structured suggestion for #![feature(..)] in more cases #134858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 19, 2025

Conversation

estebank
Copy link
Contributor

Fix #81370.

@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2024

r? @Noratrieb

rustbot has assigned @Noratrieb.
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

@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 Dec 28, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2024

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

@compiler-errors
Copy link
Member

Yeah, please revert the example that Ralf pointed out is redundant.

@rustbot author

@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 Dec 30, 2024
@estebank estebank 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 Dec 30, 2024
@compiler-errors
Copy link
Member

plz squash rather than pushing a new commit xD

@estebank
Copy link
Contributor Author

squashed

When encountering a call corresponding to an item marked as unstable behind a feature flag, provide a structured suggestion pointing at where in the crate the `#![feature(..)]` needs to be written.

```
error: `foobar` is not yet stable as a const fn
  --> $DIR/const-stability-attribute-implies-no-feature.rs:12:5
   |
LL |     foobar();
   |     ^^^^^^^^
   |
help: add `#![feature(const_foobar)]` to the crate attributes to enable
   |
LL + #![feature(const_foobar)]
   |
```

Fix rust-lang#81370.
```
error: `size_of_val` is not yet stable as a const intrinsic
  --> $DIR/const-unstable-intrinsic.rs:17:9
   |
LL |         unstable_intrinsic::size_of_val(&x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(unstable)]` to the crate attributes to enable
help: add `#![feature(unstable)]` to the crate attributes to enable
   |
LL + #![feature("unstable")]
   |
```
```
error[E0797]: base expression required after `..`
  --> $DIR/feature-gate-default-field-values.rs:62:21
   |
LL |     let x = Foo { .. };
   |                     ^
   |
help: add `#![feature(default_field_values)]` to the crate attributes to enable default values on `struct` fields
   |
LL + #![feature(default_field_values)]
   |
help: add a base expression here
   |
LL |     let x = Foo { ../* expr */ };
   |                     ++++++++++
```
@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 19, 2025

📌 Commit e68a8ce has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors 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 19, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 19, 2025
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#134858 (Provide structured suggestion for `#![feature(..)]` in more cases)
 - rust-lang#135679 (create an issue template for bootstrap)
 - rust-lang#135685 (Remove unused `item-row` CSS class)
 - rust-lang#135716 (Don't skip argument parsing when running `rustc` with no arguments)
 - rust-lang#135723 (Fix dev guide docs for error-pattern)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4842ff4 into rust-lang:master Jan 19, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 19, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 19, 2025
Rollup merge of rust-lang#134858 - estebank:issue-81370, r=Noratrieb

Provide structured suggestion for `#![feature(..)]` in more cases

Fix rust-lang#81370.
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.

Improve error reporting for #![feature(...)] in the wrong place
6 participants