Skip to content

Add virtual runtime (FS only) #27

Add virtual runtime (FS only)

Add virtual runtime (FS only) #27

GitHub Actions / clippy succeeded Nov 11, 2023

clippy

46 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 46
Note 0
Help 0

Versions

  • rustc 1.72.1 (d5c2e9c34 2023-09-13)
  • cargo 1.72.1 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (d5c2e9c3 2023-09-13)

Annotations

Check warning on line 764 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:764:34
    |
764 |         seq(run.writes_equal_rel(&tdir)).await;
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 759 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:759:30
    |
759 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 737 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:737:38
    |
737 |             seq(run.writes_equal_rel(&tdir2)),
    |                                      ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 736 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:736:34
    |
736 |             seq(run.writes_equal(&tdir)),
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 725 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:725:34
    |
725 |         seq(run.writes_equal_rel(&tdir2)).await;
    |                                  ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 724 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:724:30
    |
724 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 1064 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
    --> mfio-rt/src/virt/mod.rs:1064:9
     |
1064 |         while let Some(component) = components.next() {
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for component in components`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

Check warning on line 956 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:949:24
    |
949 |           let root_dir = Arc::new(RwLock::new(Inode {
    |  ________________________^
950 | |             id: Some(id),
951 | |             parent_link: None,
952 | |             entry: InodeData::Dir(VirtDirInner {
...   |
955 | |             metadata: Metadata::empty_dir(Permissions {}, None),
956 | |         }));
    | |___________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 866 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:858:30
    |
858 |               new_entry.insert(Arc::new(RwLock::new(Inode {
    |  ______________________________^
859 | |                 id: Some(id),
860 | |                 parent_link: Some(ParentLink {
861 | |                     parent: parent_id,
...   |
865 | |                 metadata,
866 | |             })));
    | |_______________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 848 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:841:24
    |
841 |           let root_dir = Arc::new(RwLock::new(Inode {
    |  ________________________^
842 | |             id: Some(id),
843 | |             parent_link: None,
844 | |             entry: InodeData::Dir(VirtDirInner {
...   |
847 | |             metadata: Metadata::empty_dir(Permissions {}, None),
848 | |         }));
    | |___________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 699 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`

warning: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
   --> mfio-rt/src/virt/mod.rs:689:19
    |
689 |           let ret = inode
    |  ___________________^
690 | |             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 | |             // difference here is that we are doing so with read-only lock.
692 | |             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
...   |
698 | |                 })
699 | |             });
    | |______________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
    = note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: try this
    |
689 ~         let ret = inode
690 +             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 +             // difference here is that we are doing so with read-only lock.
692 +             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
693 +             .ok_or(mferr!(Directory, NotFound, Filesystem)).map(|inode| VirtDir {
694 +                     inode,
695 +                     fs: self.fs.clone(),
696 ~                 });
    |

Check warning on line 620 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:609:26
    |
609 |           new_entry.insert(Arc::new(RwLock::new(Inode {
    |  __________________________^
610 | |             entry: InodeData::File(VirtFileInner {
611 | |                 data: from_file.data.clone(),
612 | |             }),
...   |
619 | |             metadata: from.metadata.clone(),
620 | |         })));
    | |___________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 428 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:421:37
    |
421 |   ...                   .insert(Arc::new(RwLock::new(Inode {
    |  _______________________________^
422 | | ...                       id: Some(id),
423 | | ...                       parent_link: Some(ParentLink { parent, name }),
424 | | ...                       entry: InodeData::Dir(VirtDirInner {
...   |
427 | | ...                       metadata: Metadata::empty_dir(Permissions {}, None),
428 | | ...                   })))
    | |_________________________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 378 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
   --> mfio-rt/src/virt/mod.rs:378:9
    |
378 |         while let Some(component) = components.next() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for component in components`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
    = note: `#[warn(clippy::while_let_on_iterator)]` on by default

Check warning on line 364 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:354:26
    |
354 |               entry.insert(Arc::new(RwLock::new(Inode {
    |  __________________________^
355 | |                 id: Some(id),
356 | |                 metadata: Metadata::empty_dir(Permissions {}, None),
357 | |                 entry: InodeData::Dir(VirtDirInner {
...   |
363 | |                 }),
364 | |             })));
    | |_______________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 348 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> mfio-rt/src/virt/mod.rs:348:13
    |
348 |             return Err(mferr!(Directory, AlreadyExists, Filesystem));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
348 -             return Err(mferr!(Directory, AlreadyExists, Filesystem));
348 +             Err(mferr!(Directory, AlreadyExists, Filesystem))
    |

Check warning on line 172 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:164:33
    |
164 |                           .insert(Arc::new(RwLock::new(Inode {
    |  _________________________________^
165 | |                             id: Some(id),
166 | |                             parent_link: Some(ParentLink {
167 | |                                 name: name.clone(),
...   |
171 | |                             metadata: Metadata::empty_file(Permissions {}, None),
172 | |                         })))
    | |___________________________^
    |
    = note: the trait `Sync` is not implemented for `RwLock<Inode>`
    = note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync

Check warning on line 108 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` or `Sync`

warning: usage of an `Arc` that is not `Send` or `Sync`
   --> mfio-rt/src/virt/mod.rs:108:23
    |
108 |         Self::from_fs(Arc::new(VirtFs::default()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the trait `Send` is not implemented for `VirtFs`
    = note: the trait `Sync` is not implemented for `VirtFs`
    = note: required for `Arc<VirtFs>` to implement `Send` and `Sync`
    = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
    = note: `#[warn(clippy::arc_with_non_send_sync)]` on by default

Check warning on line 68 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `VirtRt`

warning: you should consider adding a `Default` implementation for `VirtRt`
  --> mfio-rt/src/virt/mod.rs:63:5
   |
63 | /     pub fn new() -> Self {
64 | |         Self {
65 | |             cwd: VirtDir::default(),
66 | |             backend: BackendContainer::new_dyn(pending()),
67 | |         }
68 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
62 + impl Default for VirtRt {
63 +     fn default() -> Self {
64 +         Self::new()
65 +     }
66 + }
   |

Check warning on line 128 in mfio-rt/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `null` is never used

warning: associated function `null` is never used
   --> mfio-rt/src/util.rs:128:12
    |
127 | impl RawBox {
    | ----------- associated function in this implementation
128 |     pub fn null() -> Self {
    |            ^^^^

Check warning on line 19 in mfio-rt/src/native/impls/unix_extra.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `new_socket` is never used

warning: function `new_socket` is never used
  --> mfio-rt/src/native/impls/unix_extra.rs:19:15
   |
19 | pub(crate) fn new_socket(
   |               ^^^^^^^^^^

Check warning on line 7 in mfio-rt/src/native/impls/unix_extra.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `new_for_addr` is never used

warning: function `new_for_addr` is never used
 --> mfio-rt/src/native/impls/unix_extra.rs:7:15
  |
7 | pub(crate) fn new_for_addr(
  |               ^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

Check warning on line 1064 in mfio/src/io/packet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `io::packet::FullPacket<T, Perms>`

warning: useless conversion to the same type: `io::packet::FullPacket<T, Perms>`
    --> mfio/src/io/packet/mod.rs:1064:9
     |
1064 |         self.into()
     |         ^^^^^^^^^^^ help: consider removing `.into()`: `self`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
     = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 764 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:764:34
    |
764 |         seq(run.writes_equal_rel(&tdir)).await;
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 759 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:759:30
    |
759 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow