Auto merge of #56616 - estebank:issue-56539, r=davidtwco
Encode `TraitAlias` as if they were `Trait` Fix #56539.
This commit is contained in:
commit
8db23425a3
@ -1141,7 +1141,8 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
||||
|
||||
EntryKind::Impl(self.lazy(&data))
|
||||
}
|
||||
hir::ItemKind::Trait(..) => {
|
||||
hir::ItemKind::Trait(..) |
|
||||
hir::ItemKind::TraitAlias(..) => {
|
||||
let trait_def = tcx.trait_def(def_id);
|
||||
let data = TraitData {
|
||||
unsafety: trait_def.unsafety,
|
||||
@ -1154,7 +1155,6 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
||||
EntryKind::Trait(self.lazy(&data))
|
||||
}
|
||||
hir::ItemKind::ExternCrate(_) |
|
||||
hir::ItemKind::TraitAlias(..) |
|
||||
hir::ItemKind::Use(..) => bug!("cannot encode info for item {:?}", item),
|
||||
};
|
||||
|
||||
|
7
src/test/ui/run-pass/traits/trait-alias.rs
Normal file
7
src/test/ui/run-pass/traits/trait-alias.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// run-pass
|
||||
#![feature(trait_alias)]
|
||||
|
||||
pub trait Foo {}
|
||||
pub trait FooAlias = Foo;
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user