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
|
@ -2113,7 +2113,7 @@ impl<'a> Parser<'a> {
|
|||
&& let Some(poly) = bounds
|
||||
.iter()
|
||||
.filter_map(|bound| match bound {
|
||||
ast::GenericBound::Trait(poly, _) => Some(poly),
|
||||
ast::GenericBound::Trait(poly) => Some(poly),
|
||||
_ => None,
|
||||
})
|
||||
.last()
|
||||
|
|
|
@ -948,8 +948,8 @@ impl<'a> Parser<'a> {
|
|||
{
|
||||
return Ok((false, seg.ident, seg.args.as_deref().cloned()));
|
||||
} else if let ast::TyKind::TraitObject(bounds, ast::TraitObjectSyntax::None) = &ty.kind
|
||||
&& let [ast::GenericBound::Trait(trait_ref, ast::TraitBoundModifiers::NONE)] =
|
||||
bounds.as_slice()
|
||||
&& let [ast::GenericBound::Trait(trait_ref)] = bounds.as_slice()
|
||||
&& trait_ref.modifiers == ast::TraitBoundModifiers::NONE
|
||||
&& let [seg] = trait_ref.trait_ref.path.segments.as_slice()
|
||||
{
|
||||
return Ok((true, seg.ident, seg.args.as_deref().cloned()));
|
||||
|
|
|
@ -420,8 +420,13 @@ impl<'a> Parser<'a> {
|
|||
lo: Span,
|
||||
parse_plus: bool,
|
||||
) -> PResult<'a, TyKind> {
|
||||
let poly_trait_ref = PolyTraitRef::new(generic_params, path, lo.to(self.prev_token.span));
|
||||
let bounds = vec![GenericBound::Trait(poly_trait_ref, TraitBoundModifiers::NONE)];
|
||||
let poly_trait_ref = PolyTraitRef::new(
|
||||
generic_params,
|
||||
path,
|
||||
TraitBoundModifiers::NONE,
|
||||
lo.to(self.prev_token.span),
|
||||
);
|
||||
let bounds = vec![GenericBound::Trait(poly_trait_ref)];
|
||||
self.parse_remaining_bounds(bounds, parse_plus)
|
||||
}
|
||||
|
||||
|
@ -1117,8 +1122,9 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
let poly_trait = PolyTraitRef::new(lifetime_defs, path, lo.to(self.prev_token.span));
|
||||
Ok(GenericBound::Trait(poly_trait, modifiers))
|
||||
let poly_trait =
|
||||
PolyTraitRef::new(lifetime_defs, path, modifiers, lo.to(self.prev_token.span));
|
||||
Ok(GenericBound::Trait(poly_trait))
|
||||
}
|
||||
|
||||
// recovers a `Fn(..)` parenthesized-style path from `fn(..)`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue