Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude = ["test_app"]

[package]
name = "cargo_pup"
version = "0.1.3"
version = "0.1.4"
edition = "2024"
description = "A Rust architectural linting tool that integrates with rustc to enforce architectural patterns and boundaries"
license = "Apache-2.0"
Expand All @@ -34,9 +34,9 @@ anyhow = { workspace = true }
tempfile = { workspace = true }
ron = { workspace = true }
cargo_metadata = { workspace = true }
cargo_pup_common = { path = "cargo_pup_common", version = "=0.1.3" }
cargo_pup_lint_impl = { path = "cargo_pup_lint_impl", version = "=0.1.3" }
cargo_pup_lint_config = { path = "cargo_pup_lint_config", version = "=0.1.3" }
cargo_pup_common = { path = "cargo_pup_common", version = "=0.1.4" }
cargo_pup_lint_impl = { path = "cargo_pup_lint_impl", version = "=0.1.4" }
cargo_pup_lint_config = { path = "cargo_pup_lint_config", version = "=0.1.4" }

#
# These bits are just to keep rust rover happy.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ First, make sure to install [rustup](https://rustup.rs/) to manage your local ru

Then install pup; **you must use this nightly toolchain, as pup depends on compiler internals that are otherwise unavailable!**
```bash
rustup component add --toolchain nightly-2025-07-25 rust-src rustc-dev llvm-tools-preview
cargo +nightly-2025-07-25 install cargo_pup
rustup component add --toolchain nightly-2025-11-14 rust-src rustc-dev llvm-tools-preview
cargo +nightly-2025-11-14 install cargo_pup
```

## Getting Started
Expand Down Expand Up @@ -121,7 +121,7 @@ First, add the following to your `Cargo.toml`:

```toml
[dev-dependencies]
cargo_pup_lint_config = "0.1.3"
cargo_pup_lint_config = "0.1.4"
```

## Examples
Expand Down
2 changes: 1 addition & 1 deletion cargo_pup_common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo_pup_common"
version = "0.1.3"
version = "0.1.4"
edition = "2024"
description = "Common utilities and shared components for cargo-pup architectural linting tool"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions cargo_pup_lint_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo_pup_lint_config"
version = "0.1.3"
version = "0.1.4"
edition = "2024"
description = "Configuration and rule builder utilities for cargo-pup architectural linting"
license = "Apache-2.0"
Expand All @@ -13,4 +13,4 @@ serde.workspace = true
ron.workspace = true
tempfile.workspace = true
anyhow.workspace = true
cargo_pup_common = { path = "../cargo_pup_common", version = "=0.1.3" }
cargo_pup_common = { path = "../cargo_pup_common", version = "=0.1.4" }
2 changes: 1 addition & 1 deletion cargo_pup_lint_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add this to your `Cargo.toml`:

```toml
[dev-dependencies]
cargo_pup_lint_config = "0.1.3"
cargo_pup_lint_config = "0.1.4"
```

## Example
Expand Down
6 changes: 3 additions & 3 deletions cargo_pup_lint_impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo_pup_lint_impl"
version = "0.1.3"
version = "0.1.4"
edition = "2024"
description = "Core lint implementations and rustc integration for cargo-pup architectural linting"
license = "Apache-2.0"
Expand All @@ -9,8 +9,8 @@ homepage = "https://github.com/datadog/cargo-pup"
readme = "README.md"

[dependencies]
cargo_pup_lint_config = { path = "../cargo_pup_lint_config", version = "=0.1.3" }
cargo_pup_common = { path = "../cargo_pup_common", version = "=0.1.3" }
cargo_pup_lint_config = { path = "../cargo_pup_lint_config", version = "=0.1.4" }
cargo_pup_common = { path = "../cargo_pup_common", version = "=0.1.4" }
anyhow.workspace = true
regex.workspace = true
serde_json.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions cargo_pup_lint_impl/src/helpers/architecture_lint_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl ArchitectureLintRunner {
{
// This is a trait implementation
// Get the canonical trait name using the centralized helper
let trait_def_id = trait_ref.path.res.def_id();
let trait_def_id = trait_ref.trait_ref.path.res.def_id();
let canonical_full_name =
crate::helpers::queries::get_full_canonical_trait_name_from_def_id(
&tcx,
Expand Down Expand Up @@ -326,8 +326,6 @@ impl Callbacks for ArchitectureLintRunner {
_compiler: &rustc_interface::interface::Compiler,
_tcx: TyCtxt<'_>,
) -> rustc_driver::Compilation {
_compiler.sess.coverage_discard_all_spans_in_codegen();

rustc_driver::Compilation::Continue
}
}
Expand Down
6 changes: 5 additions & 1 deletion cargo_pup_lint_impl/src/lints/function_lint/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ fn get_self_type<'tcx>(
fn_def_id: rustc_hir::def_id::DefId,
) -> Option<rustc_middle::ty::Ty<'tcx>> {
ctx.tcx
.impl_of_method(fn_def_id)
.opt_associated_item(fn_def_id)
.and_then(|assoc_item| {
// Check if this associated item is from an impl block
assoc_item.impl_container(ctx.tcx)
})
.map(|impl_def_id| ctx.tcx.type_of(impl_def_id).instantiate_identity())
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-07-25"
channel = "nightly-2025-11-14"
components = ["llvm-tools-preview", "rustc-dev", "rust-analyzer", "rust-src"]
Loading