Would love to get some more clarity on them!
Question
Qualified path patterns can only refer to associated constants.
I can put ::A in a match - doesn't it count as a qualified path pattern?
As stated here - Paths - The Rust Reference
QualifiedPathType :
< Type (as TypePath)? >
"as" is optional here
Question
Enum types cannot be denoted structurally as types, but must be denoted by named reference to an enum item.
Does that mean there's no single "enum" type, but rather every defined enum is different? Isn't that the case with structs? I'm not sure if I understand it.
Question
Function pointer types, written using the fn keyword, refer to a function whose identity is not necessarily known at compile-time. They can be created via a coercion from both function items and non-capturing closures.
Type of fn items and non-capturing closures is typically known at compile time, right? Is there any example where this isn't the case? (Maybe receiving such closure through FFI - is that possible?)
Question
Additionally, the item will be publicly exported from the produced library or object file, similar to the used attribute
Will "no_mangle" and "used" attributes export publicly a private item?
Question
A trait may be implemented for Box in the same crate as T, which the orphan rules prevent for other generic types.
Shouldn't this be documented for other types (like Pin) too?
As stated here - Glossary - The Rust Reference
Any time a type T is considered local, &T, &mut T, Box, and Pin are also considered local.
Question
Note: This representation is unchanged if the tag is given its own member in the union, should that make manipulation more clear for you
I get what primitive repr of enums with fields looks like, but I don't understand this note.
Question
Bounds that don't use the item's parameters or higher-ranked lifetimes are checked when the item is defined. It is an error for such a bound to be false
Can you provide me an example where higher-ranked lifetime bound is false?
Question
If variance in T means "we can initialize &'short T with &'long T where 'long: 'short"
then what does variance in 'a (lifetime, not type) mean? (I'm referring to the variance table)
Question
When a reference (but not a Box!) is passed to a function, it is live at least as long as that function call, again except if the &T contains an UnsafeCell.
9a. Not a Box, because it can be dropped inside the function, right? Also, why not in case of &UnsafeCell? All we can do with it is getting &mut (or *mut), so it should behave the same as mutable reference.
All this also applies when values of these types are passed in a (nested) field of a compound type, but not behind pointer indirections
9b. Passed to a function or passed wherever?
primitive operation
9c. What is a primitive operation? Does arithmetic operation count as a primitive one?
If the size is 0, then the pointer must either point inside of a live allocation (including pointing just after the last byte of the allocation), or it must be directly constructed from a non-zero integer literal
9d. Does the manually contructed one have to point inside of a live allocation too? Also, why non-zero integer? Is 0 memory address always invalid?
Question
The second operand of a lazy boolean expression.
Can't the first operand be a temporary scope too? Like in this example:
(PrintOnDrop("first operand").0 == "" || PrintOnDrop("second operand").0 == "");