Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`rustc_codegen_nvvm` fails to compile on nightly version of rust that is specified in the `rust-toolchain.toml`

未关闭
#260 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust

调研方向

从 rust-toolchain.toml 和 vecadd 示例开始,然后使用指定的 nightly 重现外部 cargo build 失败。将已发布的 rustc_codegen_nvvm 0.3.0 源代码(尤其是 src/lib.rs)与仓库的构建进行比较;当从 vecadd 复制出的新项目无需依赖仓库内的 checkout 即可成功构建时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Hi there, I really like this project and want to see it succeed! Thank you for rebooting this, I'm sure I'll end up contributing once I get to grips with things a bit more :)

When doing cargo build in a new project which is simply a copy-paste of the vecadd example, I get this error:

   Compiling rustc_codegen_nvvm v0.3.0
error[E0463]: can't find crate for `rustc_attr`
  --> /home/ubuntu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustc_codegen_nvvm-0.3.0/src/lib.rs:10:1
   |
10 | extern crate rustc_attr;
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

I also get a laundry list of a bunch of other errors, presumably as a result. Btw I'm using the latest rust-toolchain.toml that's in this repo.

I looked into the source code for rustc_codegen_nvvm, and it is still v0.3.0, but it doesn't have the line extern crate rustc_attr; anywhere. I assume this is as a result of the recent version bump of the nightly Rust dependency. Of course, I can clone this repo, the dev container works just fine, and the vecadd example builds fine when run in this repo, but the build broken when you don't build stuff directly inside this repo.

I think this issue could be solved with a simple version bump + push of the rustc_codegen_nvvm crate. Please could you do this? I'd really love to use this crate even in this early stage, but can't as a result of this.

Alternatively, could you provide the nightly rust version which would successfully compile this? I tried a few different options and various settings in the rust-toolchain.toml but couldn't get anything to work.

主要语言
Rust
星标
5.4k
派生
251
平均合并
3 天 11 小时
30 天内合并 PR
3

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Rust-GPU/rust-cuda 的其他 Issue

查看 Rust-GPU/rust-cuda 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。