Rollup merge of #77452 - Mark-Simulacrum:fix-symbol-v0, r=eddyb

Permit ty::Bool in const generics for v0 mangling

This should unbreak using new-symbol-mangling = true in config.toml (once it lands in beta anyway).

Fixes #76365 (well, it will, but seems fine to close as soon as we have support)

r? @eddyb (for mangling) but I'm okay with some other reviewer too :)
This commit is contained in:
Jonas Schievink 2020-10-03 00:31:17 +02:00 committed by GitHub
commit eff6398014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -504,6 +504,7 @@ fn print_const(mut self, ct: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self:
match ct.ty.kind() {
ty::Uint(_) => {}
ty::Bool => {}
_ => {
bug!("symbol_names: unsupported constant of type `{}` ({:?})", ct.ty, ct);
}

View file

@ -0,0 +1,18 @@
// check-pass
// revisions: legacy v0
//[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib
//[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib
#![feature(min_const_generics)]
pub struct Bar<const F: bool>;
impl Bar<true> {
pub fn foo() {}
}
impl<const F: bool> Bar<F> {
pub fn bar() {}
}
fn main() {}