Move assignment / pass-by-move by default for non-trivial types, explicit clone() operation for a copy. Looks to be a destructive move with a compiler error if you use a moved-from object. #rustlang
-
Show this thread
-
Ran a few experiments. It's interesting what is and isn't allowed to compile with Rust move semantics. Here we can clearly see we won't ever actually move from s but still an error.pic.twitter.com/JrsRAtgkbP
2 replies 0 retweets 1 likeShow this thread -
-
-
-
Allowed to have N immutable references or at most 1 mutable reference with 0 immutable references to an object. I'm sure this has huge implications. I wonder, for example, how you build a mutable doubly-linked list. More to read.
#rustlang1 reply 0 retweets 0 likesShow this thread -
And finally substring / slice / string_view with a nice bit syntactic sugar. Half-open ranges are a good choice.
#rustlang1 reply 0 retweets 0 likesShow this thread -
Ch 5 Structs. Some fairly unique shorthand for initialization with the field init shorthand syntax and .. struct update syntax. Struct tuples as strong typedefs for tuples looks nice. Looks like I have to wait til Ch 10 to see how to have a reference member.
#rustlang1 reply 0 retweets 0 likesShow this thread -
"Methods can take ownership of self" feels weird but I'll try to keep an open mind.
#rustlang1 reply 0 retweets 0 likesShow this thread -
The chapter never explained any rationale for why methods and associated functions (in C++ static member functions) are in a separate impl block apart from the struct definition. It's a mystery.
#rustlang2 replies 0 retweets 0 likesShow this thread
You can make different blocks with different bounds, so methods only exist when the constraints are fulfilled. If that makes sense
-
-
Replying to @rustlang
It doesn't yet, but it sounds interesting and I look forward to when it does.
1 reply 0 retweets 1 like -
Replying to @EscJaeger
For example, Option<T> has all of these different impl blocks:pic.twitter.com/YlT0OjJY3f
1 reply 0 retweets 0 likes - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.