Skip to content

Implement base type-level interpreter and subtyping #1239

Implement base type-level interpreter and subtyping

Implement base type-level interpreter and subtyping #1239

GitHub Actions / clippy failed Jan 26, 2024 in 0s

clippy

14 errors

Details

Results

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

Versions

  • rustc 1.75.0 (82e1608df 2023-12-21)
  • cargo 1.75.0 (1d8b05cdd 2023-11-20)
  • clippy 0.1.75 (82e1608 2023-12-21)

Annotations

Check failure on line 31 in typecheck/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `is_none()` after searching an `Iterator` with `find`

error: called `is_none()` after searching an `Iterator` with `find`
  --> typecheck/src/lib.rs:31:9
   |
31 |         other.0.iter().find(|elt| !self.0.contains(elt)).is_none()
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead: `!other.0.iter().any(|elt| !self.0.contains(&elt))`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
   = note: `-D clippy::search-is-some` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::search_is_some)]`

Check failure on line 84 in typecheck/src/checker.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

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> typecheck/src/checker.rs:84:44
   |
84 |         if valid_union_type.set().contains(&expected_ty.set()) {
   |                                            ^^^^^^^^^^^^^^^^^^ help: change this to: `expected_ty.set()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `-D clippy::needless-borrow` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 72 in typecheck/src/checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
  --> typecheck/src/checker.rs:72:47
   |
72 |                 Type::builtin(comparable[..1].into_iter().map(|r| *r).collect())
   |                                               ^^^^^^^^^ help: call directly: `iter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref

Check failure on line 72 in typecheck/src/checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for copying elements

error: you are using an explicit closure for copying elements
  --> typecheck/src/checker.rs:72:31
   |
72 |                 Type::builtin(comparable[..1].into_iter().map(|r| *r).collect())
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `comparable[..1].into_iter().copied()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone

Check failure on line 69 in typecheck/src/checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
  --> typecheck/src/checker.rs:69:47
   |
69 |                 Type::builtin(comparable[2..].into_iter().map(|r| *r).collect())
   |                                               ^^^^^^^^^ help: call directly: `iter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref

Check failure on line 69 in typecheck/src/checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for copying elements

error: you are using an explicit closure for copying elements
  --> typecheck/src/checker.rs:69:31
   |
69 |                 Type::builtin(comparable[2..].into_iter().map(|r| *r).collect())
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `comparable[2..].into_iter().copied()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
   = note: `-D clippy::map-clone` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_clone)]`

Check failure on line 341 in typecheck/src/actual.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

error: redundant closure
   --> typecheck/src/actual.rs:341:26
    |
341 |                     .map(|origin| RefIdx::Resolved(origin));
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `RefIdx::Resolved`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `-D clippy::redundant-closure` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`

Check failure on line 339 in typecheck/src/actual.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`

error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
   --> typecheck/src/actual.rs:339:22
    |
339 |                     .into_iter()
    |                      ^^^^^^^^^ help: call directly: `iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
    = note: `-D clippy::into-iter-on-ref` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::into_iter_on_ref)]`

Check failure on line 275 in typecheck/src/actual.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'fir

error: the following explicit lifetimes could be elided: 'fir
   --> typecheck/src/actual.rs:275:24
    |
275 |     fn resolve_link_v2<'fir>(
    |                        ^^^^
...
278 |         fir: &'fir Fir<FlattenData>,
    |               ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
    |
275 ~     fn resolve_link_v2(
276 |         &mut self,
277 |         to_resolve: OriginIdx,
278 ~         fir: &Fir<FlattenData>,
    |

Check failure on line 31 in typecheck/src/typemap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated functions `union` and `record` are never used

error: associated functions `union` and `record` are never used
  --> typecheck/src/typemap.rs:31:12
   |
30 | impl TypeRef {
   | ------------ associated functions in this implementation
31 |     pub fn union(UnionType(node): UnionType) -> TypeRef {
   |            ^^^^^
...
35 |     pub fn record(RecordType(node): RecordType) -> TypeRef {
   |            ^^^^^^

Check failure on line 28 in typecheck/src/typemap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

struct `RecordType` is never constructed

error: struct `RecordType` is never constructed
  --> typecheck/src/typemap.rs:28:12
   |
28 | pub struct RecordType(OriginIdx);
   |            ^^^^^^^^^^

Check failure on line 27 in typecheck/src/typemap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

struct `UnionType` is never constructed

error: struct `UnionType` is never constructed
  --> typecheck/src/typemap.rs:27:12
   |
27 | pub struct UnionType(OriginIdx);
   |            ^^^^^^^^^

Check failure on line 97 in typecheck/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods `actual` and `ref_idx` are never used

error: methods `actual` and `ref_idx` are never used
   --> typecheck/src/lib.rs:97:12
    |
96  | impl TypeVariable {
    | ----------------- methods in this implementation
97  |     pub fn actual(&self) -> OriginIdx {
    |            ^^^^^^
...
104 |     pub fn ref_idx(&self) -> RefIdx {
    |            ^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`

Check failure on line 349 in typecheck/src/actual.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of deprecated associated function `Type::new`: needs a new API

error: use of deprecated associated function `Type::new`: needs a new API
   --> typecheck/src/actual.rs:349:39
    |
349 |                     final_type: Type::new(*u, variants.collect()),
    |                                       ^^^
    |
    = note: `-D deprecated` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(deprecated)]`