Skip to content

Commit d5f5e70

Browse files
committed
Use TypeFoldable derive macro in librustc_traits.
1 parent 17692b5 commit d5f5e70

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,6 +3819,7 @@ dependencies = [
38193819
"log",
38203820
"rustc",
38213821
"rustc_data_structures",
3822+
"rustc_macros",
38223823
"rustc_target",
38233824
"smallvec 1.0.0",
38243825
"syntax",

src/librustc_traits/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ path = "lib.rs"
1212
log = { version = "0.4" }
1313
rustc = { path = "../librustc" }
1414
rustc_data_structures = { path = "../librustc_data_structures" }
15+
rustc_macros = { path = "../librustc_macros" }
1516
rustc_target = { path = "../librustc_target" }
1617
syntax = { path = "../libsyntax" }
1718
syntax_pos = { path = "../libsyntax_pos" }

src/librustc_traits/chalk_context/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use rustc::ty::query::Providers;
3939
use rustc::ty::subst::{GenericArg, GenericArgKind};
4040
use rustc::mir::interpret::ConstValue;
4141
use syntax_pos::DUMMY_SP;
42+
use rustc_macros::TypeFoldable;
4243

4344
use std::fmt::{self, Debug};
4445
use std::marker::PhantomData;
@@ -66,18 +67,12 @@ crate struct UniverseMap;
6667

6768
crate type RegionConstraint<'tcx> = ty::OutlivesPredicate<GenericArg<'tcx>, ty::Region<'tcx>>;
6869

69-
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
70+
#[derive(Clone, Debug, PartialEq, Eq, Hash, TypeFoldable)]
7071
crate struct ConstrainedSubst<'tcx> {
7172
subst: CanonicalVarValues<'tcx>,
7273
constraints: Vec<RegionConstraint<'tcx>>,
7374
}
7475

75-
BraceStructTypeFoldableImpl! {
76-
impl<'tcx> TypeFoldable<'tcx> for ConstrainedSubst<'tcx> {
77-
subst, constraints
78-
}
79-
}
80-
8176
impl context::Context for ChalkArenas<'tcx> {
8277
type CanonicalExClause = Canonical<'tcx, ChalkExClause<'tcx>>;
8378

0 commit comments

Comments
 (0)