Skip to content

Commit

Permalink
Permit ty::Bool in const generics for v0 mangling
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Oct 2, 2020
1 parent 154f1f5 commit 89fdfe6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_symbol_mangling/src/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
18 changes: 18 additions & 0 deletions src/test/ui/symbol-names/issue-76365.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 89fdfe6

Please sign in to comment.