Skip to content

deps: Update syntex_syntax to 0.31.0 #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2016

Conversation

kamalmarhubi
Copy link
Contributor

Most of the churn on this bump comes from the Visibility enum changing
from

pub enum Visibility {
    Public,
    Inherited,
}

to

pub enum Visibility {
    Public,
    Crate,
    Restricted { path: P<Path>, id: NodeId },
    Inherited,
}

which require taking Visibility by reference in most places. The new
variants are not handled at this point.

Refs #970

Most of the churn on this bump comes from the `Visibility` enum changing
from

    pub enum Visibility {
        Public,
        Inherited,
    }

to

    pub enum Visibility {
        Public,
        Crate,
        Restricted { path: P<Path>, id: NodeId },
        Inherited,
    }

which require taking `Visibility` by reference in most places. The new
variants are not handled at this point.

Refs rust-lang#970
@kamalmarhubi kamalmarhubi mentioned this pull request May 2, 2016
Visibility::Public => "pub ",
Visibility::Inherited => "",
// TODO(#970): Handle new visibility types.
Visibility::Crate => unimplemented!(),
Visibility::Restricted { .. } => unimplemented!(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we handle these by returning None and then skipping the item, falling back to the missing spans? That is better than panicking, I think.

Also, (nit) if there is an issue number, prefer FIXME to TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@nrc
Copy link
Member

nrc commented May 2, 2016

All looks good, other than the comment on the panics, thanks!

@marcusklaas
Copy link
Contributor

We can land this, but we need syntex 0.32 for the try shorthand. This heroic pull request by antrik includes the required changes.

@kamalmarhubi
Copy link
Contributor Author

I'm happy to do another bump. I kind of enjoy the compiler-error chasing that goes with these bumps. Nice break from other stuff sometimes!

@kamalmarhubi
Copy link
Contributor Author

Assuming this is acceptable as an approach for handling the Visibility change, it'd be great to merge this and then see what 0.32 brings.

@nrc nrc merged commit 90c0f70 into rust-lang:master May 2, 2016
kamalmarhubi added a commit to kamalmarhubi/rustfmt that referenced this pull request May 27, 2016
This commit properly handles pub(restricted) as introduced in RFC 1422
[0]. The syntax support was added in rust-lang#971, but they were not correctly
formatted.

[0] https://github.com/rust-lang/rfcs/blob/master/text/1422-pub-restricted.md

Fixes rust-lang#970
marcusklaas pushed a commit that referenced this pull request May 27, 2016
* Handle pub(restricted)

This commit properly handles pub(restricted) as introduced in RFC 1422
[0]. The syntax support was added in #971, but they were not correctly
formatted.

[0] https://github.com/rust-lang/rfcs/blob/master/text/1422-pub-restricted.md

Fixes #970

* Drop #[inline] attribute on format_visibility

* Make newly non-failing functions return String

The change to `format_visibiilty` means that `format_header` and
`format_unit_struct` can no longer fail. Their return type is updated to
reflect that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants