Skip to content

Commit 5555e13

Browse files
authoredAug 29, 2022
Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors
Remove separate indexing of early-bound regions ~Based on #99728 This PR copies some modifications from #97839 around object lifetime defaults. These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.
2 parents 1999ed7 + da90ec1 commit 5555e13

File tree

17 files changed

+180
-432
lines changed

17 files changed

+180
-432
lines changed
 

‎compiler/rustc_infer/src/infer/error_reporting/nice_region_error/find_anon_type.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
103103
// Find the index of the named region that was part of the
104104
// error. We will then search the function parameters for a bound
105105
// region at the right depth with the same index
106-
(Some(rl::Region::EarlyBound(_, id)), ty::BrNamed(def_id, _)) => {
106+
(Some(rl::Region::EarlyBound(id)), ty::BrNamed(def_id, _)) => {
107107
debug!("EarlyBound id={:?} def_id={:?}", id, def_id);
108108
if id == def_id {
109109
self.found_type = Some(arg);
@@ -133,7 +133,7 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
133133
Some(
134134
rl::Region::Static
135135
| rl::Region::Free(_, _)
136-
| rl::Region::EarlyBound(_, _)
136+
| rl::Region::EarlyBound(_)
137137
| rl::Region::LateBound(_, _, _),
138138
)
139139
| None,
@@ -188,7 +188,7 @@ impl<'tcx> Visitor<'tcx> for TyPathVisitor<'tcx> {
188188
fn visit_lifetime(&mut self, lifetime: &hir::Lifetime) {
189189
match (self.tcx.named_region(lifetime.hir_id), self.bound_region) {
190190
// the lifetime of the TyPath!
191-
(Some(rl::Region::EarlyBound(_, id)), ty::BrNamed(def_id, _)) => {
191+
(Some(rl::Region::EarlyBound(id)), ty::BrNamed(def_id, _)) => {
192192
debug!("EarlyBound id={:?} def_id={:?}", id, def_id);
193193
if id == def_id {
194194
self.found_it = true;
@@ -209,7 +209,7 @@ impl<'tcx> Visitor<'tcx> for TyPathVisitor<'tcx> {
209209
(
210210
Some(
211211
rl::Region::Static
212-
| rl::Region::EarlyBound(_, _)
212+
| rl::Region::EarlyBound(_)
213213
| rl::Region::LateBound(_, _, _)
214214
| rl::Region::Free(_, _),
215215
)

‎compiler/rustc_lint/src/builtin.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -2026,13 +2026,13 @@ declare_lint_pass!(ExplicitOutlivesRequirements => [EXPLICIT_OUTLIVES_REQUIREMEN
20262026
impl ExplicitOutlivesRequirements {
20272027
fn lifetimes_outliving_lifetime<'tcx>(
20282028
inferred_outlives: &'tcx [(ty::Predicate<'tcx>, Span)],
2029-
index: u32,
2029+
def_id: DefId,
20302030
) -> Vec<ty::Region<'tcx>> {
20312031
inferred_outlives
20322032
.iter()
20332033
.filter_map(|(pred, _)| match pred.kind().skip_binder() {
20342034
ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(a, b)) => match *a {
2035-
ty::ReEarlyBound(ebr) if ebr.index == index => Some(b),
2035+
ty::ReEarlyBound(ebr) if ebr.def_id == def_id => Some(b),
20362036
_ => None,
20372037
},
20382038
_ => None,
@@ -2069,8 +2069,12 @@ impl ExplicitOutlivesRequirements {
20692069
.filter_map(|(i, bound)| {
20702070
if let hir::GenericBound::Outlives(lifetime) = bound {
20712071
let is_inferred = match tcx.named_region(lifetime.hir_id) {
2072-
Some(Region::EarlyBound(index, ..)) => inferred_outlives.iter().any(|r| {
2073-
if let ty::ReEarlyBound(ebr) = **r { ebr.index == index } else { false }
2072+
Some(Region::EarlyBound(def_id)) => inferred_outlives.iter().any(|r| {
2073+
if let ty::ReEarlyBound(ebr) = **r {
2074+
ebr.def_id == def_id
2075+
} else {
2076+
false
2077+
}
20742078
}),
20752079
_ => false,
20762080
};
@@ -2164,11 +2168,14 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
21642168
for (i, where_predicate) in hir_generics.predicates.iter().enumerate() {
21652169
let (relevant_lifetimes, bounds, span, in_where_clause) = match where_predicate {
21662170
hir::WherePredicate::RegionPredicate(predicate) => {
2167-
if let Some(Region::EarlyBound(index, ..)) =
2171+
if let Some(Region::EarlyBound(region_def_id)) =
21682172
cx.tcx.named_region(predicate.lifetime.hir_id)
21692173
{
21702174
(
2171-
Self::lifetimes_outliving_lifetime(inferred_outlives, index),
2175+
Self::lifetimes_outliving_lifetime(
2176+
inferred_outlives,
2177+
region_def_id,
2178+
),
21722179
&predicate.bounds,
21732180
predicate.span,
21742181
predicate.in_where_clause,

‎compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ provide! { tcx, def_id, other, cdata,
199199
codegen_fn_attrs => { table }
200200
impl_trait_ref => { table }
201201
const_param_default => { table }
202+
object_lifetime_default => { table }
202203
thir_abstract_const => { table }
203204
optimized_mir => { table }
204205
mir_for_ctfe => { table }

‎compiler/rustc_metadata/src/rmeta/encoder.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,11 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
10761076
record_array!(self.tables.inferred_outlives_of[def_id] <- inferred_outlives);
10771077
}
10781078
}
1079+
if let DefKind::TyParam | DefKind::ConstParam = def_kind {
1080+
if let Some(default) = self.tcx.object_lifetime_default(def_id) {
1081+
record!(self.tables.object_lifetime_default[def_id] <- default);
1082+
}
1083+
}
10791084
if let DefKind::Trait | DefKind::TraitAlias = def_kind {
10801085
record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id));
10811086
}

‎compiler/rustc_metadata/src/rmeta/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use rustc_index::{bit_set::FiniteBitSet, vec::IndexVec};
1616
use rustc_middle::metadata::ModChild;
1717
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
1818
use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
19+
use rustc_middle::middle::resolve_lifetime::ObjectLifetimeDefault;
1920
use rustc_middle::mir;
2021
use rustc_middle::ty::fast_reject::SimplifiedType;
2122
use rustc_middle::ty::query::Providers;
@@ -358,6 +359,7 @@ define_tables! {
358359
codegen_fn_attrs: Table<DefIndex, LazyValue<CodegenFnAttrs>>,
359360
impl_trait_ref: Table<DefIndex, LazyValue<ty::TraitRef<'static>>>,
360361
const_param_default: Table<DefIndex, LazyValue<rustc_middle::ty::Const<'static>>>,
362+
object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
361363
optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
362364
mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
363365
promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,

‎compiler/rustc_middle/src/hir/map/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,9 @@ impl<'hir> Map<'hir> {
486486
let def_kind = self.tcx.def_kind(def_id);
487487
match def_kind {
488488
DefKind::Trait | DefKind::TraitAlias => def_id,
489-
DefKind::TyParam | DefKind::ConstParam => self.tcx.local_parent(def_id),
489+
DefKind::LifetimeParam | DefKind::TyParam | DefKind::ConstParam => {
490+
self.tcx.local_parent(def_id)
491+
}
490492
_ => bug!("ty_param_owner: {:?} is a {:?} not a type parameter", def_id, def_kind),
491493
}
492494
}
@@ -495,7 +497,9 @@ impl<'hir> Map<'hir> {
495497
let def_kind = self.tcx.def_kind(def_id);
496498
match def_kind {
497499
DefKind::Trait | DefKind::TraitAlias => kw::SelfUpper,
498-
DefKind::TyParam | DefKind::ConstParam => self.tcx.item_name(def_id.to_def_id()),
500+
DefKind::LifetimeParam | DefKind::TyParam | DefKind::ConstParam => {
501+
self.tcx.item_name(def_id.to_def_id())
502+
}
499503
_ => bug!("ty_param_name: {:?} is a {:?} not a type parameter", def_id, def_kind),
500504
}
501505
}

‎compiler/rustc_middle/src/middle/resolve_lifetime.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_macros::HashStable;
1010
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, HashStable)]
1111
pub enum Region {
1212
Static,
13-
EarlyBound(/* index */ u32, /* lifetime decl */ DefId),
13+
EarlyBound(/* lifetime decl */ DefId),
1414
LateBound(ty::DebruijnIndex, /* late-bound index */ u32, /* lifetime decl */ DefId),
1515
Free(DefId, /* lifetime decl */ DefId),
1616
}
@@ -35,7 +35,13 @@ impl<T: PartialEq> Set1<T> {
3535
}
3636
}
3737

38-
pub type ObjectLifetimeDefault = Set1<Region>;
38+
#[derive(Copy, Clone, Debug, HashStable, Encodable, Decodable)]
39+
pub enum ObjectLifetimeDefault {
40+
Empty,
41+
Static,
42+
Ambiguous,
43+
Param(DefId),
44+
}
3945

4046
/// Maps the id of each lifetime reference to the lifetime decl
4147
/// that it corresponds to.

‎compiler/rustc_middle/src/query/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1597,8 +1597,9 @@ rustc_queries! {
15971597
/// for each parameter if a trait object were to be passed for that parameter.
15981598
/// For example, for `struct Foo<'a, T, U>`, this would be `['static, 'static]`.
15991599
/// For `struct Foo<'a, T: 'a, U>`, this would instead be `['a, 'static]`.
1600-
query object_lifetime_defaults(_: LocalDefId) -> Option<&'tcx [ObjectLifetimeDefault]> {
1601-
desc { "looking up lifetime defaults for a region on an item" }
1600+
query object_lifetime_default(key: DefId) -> Option<ObjectLifetimeDefault> {
1601+
desc { "looking up lifetime defaults for generic parameter `{:?}`", key }
1602+
separate_provide_extern
16021603
}
16031604
query late_bound_vars_map(_: LocalDefId)
16041605
-> Option<&'tcx FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {

‎compiler/rustc_middle/src/ty/generics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::middle::resolve_lifetime::ObjectLifetimeDefault;
21
use crate::ty;
32
use crate::ty::subst::{Subst, SubstsRef};
43
use crate::ty::EarlyBinder;
@@ -13,7 +12,7 @@ use super::{EarlyBoundRegion, InstantiatedPredicates, ParamConst, ParamTy, Predi
1312
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable)]
1413
pub enum GenericParamDefKind {
1514
Lifetime,
16-
Type { has_default: bool, object_lifetime_default: ObjectLifetimeDefault, synthetic: bool },
15+
Type { has_default: bool, synthetic: bool },
1716
Const { has_default: bool },
1817
}
1918

‎compiler/rustc_middle/src/ty/parameterized.rs

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ trivially_parameterized_over_tcx! {
5353
crate::metadata::ModChild,
5454
crate::middle::codegen_fn_attrs::CodegenFnAttrs,
5555
crate::middle::exported_symbols::SymbolExportInfo,
56+
crate::middle::resolve_lifetime::ObjectLifetimeDefault,
5657
crate::mir::ConstQualifs,
5758
ty::Generics,
5859
ty::ImplPolarity,

‎compiler/rustc_passes/src/check_attr.rs

+28
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use rustc_hir::intravisit::{self, Visitor};
1616
use rustc_hir::{self, FnSig, ForeignItem, HirId, Item, ItemKind, TraitItem, CRATE_HIR_ID};
1717
use rustc_hir::{MethodKind, Target};
1818
use rustc_middle::hir::nested_filter;
19+
use rustc_middle::middle::resolve_lifetime::ObjectLifetimeDefault;
1920
use rustc_middle::ty::query::Providers;
2021
use rustc_middle::ty::TyCtxt;
2122
use rustc_session::lint::builtin::{
@@ -172,6 +173,9 @@ impl CheckAttrVisitor<'_> {
172173
sym::no_implicit_prelude => {
173174
self.check_generic_attr(hir_id, attr, target, &[Target::Mod])
174175
}
176+
sym::rustc_object_lifetime_default => {
177+
self.check_object_lifetime_default(hir_id, span)
178+
}
175179
_ => {}
176180
}
177181

@@ -410,6 +414,30 @@ impl CheckAttrVisitor<'_> {
410414
}
411415
}
412416

417+
/// Debugging aid for `object_lifetime_default` query.
418+
fn check_object_lifetime_default(&self, hir_id: HirId, span: Span) {
419+
let tcx = self.tcx;
420+
if let Some(generics) = tcx.hir().get_generics(tcx.hir().local_def_id(hir_id)) {
421+
let object_lifetime_default_reprs: String = generics
422+
.params
423+
.iter()
424+
.filter_map(|p| {
425+
let param_id = tcx.hir().local_def_id(p.hir_id);
426+
let default = tcx.object_lifetime_default(param_id)?;
427+
Some(match default {
428+
ObjectLifetimeDefault::Empty => "BaseDefault".to_owned(),
429+
ObjectLifetimeDefault::Static => "'static".to_owned(),
430+
ObjectLifetimeDefault::Param(def_id) => tcx.item_name(def_id).to_string(),
431+
ObjectLifetimeDefault::Ambiguous => "Ambiguous".to_owned(),
432+
})
433+
})
434+
.collect::<Vec<String>>()
435+
.join(",");
436+
437+
tcx.sess.span_err(span, &object_lifetime_default_reprs);
438+
}
439+
}
440+
413441
/// Checks if a `#[track_caller]` is applied to a non-naked function. Returns `true` if valid.
414442
fn check_track_caller(
415443
&self,

‎compiler/rustc_resolve/src/late/lifetimes.rs

+80-374
Large diffs are not rendered by default.

‎compiler/rustc_typeck/src/astconv/mod.rs

+12-7
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
222222
tcx.mk_region(ty::ReLateBound(debruijn, br))
223223
}
224224

225-
Some(rl::Region::EarlyBound(index, id)) => {
226-
let name = lifetime_name(id.expect_local());
227-
tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion { def_id: id, index, name }))
225+
Some(rl::Region::EarlyBound(def_id)) => {
226+
let name = tcx.hir().ty_param_name(def_id.expect_local());
227+
let item_def_id = tcx.hir().ty_param_owner(def_id.expect_local());
228+
let generics = tcx.generics_of(item_def_id);
229+
let index = generics.param_def_id_to_index[&def_id];
230+
tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion { def_id, index, name }))
228231
}
229232

230233
Some(rl::Region::Free(scope, id)) => {
@@ -253,9 +256,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
253256
})
254257
}
255258
};
256-
257259
debug!("ast_region_to_region(lifetime={:?}) yields {:?}", lifetime, r);
258-
259260
r
260261
}
261262

@@ -2853,10 +2854,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28532854
);
28542855

28552856
if !infer_replacements.is_empty() {
2856-
diag.multipart_suggestion(&format!(
2857+
diag.multipart_suggestion(
2858+
&format!(
28572859
"try replacing `_` with the type{} in the corresponding trait method signature",
28582860
rustc_errors::pluralize!(infer_replacements.len()),
2859-
), infer_replacements, Applicability::MachineApplicable);
2861+
),
2862+
infer_replacements,
2863+
Applicability::MachineApplicable,
2864+
);
28602865
}
28612866

28622867
diag.emit();

‎compiler/rustc_typeck/src/collect.rs

+3-20
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,6 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
16171617
pure_wrt_drop: false,
16181618
kind: ty::GenericParamDefKind::Type {
16191619
has_default: false,
1620-
object_lifetime_default: rl::Set1::Empty,
16211620
synthetic: false,
16221621
},
16231622
});
@@ -1661,8 +1660,6 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
16611660
kind: ty::GenericParamDefKind::Lifetime,
16621661
}));
16631662

1664-
let object_lifetime_defaults = tcx.object_lifetime_defaults(hir_id.owner);
1665-
16661663
// Now create the real type and const parameters.
16671664
let type_start = own_start - has_self as u32 + params.len() as u32;
16681665
let mut i = 0;
@@ -1687,13 +1684,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
16871684
}
16881685
}
16891686

1690-
let kind = ty::GenericParamDefKind::Type {
1691-
has_default: default.is_some(),
1692-
object_lifetime_default: object_lifetime_defaults
1693-
.as_ref()
1694-
.map_or(rl::Set1::Empty, |o| o[i]),
1695-
synthetic,
1696-
};
1687+
let kind = ty::GenericParamDefKind::Type { has_default: default.is_some(), synthetic };
16971688

16981689
let param_def = ty::GenericParamDef {
16991690
index: type_start + i as u32,
@@ -1745,11 +1736,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
17451736
name: Symbol::intern(arg),
17461737
def_id,
17471738
pure_wrt_drop: false,
1748-
kind: ty::GenericParamDefKind::Type {
1749-
has_default: false,
1750-
object_lifetime_default: rl::Set1::Empty,
1751-
synthetic: false,
1752-
},
1739+
kind: ty::GenericParamDefKind::Type { has_default: false, synthetic: false },
17531740
}));
17541741
}
17551742

@@ -1762,11 +1749,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
17621749
name: Symbol::intern("<const_ty>"),
17631750
def_id,
17641751
pure_wrt_drop: false,
1765-
kind: ty::GenericParamDefKind::Type {
1766-
has_default: false,
1767-
object_lifetime_default: rl::Set1::Empty,
1768-
synthetic: false,
1769-
},
1752+
kind: ty::GenericParamDefKind::Type { has_default: false, synthetic: false },
17701753
});
17711754
}
17721755
}

‎src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn clean_poly_trait_ref_with_bindings<'tcx>(
192192
fn clean_lifetime<'tcx>(lifetime: hir::Lifetime, cx: &mut DocContext<'tcx>) -> Lifetime {
193193
let def = cx.tcx.named_region(lifetime.hir_id);
194194
if let Some(
195-
rl::Region::EarlyBound(_, node_id)
195+
rl::Region::EarlyBound(node_id)
196196
| rl::Region::LateBound(_, _, node_id)
197197
| rl::Region::Free(_, node_id),
198198
) = def

‎src/test/incremental/hashes/enum_defs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
504504
}
505505

506506
#[cfg(not(any(cfail1,cfail4)))]
507-
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
507+
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
508508
#[rustc_clean(cfg="cfail3")]
509-
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
509+
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
510510
#[rustc_clean(cfg="cfail6")]
511511
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
512512
Variant1(T),
@@ -559,9 +559,9 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
559559
}
560560

561561
#[cfg(not(any(cfail1,cfail4)))]
562-
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
562+
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
563563
#[rustc_clean(cfg="cfail3")]
564-
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
564+
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
565565
#[rustc_clean(cfg="cfail6")]
566566
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
567567
Variant1(T),

‎src/test/incremental/hashes/trait_defs.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1066,9 +1066,9 @@ trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
10661066
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
10671067

10681068
#[cfg(not(any(cfail1,cfail4)))]
1069-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1069+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
10701070
#[rustc_clean(cfg="cfail3")]
1071-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1071+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
10721072
#[rustc_clean(cfg="cfail6")]
10731073
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
10741074

@@ -1144,9 +1144,9 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + Refer
11441144
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
11451145

11461146
#[cfg(not(any(cfail1,cfail4)))]
1147-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1147+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
11481148
#[rustc_clean(cfg="cfail3")]
1149-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1149+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
11501150
#[rustc_clean(cfg="cfail6")]
11511151
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
11521152

@@ -1201,9 +1201,9 @@ trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0
12011201
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
12021202

12031203
#[cfg(not(any(cfail1,cfail4)))]
1204-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1204+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
12051205
#[rustc_clean(cfg="cfail3")]
1206-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1206+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
12071207
#[rustc_clean(cfg="cfail6")]
12081208
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
12091209

@@ -1254,9 +1254,9 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
12541254
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
12551255

12561256
#[cfg(not(any(cfail1,cfail4)))]
1257-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1257+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
12581258
#[rustc_clean(cfg="cfail3")]
1259-
#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1259+
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
12601260
#[rustc_clean(cfg="cfail6")]
12611261
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
12621262

0 commit comments

Comments
 (0)
Please sign in to comment.