dwrensha/fuzz-rustc

Cannot build project

Closed this issue · 2 comments

My rustc:

rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)

binary: rustc

commit-hash: b11fbfbf351b94c7eecf9e6749a4544a6d4717fa

commit-date: 2024-02-03

host: x86_64-unknown-linux-gnu

release: 1.78.0-nightly

LLVM version: 17.0.6

Error:

error[E0658]: cannot cast \dyn MachineStopType` to `dyn std::any::Any`, trait upcasting coercion is experimental`

--> rust/compiler/rustc_middle/src/mir/interpret/error.rs:499:27

|

499 | let x: &dyn Any = self;

| ^^^^

|

= note: see issue #65991 <https://github.com/rust-lang/rust/issues/65991> for more information

= help: add \#![feature(trait_upcasting)]` to the crate attributes to enable`

= note: this compiler was built on 2024-02-03; consider upgrading it if it is out of date

= note: required when coercing \&(dyn MachineStopType + 'static)` into `&(dyn std::any::Any + 'static)``


For more information about this error, try \rustc --explain E0658`.`

error: could not compile \rustc_middle` (lib) due to 1 previous error`

After adding the feature to rustc source code, I get this:

the feature \slice_group_by` has been stable since 1.78.0-nightly and no longer requires an attribute to enable`

--> rust/compiler/rustc_passes/src/lib.rs:15:12

|

15 | #![feature(slice_group_by)]

| ^^^^^^^^^^^^^^

|

= note: \#[warn(stable_features)]` on by default`


error[E0599]: no method named \group_by` found for slice `[&DeadItem]` in the current scope`

--> rust/compiler/rustc_passes/src/dead.rs:920:37

|

920 | for group in dead_codes[..].group_by(|a, b| a.level == b.level) {

| ^^^^^^^^ method not found in \[&DeadItem]``


error[E0277]: the size for values of type \[&DeadItem]` cannot be known at compilation time`

--> rust/compiler/rustc_passes/src/dead.rs:920:13

|

920 | for group in dead_codes[..].group_by(|a, b| a.level == b.level) {

| ^^^^^ doesn't have a size known at compile-time

|

= help: the trait \std::marker::Sized` is not implemented for `[&DeadItem]``

= note: all local variables must have a statically known size

= help: unsized locals are gated as an unstable feature


error[E0277]: the size for values of type \[&DeadItem]` cannot be known at compilation time`

--> rust/compiler/rustc_passes/src/dead.rs:920:22

|

920 | for group in dead_codes[..].group_by(|a, b| a.level == b.level) {

| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time

|

= help: the trait \std::marker::Sized` is not implemented for `[&DeadItem]``

note: required by a bound in \std::option::Option``

--> /rustc/b11fbfbf351b94c7eecf9e6749a4544a6d4717fa/library/core/src/option.rs:570:1


error[E0277]: the size for values of type \[&DeadItem]` cannot be known at compilation time`

--> rust/compiler/rustc_passes/src/dead.rs:920:9

|

920 | / for group in dead_codes[..].group_by(|a, b| a.level == b.level) {

921 | | self.lint_at_single_level(&group, participle, Some(def_id), report_on);

922 | | }

| |_________^ doesn't have a size known at compile-time

|

= help: the trait \std::marker::Sized` is not implemented for `[&DeadItem]``


I suspect the commit in your rust/ subdirectory is too old, and is therefore incompatible with your rustc.

I rebased the fuzz branch of dwrensha/rust just now: https://github.com/dwrensha/rust/tree/fuzz
./run-fuzzer.sh then worked for me.

Probably we should move to using a checked-in diff file, like jruderman does in his fork: https://github.com/jruderman/fuzz-rustc/blob/master/rust-changes.diff

Or include the sha256 of the commit.