-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
apint fails to compile on beta #55806
Comments
cc @Robbepop -- I believe this is your crate, though it seems plausible this is a bug in the compiler |
cc @rust-lang/compiler -- beta/stable regression, would be good to proactively triage before meeting if possible |
@oli-obk Could this be promotion-related? |
Yea. The call to |
@Mark-Simulacrum yeah that's my crate thanks for linking! I have already stumbled upon this CI error but couldn't yet find time to wrap my head around it.
So if I understood correctly simply using a |
minimal repro let x: &'static _ = &u8::max_value();
Nope, it's a new bug that I was sure we had regression tests against. |
This was injected between rustc 1.31.0-nightly (5597ee8 2018-10-03) and rustc 1.31.0-nightly (8c4ad4e 2018-10-04) Log of bors commits in that time in the details block % git log 5597ee8..8c4ad4e --author bors --format=oneline |
Hmm I wonder if this could somehow be a consequence fo #54447 ...?
|
Full diff: 5597ee8...8c4ad4e #53851 (limiting promotability of const fns) also fell in there. |
I even added unit tests, but never any for promoting functions from the libstd. rust/src/librustc/ty/constness.rs Line 88 in 0ee045e
rustc_promotable function is declared.
I think the solution is to make the const qualifier eagerly call |
Discussed a bit with @oli-obk and investigated independently. Some details of note:
#![stable(feature = "unit_test", since="1.0.0")]
#![feature(staged_api, rustc_attrs)]
#![crate_type="lib"]
#[stable(feature = "unit_test", since="1.0.0")]
pub struct S(u8);
#[stable(feature = "unit_test", since="1.0.0")]
#[rustc_promotable]
pub const fn bar() -> S { S(10) }
extern crate issue_55806_lib;
use issue_55806_lib::bar;
fn main() {
let _x: &'static _ = &bar();
}
|
reassigning to @oli-obk for followup investigation and hopefully fixing. |
…eddyb Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value` cc @pnkfelix fixes rust-lang#55806
apint fails to compile (https://crater-reports.s3.amazonaws.com/beta-1.31-1/beta-2018-10-30/reg/apint-0.2.0/log.txt) on beta. Note that the crate must be compiled in test mode.
The text was updated successfully, but these errors were encountered: