Skip to content

Commit 00448ab

Browse files
committed
Make bare-fn test less dependent on path width
1 parent a580b5c commit 00448ab

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Sets some arbitrarily large width for more consistent output (see #135288).
2+
//@ compile-flags: --diagnostic-width=120
13
struct Argument;
24
struct Return;
35

tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
2-
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:12:11
2+
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11
33
|
44
LL | takes(function);
55
| ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
66
| |
77
| required by a bound introduced by this call
88
|
99
note: required by a bound in `takes`
10-
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
10+
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:11:18
1111
|
1212
LL | fn takes(_: impl Trait) {}
1313
| ^^^^^ required by this bound in `takes`
@@ -16,18 +16,18 @@ help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`,
1616
LL | takes(function as fn(Argument) -> Return);
1717
| +++++++++++++++++++++++++
1818

19-
error[E0277]: the trait bound `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}: Trait` is not satisfied
20-
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11
19+
error[E0277]: the trait bound `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11: 16:34}: Trait` is not satisfied
20+
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11
2121
|
2222
LL | takes(|_: Argument| -> Return { todo!() });
2323
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
2424
| |
2525
| required by a bound introduced by this call
2626
|
27-
= help: the trait `Trait` is not implemented for closure `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}`
27+
= help: the trait `Trait` is not implemented for closure `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11: 16:34}`
2828
= help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
2929
note: required by a bound in `takes`
30-
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
30+
--> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:11:18
3131
|
3232
LL | fn takes(_: impl Trait) {}
3333
| ^^^^^ required by this bound in `takes`

0 commit comments

Comments
 (0)