Emit simpler code from format_args
I made this PR so that `cargo expand` dumps a less overwhelming amount of formatting-related code.
<br>
`println!("rust")` **Before:**
```rust
{
::std::io::_print(::core::fmt::Arguments::new_v1(&["rust\n"],
&match () {
_args => [],
}));
};
```
**After:**
```rust
{ ::std::io::_print(::core::fmt::Arguments::new_v1(&["rust\n"], &[])); };
```
`println!("{}", x)` **Before:**
```rust
{
::std::io::_print(::core::fmt::Arguments::new_v1(
&["", "\n"],
&match (&x,) {
_args => [::core::fmt::ArgumentV1::new(
_args.0,
::core::fmt::Display::fmt,
)],
},
));
};
```
**After:**
```rust
{
::std::io::_print(::core::fmt::Arguments::new_v1(
&["", "\n"],
&[::core::fmt::ArgumentV1::new(&x, ::core::fmt::Display::fmt)],
));
};
```
|
||
|---|---|---|
| .. | ||
| bootstrap | ||
| build_helper | ||
| ci | ||
| doc | ||
| etc | ||
| librustdoc | ||
| llvm-project@6b3dbcc81a | ||
| rustdoc-json-types | ||
| test | ||
| tools | ||
| README.md | ||
| stage0.json | ||
| version | ||
This directory contains the source code of the rust project, including:
- The test suite
- The bootstrapping build system
- Various submodules for tools, like rustdoc, rls, etc.
For more information on how various parts of the compiler work, see the rustc dev guide.