« first day (2051 days earlier)      last day (1431 days later) » 

3:06 AM
wtf is this spam
 
 
7 hours later…
9:47 AM
moderator clean up
 
 
3 hours later…
1:13 PM
@Stargateur ?
 
@PeterHall this user post seven time the same answer promoting its crate
 
@Stargateur ah
 
1:40 PM
@Stargateur This person also tweets and at-mentions random people twitter.com/steadylearner_p?lang=en
 
That's a whole new level of self-promotion.
 
1:57 PM
> I apologise in adwance for my stupid questions , but there are more to come.
2
Oh no
 
 
1 hour later…
3:27 PM
@E_net4isunsafe 100% case where OP say it's a stupid question it is not
100% of case where you say the question is stupid and OP disagree, the question is stupid
source: trust me bro
 
4:06 PM
@Stargateur nice source
 
@E_net4isunsafe so the question was stupid or not ?
 
4:36 PM
 
@Stargateur Counterexample: stackoverflow.com/questions/62023605/…
oh wait. That's what E_4_net_or_whatever_his_name_now_is was referring to
 
question is bad not stupid ^^
 
There are no stupid questions. Only stupid people.
 
shep help a lot
@PeterHall why blue is blue ?
 
@Stargateur are you trying to prove my point? :P
 
4:49 PM
2
Q: Rust - Why to import a trait when it's already implemented on struct

manikawnthIn the below example from std docs, we're importing the read trait from std::io::prelude::* although the trait is implemented on File. Why can't we implicitly use the f.read() method on File instance? Does importing the trait solve any specific problem? use std::io; use std::io::prelude::*; use...

^ stupid
5
Q: Why I can not use u8 as an index value of a Rust array?

NoqraxI am new to Rust, and I am trying to write simple bitwise replacer. I have this code: const TABLE: [u64; 8] = [ 0xC462A5B9E8D703F1, 0x68239A5C1E47BD0F, 0xB3582FADE174C960, 0xC821D4F670A53E9B, 0x7F5A816D093EB42C, 0x5DF692CAB78143E0, 0x8E25691CF4B0DA37, 0x17ED05834...

^^ stupid
-2
Q: Use-case and behavior of `this[i]`

StargateurI want to know what is the use scope of this[i]. I know this is clearly an useless question but let say it for science. What are the behaviors allow by the standard for indexing this ? I didn't find information about it, cppreference. Stupid example: #include <iostream> class foo { public: ...

very stupid
 
@Stargateur I think this is a reasonable question. It can be a paper cut for newbs and could have been done differently. I actually think the language could be improved here
 
@PeterHall answer is literally "That’s simply the way it is."
 
@Stargateur The question starts with "why"
 
better ask why not
try to prove to yourself you wrong, before say you right
 
In that particular case, I would like to see a language improvement so that you can implement a trait AND say that the methods are inherent to the type.
 
4:59 PM
that sound like inheritance with extra step
 
inherent impl Read for File { ... }
syntax can't be that because it's not a keyword.. but something like that
 
I don't really see what we gain
 
it would add those methods as inherent methods and then make the trait impl just proxy to them.
@Stargateur I would gain a few seconds every time I forget I have to do that. And newbies would save minutes.
It needs to be opt-in though
 
that will add even more confusion
I already don't like auto include of some std trait
you never know if a trait is already include or not
and so you forget you should always include it
 
5:18 PM
0
Q: Cannot infer type parameter when using redux-rs with actions that are part of a fat enum

fifn2I'm using the redux-rs library to bring the redux pattern into Rust. I keep getting a weird type mismatch error since I'm trying to use actions that are part of a fat enum. With the following code: fn root_reducer<T>(state: &State, action: &Action<T>) -> State where T: Fn(State) -> State, { ...

too many facepalm
specially the end
 
@PeterHall you say that because it's another peppa
 
@Shepmaster some people like to suffer
it's amazing each time I listen this music I imagine it's shepmaster: youtu.be/hpjV962DLWs
 
6:09 PM
damm, I need to borrow, and send result to a channel
I try to use pin... it's not clear
 
@Stargateur that doesn't start well...
And pinning would probably make it worse
 
Aw man... so, I've got a weird compilation error that seems to be a bit non-deterministic. Looking for tips on how to make it more reproducible and generate a MRE...
I can uncomment and comment various bits of code and get it to happen/disappear very reliably
then I copied my entire codebase to a fresh directory so I could try to pare it down
but in the new directory I don't get the compile error
I did a cargo clean in both the original and the new directories, didn't help. the old project reproduces 100%, the new directory I can't make it happen
with the exact same source code & Cargo.toml/Cargo.lock
it's very strange. I'm modifying one file and code in a completely unrelated file starts spitting out a lifetime error. a completely unrelated file!
 
That sounds fun
same rustc version?
 
it seems to involve me using #[async_trait], possibly #[derive(Snafu)], possibly defining a macro
yeah same rustc
it sucks cause I can't dump a dozen files on you all to help me narrow it down :/
the error, if there are any clues in it:
error: lifetime may not live long enough
   --> src/protocol/cmia.rs:278:12
    |
264 | #[async_trait]
    | - let's call the lifetime of this reference `'1`
...
273 |     async fn connect_to_client<'a>(
    |                                -- lifetime `'a` defined here
...
278 |         -> io::Result<(protocol::Read<'a, ClientMessage>, protocol::Write<'a, ServerMessage>)>
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'1`
though like I said cmia.rs is not the file I'm even touching, and the file I am touching is completely unconnected. they don't use each other, they're in different modules
 
6:26 PM
@JohnKugelman clearly not because of SNAFU, that library is ROCK SOLID and how dare you insinuate otherwise.
:-)
 
I threw that in there to force you to help me >_>
 
I'd guess that async trait is the most likely case
 
agree. both files use it
 
esp since the error message points at it (which is often a sign that it's from the expanded code)
you could try a tool like cargo expand to see what it generates, then replace the source with the expanded one
to see if it repros with a better error message
 
ok perfect will do
 
6:29 PM
Semi-related: the playground now can expand macros
won't help you though!
 
 
1 hour later…
7:42 PM
sweet, entering heisenbug territory
#[derive(Copy, Clone, Debug)]
pub struct StaticFile {
    pub name: &'static str,
    pub contents: &'static [u8],
}
fails
make it #[derive(Debug)], compiles
make it #[derive(Clone, Debug)], compiles
make it #[derive(Copy, Clone, Debug)], fails
make it #[derive(Clone, Debug)], fails
make it #[derive(Debug)], compiles
make it #[derive(Clone, Debug)], compiles
I can repeat this cycle over and over
 
feels like an incremental compilation thing
 
8:13 PM
dammit. pasting in the output of cargo expand for the function in question fixes the problem. can't make the compiler fail :(
where #[async_trait] is expanded
 

« first day (2051 days earlier)      last day (1431 days later) »