Auto merge of #131723 - matthiaskrgr:rollup-krcslig, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #122670 (Fix bug where `option_env!` would return `None` when env var is present but not valid Unicode) - #131095 (Use environment variables instead of command line arguments for merged doctests) - #131339 (Expand set_ptr_value / with_metadata_of docs) - #131652 (Move polarity into `PolyTraitRef` rather than storing it on the side) - #131675 (Update lint message for ABI not supported) - #131681 (Fix up-to-date checking for run-make tests) - #131702 (Suppress import errors for traits that couldve applied for method lookup error) - #131703 (Resolved python deprecation warning in publish_toolstate.py) - #131710 (Remove `'apostrophes'` from `rustc_parse_format`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
f79fae3069
93 changed files with 558 additions and 420 deletions
|
@ -519,7 +519,7 @@ pub enum TraitBoundModifier {
|
|||
|
||||
#[derive(Clone, Copy, Debug, HashStable_Generic)]
|
||||
pub enum GenericBound<'hir> {
|
||||
Trait(PolyTraitRef<'hir>, TraitBoundModifier),
|
||||
Trait(PolyTraitRef<'hir>),
|
||||
Outlives(&'hir Lifetime),
|
||||
Use(&'hir [PreciseCapturingArg<'hir>], Span),
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ pub enum GenericBound<'hir> {
|
|||
impl GenericBound<'_> {
|
||||
pub fn trait_ref(&self) -> Option<&TraitRef<'_>> {
|
||||
match self {
|
||||
GenericBound::Trait(data, _) => Some(&data.trait_ref),
|
||||
GenericBound::Trait(data) => Some(&data.trait_ref),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -2873,11 +2873,7 @@ pub enum TyKind<'hir> {
|
|||
OpaqueDef(&'hir OpaqueTy<'hir>, &'hir [GenericArg<'hir>]),
|
||||
/// A trait object type `Bound1 + Bound2 + Bound3`
|
||||
/// where `Bound` is a trait or a lifetime.
|
||||
TraitObject(
|
||||
&'hir [(PolyTraitRef<'hir>, TraitBoundModifier)],
|
||||
&'hir Lifetime,
|
||||
TraitObjectSyntax,
|
||||
),
|
||||
TraitObject(&'hir [PolyTraitRef<'hir>], &'hir Lifetime, TraitObjectSyntax),
|
||||
/// Unused for now.
|
||||
Typeof(&'hir AnonConst),
|
||||
/// `TyKind::Infer` means the type should be inferred instead of it having been
|
||||
|
@ -3181,6 +3177,11 @@ pub struct PolyTraitRef<'hir> {
|
|||
/// The `'a` in `for<'a> Foo<&'a T>`.
|
||||
pub bound_generic_params: &'hir [GenericParam<'hir>],
|
||||
|
||||
/// The constness and polarity of the trait ref.
|
||||
///
|
||||
/// The `async` modifier is lowered directly into a different trait for now.
|
||||
pub modifiers: TraitBoundModifier,
|
||||
|
||||
/// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`.
|
||||
pub trait_ref: TraitRef<'hir>,
|
||||
|
||||
|
|
|
@ -905,7 +905,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
|
|||
try_visit!(visitor.visit_array_length(length));
|
||||
}
|
||||
TyKind::TraitObject(bounds, ref lifetime, _syntax) => {
|
||||
for (bound, _modifier) in bounds {
|
||||
for bound in bounds {
|
||||
try_visit!(visitor.visit_poly_trait_ref(bound));
|
||||
}
|
||||
try_visit!(visitor.visit_lifetime(lifetime));
|
||||
|
@ -1160,7 +1160,7 @@ pub fn walk_param_bound<'v, V: Visitor<'v>>(
|
|||
bound: &'v GenericBound<'v>,
|
||||
) -> V::Result {
|
||||
match *bound {
|
||||
GenericBound::Trait(ref typ, _modifier) => visitor.visit_poly_trait_ref(typ),
|
||||
GenericBound::Trait(ref typ) => visitor.visit_poly_trait_ref(typ),
|
||||
GenericBound::Outlives(ref lifetime) => visitor.visit_lifetime(lifetime),
|
||||
GenericBound::Use(args, _) => {
|
||||
walk_list!(visitor, visit_precise_capturing_arg, args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue