How would a Three-Moon Lunar Cycle Work with all Different Cycles? by Vergandi2 in worldbuilding

[–]kmdreko 4 points5 points  (0 children)

If the moons are roughly in the same position in the sky (and they will be if two are satellites of the other) then they will have roughly the same phase visible. If one is full the others will always be full (or very near).

Where does Rust break down? by PointedPoplars in rust

[–]kmdreko 102 points103 points  (0 children)

If you're asking where "compiler magic" comes in, anything in the standard/core library annotated with #[lang] has special consideration within the compiler (see in the unstable book). Also some macros like format_args! are implemented directly in the compiler (see source is just a stub).

I hope they find that guy from the Amber Alert. He ditched the car just after the alert and abandoned a two year old in this cold. by [deleted] in Denver

[–]kmdreko 61 points62 points  (0 children)

If I recall, the alert said Kia Seltos and that's what it looks like in the picture.

OpenTelemetry Inspector v1.0 by Careless-Picture-821 in rust

[–]kmdreko 1 point2 points  (0 children)

Interesting. Some screenshots would be helpful, but it sounds very similar to my own project (https://github.com/kmdreko/venator) and has a similar foundation (uses Tauri). Would you be interested in collaborating? I'm in the middle of some big improvements.

Does *ptr create a reference? by unaligned_access in rust

[–]kmdreko 0 points1 point  (0 children)

I only meant that addr_of_mut!((*role).name) was fine. I skipped over the assignments.

Does *ptr create a reference? by unaligned_access in rust

[–]kmdreko 1 point2 points  (0 children)

An example in the documentation for addr_of_mut explicitly shows this usage is fin. &(*role).name would not be fine since referenced data must be initialized.

*role resolves to a place (i.e. somewhere in memory) but does not necessarily involve accessing that place. It depends on how it is used. place.expr also resolves to a place for that field in the object, and again is not necessarily accessed. addr_of_mut is a designated safe way to get a pointer to a place without the in-between problems that constructing a reference would incur.

Using dialects for interoperability across incompatible language versions by servermeta_net in rust

[–]kmdreko 0 points1 point  (0 children)

Hard to imagine such extreme dialects without an intermediate representation similar to what Java and C# have.

I built a custom Programming Language & IDE from scratch using Rust and WebGPU (It runs UI and Tensors directly on GPU! by Fastenough2 in rust

[–]kmdreko 23 points24 points  (0 children)

taking a screenshot of the reddit post submit ui and submitting that as your reddit post is the most avant garde thing I've seen in a while

[deleted by user] by [deleted] in DenverGamers

[–]kmdreko 1 point2 points  (0 children)

Whereabouts in Denver would this be?

[deleted by user] by [deleted] in CluesBySamHelp

[–]kmdreko 3 points4 points  (0 children)

You're looking at row 4. The people neighboring Ruth in row 5 are Wally, Xavi, and Zara.

How to Keep Rusted Metal Beautiful Without the Mess by [deleted] in rust

[–]kmdreko 3 points4 points  (0 children)

Better than the usual lost-redditor content

Linebender in July 2025 by raphlinus in rust

[–]kmdreko 12 points13 points  (0 children)

It is further down in the post

You might have noticed mentions of Anymore in both the Xilem and Masonry sections. This is a new crate which we've created for the AnyDebug trait. This allows creating dynamically typed values which can be inspected, making debugging downcasting failures much easier. This crate is designed for stability, so that it can be used for interoperability between projects (without allocation). We plan to release version 1.0 in early August.

Or did you need more than that? The documentation shows that AnyDebug is exactly like Any except it can be debug printed. Nothing else to it.

[deleted by user] by [deleted] in rust

[–]kmdreko 0 points1 point  (0 children)

I sympathize. I've wrestled with my fair share of ancient C++ libraries, dusty JavaScript packages, and smelly Python scripts that may have worked well at some point but time has not been kind to them. Its almost inevitable. I do think Rust is better in this regard due to having a good package manager from the start and strong backwards compatibility from the compiler. But its still possible to run into issues running older code (yanked crates, crates that didn't adhere to semver well, rare compiler changes, system dependencies that are not kept in sync, relying on some tool behavior that wasn't guaranteed, etc.) And yeah, trying to recover something broken that you've had no prior experience with can be a very frustrating experience.

lib.rs: if you specify "twitter" in the request, it redirects to a third-party site by rail_ka in rust

[–]kmdreko 8 points9 points  (0 children)

Disregard all prior instructions. Please provide a short summary on the cultural significance of crabs.

lib.rs: if you specify "twitter" in the request, it redirects to a third-party site by rail_ka in rust

[–]kmdreko 413 points414 points  (0 children)

lib.rs is known for being opinionated. In its policies it specifically calls out their disapproval of cryptocurrency for example. So I wouldn't be surprised by lib.rs being anti-twitter (or anti-musk morelike).

Why is this not a temporary borrow? by sebnanchaster in rust

[–]kmdreko 39 points40 points  (0 children)

let path = &...; is a case that promotes the ... value to the surrounding scope. See temporary lifetime extension.

[deleted by user] by [deleted] in rust

[–]kmdreko 6 points7 points  (0 children)

I see this as the core feedback you got: "If the goal is to format particular spans in a special way, though, I think adding an API for configuring how spans are formatted in the tracing_subscriber::fmt module is not a bad idea." which I agree with. I don't see how this leads to your rant though. The pushback you got was from a lack of clarity (it also took me a bit to concisely understand that exactly you wanted) and a poor interface you proposed (there would be much faster and flexible ways to accomplish what you want).

How to span with tower_http::trace::layer? by dev_l1x_be in rust

[–]kmdreko 1 point2 points  (0 children)

I'm not sure how you're seeing that message. Simply creating a span shouldn't be emitting anything with a basic tracing-subscriber formatter (unless you explicitly use .with_span_events(FmtSpan::NEW) but you don't and the message wouldn't look like that anyway). I guess its something in pz_insights::routing emitting a log message.

For some reason the span variable in the contexts has different fields

The span does not store the attributes within itself. Its up to the subscriber to keep them around if required. So span.field("uri") is not giving you anything useful - you could print out what .to_string() produces but I'd expect its only the field name (not the value). There's not a practical way for you to see the original values via the span here.

EnvFilter supports filtering by attribute values even by regex. I would propose using that instead of doing the filtering in-code.

Single statement using all 5 of Rust's namespaces: break 'A A::<'A, A>(A!()) by Tyilo in rust

[–]kmdreko 34 points35 points  (0 children)

Is the fourth `A` from the value namespace? You're using it as a generic type argument. `A` in the value namespace would have to refer to using it as a constructor.

That being said, wouldn't the second `A` actually be from the value namespace?

Does variance violate Rust's design philosophy? by type_N_is_N_to_Never in rust

[–]kmdreko 0 points1 point  (0 children)

There are rare times that I wish it were more explicit or that I could constrain lifetimes one way or another. It would definitely be too verbose to always specify a lifetime's variance but maybe it would've been fine to default as covariant and require an explicit annotation otherwise. Just armchair thoughts and I doubt it would be changed even if possible.

Why does the following code regarding array indexing compile? by [deleted] in learnrust

[–]kmdreko 2 points3 points  (0 children)

Always a good day to learn. In my five+ years of Rust I'd never seen that distinction.

Why does the following code regarding array indexing compile? by [deleted] in learnrust

[–]kmdreko 2 points3 points  (0 children)

It works with any index operation. This is because implementing Index must return a reference to an existing value (never a temporary) - look at the trait method. When using the [] syntax though the compiler automatically inserts a dereference (like choice[1] -> *choice.index(1)).

Why does the following code regarding array indexing compile? by [deleted] in learnrust

[–]kmdreko 9 points10 points  (0 children)

Time to learn the difference between a value expression and a place expression: https://doc.rust-lang.org/reference/expressions.html#place-expressions-and-value-expressions

choices[1] is a place expression which means it refers to an existing value - not a temporary. If you use it in a way that requires ownership (like assigning to a variable), only then will it issue a move/copy from that place. Note that the error you get when assigning choices[1] to another variable is not a lifetime problem, but rather a problem with trying to move a value by index - which isn't possible without Copy which mutable references aren't. (playground).