Skip to content

Commit 1d1a32e

Browse files
committed
Remove NoSend/NoSync markers
Now that these two traits are opt-in, the markers are no longer needed.
1 parent 51f1376 commit 1d1a32e

18 files changed

+63
-203
lines changed

src/blob.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ use {raw, Oid};
99
/// [1]: http://git-scm.com/book/en/Git-Internals-Git-Objects
1010
pub struct Blob<'repo> {
1111
raw: *mut raw::git_blob,
12-
marker1: marker::ContravariantLifetime<'repo>,
13-
marker2: marker::NoSend,
14-
marker3: marker::NoSync,
12+
marker: marker::ContravariantLifetime<'repo>,
1513
}
1614

1715
impl<'repo> Blob<'repo> {
@@ -22,9 +20,7 @@ impl<'repo> Blob<'repo> {
2220
pub unsafe fn from_raw(raw: *mut raw::git_blob) -> Blob<'repo> {
2321
Blob {
2422
raw: raw,
25-
marker1: marker::ContravariantLifetime,
26-
marker2: marker::NoSend,
27-
marker3: marker::NoSync,
23+
marker: marker::ContravariantLifetime,
2824
}
2925
}
3026

src/branch.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ pub struct Branch<'repo> {
1717
/// An iterator over the branches inside of a repository.
1818
pub struct Branches<'repo> {
1919
raw: *mut raw::git_branch_iterator,
20-
marker1: marker::ContravariantLifetime<'repo>,
21-
marker2: marker::NoSend,
22-
marker3: marker::NoSync,
20+
marker: marker::ContravariantLifetime<'repo>,
2321
}
2422

2523
impl<'repo> Branch<'repo> {
@@ -109,9 +107,7 @@ impl<'repo> Branches<'repo> {
109107
-> Branches<'repo> {
110108
Branches {
111109
raw: raw,
112-
marker1: marker::ContravariantLifetime,
113-
marker2: marker::NoSend,
114-
marker3: marker::NoSync,
110+
marker: marker::ContravariantLifetime,
115111
}
116112
}
117113
}

src/commit.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use {raw, Oid, Error, Signature, Tree, Time};
1010
/// [1]: http://git-scm.com/book/en/Git-Internals-Git-Objects
1111
pub struct Commit<'repo> {
1212
raw: *mut raw::git_commit,
13-
marker1: marker::ContravariantLifetime<'repo>,
14-
marker2: marker::NoSend,
15-
marker3: marker::NoSync,
13+
marker: marker::ContravariantLifetime<'repo>,
1614
}
1715

1816
/// An iterator over the parent commits of a commit.
@@ -35,9 +33,7 @@ impl<'repo> Commit<'repo> {
3533
pub unsafe fn from_raw(raw: *mut raw::git_commit) -> Commit<'repo> {
3634
Commit {
3735
raw: raw,
38-
marker1: marker::ContravariantLifetime,
39-
marker2: marker::NoSend,
40-
marker3: marker::NoSync,
36+
marker: marker::ContravariantLifetime,
4137
}
4238
}
4339

src/config.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ pub struct Config {
1515
/// An entry has a name, a value, and a level it applies to.
1616
pub struct ConfigEntry<'cfg> {
1717
raw: *const raw::git_config_entry,
18-
marker1: marker::ContravariantLifetime<'cfg>,
19-
marker2: marker::NoSend,
20-
marker3: marker::NoSync,
18+
marker: marker::ContravariantLifetime<'cfg>,
2119
}
2220

2321
/// An iterator over the `ConfigEntry` values of a `Config` structure.
2422
pub struct ConfigEntries<'cfg> {
2523
raw: *mut raw::git_config_iterator,
26-
marker1: marker::ContravariantLifetime<'cfg>,
27-
marker2: marker::NoSend,
28-
marker3: marker::NoSync,
24+
marker: marker::ContravariantLifetime<'cfg>,
2925
}
3026

