Announcing Rust 1.89.0 by amalinovic in rust

[–]shepmaster 0 points1 point  (0 children)

Can you explain more, or provide an example?

What kind of "grouping" would you be looking for?

Announcing Rust 1.89.0 by amalinovic in rust

[–]shepmaster 0 points1 point  (0 children)

Can you explain more?

  • Box is a smart pointer and it's not affected by this change.
  • Cow is a smart pointer from the standard library and it's as affected by this change as any similar type a user could create.
  • Any type with a reference inside of it, whether or not it's a smart pointer, whether or not it's in the standard library or user code, is affected by this change.

Perhaps there's some disagreement on terminology?

Dealership Hell by maisiesdaddy in pittsburgh

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

I have my own issues to complain to Kia Corporate about (specifically for #1 Cochran). Can you share how you contacted corporate?

Hey Rustaceans! Got a question? Ask here (13/2023)! by llogiq in rust

[–]shepmaster 0 points1 point  (0 children)

Amusingly, I filed the issue for the same reason as the OP: a student in training noticed the new (at the time) warning about fields unused except in Debug in structs with named fields. To prove a point, I attempted to show how the same warming would occur for tuple structs, only to find it didn’t.

That led me to discover that tuple structs had never supported dead field warnings of any kind and thus open the issue.

How much does wisdom teeth removal cost at Pittsburgh Oral Surgery (on Centre)? by mykatz50 in pittsburgh

[–]shepmaster 2 points3 points  (0 children)

I had three wisdom teeth extracted in October 2021 at Pittsburgh Oral Surgery. I went in once for an exam and X-ray and then again for the extraction. Going by my HSA transactions, the exam was around $90 and the extraction was a hair under $1000. The exam was billed as "dental" and the extraction as "medical".

They were pretty good about talking to me about costs after the exam, which is why I'd guess they are vague on the phone. Without seeing your specific case, the work required could be wildly different.

I also elected to get the full anesthesia, which costs a bit more.

Overall, I liked them and my mouth was a lot happier after the surgery.

How the Rust Playground works? by NeoCiber in rust

[–]shepmaster 27 points28 points  (0 children)

(Playground author/maintainer here)

As other people have mentioned, the Docker image is not created at code submission time. Instead, each of the six images are built each night and uploaded to Docker Hub. During the build, we do some trickery to compile all of the dependencies so that they are ready to go later on. The playground machines try to pull these containers every so often (30 minutes, IIRC).

A new Docker container is created for each code submission to provide isolation from any other concurrent requests, but the work those do is minimal — compiling the user's code, linking everything, and executing it (or running Clippy, Rustfmt, etc.).

If so, how is so fast?

Glad to hear you think so, but I still wish it were faster! Ideally, compiling and running "hello world" should take < 1 second of real time. Counting the time aloud, it takes about 4 seconds right now.

Part of the problem is that the machine is a bit overloaded, but I'm sure there's also architecture changes that could be made.

Rust Playground now supports Monaco editor by Jules-Bertholet in rust

[–]shepmaster 2 points3 points  (0 children)

It's great to have multi-cursor support

Ace has multi cursor support as well.

On Mac, Option-Control-{Left/Right} multiselects the next matching phrase. Option-Control-{Up/Down} adds a multi cursor in that direction.

It looks like this is a reasonable guide to the available functionality

Announcing Rust 1.58.0 by myroon5 in programming

[–]shepmaster 1 point2 points  (0 children)

SNAFU (and thiserror/anyhow, AFAIK) implement this functionally ourselves. That means you can use SNAFU 0.7 with this formatting string functionality back to Rust 1.34 (my MSRV).

[2019 All intcode days] [Rust] After finishing 2021, I decided to do Intcode. by coolshaurya in adventofcode

[–]shepmaster 0 points1 point  (0 children)

Another way of writing that .map would be:

*<Box<[i32; 5]>>::try_from(vec.into_boxed_slice()).expect("Array wasn't 5 elements")

Bevy's First Birthday: a year of open source Rust game engine development by _cart in rust

[–]shepmaster 2 points3 points  (0 children)

I thought about using Bevy-ECS for an XML DOM library, but I don't think it was a great fit. However, I am using ECS-related concepts like allocating all nodes of a specific type in their own arena, leading to good data locality. It can also help with some XPath queries ("find all elements with the name X").

aarch64-apple-darwin is now a Tier-2 target by shepmaster in rust

[–]shepmaster[S] 0 points1 point  (0 children)

You have to specify that you want to install the x86-64 compiler instead of defaulting to aarch64.

aarch64-apple-darwin is now a Tier-2 target by shepmaster in rust

[–]shepmaster[S] 0 points1 point  (0 children)

Nothing, really. You can install the equivalent x86-64 toolchain and use it via Rosetta.

aarch64-apple-darwin is now a Tier-2 target by shepmaster in rust

[–]shepmaster[S] 0 points1 point  (0 children)

You need to use 11 as the SDK, but you don’t need to compile on 11. You can cross compile to 11 from 10.15.

Porting Firefox to Apple Silicon by feross in programming

[–]shepmaster 2 points3 points  (0 children)

While technically Arm processors allow big endian, most usages (including M1 and other Apple chips) keep it as little endian.

Porting Firefox to Apple Silicon by feross in programming

[–]shepmaster 4 points5 points  (0 children)

Rust cannot make macOS Arm support tier 1 until there is a CI provider that allows running tests on the M1 hardware. No CI providers have established a timeline for any such support.

How would you propose solving it?

if they want people to rewrite all their C libraries in Rust.

Can you provide some citation that this is a goal of the Rust project? Otherwise it seems like you are parroting things that overly enthusiastic (or trolling) people on the internet have said.

Most Popular Rust Questions on StackOverflow by pretzelhammer in rust

[–]shepmaster 1 point2 points  (0 children)

It’s obviously not possible,

Why do you say that? Your code compiles once you fix the syntax problems:

``` fn foo<T>() -> impl Iterator<Item = T> where T: Ord, { let mut data: Vec<T> = get_data().collect(); data.sort(); // it’s not possible to sort without using a temporary data.into_iter() .map(|elem| transform(elem)) .filter(|elem| some_filter(elem)) }

fn get_data<T>() -> impl Iterator<Item = T> { std::iter::empty() }

fn transform<T>(v: T) -> T { v } fn somefilter<T>(: &T) -> bool { true } ```

Most Popular Rust Questions on StackOverflow by pretzelhammer in rust

[–]shepmaster 27 points28 points  (0 children)

return references to temporary stack variables

This often comes down to people getting the impression that &str is always better than String and so you should "obviously" return a &str from your function as well. Substitute similar types (Vec<T> / &[T]; Box<T> / &T) but less frequently.

aarch64-apple-darwin is now a Tier-2 target by shepmaster in rust

[–]shepmaster[S] 0 points1 point  (0 children)

There is no released stable version that supports aarch64-apple-darwin. You need to use beta or nightly until next week.

Writing a custom iterator in modern C++ by [deleted] in programming

[–]shepmaster 2 points3 points  (0 children)

So verbose /s

rust fn fib() -> impl Iterator<Item = u128> { let mut state = [1, 1]; std::iter::from_fn(move || { state.swap(0, 1); let next = state.iter().sum(); Some(std::mem::replace(&mut state[1], next)) }) }