Provide structured suggestion for #![feature(..)] in more cases#134858
Merged
Conversation
Collaborator
|
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
Collaborator
|
Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
RalfJung
reviewed
Dec 28, 2024
Contributor
|
Yeah, please revert the example that Ralf pointed out is redundant. @rustbot author |
Contributor
|
plz squash rather than pushing a new commit xD |
bf1475b to
69bf257
Compare
Contributor
Author
|
squashed |
Noratrieb
reviewed
Jan 17, 2025
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 */ };
| ++++++++++
```
Member
|
@bors r+ |
Collaborator
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #81370.