-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
StableHasher: unexpected region with impl trait for type with complex generic constant #77708
Comments
I'm trying to add this ICE to the glacier. Can you confirm if this still causes an ICE with the latest nightly? |
It appears to be working now. |
Just like in #72442, this bug is only present when building in debug mode and with incremental compilation enabled. If you copy the first example from this ticket to an empty project, then:
Tested just now with rustc 1.50.0-nightly (f745834 2020-12-18). The playground sets |
Issue: rust-lang/rust#77708
It's still present in the latest build:
Related issue: #84355 |
this is my current MCVE that also panics on stable: #![feature(const_generics)]
#![feature(const_evaluatable_checked)]
struct Z;
const fn one() -> usize { 1 }
fn from_a_to_b<T>(source: [u8; one()]) -> T {
todo!()
}
fn main() {
let _: &Z = from_a_to_b([0; 1]);
} Regression in nightly-2020-09-19 f3c923a...bbc6774 @rustbot modify labels: A-incr-comp regression-from-stable-to-stable |
I have another example while I was reducing #85848 #![feature(const_generics, const_evaluatable_checked)]
trait Delegates<T> {}
struct FileCap<const Op: bool> {}
fn writes_to_path<C>(cap: &C)
where
C: Delegates<FileCap<{ false }>>,
{
writes_to_specific_path(&cap);
}
fn writes_to_specific_path<C>(cap: &C)
where
C: Delegates<FileCap<{ false }>>,
{
}
fn main() {} Funny enough, the braces around |
Code
Assuming the following header:
The following example in trait impl causes an ICE:
The following without a trait implementation does not:
Neither does the equivalent implementation without
const_evaluatable_checked
:Meta
rustc --version --verbose
:Error output
cargo check
Backtrace
Query Stack
Possibly related to #77650
The text was updated successfully, but these errors were encountered: