about summary refs log tree commit diff
path: root/src/test/ui/issues
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-21 06:20:18 +0000
committerbors <bors@rust-lang.org>2022-01-21 06:20:18 +0000
commit0bcacb391b28460f5a50fd627f01f670dfcfc7cc (patch)
treeefe7eacd74114713b277589bdda6716bd4e59e25 /src/test/ui/issues
parent523be2e05da322daaecf1ecc8f2c0d625f5f46e3 (diff)
parent7ee21e3de115e086061e5fdc5729c4e41969def9 (diff)
downloadrust-0bcacb391b28460f5a50fd627f01f670dfcfc7cc.tar.gz
rust-0bcacb391b28460f5a50fd627f01f670dfcfc7cc.zip
Auto merge of #91359 - dtolnay:args, r=Mark-Simulacrum
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)],
    ));
};
```
Diffstat (limited to 'src/test/ui/issues')
-rw-r--r--src/test/ui/issues/issue-69455.stderr18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/test/ui/issues/issue-69455.stderr b/src/test/ui/issues/issue-69455.stderr
index da84a6b52da..95617e4ecc8 100644
--- a/src/test/ui/issues/issue-69455.stderr
+++ b/src/test/ui/issues/issue-69455.stderr
@@ -1,8 +1,16 @@
-error[E0284]: type annotations needed: cannot satisfy `<u64 as Test<_>>::Output == _`
-  --> $DIR/issue-69455.rs:29:26
+error[E0282]: type annotations needed
+  --> $DIR/issue-69455.rs:29:5
    |
+LL |     type Output;
+   |     ------------ `<Self as Test<Rhs>>::Output` defined here
+...
 LL |     println!("{}", 23u64.test(xs.iter().sum()));
-   |                          ^^^^ cannot satisfy `<u64 as Test<_>>::Output == _`
+   |     ^^^^^^^^^^^^^^^---------------------------^
+   |     |              |
+   |     |              this method call resolves to `<Self as Test<Rhs>>::Output`
+   |     cannot infer type for type parameter `T` declared on the associated function `new`
+   |
+   = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0283]: type annotations needed
   --> $DIR/issue-69455.rs:29:26
@@ -25,5 +33,5 @@ LL |     println!("{}", 23u64.test(xs.iter().sum::<S>()));
 
 error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0283, E0284.
-For more information about an error, try `rustc --explain E0283`.
+Some errors have detailed explanations: E0282, E0283.
+For more information about an error, try `rustc --explain E0282`.