Comments (3)
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.
Related Issues (20)
- trying to get pointer to extern typed field causes runtime panic HOT 5
- Tracking Issue for `-Z verbose-asm`
- `unreachable_code` detection and/or lint seems broken HOT 1
- Internal Compiler Error when using extern types HOT 7
- Tracking Issue for consolidating command invocations in bootstrap
- electric bug display with seismic detector HOT 1
- Can `DynMetadata` be made constructable? HOT 1
- ICE: type map: `left == right`
- C-variadic functions may not be extern "C-unwind" HOT 3
- Tracking Issue for `mpmc`
- rustc panicked: [evaluate_obligation] evaluating trait selection obligation HOT 2
- Mistaken type annotation on documentation page for HashMap HOT 3
- ICE: `no def-id for fresh lifetime` HOT 1
- Confusing documentation for wasm32-wasip1-threads HOT 1
- Main thread thread-local destructors are not run on musl, android HOT 1
- File format not recognized when linking rmeta file for sparc-linux-unknown-gnu HOT 7
- Unhelpful compiler suggestion when trying to dereference a pointer that is not `Copy` HOT 5
- Infinite recursion when reordering bounds in where clause
- Different behavior when changing `opt-level` HOT 4
- `<core::iter::Filter as Iterator>::next_chunk` virtually `core::mem::forget`s all elements that fail the predicate
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.