Skip to content

Commit 492fad7

Browse files
authored
Chore: Update clippy & dependencies (#36)
* Updated clippy adn dependencies * Disable codecove as it's grcov error for -Zprofile issue
1 parent 52b54f9 commit 492fad7

File tree

5 files changed

+35
-32
lines changed

5 files changed

+35
-32
lines changed

.github/workflows/tests.yml

+22-23
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ jobs:
4040
run: cargo build --all-features
4141
- name: Test
4242
run: cargo test --all-targets --all-features
43-
env:
44-
CARGO_INCREMENTAL: '0'
45-
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
46-
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
47-
- name: Install grcov
48-
run: |
49-
if [[ ! -f ~/.cargo/bin/grcov ]]; then
50-
cargo install grcov
51-
fi
43+
# env:
44+
# CARGO_INCREMENTAL: '0'
45+
# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
46+
# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
47+
# - name: Install grcov
48+
# run: |
49+
# if [[ ! -f ~/.cargo/bin/grcov ]]; then
50+
# cargo install grcov
51+
# fi
5252
- name: Save cache
5353
uses: actions/cache/save@v3
5454
with:
@@ -58,17 +58,16 @@ jobs:
5858
~/.cargo/registry/cache/
5959
~/.cargo/git/db/
6060
key: ${{ runner.os }}-cargo
61-
- name: Run grcov
62-
run: |
63-
mkdir ./target/debug/coverage/
64-
grcov . -s . -b ./target/debug/ -o ./target/debug/coverage/ --ignore-not-existing --excl-line="grcov-excl-line|#\\[derive\\(|//!|///" --excl-start="grcov-excl-start" --excl-stop="grcov-excl-end" --ignore="*.cargo/*" --ignore="src/lib.rs" --ignore="tests/*"
65-
- name: Upload coverage reports to Codecov
66-
uses: codecov/codecov-action@v3
67-
env:
68-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69-
with:
70-
directory: ./target/debug/coverage/
71-
files: ./target/debug/coverage/lcov
72-
verbose: true
73-
fail_ci_if_error: true
74-
61+
# - name: Run grcov
62+
# run: |
63+
# mkdir ./target/debug/coverage/
64+
# grcov . -s . -b ./target/debug/ -o ./target/debug/coverage/ --ignore-not-existing --excl-line="grcov-excl-line|#\\[derive\\(|//!|///" --excl-start="grcov-excl-start" --excl-stop="grcov-excl-end" --ignore="*.cargo/*" --ignore="src/lib.rs" --ignore="tests/*"
65+
# - name: Upload coverage reports to Codecov
66+
# uses: codecov/codecov-action@v3
67+
# env:
68+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69+
# with:
70+
# directory: ./target/debug/coverage/
71+
# files: ./target/debug/coverage/lcov
72+
# verbose: true
73+
# fail_ci_if_error: true

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "semantic-analyzer"
3-
version = "0.4.5"
3+
version = "0.4.6"
44
authors = ["Evgeny Ukhanov <mrlsd@ya.ru>"]
55
description = "Semantic analyzer library for compilers written in Rust for semantic analysis of programming languages AST"
66
keywords = ["compiler", "semantic-analisis", "semantic-alalyzer", "compiler-design", "semantic"]
@@ -14,7 +14,7 @@ repository = "https://github.com/mrLSD/semantic-analyzer-rs"
1414
doctest = false
1515

1616
[dependencies]
17-
nom_locate = "4.2"
17+
nom_locate = "5.0"
1818
serde = { version = "1", features = ["derive"], optional = true }
1919

2020
[dev-dependencies]

src/ast.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a> Ident<'a> {
4444
}
4545
}
4646

47-
impl<'a> std::fmt::Display for Ident<'a> {
47+
impl std::fmt::Display for Ident<'_> {
4848
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4949
write!(f, "{}", self.fragment())
5050
}
@@ -58,7 +58,7 @@ impl<'a> From<&'a str> for Ident<'a> {
5858

5959
/// Ident Serializer
6060
#[cfg(feature = "codec")]
61-
impl<'a> Serialize for Ident<'a> {
61+
impl Serialize for Ident<'_> {
6262
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6363
where
6464
S: Serializer,
@@ -227,7 +227,7 @@ impl GetLocation for FunctionName<'_> {
227227
}
228228
}
229229

230-
impl<'a> std::fmt::Display for FunctionName<'a> {
230+
impl std::fmt::Display for FunctionName<'_> {
231231
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
232232
write!(f, "{}", self.0.fragment())
233233
}
@@ -406,7 +406,7 @@ impl GetLocation for StructTypes<'_> {
406406
}
407407
}
408408

409-
impl<'a> GetName for StructTypes<'a> {
409+
impl GetName for StructTypes<'_> {
410410
fn name(&self) -> String {
411411
(*self.name.fragment()).to_string()
412412
}
@@ -430,7 +430,7 @@ pub enum Type<'a> {
430430
Array(Box<Self>, u32),
431431
}
432432

433-
impl<'a> GetName for Type<'a> {
433+
impl GetName for Type<'_> {
434434
fn name(&self) -> String {
435435
match self {
436436
Self::Primitive(primitive) => primitive.name(),

src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![deny(clippy::pedantic, clippy::nursery, clippy::as_conversions)]
2-
#![allow(clippy::module_name_repetitions, clippy::doc_lazy_continuation)]
2+
#![allow(
3+
clippy::module_name_repetitions,
4+
clippy::doc_lazy_continuation,
5+
clippy::too_long_first_doc_paragraph
6+
)]
37
//! # Semantic Analyzer
48
//! The semantic analyzer consists of the following basic elements:
59
//! - AST is an abstract syntax tree that implements a predefined set of

src/semantic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ where
748748
if_body_state.borrow_mut().jump_function_return(res);
749749
if_body_state.borrow_mut().set_return();
750750
return_is_called = true;
751-
};
751+
}
752752
}
753753
}
754754
}

0 commit comments

Comments
 (0)