3127
impl Config {
@@ -341,9 +337,7 @@ impl<'cfg> ConfigEntry<'cfg> {
341337
-> ConfigEntry<'cfg> {
342338
ConfigEntry {
343339
raw: raw,
344-
marker1: marker::ContravariantLifetime,
345-
marker2: marker::NoSend,
346-
marker3: marker::NoSync,
340+
marker: marker::ContravariantLifetime,
347341
}
348342
}
349343

@@ -381,9 +375,7 @@ impl<'cfg> ConfigEntries<'cfg> {
381375
-> ConfigEntries<'cfg> {
382376
ConfigEntries {
383377
raw: raw,
384-
marker1: marker::ContravariantLifetime,
385-
marker2: marker::NoSend,
386-
marker3: marker::NoSync,
378+
marker: marker::ContravariantLifetime,
387379
}
388380
}
389381
}

src/diff.rs

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ use {raw, panic, Delta, Oid, Repository, Tree, Error, Index, DiffFormat};
1313
/// generator functions below (such as `Diff::tree_to_tree`).
1414
pub struct Diff {
1515
raw: *mut raw::git_diff,
16-
marker1: marker::NoSend,
17-
marker2: marker::NoSync,
1816
}
1917

2018
/// Description of changes to one entry.
2119
pub struct DiffDelta<'a> {
2220
raw: *mut raw::git_diff_delta,
23-
marker1: marker::ContravariantLifetime<'a>,
24-
marker2: marker::NoSend,
25-
marker3: marker::NoSync,
21+
marker: marker::ContravariantLifetime<'a>,
2622
}
2723

2824
/// Description of one side of a delta.
@@ -32,9 +28,7 @@ pub struct DiffDelta<'a> {
3228
/// you are tracking type changes or ignored/untracked directories).
3329
pub struct DiffFile<'a> {
3430
raw: *const raw::git_diff_file,
35-
marker1: marker::ContravariantLifetime<'a>,
36-
marker2: marker::NoSend,
37-
marker3: marker::NoSync,
31+
marker: marker::ContravariantLifetime<'a>,
3832
}
3933

4034
/// Structure describing options about how the diff should be executed.
@@ -55,24 +49,18 @@ pub struct Deltas<'diff> {
5549
/// Structure describing a line (or data span) of a diff.
5650
pub struct DiffLine<'a> {
5751
raw: *const raw::git_diff_line,
58-
marker1: marker::ContravariantLifetime<'a>,
59-
marker2: marker::NoSend,
60-
marker3: marker::NoSync,
52+
marker: marker::ContravariantLifetime<'a>,
6153
}
6254

6355
/// Structure describing a hunk of a diff.
6456
pub struct DiffHunk<'a> {
6557
raw: *const raw::git_diff_hunk,
66-
marker1: marker::ContravariantLifetime<'a>,
67-
marker2: marker::NoSend,
68-
marker3: marker::NoSync,
58+
marker: marker::ContravariantLifetime<'a>,
6959
}
7060

7161
/// Structure describing a hunk of a diff.
7262
pub struct DiffStats {
7363
raw: *mut raw::git_diff_stats,
74-
marker1: marker::NoSend,
75-
marker2: marker::NoSync,
7664
}
7765

7866
impl Diff {
@@ -209,11 +197,7 @@ impl Diff {
209197
/// This method is unsafe as there is no guarantee that `raw` is a valid
210198
/// pointer.
211199
pub unsafe fn from_raw(raw: *mut raw::git_diff) -> Diff {
212-
Diff {
213-
raw: raw,
214-
marker1: marker::NoSend,
215-
marker2: marker::NoSync,
216-
}
200+
Diff { raw: raw }
217201
}
218202

219203
/// Merge one diff into another.
@@ -309,9 +293,7 @@ impl<'a> DiffDelta<'a> {
309293
pub unsafe fn from_raw(raw: *mut raw::git_diff_delta) -> DiffDelta<'a> {
310294
DiffDelta {
311295
raw: raw,
312-
marker1: marker::ContravariantLifetime,
313-
marker2: marker::NoSend,
314-
marker3: marker::NoSync,
296+
marker: marker::ContravariantLifetime,
315297
}
316298
}
317299

@@ -368,9 +350,7 @@ impl<'a> DiffFile<'a> {
368350
pub unsafe fn from_raw(raw: *const raw::git_diff_file) -> DiffFile<'a> {
369351
DiffFile {
370352
raw: raw,
371-
marker1: marker::ContravariantLifetime,
372-
marker2: marker::NoSend,
373-
marker3: marker::NoSync,
353+
marker: marker::ContravariantLifetime,
374354
}
375355
}
376356

@@ -688,9 +668,7 @@ impl<'a> DiffLine<'a> {
688668
pub unsafe fn from_raw(raw: *const raw::git_diff_line) -> DiffLine<'a> {
689669
DiffLine {
690670
raw: raw,
691-
marker1: marker::ContravariantLifetime,
692-
marker2: marker::NoSend,
693-
marker3: marker::NoSync,
671+
marker: marker::ContravariantLifetime,
694672
}
695673
}
696674

@@ -754,9 +732,7 @@ impl<'a> DiffHunk<'a> {
754732
pub unsafe fn from_raw(raw: *const raw::git_diff_hunk) -> DiffHunk<'a> {
755733
DiffHunk {
756734
raw: raw,
757-
marker1: marker::ContravariantLifetime,
758-
marker2: marker::NoSend,
759-
marker3: marker::NoSync,
735+
marker: marker::ContravariantLifetime,
760736
}
761737
}
762738

@@ -792,11 +768,7 @@ impl DiffStats {
792768
/// This function is unsafe as the validity of the pointer cannot be
793769
/// guaranteed.
794770
pub unsafe fn from_raw(raw: *mut raw::git_diff_stats) -> DiffStats {
795-
DiffStats {
796-
raw: raw,
797-
marker1: marker::NoSend,
798-
marker2: marker::NoSync,
799-
}
771+
DiffStats { raw: raw }
800772
}
801773

802774
/// Get the total number of files chaned in a diff.

src/note.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ use {raw, Signature, Oid};
88
/// [note]: http://git-scm.com/blog/2010/08/25/notes.html
99
pub struct Note<'repo> {
1010
raw: *mut raw::git_note,
11-
marker1: marker::ContravariantLifetime<'repo>,
12-
marker2: marker::NoSend,
13-
marker3: marker::NoSync,
11+
marker: marker::ContravariantLifetime<'repo>,
1412
}
1513

1614
/// An iterator over all of the notes within a repository.
1715
pub struct Notes<'repo> {
1816
raw: *mut raw::git_note_iterator,
19-
marker1: marker::ContravariantLifetime<'repo>,
20-
marker2: marker::NoSend,
21-
marker3: marker::NoSync,
17+
marker: marker::ContravariantLifetime<'repo>,
2218
}
2319

2420
impl<'repo> Note<'repo> {
@@ -29,9 +25,7 @@ impl<'repo> Note<'repo> {
2925
pub unsafe fn from_raw(raw: *mut raw::git_note) -> Note<'repo> {
3026
Note {
3127
raw: raw,
32-
marker1: marker::ContravariantLifetime,
33-
marker2: marker::NoSend,
34-
marker3: marker::NoSync,
28+
marker: marker::ContravariantLifetime,
3529
}
3630
}
3731

@@ -80,9 +74,7 @@ impl<'repo> Notes<'repo> {
8074
pub unsafe fn from_raw(raw: *mut raw::git_note_iterator) -> Notes<'repo> {
8175
Notes {
8276
raw: raw,
83-
marker1: marker::ContravariantLifetime,
84-
marker2: marker::NoSend,
85-
marker3: marker::NoSync,
77+
marker: marker::ContravariantLifetime,
8678
}
8779
}
8880
}

src/object.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use {raw, Oid, ObjectType, Error, Buf};
88
/// [1]: http://git-scm.com/book/en/Git-Internals-Git-Objects
99
pub struct Object<'repo> {
1010
raw: *mut raw::git_object,
11-
marker1: marker::ContravariantLifetime<'repo>,
12-
marker2: marker::NoSend,
13-
marker3: marker::NoSync,
11+
marker: marker::ContravariantLifetime<'repo>,
1412
}
1513

1614
impl<'repo> Object<'repo> {
@@ -21,9 +19,7 @@ impl<'repo> Object<'repo> {
2119
pub unsafe fn from_raw(raw: *mut raw::git_object) -> Object<'repo> {
2220
Object {
2321
raw: raw,
24-
marker1: marker::ContravariantLifetime,
25-
marker2: marker::NoSend,
26-
marker3: marker::NoSync,
22+
marker: marker::ContravariantLifetime,
2723
}
2824
}
2925

@@ -56,9 +52,7 @@ impl<'repo> Object<'repo> {
5652
}
5753
Ok(Object {
5854
raw: raw,
59-
marker1: marker::ContravariantLifetime,
60-
marker2: marker::NoSend,
61-
marker3: marker::NoSync,
55+
marker: marker::ContravariantLifetime,
6256
})
6357
}
6458

@@ -84,9 +78,7 @@ impl<'a> Clone for Object<'a> {
8478
assert_eq!(rc, 0);
8579
Object {
8680
raw: raw,
87-
marker1: marker::ContravariantLifetime,
88-
marker2: marker::NoSend,
89-
marker3: marker::NoSync,
81+
marker: marker::ContravariantLifetime,
9082
}
9183
}
9284
}

src/pathspec.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ use {raw, Error, Tree, PathspecFlags, Index, Repository, DiffDelta};
88
/// structures.
99
pub struct Pathspec {
1010
raw: *mut raw::git_pathspec,
11-
marker1: marker::NoSend,
12-
marker2: marker::NoSync,
1311
}
1412

1513
/// List of filenames matching a pathspec.
1614
pub struct PathspecMatchList<'ps> {
1715
raw: *mut raw::git_pathspec_match_list,
18-
marker1: marker::ContravariantLifetime<'ps>,
19-
marker2: marker::NoSend,
20-
marker3: marker::NoSync,
16+
marker: marker::ContravariantLifetime<'ps>,
2117
}
2218

2319
/// Iterator over the matched paths in a pathspec.
@@ -61,11 +57,7 @@ impl Pathspec {
6157
/// This function is unsafe as the validity of the pointer is not
6258
/// guaranteed.
6359
pub unsafe fn from_raw(raw: *mut raw::git_pathspec) -> Pathspec {
64-
Pathspec {
65-
raw: raw,
66-
marker1: marker::NoSend,
67-
marker2: marker::NoSync,
68-
}
60+
Pathspec { raw: raw }
6961
}
7062

7163
/// Match a pathspec against files in a tree.
@@ -152,9 +144,7 @@ impl<'ps> PathspecMatchList<'ps> {
152144
-> PathspecMatchList<'ps> {
153145
PathspecMatchList {
154146
raw: raw,
155-
marker1: marker::ContravariantLifetime,
156-
marker2: marker::NoSend,
157-
marker3: marker::NoSync,
147+
marker: marker::ContravariantLifetime,
158148
}
159149
}
160150

src/push.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use {raw, Error, Signature};
1010
/// repository.
1111
pub struct Push<'remote> {
1212
raw: *mut raw::git_push,
13-
marker1: marker::ContravariantLifetime<'remote>,
14-
marker2: marker::NoSend,
15-
marker3: marker::NoSync,
13+
marker: marker::ContravariantLifetime<'remote>,
1614
}
1715

1816
/// A status representing the result of updating a remote reference.
@@ -32,9 +30,7 @@ impl<'remote> Push<'remote> {
3230
pub unsafe fn from_raw(raw: *mut raw::git_push) -> Push<'remote> {
3331
Push {
3432
raw: raw,
35-
marker1: marker::ContravariantLifetime,
36-
marker2: marker::NoSend,
37-
marker3: marker::NoSync,
33+
marker: marker::ContravariantLifetime,
3834
}
3935
}
4036

0 commit comments

Comments
 (0)