about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-07 20:28:19 +0200
committerGitHub <noreply@github.com>2024-08-07 20:28:19 +0200
commite5a3c32ffa5c4e26e82955f26352e9d9a6bcd05d (patch)
treeb74f74c492a39da05e0970c6c94a24b421402b0b
parent8f5b50d4ba7cbbfffb9d8c5d268459ff2207a5c1 (diff)
parentb174cf827bc020f45ca603723eb8d3c4c5ae339e (diff)
downloadrust-e5a3c32ffa5c4e26e82955f26352e9d9a6bcd05d.tar.gz
rust-e5a3c32ffa5c4e26e82955f26352e9d9a6bcd05d.zip
Rollup merge of #128755 - yaahc:jj-crlf, r=estebank
Integrate crlf directly into related test file instead via of .gitattributes

resolves https://github.com/rust-lang/rust/issues/128708

This PR seeks to resolve a contributor papercut when using jj to manage the git repo locally which does not support .gitattributes. It does so by integrating the crlf characters directly into the related test and disabling Git's end of line normalization logic across platforms for that specific file, instead of configuring git to always check out the files with alternative eol characters.

related documentation: https://git-scm.com/docs/gitattributes#Documentation/gitattributes.txt-Unset-1
-rw-r--r--tests/rustdoc-ui/intra-doc/.gitattributes2
-rw-r--r--tests/rustdoc-ui/intra-doc/warning-crlf.rs52
2 files changed, 27 insertions, 27 deletions
diff --git a/tests/rustdoc-ui/intra-doc/.gitattributes b/tests/rustdoc-ui/intra-doc/.gitattributes
index 6c125fac52f..0ac2e3c27f4 100644
--- a/tests/rustdoc-ui/intra-doc/.gitattributes
+++ b/tests/rustdoc-ui/intra-doc/.gitattributes
@@ -1 +1 @@
-warning-crlf.rs eol=crlf
+warning-crlf.rs -text
diff --git a/tests/rustdoc-ui/intra-doc/warning-crlf.rs b/tests/rustdoc-ui/intra-doc/warning-crlf.rs
index ab096b860f8..9d3a4673c9d 100644
--- a/tests/rustdoc-ui/intra-doc/warning-crlf.rs
+++ b/tests/rustdoc-ui/intra-doc/warning-crlf.rs
@@ -1,26 +1,26 @@
-// ignore-tidy-cr
-//@ check-pass
-
-// This file checks the spans of intra-link warnings in a file with CRLF line endings. The
-// .gitattributes file in this directory should enforce it.
-
-/// [error]
-pub struct A;
-//~^^ WARNING `error`
-
-///
-/// docs [error1]
-//~^ WARNING `error1`
-
-/// docs [error2]
-///
-pub struct B;
-//~^^^ WARNING `error2`
-
-/**
- * This is a multi-line comment.
- *
- * It also has an [error].
- */
-pub struct C;
-//~^^^ WARNING `error`
+// ignore-tidy-cr

+//@ check-pass

+

+// This file checks the spans of intra-link warnings in a file with CRLF line endings. The

+// .gitattributes file in this directory should enforce it.

+

+/// [error]

+pub struct A;

+//~^^ WARNING `error`

+

+///

+/// docs [error1]

+//~^ WARNING `error1`

+

+/// docs [error2]

+///

+pub struct B;

+//~^^^ WARNING `error2`

+

+/**

+ * This is a multi-line comment.

+ *

+ * It also has an [error].

+ */

+pub struct C;

+//~^^^ WARNING `error`