Unit-like structs doc: Improve code sample
r? @steveklabnik
BTW it seems that
```Rust
let p = Proton {};
```
compiles without an error. That's why I didn't add it to the example. It's about consistency anyway.
Make transmuting from fn item types to pointer-sized types a hard error.
Closes#19925 by removing the future compatibility lint and the associated workarounds.
This is a `[breaking-change]` if you `transmute` from a function item without casting first.
For more information on how to fix your code, see https://github.com/rust-lang/rust/issues/19925.
Simplify `TokenTree` and fix `macro_rules!` bugs
This PR
- fixes#39390, fixes#39403, and fixes#39404 (each is a [breaking-change], see issues for examples),
- fixes#39889,
- simplifies and optimizes macro invocation parsing,
- cleans up `ext::tt::transcribe`,
- removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
- instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
- removes `parser.quote_depth` and `parser.parsing_token_tree`, and
- removes `quote_matcher!`.
- Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
- I found no outside uses of `quote_matcher!` when searching Rust code on Github.
r? @nrc
Move two large error_reporting fn's to a separate file
Hello!
I tried to make `librustc/infer/error_reporting,rs` more readable by modularizing it and moving its two largest functions to a separate file.
If you have any suggestions, please send it right away! 🚀
Thanks goes to @nikomatsakis for supporting.
added Error and Display impl for std::ffi::FromBytesWithNulError
Fixes#39925.
This is my first PR, so I wasn't quite sure about the stability annotation.
impl RangeArgument for RangeInclusive and add appropriate tests
Now that `RangeArgument` returns a `Bound`, the impl for `RangeInclusive` is natural to implement and all that's required are tests around it.
Simplify `TokenTree` and fix `macro_rules!` bugs
This PR
- fixes#39390, fixes#39403, and fixes#39404 (each is a [breaking-change], see issues for examples),
- fixes#39889,
- simplifies and optimizes macro invocation parsing,
- cleans up `ext::tt::transcribe`,
- removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
- instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
- removes `parser.quote_depth` and `parser.parsing_token_tree`, and
- removes `quote_matcher!`.
- Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
- I found no outside uses of `quote_matcher!` when searching Rust code on Github.
r? @nrc
sort unstable book alphabetically
I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically
r? @frewsxcv
Structs doc: Change "pointers" to "references"
Let's call them "references" instead of "pointers". That's how they're called in chapter 4.9 "References and Borrowing".
r? @steveklabnik
I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically
Make lifetime elision docs clearer
Previously it said
"It's forbidden to allow reasoning about types based on the item signature alone."
I think that sentence is wrong. Rust **uses** the item signatures to perform type inference within the body. I think what's meant is the other way around: It does not infer types for item signatures.
r? @steveklabnik
Example for how to provide stdin using std::process::Command
Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.
r? @steveklabnik