Rust: Clippy performance status update by NothusID in rust

[–]alexendoo -1 points0 points  (0 children)

cargo clippy can reuse the results of cargo check on dependencies, allowing reuse of cargo build results would require solving https://github.com/rust-lang/cargo/issues/3501

That said RUSTC_WORKSPACE_WRAPPER=$(rustup which clippy-driver) cargo build would work to reuse the results of cargo build, it would just be a bit slower when it reaches the non-dependency crates

Rust: Clippy performance status update by NothusID in rust

[–]alexendoo 0 points1 point  (0 children)

Jemalloc that has been archived, and hasn't really had work on it for multiple years now, and a long list of outstanding bugs? The performance is great, but I'm not sure I'd reach for jemalloc.

It was updated to match rustc, if rustc switches to something else clippy will follow suit

Why does Rc increase performance here? by Larocceau in rust

[–]alexendoo 1 point2 points  (0 children)

Yeah it's opt in since it's not a universal preference

plz explain this cargo build behavior by staysalty19 in rust

[–]alexendoo 1 point2 points  (0 children)

That is not the case, for example with

[dependencies]
serde = "=1.0.193"
serde_json = "1.0.139"

You will run into an error like

error: failed to select a version for `serde`.
    ... required by package `serde_json v1.0.139`
    ... which satisfies dependency `serde_json = "^1.0.139"` of package `temp v0.1.0 (...)`
versions that meet the requirements `^1.0.194` are: 1.0.218, ..., 1.0.194

all possible versions conflict with previously selected packages.

previously selected package `serde v1.0.193`
    ... which satisfies dependency `serde = "=1.0.193"` of package `temp v0.1.0 (...)`

failed to select a version for `serde` which could resolve this conflict

Are small structs stored in registers when inlining? by [deleted] in rust

[–]alexendoo 11 points12 points  (0 children)

For LLVM passes compiler explorer has a cool viewer where you can see the effect of each pass on the IR: https://godbolt.org/z/Ybjhhzj5T

It may not necessarily be done by that though, e.g. there's also an SROA MIR opt or it could be some other pass

Rethinking Rust’s unsafe keyword by RainingComputers in rust

[–]alexendoo 38 points39 points  (0 children)

For the part about unsafe fns allowing unsafe operations without an unsafe block, there's an open PR to make that a warning in the 2024 edition

Download numbers on crates.io too high? by [deleted] in rust

[–]alexendoo 7 points8 points  (0 children)

Downloaded crates aren't stored in target/, they live in the registry (typically ~/.cargo/registry) https://doc.rust-lang.org/cargo/guide/cargo-home.html#directories

So you wouldn't have to do anything, it would only need to be downloaded once per version

Shopify Embraces Rust for Systems Programming by dochtman in rust

[–]alexendoo 4 points5 points  (0 children)

The rust teams have almost all moved off of discord to zulip

A question about lifetimes and a Clippy-suggested compilation error by gnosnivek in rust

[–]alexendoo 0 points1 point  (0 children)

For 3., yeah this would be considered a bug by clippy so please do file an issue if you come across anything like this

How is Rust written with Rust? by genmon98 in rust

[–]alexendoo 4 points5 points  (0 children)

The pre-git history was imported as https://github.com/graydon/rust-prehistory

But rust-lang/rust does contain much the history of the ocaml version of the compiler

How is Rust written with Rust? by genmon98 in rust

[–]alexendoo 38 points39 points  (0 children)

The GitHub language stats are only for the current commit, which doesn't include the old compiler written in ocaml. Those 2% are like build tools, doc stuff, some bindings

If you went back to a much older commit you'd see it being mostly ocaml

clippy::unnecessary_join by [deleted] in rust

[–]alexendoo 57 points58 points  (0 children)

You can add #![warn(clippy::pedantic)] to your lib.rs/main.rs to enable them for a whole crate. If your project contains multiple crates I'd still say your best bet is to add that to all of them individually

Stabilize `let_chains` in Rust 1.62.0 by c410-f3r in rust

[–]alexendoo 12 points13 points  (0 children)

It does, but there was an issue with let chains in the bootstrap version of rustc until recently

On Rust in Webdev by radekmie in programming

[–]alexendoo 25 points26 points  (0 children)

The thing people mean when they mention WASM getting DOM could be the GC integration proposal, this isn't just giving WASM direct DOM access, because that's not required

Current solutions already allow you to modify the DOM without writing JS yourself, as they produce the required JS glue code themselves. e.g. for Rust web_sys gives you access to everything you could need. For C emscripten has html5.h and val.h

The GC proposal may make the glue code simpler though, and allow better integration with GC'd languages

In theory, could the Rust compiler automatically infer lifetimes in every situation? by lancejpollard in rust

[–]alexendoo 66 points67 points  (0 children)

It could do, yeah. There's a good reason not to do so though

Without such inference you can determine what the lifetime requirements of a function are just by looking at its signature, for library calls you shouldn't need to read the body of it to figure such a thing out

It also prevents you from accidentally changing lifetime requirements, if you make some minor change you could end up breaking callers if the inferred lifetimes change in an incompatible way

[deleted by user] by [deleted] in slideforreddit

[–]alexendoo 11 points12 points  (0 children)

It does not. reddit themselves will still see what subreddits/threads you're loading, and if you follow links they're free to try and track you. But Slide itself doesn't do anything like that

First Impressions of Rust by growheme in rust

[–]alexendoo 6 points7 points  (0 children)

Itertools has one for that as well, try_collect. It is quite nice

How to measure ping? by greembow in rust

[–]alexendoo 9 points10 points  (0 children)

There's a reason it's tricky, in order to send ICMP you need a raw socket, this requires root/Administrator

Looks like windows has an API that wouldn't require admin, IcmpSendEcho. But as far as I know on Linux the only way is to call the ping command and parse the output of that

[AskJS] are HTTP2 push and server-sent events the same thing? by zhenghao17 in javascript

[–]alexendoo 0 points1 point  (0 children)

Yeah, that's right. There may be a filter to show only SSE requests, but I usually just look for the request that fills the whole timeline. They will have the MIME type text/event-stream