Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make code compile and lint cleanly under all relevant versions of rust #196

Open
jlapeyre opened this issue Mar 26, 2024 · 1 comment
Open
Labels
Looking for assignee Looking to contribute? Browse these. priority medium

Comments

@jlapeyre
Copy link
Collaborator

We need to have more reliable CI for all relevant versions of the rust toolchain. Is there a way to make this happen? I'd prefer to not to commit Cargo.lock.

In our GH CI, this is what runs with the default Rust version (is it maybe the latest stable?)

- name: Clippy
run: cargo clippy --all-targets -- -D warnings -D clippy::dbg_macro
- name: Run tests
run: cargo test --verbose -- --skip sourcegen_ast --skip sourcegen_ast_nodes

But for the MSRV, we do not run clippy in CI, and the command for running tests is slightly different.

- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose --lib --tests -- --skip sourcegen_ast --skip sourcegen_ast_nodes

I found that occasionally upon pushing a PR, CI would fail because some component or dep is upgraded.

I tried some conditional compilation. For example here:

impl<N: AstNode> Clone for AstPtr<N> {
#[rustversion::before(1.74)]
fn clone(&self) -> AstPtr<N> {
AstPtr {
raw: self.raw.clone(),
_ty: PhantomData,
}
}
#[rustversion::since(1.74)]
fn clone(&self) -> AstPtr<N> {
AstPtr {
raw: self.raw,
_ty: PhantomData,
}
}
}

I think it helped, but I don't recall why I was not able to solve the problem completely.

@jlapeyre jlapeyre added priority medium Looking for assignee Looking to contribute? Browse these. labels Mar 26, 2024
@Raghav-Bell
Copy link
Contributor

Followings are good references to resolve this issue:
clone_copy issue reported
[Roadmap] Lint groups
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Looking for assignee Looking to contribute? Browse these. priority medium
Projects
None yet
Development

No branches or pull requests

2 participants