Skip to content

Commit 61729b3

Browse files
committed
tidy: Cleanup the directory whitelist
1 parent 9a239ef commit 61729b3

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

src/librustc_data_structures/owning_ref/mod.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This allows moving and dropping of a `OwningRef` without needing to recreate the
1010
This can sometimes be useful because Rust borrowing rules normally prevent
1111
moving a type that has been moved from. For example, this kind of code gets rejected:
1212
13-
```rust,ignore
13+
```compile_fail,E0515
1414
fn return_owned_and_referenced<'a>() -> (Vec<u8>, &'a [u8]) {
1515
let v = vec![1, 2, 3, 4];
1616
let s = &v[1..3];
@@ -43,7 +43,8 @@ and preventing mutable access to root containers, which in practice requires hea
4343
as provided by `Box<T>`, `Rc<T>`, etc.
4444
4545
Also provided are typedefs for common owner type combinations,
46-
which allow for less verbose type signatures. For example, `BoxRef<T>` instead of `OwningRef<Box<T>, T>`.
46+
which allow for less verbose type signatures.
47+
For example, `BoxRef<T>` instead of `OwningRef<Box<T>, T>`.
4748
4849
The crate also provides the more advanced `OwningHandle` type,
4950
which allows more freedom in bundling a dependent handle object
@@ -495,7 +496,8 @@ impl<O, T: ?Sized> OwningRef<O, T> {
495496
}
496497
}
497498

498-
/// Erases the concrete base type of the owner with a trait object which implements `Send` and `Sync`.
499+
/// Erases the concrete base type of the owner with a trait object
500+
/// which implements `Send` and `Sync`.
499501
///
500502
/// This allows mixing of owned references with different owner base types.
501503
pub fn erase_send_sync_owner<'a>(self) -> OwningRef<O::Erased, T>
@@ -507,7 +509,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
507509
}
508510
}
509511

510-
// TODO: wrap_owner
512+
// UNIMPLEMENTED: wrap_owner
511513

512514
// FIXME: Naming convention?
513515
/// A getter for the underlying owner.
@@ -753,7 +755,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
753755
}
754756
}
755757

756-
// TODO: wrap_owner
758+
// UNIMPLEMENTED: wrap_owner
757759

758760
// FIXME: Naming convention?
759761
/// A getter for the underlying owner.

src/librustc_data_structures/owning_ref/tests.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ mod owning_handle {
274274
use std::cell::RefCell;
275275
let cell = Rc::new(RefCell::new(2));
276276
let cell_ref = RcRef::new(cell);
277-
let mut handle = OwningHandle::new_with_fn(cell_ref, |x| unsafe { x.as_ref() }.unwrap().borrow_mut());
277+
let mut handle = OwningHandle::new_with_fn(cell_ref, |x| {
278+
unsafe { x.as_ref() }.unwrap().borrow_mut()
279+
});
278280
assert_eq!(*handle, 2);
279281
*handle = 3;
280282
assert_eq!(*handle, 3);
@@ -319,8 +321,12 @@ mod owning_handle {
319321
let result = {
320322
let complex = Rc::new(RefCell::new(Arc::new(RwLock::new("someString"))));
321323
let curr = RcRef::new(complex);
322-
let curr = OwningHandle::new_with_fn(curr, |x| unsafe { x.as_ref() }.unwrap().borrow_mut());
323-
let mut curr = OwningHandle::new_with_fn(curr, |x| unsafe { x.as_ref() }.unwrap().try_write().unwrap());
324+
let curr = OwningHandle::new_with_fn(curr, |x| {
325+
unsafe { x.as_ref() }.unwrap().borrow_mut()
326+
});
327+
let mut curr = OwningHandle::new_with_fn(curr, |x| {
328+
unsafe { x.as_ref() }.unwrap().try_write().unwrap()
329+
});
324330
assert_eq!(*curr, "someString");
325331
*curr = "someOtherString";
326332
curr
@@ -353,8 +359,12 @@ mod owning_handle {
353359
let result = {
354360
let complex = Rc::new(RefCell::new(Arc::new(RwLock::new("someString"))));
355361
let curr = RcRef::new(complex);
356-
let curr = OwningHandle::new_with_fn(curr, |x| unsafe { x.as_ref() }.unwrap().borrow_mut());
357-
let mut curr = OwningHandle::new_with_fn(curr, |x| unsafe { x.as_ref() }.unwrap().try_write().unwrap());
362+
let curr = OwningHandle::new_with_fn(curr, |x| {
363+
unsafe { x.as_ref() }.unwrap().borrow_mut()
364+
});
365+
let mut curr = OwningHandle::new_with_fn(curr, |x| {
366+
unsafe { x.as_ref() }.unwrap().try_write().unwrap()
367+
});
358368
assert_eq!(*curr, "someString");
359369
*curr = "someOtherString";
360370
curr

src/tools/tidy/src/lib.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,19 @@ pub mod unstable_book;
4343

4444
fn filter_dirs(path: &Path) -> bool {
4545
let skip = [
46-
"src/llvm",
47-
"src/llvm-project",
4846
"src/llvm-emscripten",
49-
"src/libbacktrace",
50-
"src/librustc_data_structures/owning_ref",
51-
"src/vendor",
47+
"src/llvm-project",
48+
"src/stdarch",
5249
"src/tools/cargo",
53-
"src/tools/clang",
54-
"src/tools/rls",
5550
"src/tools/clippy",
51+
"src/tools/miri",
52+
"src/tools/rls",
5653
"src/tools/rust-installer",
5754
"src/tools/rustfmt",
58-
"src/tools/miri",
59-
"src/tools/lld",
60-
"src/tools/lldb",
61-
"src/target",
62-
"src/stdarch",
63-
"src/rust-sgx",
64-
"target",
65-
"vendor",
6655
];
6756
skip.iter().any(|p| path.ends_with(p))
6857
}
6958

70-
7159
fn walk_many(
7260
paths: &[&Path], skip: &mut dyn FnMut(&Path) -> bool, f: &mut dyn FnMut(&DirEntry, &str)
7361
) {

0 commit comments

Comments
 (0)