Skip to content
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

Suggest updating the compiler #117318

Closed
CryZe opened this issue Oct 28, 2023 · 8 comments
Closed

Suggest updating the compiler #117318

CryZe opened this issue Oct 28, 2023 · 8 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@CryZe
Copy link
Contributor

CryZe commented Oct 28, 2023

Code

On an older compiler:

fn main() {
  1u32.div_ceil(5);
}

Current output

error[E0658]: use of unstable library feature 'int_roundings'
  --> src\lib.rs:38:14
   |
38 |         1u32.div_ceil(5);
   |              ^^^^^^^^
   |
   = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information

Desired output

error[E0658]: use of unstable library feature 'int_roundings'
  --> src\lib.rs:38:14
   |
38 |         1u32.div_ceil(5);
   |              ^^^^^^^^
   |
   = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information
   = note: if you are on an old compiler version you may need to update your compiler

Rationale and extra context

Throughout all my time with Rust I've heard from multiple people (who may be less experienced) on various occasions that after pulling the latest commit, that my Rust code is accidentally using unstable features. Every single time they didn't know that the problem isn't that I used unstable features, but that those features stabilized in the meantime and that they need to update their compiler version.

Maybe the compiler could even check based on the date if a new version of the compiler should be out and only emit that note then.

Other cases

No response

Anything else?

No response

@CryZe CryZe added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 28, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2023
@matthiaskrgr
Copy link
Member

Wouldn't that require that 1.73.0 knows that a feature has actually been stabilized in 1.75.0 for example?

@Noratrieb
Copy link
Member

That's why the message should be a suggestion with "if you're on an older compiler". We cannot know what's stable in the future, but making the suggestion doesn't hurt and seems like a good idea.

@Noratrieb Noratrieb added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 28, 2023
@ketsuban
Copy link
Contributor

It might be worth checking the system time and only printing this message if the current version was built more than (say) six weeks ago. That's enough time for one release train to arrive.

@Rajveer100
Copy link
Contributor

@rustbot claim

@George-lewis
Copy link
Contributor

Hi all, this issue seems to have stalled? I hope no one minds if I make an attempt. I'll claim this and open a PR shortly

@George-lewis
Copy link
Contributor

@rustbot claim

@rustbot rustbot assigned George-lewis and unassigned Rajveer100 Dec 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 11, 2024
…g-compiler, r=Nilstrieb

Suggest Upgrading Compiler for Gated Features

This PR addresses rust-lang#117318

I have a few questions:

1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag
  a. How can I handle the changing message in the tests?
3. Do we want to only show this message when the compiler is old?
  a. How can we determine when the compiler is old?

I'll wait until we figure out the message to bless the tests
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 11, 2024
…g-compiler, r=Nilstrieb

Suggest Upgrading Compiler for Gated Features

This PR addresses rust-lang#117318

I have a few questions:

1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag
  a. How can I handle the changing message in the tests?
3. Do we want to only show this message when the compiler is old?
  a. How can we determine when the compiler is old?

I'll wait until we figure out the message to bless the tests
Noratrieb added a commit to Noratrieb/rust that referenced this issue Jan 13, 2024
…ing-compiler, r=Nilstrieb

Suggest Upgrading Compiler for Gated Features

This PR addresses rust-lang#117318

I have a few questions:

1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag
  a. How can I handle the changing message in the tests?
3. Do we want to only show this message when the compiler is old?
  a. How can we determine when the compiler is old?

I'll wait until we figure out the message to bless the tests
Noratrieb added a commit to Noratrieb/rust that referenced this issue Jan 13, 2024
…ing-compiler, r=Nilstrieb

Suggest Upgrading Compiler for Gated Features

This PR addresses rust-lang#117318

I have a few questions:

1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag
  a. How can I handle the changing message in the tests?
3. Do we want to only show this message when the compiler is old?
  a. How can we determine when the compiler is old?

I'll wait until we figure out the message to bless the tests
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 13, 2024
…g-compiler, r=Nilstrieb

Suggest Upgrading Compiler for Gated Features

This PR addresses rust-lang#117318

I have a few questions:

1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag
  a. How can I handle the changing message in the tests?
3. Do we want to only show this message when the compiler is old?
  a. How can we determine when the compiler is old?

I'll wait until we figure out the message to bless the tests
@Ekleog
Copy link

Ekleog commented Jan 24, 2024

Considering #119088 landed, I think this could be closed? :)

@workingjubilee
Copy link
Member

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants