gchristensen changed the topic of #nixos-borg to: https://www.patreon.com/ofborg https://monitoring.nix.ci/dashboard/db/ofborg?refresh=10s&orgId=1&from=now-1h&to=now "I get to skip reviewing the PHP code and just wait until it is rewritten in something sane, like POSIX shell. || https://logs.nix.samueldr.com/nixos-borg
orivej has quit [Ping timeout: 256 seconds]
cole-h has quit [Quit: Goodbye]
orivej has joined #nixos-borg
adisbladis has quit [Quit: ZNC 1.7.5 - https://znc.in]
adisbladis has joined #nixos-borg
cole-h has joined #nixos-borg
<LnL> man... how do you use traits without putting everything in a box
<cole-h> Depends on how you're trying to use it.
<tilpner> Or of course fn quuuux<T: Foo>(_foo: T) {}
<cole-h> If you need to pass around Trait objects, things start to get somewhat hairy (at least, in my current understanding)
* tilpner is an expert at naming things
<cole-h> :D
<LnL> hold on please tell me this isn't because I've been using dyn instead of an explicit reference with &dyn
<tilpner> What exactly have you been writing instead?
<cole-h> rofl oops
<tilpner> dyn isn't really necessary, just more explicit. But it doesn't work stand-alone
<LnL> it's the "I don't know the size of the value" errors I'm generally running into
<tilpner> Yes, that sounds right
<tilpner> Do try with &
<LnL> yeah that seem to be ok
<LnL> didn't realise you can use & with dyn
<tilpner> You can in fact leave the dyn off entirely, and it will change nothing
<tilpner> (But rustc will whine at you)
* cole-h usually uses `impl Trait` over `&dyn Trait`
<tilpner> & is the important part here, not dyn
<tilpner> cole-h: That is not the same, and you know it :)
<cole-h> Hehe
<LnL> well impl Trait only works when it can be inferred
<tilpner> Ehh, what do you mean?
<LnL> not sure how to describe it
<cole-h> The compiler infers the type from the trait -- every `impl Trait` will be replaced with a concrete type at compile time (explanation shamelessly stolen from https://joshleeb.com/posts/rust-traits-and-trait-objects/)
<tilpner> (Who was that directed at?)
<cole-h> I don't know. I thought I was directing it at you, tilpner x)
* cole-h is a self-admitted newb to type theory as well as somewhat deeper Rust topics like traits
<cole-h> Time to read the RFC!
<tilpner> I know what impl Trait does, at least superficially
<tilpner> But LnL said that like quuux and quuuux weren't equivalent
<tilpner> (They are not, strictly. Imagine quuuux with &T)
<tilpner> LnL: This is getting into nitpick territory, but Rust can actually infer the type of foo to be dyn Foo in your case
ekleog has quit [Quit: WeeChat 2.7.1]
ekleog has joined #nixos-borg
orivej has quit [Ping timeout: 260 seconds]