mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 10:33:34 +00:00
fmt
This commit is contained in:
parent
d777cb84e2
commit
5f61271e38
@ -192,9 +192,9 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
|
||||
let res = segment.res.filter(|&r| r != Res::Err).unwrap_or(path.res);
|
||||
use def::CtorOf;
|
||||
let generics = match res {
|
||||
Res::Def(DefKind::Ctor(CtorOf::Variant, _), def_id) => {
|
||||
tcx.generics_of(tcx.parent(def_id).and_then(|def_id| tcx.parent(def_id)).unwrap())
|
||||
}
|
||||
Res::Def(DefKind::Ctor(CtorOf::Variant, _), def_id) => tcx.generics_of(
|
||||
tcx.parent(def_id).and_then(|def_id| tcx.parent(def_id)).unwrap(),
|
||||
),
|
||||
Res::Def(DefKind::Variant | DefKind::Ctor(CtorOf::Struct, _), def_id) => {
|
||||
tcx.generics_of(tcx.parent(def_id).unwrap())
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// check-pass
|
||||
pub enum Foo<const N: usize> {
|
||||
enum Foo<const N: usize> {
|
||||
Variant,
|
||||
Variant2(),
|
||||
Variant3{},
|
||||
|
Loading…
Reference in New Issue
Block a user