« first day (2205 days earlier)      last day (1283 days later) » 

11:09 AM
"error: internal compiler error" send help plz
 
11:19 AM
there is no way I can make this a MCVE
 
@Stargateur Oh, wow, is that all the info you're given?
 
error: internal compiler error: compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:308:25: while adjusting Expr { hir_id: HirId { owner: DefId(0:98 ~ parrot[ac49]::sip_cap::start), local_id: 141 }, kind: Path(Resolved(None, Path { span: src/sip_cap.rs:112:78: 112:79 (#0), res: Local(HirId { owner: DefId(0:98 ~ parrot[ac49]::sip_cap::start), local_id: 6 }), segments: [PathSegment { ident: a#0, hir_id: Some(HirId { owner: DefId(0:98 ~ parrot[ac49]::sip_cap::start), local_id: 140 }), res: Some(Local(HirId { owner: DefId(0:98 ~ parrot[ac49]::sip_cap::start), local_id: 6 })), args: None, infer_arg
actually I find I can maybe create a mcve
 
In these chilly days, the last thing we want is ICE. ;)
 
specially when you already trying to fix a mystic bug, using pcap
can't reproduce play.rust-lang.org/…
more close but still no reproduction play.rust-lang.org/…
 
11:44 AM
Hot statements in the GAT tracker.
3
 
I don't think it's a good thing to write
I would answer, please be my guess
I mean, on this chat we can troll, but ask on the issue tracker to do work is not very respectful
 
12:03 PM
It's not the first time we see people growing impatient on the internet. But still, it's not like it's a plain "why isn't this done yet" kind of comment.
At least we got ourselves a status update.
Ay look it's @LukasKalbertodt
 
Was about to post the GAT thread here, but of course you didn't disappoint me and already posted it!
And yeah, I also think the post is fine. There hasn't been an update for quite some time
 
Aye, the way I see it, things are rolling in the right direction.
Several uses of GAT work on nightly, even.
Were they already stable, I probably wouldn't have needed more.
 
12:18 PM
@E_net4iscleaningup I should try stuff out again. Haven't looked into GATs in quite some time tbh :/
 
12:39 PM
Jul 10 at 16:05, by E_net4 the close voter
 
@E_net4iscleaningup Very cool
 
1:49 PM
is it possible to have an attribute be conditional on whether the target is bin or lib?
#![cfg_attr(target = "bin", allow(dead_code))]
doesn't work. No errors, but still warns on dead code
This is for a crate that has both a lib.rs and a main.rs - which I don't like but I'd prefer not to change it at this point in time.
 
I guess it can just have the attribute unconditionally, in the main.rs. But I kind of hoped this would work
 
@PeterHall There isn't any built-in thing that I'm aware of, you could of course do all sorts of hacking around and make it depend on other values than target -- none of which is elegant or preferred I guess. Although I do understand you said you don't want to change it, but literally the change we talk about would involve moving the main.rs into a separate, standalone crate and add the original crate as a dependency to it, no?
 
@PeterVaro Yeah, basically. I just somehow expected target ="lib" or target = "bin" to work
 
> whether the target is bin or lib
I don't follow
a given crate is either one or the other.
 
2:02 PM
@Shepmaster It can have both a lib.rs and a main.rs
 
but in that case there are two compilations
That cargo package contains two crates
 
indeed
 
so a crate is either a lib or a bin
 
@Shepmaster yes
I was expecting to be able to use target, based on the nomenclature here doc.rust-lang.org/cargo/commands/…
 
so a hypothetical target = bin would always be true or false, depending on if it's in lib.rs or main.rs
 
2:04 PM
@Shepmaster exactly
but some modules would be part of both
 
unless you are doing some nastiness where the main.rs doesn't use lib.rs as a crate and instead adds files directly as another module?
 
and they could contain items that are not used by the bin target
main.rs can do mod lib;
but then all modules defined in lib.rs are wrong
 
can, yes. shouldn't though
to restate, just in case: having both main.rs and lib.rs is totally normal. Then main.rs should say use the_crate_name::whatever.
What's not usual is importing the same file via mod foo in both main.rs and lib.rs
 
@Shepmaster I actually didn't consider that... does it work?
 
> Additionally, you can just create a src/main.rs that will be used as the defacto executable
158
A: Rust package with both a library and a binary?

ShepmasterYou can also just put binary sources in src/bin and the rest of your sources in src. You can see an example in my project. You do not need to modify your Cargo.toml at all, and each source file will be compiled to a binary of the same name. The other answer’s configuration is then replaced by: ...

 
2:10 PM
half of my project have both lib and bin
for example, my sip parser have a bin that read stdin and parse the sip given
simple but useful
 
yep. I have little utilities in src/bin/whatever.rs to read files and play around with the library
 
in this case, the bin is a service, but also exposes a "run" function in a lib so we can run lots of services in the same binary (mostly for convenience in testing etc), and also exposes a few utilities for working with messages that the service consumes or produces.
So yeah, there are other ways of structuring it, so I can do that. But I was expecting to be able to apply attributes based on target, which it seems I cannot.
 
2:43 PM
@PeterHall I'm allergic to word like "service"
 
@Stargateur You prefer the French word... um... le_service?
 
I prefer utils, program, etc
@Shepmaster there is not enough crate on playground !
MORE
PUT IT 100000 CRATE !
ALL OF THEM
 
@Stargateur which one(s) you missing?
 
@Shepmaster oh, today, it's crates.io/crates/num_enum :p
 
2:59 PM
@Stargateur Yeah. I can't remember which ones I was missing, but I recently found some with a few million crates.io downloads weren't there.
 
I like crates.
 
Always open to finding different algorithms to get that seed list
 
I thought it was based on crates.io downloads
But, for example, thiserror (not on playground) has 4.5m, while adler (on playground) has 2.5m.
 
what is the problem include a lot of them ? too much space ? it's slow the compilation ? too much time to compile when updating ? incompatibility ?
 
You could possibly keep track of "crate not found" errors and consider adding those when they reach a threshold
 
3:03 PM
haha
not bad
 
maybe require a number of unique ips, to discourage abuse.
and also require some minimum number of downloads from cates.io
 
or maybe a way to ask for additional crate and then a admin of the site can "valid" at hand
 
bincode has 5m downloads, also not included
That's one I tried recently, when answering a SO question
 
@Stargateur Yes.
@PeterHall ish. There are a number of "seeds". Those come from the crates in the Rust cookbook and the top 100 downloads from crates.io
Then I scan all the dependencies and make them public, since they have to be compiled anyway.
adler v0.2.3
├── miniz_oxide v0.4.3
│   ├── backtrace v0.3.53
│   │   ├── error-chain v0.12.4
│   │   │   ├── playground v0.0.1 (/Users/shep/Projects/integer32/playground/compiler/base)
│   │   │   └── publicsuffix v1.5.4
│   │   │       └── cookie_store v0.12.0
│   │   │           └── reqwest v0.10.8
│   │   │               └── playground v0.0.1 (/Users/shep/Projects/integer32/playground/compiler/base)
│   │   ├── failure v0.1.8
│   │   │   └── playground v0.0.1 (/Users/shep/Projects/integer32/playground/compiler/base)
 
@Shepmaster A flaw with this approach is that the top downloads are more likely to be dependencies that casual Rust users wouldn't normally use directly
 
3:12 PM
I think a manual list make more sense
 
@PeterHall I've long been interested in tracking compilation errors in aggregate. I don't have much of a clue on how to do that though.
@PeterHall I'm aware.
@Stargateur That's why the Rust cookbook is there.
 
@Shepmaster what is it ?
 
Also, if there's a manual list, then I'm blocking failure, error-chain, thiserror, anyhow, etc. Adding snafu.
(this is why there isn't a manual list, because people will complain about me picking favorites)
 
@Shepmaster yeah normal
 
I'm sure you are asked this a lot: could the policy change that 100 to a larger number in the future?
 
3:15 PM
@Shepmaster If you added snafu, you'd have to add all "competitor" crates that have more downloads. I think that would address any criticism
 
> you'd have to add all "competitor" crates that have more downloads
Why have to?
If it's a manual list, then I get to do whatever I want
 
For social justice :tm:.
 
That's the point of "manual": I know better than anyone else
 
I think 100 is maybe a little number considering the grow of rust
 
@Shepmaster You wouldn't have to if you didn't care about the criticism - which you just implied that you cared about.
 
3:16 PM
maybe use a pourcentage
 
Yes, 100 is a number I picked out of thin air.
 
A percentage of what? Crate downloads per total downloads?
 
> We are open to well-reasoned alternate algorithms, but be aware that any proposal would likely be expected to also provide the majority of implementation work.
that last sentence seems to have stopped a lot of this, for some reason
 
I propose to keep this number but use % so let's make the playground download 100% of the crate
 
heh
 
3:18 PM
I wonder if lib.rs could be of anyuse about this
 
or docs.rs
compute the top N crates people look at
 
using the "I'm feeling lucky" of docs.rs, take 100, so them the playground crate will change randomly everyday
 
Each time there is a new Rust release, they do a crater run, which builds all crates. If that build cache could be persisted until the next release...
 
oh
but can all crates be compatible ?
 
@Stargateur No. Many have conflicting features
 
3:21 PM
I think there could be problem with crate that use C lib that will make rust fail to link
a colaborator of the crate ask me a usecase but delete its message so now i'm talking to myself github.com/illicitonion/num_enum/issues/32
 
3:34 PM
damm, I want to write an RFC
but there is no way I have the motivation to
 
@Stargateur for what?
 
3:49 PM
@Shepmaster I would like to be able to make enum that represent an integer, able to fail down to a unknown state
 
*blinkblink*
 
let say you have your enum value 0 is bar, 1 is foo, etc. I want to be able to say that if something like 42 come and I don't have variant for it, rust allow me to match my enum, and this 42 will call an a special variant that will contain the unknown integer without taking more space
wait I will make an example
there is already too much time I need this feature
I don't think there is any problem having this
well expect the syntax I'm not a lang designer
 
Oh, I think I'm getting an idea of what you're after.
Sounds like the hardest part is negating the other variants out of the new one to maintain the same binary representation. So for example, if your enum Foo is repr(u16), you would have a variant Foo::Other(u16ButWithoutTheOtherVariants).
Otherwise it's a type with additional information, and requires more space.
 
yeah no more information
 
That would have been interesting for my DICOM VR type, so that one could tell apart other unknown VRs without additional space.
But TBH it's pretty hard for me to picture that in this type system.
 
4:04 PM
I didn't replace Linktype because there could be random protocol come from nowhere, so it's annoying but with the feautre I want that would be perfect
@E_net4iscleaningup exactly
it's annoying because I see no problem to do that
 
How would you represent the AnythingElseButVariant type?
 
well, obviously this require you match out every other variant
 
I mean, into the type system. The closest we have is NonZero, but we cannot create our own integral types with "holes" in them.
 
i don't fully get what you mean
well my point is to create a RFC that add it to rust
there is no way to do it for now
 
RFCs are generally written with at least the assistance of someone who could make it happen.
 
4:13 PM
We recently did some code like this, I think. When I get back from lunch I’ll show you the example. You probably won’t like it though
 
well, my whole idea is to make it safe :p
cause I see no technical reason this would be impossible
 
but so look like you have the same problme that me :p
 
> I don't think that's possible today. The lowering code for match can only use switchInt on specific values, not ranges of things.
My case originated from looking at github.com/google/flatbuffers/pull/6098
 
well, yes that obviously need some dev,
it's annoying
but I guess the first real step is to create a issue and so a RFC
 
 
2 hours later…
7:01 PM
@PeterHall why no answer?
 
7:23 PM
@Shepmaster You stole my answer word-for-word!!!
 
@PeterHall yes.
 
@Shepmaster ok, you edited now.. I'll allow it
 
It was nice of you to make it so easily copy-pastable.
I think your comment would have been a perfectly fine answer, even without the stuff I added
@PeterHall I'd be perfectly chuffed to quote that line and attribute you.
:-)
 
@Shepmaster ok good point. I demand a citation!
 
@PeterHall done
I thought about making the link go somewhere silly
 
 
2 hours later…
9:12 PM
@Shepmaster :+1:
 

« first day (2205 days earlier)      last day (1283 days later) »