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

Tracking issue for future-incompatibility lint soft_unstable #64266

Open
petrochenkov opened this issue Sep 7, 2019 · 5 comments
Open

Tracking issue for future-incompatibility lint soft_unstable #64266

petrochenkov opened this issue Sep 7, 2019 · 5 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Sep 7, 2019

What is this lint about

When some feature is unstable, but was allowed on stable due to some stability checking hole or oversight we may unstabilize it in a "soft" way to avoid breaking crates depending on the crates using the feature.

This soft unstabilization can be done using this lint.

Features that are currently emitting this lint

The #[bench] attribute

Tracking issue: #50297

Inner #![test] and #![rustfmt::skip]

Tracking issue: #54726

RustcEncodable & RustcDecodable

Tracking issue: #134301

Before adding new features here, read this

We should really support a separate tracking issue for each case of a soft-unstable feature; having them all point here doesn't make a ton of sense.

@petrochenkov petrochenkov added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Sep 7, 2019
@Centril Centril added C-future-incompatibility Category: Future-incompatibility lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Sep 7, 2019
@lqd
Copy link
Member

lqd commented Oct 4, 2019

#[deny(soft_unstable)] is on by default, but the error message (playground) still has a lint-like note warning mentioning it will become a hard error in the future:

= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>

do we need an issue for this ?

Centril added a commit to Centril/rust that referenced this issue Jan 11, 2020
feature_gate: Remove `GateStrength`

The "soft feature gating" from `feature_gate/check.rs` is unused, and even if it were used, hardcoded warning is not a good solution and [deny-by-default lint](rust-lang#64266) would be a better way to do this.

cc rust-lang#67806 (comment)
r? @Centril
Centril added a commit to Centril/rust that referenced this issue Jan 11, 2020
feature_gate: Remove `GateStrength`

The "soft feature gating" from `feature_gate/check.rs` is unused, and even if it were used, hardcoded warning is not a good solution and [deny-by-default lint](rust-lang#64266) would be a better way to do this.

cc rust-lang#67806 (comment)
r? @Centril
apyrgio added a commit to apyrgio/tindercrypt that referenced this issue Mar 17, 2021
The generated Rust code from our proto files triggers a warning in Rust
nightly, which we treat as an error:

    error: custom inner attributes are unstable
    Error:  --> src/../proto/metadata.rs:9:4
      |
    9 | #![rustfmt::skip]
      |    ^^^^^^^^^^^^^
      |
      = note: `#[deny(soft_unstable)]` on by default
      = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
      = note: for more information, see issue #64266 <rust-lang/rust#64266>

This is already reported in the `rust-protobuf` repo [1] so until it's
fixed, we choose to silence this warning to make our builds work.

[1]: stepancheg/rust-protobuf#551
apyrgio added a commit to apyrgio/tindercrypt that referenced this issue Mar 17, 2021
The generated Rust code from our proto files triggers a warning in Rust
nightly, which we treat as an error:

    error: custom inner attributes are unstable
    Error:  --> src/../proto/metadata.rs:9:4
      |
    9 | #![rustfmt::skip]
      |    ^^^^^^^^^^^^^
      |
      = note: `#[deny(soft_unstable)]` on by default
      = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
      = note: for more information, see issue #64266 <rust-lang/rust#64266>

This is already reported in the `rust-protobuf` repo [1] so until it's
fixed, we choose to silence this warning to make our builds work.

[1]: stepancheg/rust-protobuf#551
scottlamb added a commit to scottlamb/moonfire-nvr that referenced this issue Mar 24, 2021
The CI nightly builds had been broken with the following error:

```
error: custom inner attributes are unstable
  --> /home/runner/work/moonfire-nvr/moonfire-nvr/server/target/debug/build/moonfire-db-415ce696a754c614/out/schema.rs:10:4
   |
10 | #![rustfmt::skip]
   |    ^^^^^^^^^^^^^
   |
   = note: `#[deny(soft_unstable)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #64266 <rust-lang/rust#64266>
```

I'd thought this was by mistake given that #[rustfmt::skip] is still
advertised on rustfmt's github page, but maybe not. Looks like
rust-protobuf's newest version uses
`#![cfg_attr(rustfmt, rustfmt::skip)]` to avoid this error.

Also fix a warning on nightly about an extraneous semicolon.
@Stargateur
Copy link
Contributor

Stargateur commented Aug 31, 2021

So this feature is used to make breaking change to avoid breaking change ? The concept of solf_unstable don't make any sense for me, specially if #[deny(soft_unstable)] is default. It's just a more complicate way that produce the same result. Or I'm missing something.

#[stability(level=2.33333333, wind-strenght=5.3)] (not from me, author probably wishes to stay in shadow)

@yaahc
Copy link
Member

yaahc commented May 16, 2022

I think I might need to use this for #95956 as well

cafkafk added a commit to eza-community/eza that referenced this issue Sep 27, 2023
See: rust-lang/rust#64266
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Omnikron13 pushed a commit to Omnikron13/eza that referenced this issue Mar 17, 2024
See: rust-lang/rust#64266
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
@fmease fmease changed the title Tracking issue for soft_unstable compatibility lint Tracking issue for future-incompatibility lint soft_unstable Sep 14, 2024
@fmease fmease added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Sep 14, 2024
@kryptan
Copy link
Contributor

kryptan commented Nov 19, 2024

Why doesn't compiler error message say what feature should I enable? It tells me about the lint soft_unstable but not about feature(custom_inner_attributes). Error messages for unstable features typically tell you the name of the feature.

@RalfJung
Copy link
Member

This has been shown in future breakage reports for almost a year now (since #116274). I think we should move on towards making this lint a hard error.

IMO if we want to de-stabilize something in the future, we should just have a new lint for each such case. I don't think it is a good idea to have one lint used as a grab-bag for a bunch of independent things; each de-stabilization needs to be handled on its own timeline anyway and might need its own guidance for how to adjust the code to make it still work.


@kryptan please file an issue with a piece of example code triggering a sub-par diagnostic, and what information you think is missing from the diagnostic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
Archived in project
Development

No branches or pull requests

8 participants