Some ICEs manifest as if the crate compiled successfully
まだ誰も着手していません。
評価
調査の方向性
tests/compiletest.rs と tests/ui/break-rust.rs から始め、次に cargo test を実行して、rustc は panic する一方で trybuild は成功を報告するケースを再現します。harness がコンパイラプロセスの結果をどのように解釈するかを追跡します。この ICE が成功した compile-fail テストではなく、コンパイル失敗として報告されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
For example the following ICE in nightly-2020-06-04 (https://github.com/rust-lang/rust/issues/97698):
// tests/compiletest.rs
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/ui/break-rust.rs");
}
// tests/ui/break-rust.rs
trait AmbiguousIfImpl<A> {
fn method() {}
}
struct One;
struct Two;
impl<T> AmbiguousIfImpl<One> for T {}
impl<T> AmbiguousIfImpl<Two> for T {}
struct Struct;
fn main() {
<Struct as AmbiguousIfImpl<_>>::method();
}
$ cargo test
running 1 test
test tests/ui/break-rust.rs ... error
Expected test case to fail to compile, but it succeeded.
test ui ... FAILED
failures:
---- ui stdout ----
thread 'ui' panicked at '1 of 1 tests failed', github.com-1ecc6299db9ec823/trybuild-1.0.61/src/run.rs:100:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.38s
error: test failed, to rerun pass '--test compiletest'
Meanwhile the crate definitely fails to build and rustc exits with nonzero code.
thread 'rustc' panicked at 'range end index 2 out of range for slice of length 1', library/core/src/slice/index.rs:73:5
stack backtrace:
…
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.63.0-nightly (a6b8c6954 2022-06-03) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
- 主要言語
- Rust
- スター
- 1k
- フォーク
- 87
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dtolnay/trybuild のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
dtolnay/trybuild の issue をすべて見る
似ている issue
-
priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
storytold/photocraft#15350 ·
メンテナーはふだん 1 日以内に返信
-
area:davinci
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ubugeeei-prod/vize#13167 ·
メンテナーはふだん 1 日以内に返信
-
area:ui enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
transit-audio/transit#738 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
hocinehacherouf/liberarr#78 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信