about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-10 06:28:41 +0100
committerGitHub <noreply@github.com>2025-01-10 06:28:41 +0100
commitefc25237ac3da1d7e39aebbd0b5d959ed7e22b18 (patch)
tree29f2087e2a84f065d7c1d59e94f2ebc5d15f55c0
parent7739e282ec43637015919429eca119c16d527d1b (diff)
parent00448ab45ab952749d4d4d14894cee8ff3231cd3 (diff)
downloadrust-efc25237ac3da1d7e39aebbd0b5d959ed7e22b18.tar.gz
rust-efc25237ac3da1d7e39aebbd0b5d959ed7e22b18.zip
Rollup merge of #135294 - ChrisDenton:bare-fn-width, r=jieyouxu
Make `bare-fn-no-impl-fn-ptr-99875` test less dependent on path width

This sets diagnostic-width to some arbitrary number. Seems to work on my machine.
-rw-r--r--tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs2
-rw-r--r--tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr12
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs
index cf73fd8d31f..f776a6ce4c1 100644
--- a/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs
+++ b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs
@@ -1,3 +1,5 @@
+// Sets some arbitrarily large width for more consistent output (see #135288).
+//@ compile-flags: --diagnostic-width=120
 struct Argument;
 struct Return;
 
diff --git a/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr
index 5b89158b0db..ba0af763975 100644
--- a/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr
+++ b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
-  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:12:11
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11
    |
 LL |     takes(function);
    |     ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
@@ -7,7 +7,7 @@ LL |     takes(function);
    |     required by a bound introduced by this call
    |
 note: required by a bound in `takes`
-  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:11:18
    |
 LL | fn takes(_: impl Trait) {}
    |                  ^^^^^ required by this bound in `takes`
@@ -16,18 +16,18 @@ help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`,
 LL |     takes(function as fn(Argument) -> Return);
    |                    +++++++++++++++++++++++++
 
-error[E0277]: the trait bound `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}: Trait` is not satisfied
-  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11
+error[E0277]: the trait bound `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11: 16:34}: Trait` is not satisfied
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11
    |
 LL |     takes(|_: Argument| -> Return { todo!() });
    |     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the trait `Trait` is not implemented for closure `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}`
+   = help: the trait `Trait` is not implemented for closure `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:16:11: 16:34}`
    = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
 note: required by a bound in `takes`
-  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:11:18
    |
 LL | fn takes(_: impl Trait) {}
    |                  ^^^^^ required by this bound in `takes`