rust/src/test/ui/closures
bors aa8f27bf4d Auto merge of #87668 - estebank:tweak-bound-output, r=oli-obk
Use note for pointing at bound introducing requirement

Modify output for pointing where a trait bound obligation is introduced in an E0277 from using a span label to using a note in order to always preserve order of the output:

Before:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
  ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | --------------- required by this bound in `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
```
After:
```
error[E0277]: `<<Self as Case1>::A as Iterator>::Item` doesn't implement `Debug`
  --> $DIR/bounds-on-assoc-in-trait.rs:18:28
   |
LL |     type A: Iterator<Item: Debug>;
   |                            ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
note: required by a bound in `Debug`
  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
   |
LL | pub trait Debug {
   | ^^^^^^^^^^^^^^^ required by this bound in `Debug`
```
2021-08-17 06:59:49 +00:00
..
2229_closure_analysis Update test output. 2021-08-16 11:38:32 +02:00
closure-expected-type Update ui tests 2021-02-01 18:23:12 +01:00
print Modify structured suggestion output 2021-08-11 09:46:24 +00:00
closure-array-break-length.rs ty: convert ErrorHandled::Reported to ConstKind::Error. 2020-04-16 19:00:30 +03:00
closure-array-break-length.stderr ty: convert ErrorHandled::Reported to ConstKind::Error. 2020-04-16 19:00:30 +03:00
closure-bounds-cant-promote-superkind-in-struct.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-cant-promote-superkind-in-struct.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
closure-bounds-static-cant-capture-borrowed.nll.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
closure-bounds-static-cant-capture-borrowed.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-static-cant-capture-borrowed.stderr Don't suggest adding 'static lifetime to arguments 2021-05-12 21:43:09 -04:00
closure-bounds-subtype.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-subtype.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
closure-immutable-outer-variable.fixed liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-immutable-outer-variable.rs liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-immutable-outer-variable.rs.fixed remove remaining copyright headers 2018-12-28 21:50:33 +01:00
closure-immutable-outer-variable.stderr liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-move-sync.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
closure-move-sync.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
closure-no-fn-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-1.stderr diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-no-fn-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-2.stderr diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-no-fn-3.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-3.stderr pretty.rs: Update Closure and Generator print 2020-09-28 01:27:19 -04:00
closure-no-fn-4.rs diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-no-fn-4.stderr diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-no-fn-5.rs diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-no-fn-5.stderr diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-referencing-itself-issue-25954.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-referencing-itself-issue-25954.stderr Update tests 2019-03-11 23:10:26 +03:00
closure-reform-bad.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-reform-bad.stderr diagnostics: Note capturing closures can't be coerced to fns 2020-11-29 03:35:38 -05:00
closure-return-type-mismatch.rs Explain where the closure return type was inferred 2020-10-22 10:44:55 -04:00
closure-return-type-mismatch.stderr Explain where the closure return type was inferred 2020-10-22 10:44:55 -04:00
closure-wrong-kind.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-wrong-kind.stderr Update tests 2019-03-11 23:10:26 +03:00
closure_cap_coerce_many_fail.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_cap_coerce_many_fail.stderr pretty.rs: Update Closure and Generator print 2020-09-28 01:27:19 -04:00
closure_no_cap_coerce_many_check_pass.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_run_pass.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_unsafe_0.mir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
closure_no_cap_coerce_many_unsafe_0.rs Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
closure_no_cap_coerce_many_unsafe_0.thir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
closure_no_cap_coerce_many_unsafe_1.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
coerce-unsafe-closure-to-unsafe-fn-ptr.rs Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr Test -Zthir-unsafeck for unsafe function calls 2021-05-11 20:35:38 +02:00
coerce-unsafe-to-closure.rs Remove compile-fail test suite 2020-12-29 23:39:56 +03:00
coerce-unsafe-to-closure.stderr Remove compile-fail test suite 2020-12-29 23:39:56 +03:00
deeply-nested_closures.rs Avoid exponential behaviour when relating types 2020-02-02 12:10:08 +00:00
diverging-closure.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
issue-41366.rs Normalize projection bounds when considering candidates 2020-10-06 11:19:31 +01:00
issue-41366.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
issue-46742.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
issue-48109.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
issue-52437.rs Update tests 2020-06-28 10:08:12 -07:00
issue-52437.stderr Update tests 2020-06-28 10:08:12 -07:00
issue-67123.rs Do not ICE on closure 2019-12-09 18:55:38 +09:00
issue-67123.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
issue-68025.rs Fix ICE #68025 2020-01-20 07:06:27 +09:00
issue-72408-nested-closures-exponential.rs Only visit types once when walking the type tree 2020-09-17 20:44:11 -05:00
issue-80313-mutable-borrow-in-closure.rs Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutable-borrow-in-closure.stderr Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutable-borrow-in-move-closure.rs Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutable-borrow-in-move-closure.stderr Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutation-in-closure.rs Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutation-in-closure.stderr Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutation-in-move-closure.rs Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-80313-mutation-in-move-closure.stderr Point to span of upvar making closure FnMut 2021-01-25 16:53:27 +11:00
issue-81700-mut-borrow.rs Fix panic when emitting diagnostic for closure mutable binding error 2021-02-03 12:36:24 -05:00
issue-81700-mut-borrow.stderr Fix panic when emitting diagnostic for closure mutable binding error 2021-02-03 12:36:24 -05:00
issue-82438-mut-without-upvar.rs Skip emitting closure diagnostic when closure_kind_origins has no entry 2021-02-23 09:46:20 -05:00
issue-82438-mut-without-upvar.stderr Skip emitting closure diagnostic when closure_kind_origins has no entry 2021-02-23 09:46:20 -05:00
issue-84128.rs fix reporting return type in some cases 2021-04-16 17:06:19 +02:00
issue-84128.stderr fix reporting return type in some cases 2021-04-16 17:06:19 +02:00
local-type-mix.rs Lower closure prototype after its body. 2021-01-21 22:59:07 +01:00
local-type-mix.stderr Lower closure prototype after its body. 2021-01-21 22:59:07 +01:00
old-closure-arg-call-as.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-arg.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-explicit-types.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-expr-precedence.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-expr-precedence.stderr Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-expression-remove-semicolon.fixed Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-expression-remove-semicolon.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-expression-remove-semicolon.stderr Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-fn-coerce.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-iter-1.rs Move block-related tests 2021-01-01 09:23:10 +09:00
old-closure-iter-2.rs Move block-related tests 2021-01-01 09:23:10 +09:00