Comments (4)
I think its worth noting that even the LSP interprets M
to be Message2
when passing Message1
into message_fn
. So its not just the error message, but also the lsp seems to be thinking that M is Message2
.
from rust.
It's unclear to me why rust decides that the Message2 impl must be the intended impl in main. The intended impl is the Message1 one.
I think the trait solver decides that M = Message2
, because it's the only valid value for M
in the where-clause (Thing: HasMessage<M>
). There are only two impl blocks for HasMessage
, and Thing
doesn't implement Clone
, so it only qualifies for the second (HasMessage<Message2>
), and thus only implements the trait HasMessage<Message2>
.
Ideally, the lint could explain this (and probably display a message1 similar to the above "reasonable errors", plus a note that M = Message2
works).
Footnotes
-
"the trait bound
Thing: HasMessage<Message1>
is not satisfied..." ↩
from rust.
@rustbot claim
from rust.
@rustbot release-assignment
from rust.
Related Issues (20)
- Unnecessary alloca Without Optimization Flags HOT 4
- Can't cast higher-ranked safe fn to (not higher-ranked) unsafe fn ptr
- Regression in clone impl of enum with variant that has a field with a bivariant substitution HOT 3
- A different case of `implementation of "FnOnce` is not general enough" HOT 2
- ICE compiling internal project
- Weird AVX 512 code generated with std::simd when using -Zbuild-std
- Long ty names written to disk can leak username info in paths
- Unify/streamline long type name written to disk mechanism
- Build to AArch64 errors with "error: fixup value out of range"
- Incorrect relative jump (rjmp) code generation in latest nightly release for AVR toolchain HOT 1
- `unused_qualification` breaks code for older rust versions HOT 1
- We should document the exact minimum versions of build tools required to build a given Rust toolchain
- Rust debugger crashes with error "Library not loaded: @rpath/libunwind.1.dylib" on m1 mac HOT 2
- `--emit metadata` produces less error messages with some targets
- Tracking Issue for `ptr::fn_addr_eq`
- Overly conservative async capture analysis when values are borrowed HOT 4
- Option::get_or_insert(_with) incorrectly documented as experimental HOT 2
- ICE: transmute: called `Result::unwrap()` on an `Err` value: ReferencesError(ErrorGuaranteed(())) HOT 11
- Outdated `static.rust-lang.org` documentation from 2014 HOT 2
- Сompiler can't remove panic locations if they are not used in panic handler HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.