Blog: Rust's Built-In Traits: the When, How and Why


#1

Here is another blog post, this time about the useful traits in std.

If you find an error or something I missed, feel free to comment here.


#2

By default, Rust (like C++) has move semantics

I thought C++ isn’t move by default?

Awesome post, though!


#3

Maybe he’s talking about T&&. Anyway, it isn’t the default value passing.


#4

I was thinking about your Bane impression. :smile:


#5

The title is a bit confusing for built-in rusties :smile:


#6

I have tagged you as built-in rustie now.


#7

That’s appropriate!

I saw this by the way:

Aside: Just before Rust 1.0.0, someone actually implemented Add for String
to mean concatenation. It took yours truly (among others) a heartrending plea
to the Rust gods until they mended this particular error.

+ for String and Vec were implemented some while before Rust 1.0. Add for String still exists and is stable; it was Add for Vec that we removed. (And we said we would revisit the issue of whether to have + on Vec or not, after Rust 1.0).


#8

Yeah, so C++ doesn’t have move semantics by default, it has opt-in move, which was sort of the point of the Bane impression :laughing: