Skip to content
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

Rollup of 5 pull requests #65964

Closed
wants to merge 15 commits into from
Closed

Commits on Oct 26, 2019

  1. Update comments re type parameter hack in object safety

    To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue rust-lang#43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.
    mikeyhew committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    fb4095d View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2019

  1. Configuration menu
    Copy the full SHA
    58b67c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2019

  1. Configuration menu
    Copy the full SHA
    08ca236 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2019

  1. Configuration menu
    Copy the full SHA
    1a8677a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    39c5b07 View commit details
    Browse the repository at this point in the history
  3. cleanup can_begin_const_arg

    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    9ffdc3b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cf75e6e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4c8544b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d6c9391 View commit details
    Browse the repository at this point in the history
  7. syntax: use distinct FloatTy from rustc_target.

    We also sever syntax's dependency on rustc_target as a result.
    This should slightly improve pipe-lining.
    
    Moreover, some cleanup is done in related code.
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    0d15968 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#65112 - jack-t:type-parens-lint, r=varkor

    Add lint and tests for unnecessary parens around types
    
    This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.
    
    The PR fixes rust-lang#64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.
    
    I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.
    
    There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    5272df0 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#65850 - mikeyhew:patch-1, r=nikomatsakis

    Update comments re type parameter hack in object safety
    
    To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue rust-lang#43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.
    
    cc @Centril @nikomatsakis @bovinebuddha
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    edd869d View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#65884 - Centril:non-hardcoded-abis, r=petro…

    …chenkov
    
    syntax: ABI-oblivious grammar
    
    This PR has the following effects:
    
    1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal.
    
    2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate.
    
    3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place.
    
    4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat.
    
    cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :)
    
    r? @varkor
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    d79fb1f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#65914 - estebank:type-alias-bounds-sugg, r=…

    …davidtwco
    
    Use structured suggestion for unnecessary bounds in type aliases
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    07c6ee6 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#65959 - vext01:immediate-docstring, r=david…

    …twco
    
    Fix an incorrect docstring for Immediate in librustc_mir/interpret.
    
    I suspect `Immediate` was once called `Value`?
    Centril committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    1aa1a9c View commit details
    Browse the repository at this point in the history