Description
Summary:
- This is when adding const generics to an existing project (the original author is someone else). So I can't minimize it at the moment, and I most likely have some errors. But:
- nightly/stable - both are (to be) implemented.
stable
uses a type alias (insrc/trait_flags.rs:
pub type TraitFlags = u8;
) instead of a custom struct.stable
runs all tests fine.nightly
(hopes to) usegeneric_const_exprs
. It's behindunstable_generic_const_own_type
feature - see the following.
Surprisingly, even though it mentions ICE, the problem shows up
- only when RUNNING tests
cargo +nightly test --features unstable_generic_const_own_type
- but NOT when running a check on tests with
cargo +nightly check --tests --features unstable_generic_const_own_type
.
To replicate:
git clone https://github.com/peter-lyons-kehl/phantom-newtype-rs
cd phantom-newtype-rs
git checkout aaf428c25ef3f7fb1de5aa290b38e9908390fad3
cargo +nightly test --features unstable_generic_const_own_type
Code
See above.
Meta
# on current Manjaro x64
uname -a
Linux spectre 6.12.1-4-MANJARO #1 SMP PREEMPT_DYNAMIC Mon, 25 Nov 2024 05:36:03 +0000 x86_64 GNU/Linux
Rustup installed as a Manjaro (Arch) package. Both nightly
and stable
installed with rustup
and current:
rustc --version --verbose
:
rustc 1.85.0-nightly (9c707a8b7 2024-12-07)
binary: rustc
commit-hash: 9c707a8b769523bb6768bf58e74fa2c39cc24844
commit-date: 2024-12-07
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5
Error output
See also attached ICE TXT files.
<output>
(SKIPPED WARNINGS)
running 2 tests
test instant::tests::test_complex_instant_arithmetics ... ok
test trait_flag::test_flags::all ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests phantom_newtype
running 32 tests
test src/amount.rs - amount::Amount (line 138) ... FAILED
test src/amount.rs - amount::Amount (line 126) ... FAILED
test src/amount.rs - amount::Amount (line 31) - compile fail ... ok
test src/amount.rs - amount::Amount (line 108) ... ok
test src/amount.rs - amount::Amount (line 47) ... FAILED
test src/amount.rs - amount::Amount (line 65) ... FAILED
test src/amount.rs - amount::Amount (line 82) ... FAILED
test src/amount.rs - amount::Amount (line 96) ... FAILED
test src/amount.rs - amount::Amount<TF,Unit,Repr>::get (line 157) ... FAILED
test src/amount.rs - amount::Amount<TF,Unit,Repr>::display (line 206) ... FAILED
test src/amount.rs - amount::Amount<TF,Unit,Repr>::unit (line 185) ... FAILED
test src/id.rs - id::Id (line 48) - compile fail ... ok
test src/id.rs - id::Id (line 127) ... ok
test src/id.rs - id::Id (line 30) ... ok
test src/id.rs - id::Id (line 113) ... ok
test src/id.rs - id::Id (line 62) ... ok
test src/id.rs - id::Id (line 76) ... ok
test src/id.rs - id::Id<Entity,Repr>::get (line 145) ... ok
test src/id.rs - id::Id<Entity,Repr>::display (line 182) ... ok
test src/id.rs - id::Id<Entity,Repr>::new (line 161) ... ok
test src/id.rs - id::Id (line 95) ... ok
test src/instant.rs - instant::Instant (line 100) ... ok
test src/instant.rs - instant::Instant (line 132) ... FAILED
test src/instant.rs - instant::Instant (line 120) ... FAILED
test src/instant.rs - instant::Instant (line 53) ... FAILED
test src/instant.rs - instant::Instant (line 33) ... FAILED
test src/instant.rs - instant::Instant<TF,Unit,Repr>::display (line 200) ... FAILED
test src/instant.rs - instant::Instant (line 73) ... FAILED
test src/instant.rs - instant::Instant (line 88) ... FAILED
test src/to.rs - to::As (line 25) ... ignored
test src/instant.rs - instant::Instant<TF,Unit,Repr>::get (line 153) ... FAILED
test src/instant.rs - instant::Instant<TF,Unit,Repr>::unit (line 179) ... FAILED
failures:
---- src/amount.rs - amount::Amount (line 138) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074664.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount (line 126) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074666.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount (line 47) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074683.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount (line 65) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074687.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount (line 82) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074695.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount (line 96) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_46-2074703.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount<TF,Unit,Repr>::get (line 157) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_47-2074712.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount<TF,Unit,Repr>::display (line 206) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_47-2074709.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/amount.rs - amount::Amount<TF,Unit,Repr>::unit (line 185) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_47-2074714.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 132) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074907.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 120) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074892.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 53) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074915.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 33) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074913.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant<TF,Unit,Repr>::display (line 200) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074927.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 73) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074921.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant (line 88) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074923.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant<TF,Unit,Repr>::get (line 153) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074934.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
---- src/instant.rs - instant::Instant<TF,Unit,Repr>::unit (line 179) stdout ----
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: Encountered anon const with inference variable args but no error reported
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:605:27 - disabled backtrace
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/share/pkehl/GIT/phantom-newtype-rs/rustc-ice-2024-12-08T20_05_48-2074938.txt` to your bug report
query stack during panic:
end of query stack
Couldn't compile the test.
failures:
src/amount.rs - amount::Amount (line 126)
src/amount.rs - amount::Amount (line 138)
src/amount.rs - amount::Amount (line 47)
src/amount.rs - amount::Amount (line 65)
src/amount.rs - amount::Amount (line 82)
src/amount.rs - amount::Amount (line 96)
src/amount.rs - amount::Amount<TF,Unit,Repr>::display (line 206)
src/amount.rs - amount::Amount<TF,Unit,Repr>::get (line 157)
src/amount.rs - amount::Amount<TF,Unit,Repr>::unit (line 185)
src/instant.rs - instant::Instant (line 120)
src/instant.rs - instant::Instant (line 132)
src/instant.rs - instant::Instant (line 33)
src/instant.rs - instant::Instant (line 53)
src/instant.rs - instant::Instant (line 73)
src/instant.rs - instant::Instant (line 88)
src/instant.rs - instant::Instant<TF,Unit,Repr>::display (line 200)
src/instant.rs - instant::Instant<TF,Unit,Repr>::get (line 153)
src/instant.rs - instant::Instant<TF,Unit,Repr>::unit (line 179)
test result: FAILED. 13 passed; 18 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.50s
error: doctest failed, to rerun pass `--doc`
rustc-ice-2024-12-08T20_05_48-2074938.txt
rustc-ice-2024-12-08T20_05_48-2074934.txt
rustc-ice-2024-12-08T20_05_48-2074923.txt
rustc-ice-2024-12-08T20_05_48-2074927.txt
rustc-ice-2024-12-08T20_05_48-2074921.txt
rustc-ice-2024-12-08T20_05_48-2074913.txt
rustc-ice-2024-12-08T20_05_48-2074915.txt
rustc-ice-2024-12-08T20_05_48-2074907.txt
rustc-ice-2024-12-08T20_05_48-2074892.txt
rustc-ice-2024-12-08T20_05_47-2074709.txt
rustc-ice-2024-12-08T20_05_47-2074714.txt
rustc-ice-2024-12-08T20_05_47-2074712.txt
rustc-ice-2024-12-08T20_05_46-2074703.txt
rustc-ice-2024-12-08T20_05_46-2074683.txt
rustc-ice-2024-12-08T20_05_46-2074687.txt
rustc-ice-2024-12-08T20_05_46-2074695.txt
rustc-ice-2024-12-08T20_05_46-2074666.txt
rustc-ice-2024-12-08T20_05_46-2074664.txt