-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Adding struct/variant causes inference error in unrelated code #80964
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
Labels
C-bug
Category: This is a bug.
Comments
Perhaps related: #44345? Mine doesn’t involve a dep upgrade, though. |
Presumably this happens when |
Indeed, it does. |
In that case, closing as a duplicate of #44345 |
wchargin
added a commit
to tensorflow/tensorboard
that referenced
this issue
Jan 13, 2021
Summary: The data provider RPC protocol requires servers to emit “blob keys”, opaque, URL-safe tokens that uniquely identify blobs. This patch defines an in-memory `BlobKey` struct with encoding and decoding. The wire format is URL-safe base64 (with no padding) over JSON. The seemingly unrelated changes are needed because loading `serde_json` adds trait implementations that make some type inference inadmissible: <rust-lang/rust#80964> Test Plan: Unit tests included. wchargin-branch: rust-blob-keys wchargin-source: bd9d325a73fb7757b2916e52a72c4e23255c51ed
wchargin
added a commit
to tensorflow/tensorboard
that referenced
this issue
Jan 13, 2021
Summary: The data provider RPC protocol requires servers to emit “blob keys”, opaque, URL-safe tokens that uniquely identify blobs. This patch defines an in-memory `BlobKey` struct with encoding and decoding. The wire format is URL-safe base64 (with no padding) over JSON. The seemingly unrelated changes are needed because loading `serde_json` adds trait implementations that make some type inference inadmissible: <rust-lang/rust#80964> Test Plan: Unit tests included. wchargin-branch: rust-blob-keys
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried this code:
I expected it to compile, and it does. But when I uncomment the final
line, a new inference error appears on the
assert_eq!
line:By itself, the inference error seems reasonable enough, and I can just
add type annotations. But the change has nothing to do with the error.
This is a stripped-down example. In my real code, I’m adding a variant
to an existing error enum, and I see two inference errors in entirely
unrelated modules:
Cloneable example:
https://github.com/wchargin/rust-inference-action-at-a-distance
Meta
Can repro in 1.48.0, 1.49.0-beta, and 2021-01-06 nightly.
cargo/rustc versions
Cargo.toml
Cargo.lock
The text was updated successfully, but these errors were encountered: