Skip to content

Commit

Permalink
fix(iroh-net): Fix a compiler error with newer derive_more versions (
Browse files Browse the repository at this point in the history
…#2578)

## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
The `#[derive(Debug)]` used to generate an impl like this:
```rust
#[automatically_derived]
impl<'a> ::core::fmt::Debug for Accept<'a>
where
    quinn::Accept<'a>: ::core::fmt::Debug,
    Endpoint: ::core::fmt::Debug,
{
// ...
}
```

But `quinn::Accept` doesn't implement `Debug`.

## Breaking Changes

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

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
I'm... Really stumped on what changed in `derive_more`. When I expand
the macro, in both versions there's a `Debug` bound on `quinn::Accept`,
which just can't be right... Anyhow.

## Change checklist

- [X] Self-review.
- ~~[ ] 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.~~
- ~~[ ] Tests if relevant.~~
- [X] All breaking changes documented.
  • Loading branch information
matheus23 authored Aug 2, 2024
1 parent 347d45c commit 3f3fec5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions iroh-docs/src/store/fs/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pub struct Tables<'tx> {
pub records_by_key: Table<'tx, RecordsByKeyId<'static>, ()>,
pub namespaces: Table<'tx, &'static [u8; 32], (u8, &'static [u8; 32])>,
pub latest_per_author: Table<'tx, LatestPerAuthorKey<'static>, LatestPerAuthorValue<'static>>,
#[debug("MultimapTable")]
pub namespace_peers: MultimapTable<'tx, &'static [u8; 32], (Nanos, &'static PeerIdBytes)>,
pub download_policy: Table<'tx, &'static [u8; 32], &'static [u8]>,
pub authors: Table<'tx, &'static [u8; 32], &'static [u8; 32]>,
Expand Down
1 change: 1 addition & 0 deletions iroh-net/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ impl Endpoint {
#[pin_project::pin_project]
pub struct Accept<'a> {
#[pin]
#[debug("quinn::Accept")]
inner: quinn::Accept<'a>,
magic_ep: Endpoint,
}
Expand Down

0 comments on commit 3f3fec5

Please sign in to comment.