#rust-lang

/

      • Jesin joined the channel
      • nagisa_ is now known as
      • phaylon
        wrt. auto-deref when Copy, wouldn't that mean code might stop working when one adds Copy to a type?
      • ubsan
        phaylon: it would only mean that code starts compiling that didn't already
      • afaict
      • phaylon
        even when the type of `foo.bar` would change from &X to X?
      • ubsan
        phaylon: I mean, I imagine that it would only autoderef if necessary
      • phaylon
        e.g. foo<T:RefOrOwned>(_: T) {} foo(bar.baz) and flip copy-ness of .baz
      • as in "if it doesn't work, try compiling the other way"?
      • woboats
        phaylon, it woudln't *change* from &X to X, it would be &X unless you tried to unify it with X
      • so if the code compiled with the value as &X nothing would change
      • so yes, what ubsan said
      • phaylon
        ah
      • would the visible semantics for non-copy types be similar like the pass-owned-to-ref proposal, as in it auto-refs but consumes the field/object?
      • kimundi has quit
      • woboats
        phaylon, I don't know what you mean
      • kimundi joined the channel
      • phaylon
        there's a proposal floating around allowing `fn foo(t: &T) {} foo(owned_t)` that's basically `{ foo(&owned_t) }`, so it auto-refs, but acts like it was moved
      • so I was wondering if `foo(something.owned_t)` would follow those semantics
      • just thinking out loud at this point, I'm more of a be-explicit kinda guy
      • woboats
        phaylon, i think there's not a connection.
      • this is about where `something` is `&T`, you get a reference from `something.owned_t`
      • you're talking about if `something` is `T` but the foo takes a reference
      • phaylon
        ah, true
      • woboats
        so yea it would work the same way for `t` or `x.t` but that's just because they're both expressions that evaluate to `T`
      • also I am so close to that sweet nagbot 0
      • phaylon
        I'm not understanding that last line :) I assume I'm missing context
      • warmwaffles has quit
      • woboats
        phaylon, there's a bot that emails team members about RFCs and issues they need to comment on, my daily email only had 1 item today
      • phaylon
        aah, there's the context
      • for a moment I thought I was the nagbot. I'm sometimes worries that I'm criticising too much
      • jseyfried has quit
      • brson has quit
      • woboats
        phaylon, not at all :)
      • alunux has quit
      • Jesin has quit
      • kimundi has quit
      • kimundi joined the channel
      • Jesin joined the channel
      • brson joined the channel
      • russ_za has quit
      • russ_za joined the channel
      • Ink_heart joined the channel
      • Ink_heart has quit
      • russ_za has quit
      • russ_za joined the channel
      • WindowsBunny joined the channel
      • jseyfried joined the channel
      • WindowsBunny1 joined the channel
      • WindowsBunny has quit
      • WindowsBunny1 is now known as
      • brson has quit
      • AstralSorcerer joined the channel
      • srwalker101 joined the channel
      • srwalker101 has quit
      • srwalker101 joined the channel
      • Ink_heart joined the channel
      • Ink_heart has quit
      • https://is.gd/LHX7ed The new frontiers of typenum, it'll be fairly trivial to implement `where {x < y}` type of clauses with const generics
      • eddyb, did you know this?
      • eddyb
        lol
      • woboats
        people will definitely do this
      • eddyb
        woboats: this is Refl isn't it
      • woboats
        I'm not sure.. they at least have to be compile time values still
      • eddyb
        like you can just do where (): IsTrue<{f(X)}>
      • woboats
        yes exactly
      • gee
      • so you dont even need custom traits
      • eddyb
        or bool: Is<{f(X)}, true> if we allowed const LHS: Self
      • woboats
      • eddyb
        woboats: do note that unification is used to compare these
      • so you can't repeat a bound to make a "perfect proxy" *unless* two distinct {f(X)} expressions unify with eachother without a known X
      • woboats
        so I'm sure people doing this will immediately want us to implement a smarter theory of equality
      • eddyb
        woboats: which is what we need for bool constant predicates in where clauses or whatever
      • woboats
        I don't like boolean predicates because I'm afraid of the programs people will write with them
      • in terms of having comprehensible APIs
      • eddyb
        like, that smarter equality we won't have from the start is why we don't have bounds from the start, in terms of technical reasons
      • woboats
        that makes sense
      • hmmm i guess i thought of these questions as very distant but it seems like they'll be raised quickly after const generics are implemented
      • eddyb
        hmmmmm
      • woboats: ooh
      • what your trait scheme allows you to do
      • is proxy a bound
      • because you have no expressions in the bound itself
      • i.e. two LessThan<X, Y> or w/e unify with eachother
      • in a way expressions don't
      • or rather, you're emulating the fancier expression equality by "desugaring" it into constructs rustc already understands well
      • woboats
        right
      • so the only thing is it can't prove things like
      • GreaterThan<X, Y> implies LessThan<Y, X>
      • well maybe it can but i dont think so?
      • Zoxc
        Is it possible to make a sanitizer for the property TBAA relies on?
      • arielby joined the channel
      • nagisa joined the channel
      • dev joined the channel
      • woboats has quit
      • jschuster has quit
      • niconii has quit
      • jseyfried has quit
      • jschuster joined the channel
      • dev has quit
      • dev joined the channel
      • srwalker_ joined the channel
      • srwalker101 has quit
      • srwalker_ has quit
      • dev1 joined the channel
      • dev has quit
      • dev1 is now known as
      • dev1 joined the channel
      • dev1 has quit
      • srwalker101 joined the channel
      • AstralSorcerer has quit
      • ubsan has quit
      • ubsan joined the channel
      • arielby has quit
      • lukaramu joined the channel
      • AstralSorcerer joined the channel
      • RoadToSilverPotato joined the channel
      • RoadToSilverPotato
        Hi
      • RoadToSilverPotato has quit
      • ubsan
        idea
      • DerefAssign could allow us to make `*v = [1, 2, 3]` work really nicely
      • (plus rvalue dsts)
      • brayniac joined the channel
      • brson joined the channel
      • warmwaffles joined the channel
      • eddyb
        ubsan: DerefAssign is what I thought <- could be :P
      • ubsan
        eddyb: no
      • eddyb ducks and runs
      • obviously not
      • AstralSorcerer has quit
      • <- is for placement
      • i.e., no dropping!
      • eddyb
        (I mean, (*v.back() = value): &mut T instead of (v.back() <- value): &mut T)
      • ah that makes sense somewhat
      • srwalker101 has quit
      • srwalker101 joined the channel
      • srwalker101 has quit
      • Regexident joined the channel
      • srwalker101 joined the channel
      • jseyfried joined the channel
      • srwalker101 has quit
      • ubsan has quit
      • ubsan joined the channel
      • woboats joined the channel
      • srwalker101 joined the channel
      • AstralSorcerer joined the channel
      • niconii joined the channel
      • srwalker101 has quit
      • srwalker101 joined the channel