about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2020-10-02 09:28:05 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2020-10-02 09:45:48 -0400
commit89fdfe682870bd60e759a38c0509af605eaff759 (patch)
tree51fd7ff2efc411e68edb5ad60cbf7c912de3f3fc
parent154f1f544dd68f7b53ff8d9952811e855f4c2d7c (diff)
downloadrust-89fdfe682870bd60e759a38c0509af605eaff759.tar.gz
rust-89fdfe682870bd60e759a38c0509af605eaff759.zip
Permit ty::Bool in const generics for v0 mangling
-rw-r--r--compiler/rustc_symbol_mangling/src/v0.rs1
-rw-r--r--src/test/ui/symbol-names/issue-76365.rs18
2 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs
index 091d488138e..da9c93143bf 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 00000000000..61ba255dac0
--- /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<const F: bool>;
+
+impl Bar<true> {
+    pub fn foo() {}
+}
+
+impl<const F: bool> Bar<F> {
+    pub fn bar() {}
+}
+
+fn main() {}