You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init_hack type checks, but init_hack2 doesn't, and the type error referes to a type parameter not bound in this module. I think there is some larger problem involving associated functions, as I really shouldn't need init_hack at all.
Unfortunately for the time being I cannot release my whole program because it is used in a school assignment. Reducing the program (e.g. making a new trait with just init, unused by other code) make the problem go away, so this code sample is the best I can do.
use std::io::net::ip::{Ipv4Addr,IpAddr};use std::option::Option;use std::sync::Arc;usesuper::IpState;pubtraitRoutingTable:Send + Sync{// initialized with the neighbor IPsfninit<I>(i:I) -> SelfwhereI:Iterator<IpAddr>;fnlookup(&self,IpAddr) -> Option<IpAddr>;fnmonitor(state:Arc<IpState<Self>>) -> ();fndump(&self);}pubfninit_hack<RT,I>(i:I) -> RTwhereRT:RoutingTable,I:Iterator<IpAddr>{RoutingTable::init::<I>(i)}pubfninit_hack2<I,RT>(i:I) -> RTwhereRT:RoutingTable,I:Iterator<IpAddr>{RoutingTable::init::<I>(i)}pubfnmonitor_hack<RT>(s:Arc<IpState<RT>>)whereRT:RoutingTable{RoutingTable::monitor(s);}
The text was updated successfully, but these errors were encountered:
…Veykril
Clamp Position::character to line length
LSP says about Position::character
> If the character value is greater than the line length it defaults back to the line length.
but from_proto::offset() doesn't implement this.
A client might for example request code actions for a whole line by sending
Position::character=99999. I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.
Not sure how to update Cargo.lock (lib/README.md doesn't say how).
Fixesrust-lang#18240
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
Oct 22, 2024
LSP says about Position::character
> If the character value is greater than the line length it defaults back to the line length.
but from_proto::offset() doesn't implement this.
A client might for example request code actions for a whole line by sending
Position::character=99999. I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.
Technically it should be a warning, not an error but warning is not shown by default so keep
it at error I guess.
Fixesrust-lang#18240
init_hack
type checks, butinit_hack2
doesn't, and the type error referes to a type parameter not bound in this module. I think there is some larger problem involving associated functions, as I really shouldn't needinit_hack
at all.Unfortunately for the time being I cannot release my whole program because it is used in a school assignment. Reducing the program (e.g. making a new trait with just
init
, unused by other code) make the problem go away, so this code sample is the best I can do.The text was updated successfully, but these errors were encountered: