summaryrefslogtreecommitdiff
path: root/t/t4018
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-06-21 18:24:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-21 18:24:08 (GMT)
commita41dad4330c8291893b5c5b013457499855ec9b5 (patch)
tree21b5ec00fedc07883eee26ca823d516477e4fc10 /t/t4018
parenta6a95cd1b46e48e5fe06bdbb0839a67ebeef4682 (diff)
parent33be7b38c23fbbaf75197f6150323e0d4c84bf12 (diff)
downloadgit-a41dad4330c8291893b5c5b013457499855ec9b5.zip
git-a41dad4330c8291893b5c5b013457499855ec9b5.tar.gz
git-a41dad4330c8291893b5c5b013457499855ec9b5.tar.bz2
Merge branch 'ml/userdiff-rust'
The pattern "git diff/grep" use to extract funcname and words boundary for Rust has been added. * ml/userdiff-rust: userdiff: two simplifications of patterns for rust userdiff: add built-in pattern for rust
Diffstat (limited to 't/t4018')
-rw-r--r--t/t4018/rust-fn5
-rw-r--r--t/t4018/rust-impl5
-rw-r--r--t/t4018/rust-struct5
-rw-r--r--t/t4018/rust-trait5
4 files changed, 20 insertions, 0 deletions
diff --git a/t/t4018/rust-fn b/t/t4018/rust-fn
new file mode 100644
index 0000000..cbe0215
--- /dev/null
+++ b/t/t4018/rust-fn
@@ -0,0 +1,5 @@
+pub(self) fn RIGHT<T>(x: &[T]) where T: Debug {
+ let _ = x;
+ // a comment
+ let a = ChangeMe;
+}
diff --git a/t/t4018/rust-impl b/t/t4018/rust-impl
new file mode 100644
index 0000000..09df3cd
--- /dev/null
+++ b/t/t4018/rust-impl
@@ -0,0 +1,5 @@
+impl<'a, T: AsRef<[u8]>> std::RIGHT for Git<'a> {
+
+ pub fn ChangeMe(&self) -> () {
+ }
+}
diff --git a/t/t4018/rust-struct b/t/t4018/rust-struct
new file mode 100644
index 0000000..76aff1c
--- /dev/null
+++ b/t/t4018/rust-struct
@@ -0,0 +1,5 @@
+#[derive(Debug)]
+pub(super) struct RIGHT<'a> {
+ name: &'a str,
+ age: ChangeMe,
+}
diff --git a/t/t4018/rust-trait b/t/t4018/rust-trait
new file mode 100644
index 0000000..ea397f0
--- /dev/null
+++ b/t/t4018/rust-trait
@@ -0,0 +1,5 @@
+unsafe trait RIGHT<T> {
+ fn len(&self) -> u32;
+ fn ChangeMe(&self, n: u32) -> T;
+ fn iter<F>(&self, f: F) where F: Fn(T);
+}