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

iroh-net: default features are not compatible with doc tests #2950

Closed
dignifiedquire opened this issue Nov 19, 2024 · 0 comments · Fixed by #2983
Closed

iroh-net: default features are not compatible with doc tests #2950

dignifiedquire opened this issue Nov 19, 2024 · 0 comments · Fixed by #2983
Assignees
Milestone

Comments

@dignifiedquire
Copy link
Contributor

$ cargo test -p iroh-net

fails with

---- iroh-net/src/discovery.rs - discovery (line 73) stdout ----
error[E0432]: unresolved import `iroh_net::discovery::local_swarm_discovery`
   --> iroh-net/src/discovery.rs:76:26
    |
6   | use iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery;
    |                          ^^^^^^^^^^^^^^^^^^^^^ could not find `local_swarm_discovery` in `discovery`
    |
note: found an item that was configured out
   --> /Users/dignified/opensource/iroh/iroh-net/src/discovery.rs:115:9
    |
115 | pub mod local_swarm_discovery;
    |         ^^^^^^^^^^^^^^^^^^^^^
note: the item is gated behind the `discovery-local-network` feature
   --> /Users/dignified/opensource/iroh/iroh-net/src/discovery.rs:113:7
    |
113 | #[cfg(feature = "discovery-local-network")]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0432`.
Couldn't compile the test.

failures:
    iroh-net/src/discovery.rs - discovery (line 73)
@dignifiedquire dignifiedquire added this to the v0.29.0 milestone Nov 19, 2024
@flub flub self-assigned this Nov 25, 2024
@ramfox ramfox moved this to 📋 Backlog in iroh Nov 25, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 2, 2024
## Description

This test can only work if the feature is enabled.  Feature-flag the
entire test contents.

Closes #2950.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
@flub flub closed this as completed in #2983 Dec 2, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in iroh Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants