Skip to content

Commit 5314b36

Browse files
committed
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
2 parents e0d0aac + e2939c3 commit 5314b36

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/spanned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl Spanned for ast::GenericArg {
180180
impl Spanned for ast::GenericBound {
181181
fn span(&self) -> Span {
182182
match *self {
183-
ast::GenericBound::Trait(ref ptr, _) => ptr.span,
183+
ast::GenericBound::Trait(ref ptr) => ptr.span,
184184
ast::GenericBound::Outlives(ref l) => l.ident.span,
185185
ast::GenericBound::Use(_, span) => span,
186186
}

src/types.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,16 +610,14 @@ impl Rewrite for ast::GenericBound {
610610

611611
fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
612612
match *self {
613-
ast::GenericBound::Trait(
614-
ref poly_trait_ref,
615-
ast::TraitBoundModifiers {
613+
ast::GenericBound::Trait(ref poly_trait_ref) => {
614+
let snippet = context.snippet(self.span());
615+
let has_paren = snippet.starts_with('(') && snippet.ends_with(')');
616+
let ast::TraitBoundModifiers {
616617
constness,
617618
asyncness,
618619
polarity,
619-
},
620-
) => {
621-
let snippet = context.snippet(self.span());
622-
let has_paren = snippet.starts_with('(') && snippet.ends_with(')');
620+
} = poly_trait_ref.modifiers;
623621
let mut constness = constness.as_str().to_string();
624622
if !constness.is_empty() {
625623
constness.push(' ');

0 commit comments

Comments
 (0)