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

Fix compatibility with Rust 1.40 #571

Merged
merged 2 commits into from
Dec 23, 2019

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Dec 23, 2019

Recently released Clippy 1.40 ships with this lint enabled by default. Since we run with "warnings as errors" policy, this lint causes build failures which is not nice.

error: needless `fn main` in doctest
  --> src/wrappers/themis/rust/libthemis-src/src/lib.rs:37:4
   |
37 | //! fn main() {
   |    ^^^^^^^^^^^^
   |
   = note: `-D clippy::needless-doctest-main` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main

error: aborting due to previous error

I wouldn't say that explicit main() here is needless and some people share the same sentiment. However, since this is top-level module docs, we cannot disable this lint for this place specifically without turning it off in the entire module. Okay, Clippy, you win.

Checklist

  • Change is covered by automated tests
  • Benchmark results are attached (N/A)
  • The coding guidelines are followed
  • Public API has proper documentation
  • Example projects and code samples are updated (no API changes)
  • Changelog is updated if needed (minor change)

Recently released Clippy 1.40 ships with this lint enabled by default.
Since we run with "warnings as errors" policy, this lint causes build
failures which is not nice.

    error: needless `fn main` in doctest
      --> src/wrappers/themis/rust/libthemis-src/src/lib.rs:37:4
       |
    37 | //! fn main() {
       |    ^^^^^^^^^^^^
       |
       = note: `-D clippy::needless-doctest-main` implied by `-D warnings`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main

    error: aborting due to previous error

I wouldn't say that explicit main() here is needless and some people
share the same sentiment [1]. However, since this is top-level module
docs, we cannot disable this lint for this place specifically without
turning it off in the entire module. Okay, Clippy, you win.

[1]: rust-lang/rust-clippy#4858
@ilammy ilammy added the W-RustThemis 🦀 Wrapper: Rust-Themis, Rust API, Cargo crates label Dec 23, 2019
Copy link
Contributor

@vixentael vixentael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technologies are weird

No idea what changed here, but for some reason Cargo does not allow to
use "--features" with virtual crates now. However, it has no issues with
it once we're in "themis" crate subdirectory and ask to document all
crates in the workspace anyway.

Apparently, "--features" was not supposed to work with workspaces in the
first place [1], but I have no clue it worked before.

[1]: rust-lang/cargo#5015
@ilammy
Copy link
Collaborator Author

ilammy commented Dec 23, 2019

Yay! More breaking changes in the toolchain with recent Rust 1.40 release. I'd just quote the commit:

Fix Cargo with "--features"

No idea what changed here, but for some reason Cargo does not allow to use "--features" with virtual crates now. However, it has no issues with it once we're in "themis" crate subdirectory and ask to document all crates in the workspace anyway.

Apparently, --features was not supposed to work with workspaces in the first place, but I have no clue why it worked before.

Hopefully, this unbreaks Rust build.

I've added it here instead of making a new pull request. I'll rename the PR into something more appropriate.

@ilammy ilammy changed the title Fix clippy::needless-doctest-main Fix compatibility with Rust 1.40 Dec 23, 2019
@ilammy ilammy merged commit 4a81815 into cossacklabs:master Dec 23, 2019
@ilammy ilammy deleted the needless-doctest-main branch December 23, 2019 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
W-RustThemis 🦀 Wrapper: Rust-Themis, Rust API, Cargo crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants