From 89fdfe682870bd60e759a38c0509af605eaff759 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 2 Oct 2020 09:28:05 -0400 Subject: [PATCH] Permit ty::Bool in const generics for v0 mangling --- compiler/rustc_symbol_mangling/src/v0.rs | 1 + src/test/ui/symbol-names/issue-76365.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/test/ui/symbol-names/issue-76365.rs diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index 091d488138e46..da9c93143bfb3 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -504,6 +504,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> { match ct.ty.kind() { ty::Uint(_) => {} + ty::Bool => {} _ => { bug!("symbol_names: unsupported constant of type `{}` ({:?})", ct.ty, ct); } diff --git a/src/test/ui/symbol-names/issue-76365.rs b/src/test/ui/symbol-names/issue-76365.rs new file mode 100644 index 0000000000000..61ba255dac04d --- /dev/null +++ b/src/test/ui/symbol-names/issue-76365.rs @@ -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; + +impl Bar { + pub fn foo() {} +} + +impl Bar { + pub fn bar() {} +} + +fn main() {}