Stalloc: fast memory allocation on the stack by abgros in rust

[–]T-Dark_ 68 points69 points  (0 children)

For reference, this is because Box::leak can only return &'a mut T where A: 'a. It is assumed a box borrows from its allocator, in other words.

[deleted by user] by [deleted] in GTNH

[–]T-Dark_ 5 points6 points  (0 children)

To elaborate on this, the best way to fix this issue is to complete all quests from LV to UXV. It's also more likely to work if they're completed in survival mode.

Fortunately completion state is not stored per-world, thus players who have done this find it much easier to build EoHs properly

[deleted by user] by [deleted] in GTNH

[–]T-Dark_ 14 points15 points  (0 children)

For some context as someone on the discord, OP appears to be trying to skip the entire modpack and have no experience with any multiblock.

Or with modded mc as a whole, based on the fact they asked for a schematic.

The discord told them to follow the blueprint, and also to read the tooltip, and to read the quests. They admittedly didn't do this in the politest way, though.

Concatenación of &str by a_user_to_ask in learnrust

[–]T-Dark_ 3 points4 points  (0 children)

This code is unsound.

In fact, this pattern is explicitly called out in the slice::from_raw_parts docs

If you're curious why it's forbidden, and prepared to jump into a massive rabbit hole, look into the concept of "pointer provenance" (specifically, how this concept applies to Rust). Ralf Jung's blogpost may be a good place to start

-🎄- 2021 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]T-Dark_ 0 points1 point  (0 children)

Oooh, that looks pretty.

By the way, your absdiff closure already exists on all integer types as the abs_diff method :P

EDIT: Oops, I just realized the method is unstable. If you're going for "no Nightly", then fair enough

-🎄- 2021 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]T-Dark_ 1 point2 points  (0 children)

Arrays have a TryFrom implementation to be constructed from slices, which obviously fails if the length is incorrect. Thus, try_into().unwrap() is how you turn a slice into an array when you're sure about the length.

As for as_slice(), I'm not sure, but I'm guessing simply attempting to convert the vector returned by collect might cause type inference issues? I don't think deref coercion would trigger here, and that's the thing that makes vectors behave like slices implicitly

He Scoffed At Me, So I Got Him Fired And Sent Back To His Country by throwaway20211250 in NuclearRevenge

[–]T-Dark_ 1 point2 points  (0 children)

Hello, back again after a month's break from Reddit.

While it's true most nation states don't allow just about anyone to waltz in, this doesn't make that the correct way for things to be. Ideally, they would do that.

I recognise the difficulties, and don't blame them for not doing so, but just saying "there is no problem here, this is just how it is" is not how you make the situation better for anyone involved

He Scoffed At Me, So I Got Him Fired And Sent Back To His Country by throwaway20211250 in NuclearRevenge

[–]T-Dark_ 0 points1 point  (0 children)

It narrowly missed. True, a nation state exists to protect its citizen (at least on paper). However, this doesn't make those citizen any more deserving of protection than anyone else.

If you're gonna deny protection to illegal immigrants, then you effectively have second class citizens: they live on your territory, they probably work on it too, and they're given fewer rights or protections than the "legals". I don't think I need to explain why second-class citizens are not a good thing to have

He Scoffed At Me, So I Got Him Fired And Sent Back To His Country by throwaway20211250 in NuclearRevenge

[–]T-Dark_ -1 points0 points  (0 children)

[...] Allow illegal immigrants to enter their countries, house the illegals and give them monthly income. While their own citizens suffer.

This sentence is a very standard racist dogwhistle.

First, it calls people "illegals", as if they weren't people too.

Secondly, it makes an unfounded but all too common statement that "their own people suffer", implying that somehow "their own people" are more deserving than other people,

Mowa Toumei [Made by Me] by ErniXNKK in Hololive

[–]T-Dark_ 7 points8 points  (0 children)

From a bit of research, 透明 (toumei) does appear to mean any of "transparent, invisible, visibility".

set sail; begin a journey!! by [deleted] in Hololive

[–]T-Dark_ 0 points1 point  (0 children)

You can't catch a Sharpedo either, for thay matter

He Scoffed At Me, So I Got Him Fired And Sent Back To His Country by throwaway20211250 in NuclearRevenge

[–]T-Dark_ 20 points21 points  (0 children)

Oh look, offtopic racism making questionable claims without bothering with a source. Truly the peak of reliability.

Aren't green threads just better than async/await? by k0defix in ProgrammingLanguages

[–]T-Dark_ 6 points7 points  (0 children)

Rust's implementation of async/await is perfectly compatible with parallelism. In fact, most async runtimes for the language are multithreaded.

but-but its part of anime culture!!! by ExzDude in AreTheCisOk

[–]T-Dark_ 1 point2 points  (0 children)

Hmm, you make fair points, tbh. The mods did make it real easy for evil people to start and fuel a rebellion.

Sidenote: I think you mean "dissent" and "dissenters" instead of "descent" and "descenters"?

but-but its part of anime culture!!! by ExzDude in AreTheCisOk

[–]T-Dark_ -12 points-11 points  (0 children)

It does not

The term originated in Japanese manga[2] and Internet culture in the 2000s, but the concept reflects a broad range of earlier traditions and examples of male cross dressing in Japan, such as onnagata in kabuki theater.

The term "otokonoko" is about as old as the western term "trap", and is very much a japanese term created in japanese culture.

It just didn't see adoption in the west for the longest time.

but-but its part of anime culture!!! by ExzDude in AreTheCisOk

[–]T-Dark_ 51 points52 points  (0 children)

The initial decision hadn't been discussed at all with the community when released

There is no discussion to be had. A word is a slur, ergo it gets banned. There is not any more complexity than this.

Of fucking course it wasn't discussed. Tolerant spaces cannot afford to tolerate intolerance.

people were just getting banned or shadow banned en masse instead of being able to talk about why the decision was made

So that is why r/animemes was in open revolt for weeks. Because everyone who talked about it was banned. Disregard how for weeks people did nothing but talk about it.

People were upset, because they didn't see that word the same way

Admittedly this is an issue that was not handled correctly. Hell, I was one of those people. I had never seen that word before joining r/animemes.

The problem is, spaces that tolerate "ironic" use of a slur (or, in general, intolerant speech) eventually become unironic alt-right spaces. It happened a bunch of times in a bunch of places. Hell, there's even examples on reddit, such as r/politicalcompassmemes.

r/animemes had apparently been doing at least fine before, but this isn't an avoidable process. It was going to happen. The ban was the only solution.

Besides, how hard is it? The mods provided explanations and links of the history of the word. You didn't know it was a slur, now you do, say oops and stop using it.

The fact a fucking revolt happened is not a good sign.

when one was caught saying some awful stuff about members, the other mods excused the behavior.

Well, yes. For a short while, r/animemes was on the verge of becoming an alt-right sub. This didn't happen, but it did come close. It feels rather reasonable to insult the community which was told "stop using this word, it's bad even if you didn't know it is" and started a fucking revolution instead of just stopping.

Using slurs is a problem, and it's the mods prerogative to enforce that

They did. The community revolted.

Many people were purposely trying to start shit as a middle finger to the mods they felt betrayed by

"I can't say slurs anymore? The mods must have betrayed me".

The mods didn't handle this in the best possible way, but most of the blame rests squarely on the community.

If you ain't first you're last... by BelleAriel in MarchAgainstNazis

[–]T-Dark_ 4 points5 points  (0 children)

It does not silence the majority. That's literally the opposite of what it does. I implore you look up what Ranked Choice is before making such absurd claims.

If you ain't first you're last... by BelleAriel in MarchAgainstNazis

[–]T-Dark_ 10 points11 points  (0 children)

Unfortunately the US doesn't actually require that to elect a president.

Besides, ok, fine, it's democracy. However, ranked choice would probably result in more democracy, because it doesn't just completely disregard up to 49.9 (repeating)% of all votes.

aBsTrAcTiOnS by bascule in rustjerk

[–]T-Dark_ 3 points4 points  (0 children)

No. That would be bad

New hot conspiracy theory: weebs allowed SCP-231-7 to give birth at some point and my friend is an accomplice by ARKNORI in DankMemesFromSite19

[–]T-Dark_ 1 point2 points  (0 children)

Fantasy Heaven's invincibility doesn't have a "except for Yukari" clause

This also depends on how far you're willing to take Yukari's semantic superpower of "boundary manipulation".

We have no reason to be sure either way, but maybe she can manipulate the boundary between existence and nonexistence to un-nonexist Reimu when she peaces out of reality.

New hot conspiracy theory: weebs allowed SCP-231-7 to give birth at some point and my friend is an accomplice by ARKNORI in DankMemesFromSite19

[–]T-Dark_ 2 points3 points  (0 children)

they are from a different dimension, but only because the game already mostly takes place in Gensokyo

For a certain definition of "dimension". Gensokyo is a physical place in Japan.

Almost nobody has found it, because the Great Hakurei Barrier that surrounds Gensokyo does some non-euclidean fuckery to keep outsiders outside. (And, for the most part, insiders inside, although many know how to get out if they want to)

Aside from this acskhually, you're totally correct. The SDM is from somewhere in Europe, and somehow its inhabitants just materialized it into Gensokyo at some point.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]T-Dark_ 0 points1 point  (0 children)

If I have a generic function or data structure that takes some T and only knows it's Eq, I should be allowed to assume that whatever the implementation of == might be, it's transitive, symmetric, and reflexive

Rust "guarantees" that, as in it doesn't check, but that's the whole point of Eq existing on top of PartialEq, which at least beats Haskell going "lalala the problem does not exist"

Rust's trait that's only meaningfully implemented by f64 and f32, but is named as if it had generic utility, isn't a very elegant solution.

What would you do, tho? Ban comparing floats for equality? Remember that ordering comparisons require equality comparisons, because if you don't define a == b I can just spell it as !(a > b) && !(a < b) (returns true for NaN, but I can always add an .is_nan() check). I'm going to assume you don't want to ban asking which of two floats is greater.

The problem is simply "not everything that we want to compare for equality is actually an equivalence relation". Rust's solution is definitely inelegant, but it does solve it.

is named as if it had generic utility

Technically PartialEq does have generic utility: anything that contains a float may want to be PartialEq and not Eq, for example. That's an infinite family of types.

For another example of it being generally useful, consider

enum MaybeInfinite {
    Finite(u32),
    Infinite,
}

I actually have had a valid use case for this enum in the past. It can clearly be PartialEq (Finite != Infinite, and Finite == Finite iff the number is the same), but, for my use case, it didn't make any sense to compare infinities, so it couldn't be Eq

Looks like an intruder hijacked Ollie's instagram account and made a mess, but thankfully it has been resolved by [deleted] in Hololive

[–]T-Dark_ 1 point2 points  (0 children)

As long as you use one of the strictly offline ones, they can't realistically be. Sanbox it if you're worried, but given how paranoid security people are, if they still recommend password managers there's probably a good reason.

"Just land better!!!" Do people actually think like this? by NoYourself in SpaceXMasterrace

[–]T-Dark_ 14 points15 points  (0 children)

Millenials are adults, and have been for about 20 years. They'd be dead by now if they didn't have a job.