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

Incoming breakage: Replace an invalid #[deprecated] attribute with a doc comment #932

Merged
merged 1 commit into from
Nov 11, 2022
Merged

Incoming breakage: Replace an invalid #[deprecated] attribute with a doc comment #932

merged 1 commit into from
Nov 11, 2022

Conversation

fmease
Copy link
Contributor

@fmease fmease commented Nov 11, 2022

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

#[deprecated] attributes on impl blocks do not have any effect and normally the deny-by-default lint useless_deprecated would be triggered with the message this #[deprecated] annotation has no effect.
However, there is a bug in the current version of the Rust compiler that makes it ignore the attribute entirely if it is malformed
which is the case for the #[deprecated] attached to the From impl for GeometryCollection (the version is not surrounded by double quotes).
I've replaced the attribute with a documentation comment similar to the one for the softly deprecated associated function GeometryCollection::new_from.


The compiler bug is about to be fixed (rust-lang/rust#104148) and the malformed attribute will soon become a hard error.
This future breakage was found with the help of crater (see the build log).

@michaelkirk
Copy link
Member

bors r+

Thanks @fmease!

@bors
Copy link
Contributor

bors bot commented Nov 11, 2022

Build succeeded:

@bors bors bot merged commit 5bd52c1 into georust:main Nov 11, 2022
@michaelkirk
Copy link
Member

A reminder to future us... assuming rust-lang/rust#104148 is merged soon, I think this change would hit beta 2022-12-15 and stable 2023-1-26.

People will see a failure like this:

[INFO] [stderr]     Checking geo-types v0.7.7
[INFO] [stdout] error: expected `,`, found `.`
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/github.com-1ecc6299db9ec823/geo-types-0.7.7/src/geometry/geometry_collection.rs:111:25
[INFO] [stdout]     |
[INFO] [stdout] 111 | #[deprecated(since = 0.7.5, note = "Use `GeometryCollection::from(vec![geom])` instead.")]
[INFO] [stdout]     |                         ^ expected `,`
[INFO] [stdout] 

In which case they just need to update geo-types to something newer than geo-types-0.7.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants