1. 17 5月, 2018 3 次提交
  2. 16 5月, 2018 21 次提交
    • K
      Rollup merge of #50669 - QuietMisdreavus:deprecated-attrs, r=GuillaumeGomez · 5074a7e1
      kennytm 提交于
      rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`
      
      Closes https://github.com/rust-lang/rust/issues/48164
      
      Blocked on https://github.com/rust-lang/rust/pull/50541 - this includes those changes, which were necessary to create the UI test
      
      cc https://github.com/rust-lang/rust/issues/44136
      
      Turns out, there were special attributes to mess with rustdoc passes and plugins! Who knew! Since we deprecated the CLI flags for this functionality, it makes sense that we do the same for the attributes.
      
      This PR also introduces a `#![doc(document_private_items)]` attribute, to match the `--document-private-items` flag introduced in https://github.com/rust-lang/rust/pull/44138 when the passes/plugins flags were deprecated.
      
      I haven't done a search to see whether these attributes are being used at all, but if the flags were any indication, i don't expect to see any users of these.
      5074a7e1
    • K
      Rollup merge of #50656 - leodasvacas:fix-impl-trait-in-main-ret, r=nikomatsakis · 5cc6fd35
      kennytm 提交于
      Fix `fn main() -> impl Trait` for non-`Termination` trait
      
      Fixes #50595.
      
      This bug currently affects stable. Why I think we can go for hard error:
      - It will in stable for at most one cycle and there is no legitimate reason to abuse it, nor any known uses in the wild.
      - It only affects `bin` crates (which have a `main`), so there is little practical difference between a hard error or a deny lint, both are a one line fix.
      
      The fix was to just unshadow a variable. Thanks @nikomatsakis for the mentoring!
      
      r? @nikomatsakis
      5cc6fd35
    • K
      Rollup merge of #50638 - tbu-:pr_open_cloexec_once, r=nagisa · d623f45a
      kennytm 提交于
      Don't unconditionally set CLOEXEC twice on every fd we open on Linux
      
      Previously, every `open64` was accompanied by a `ioctl(…, FIOCLEX)`,
      because some old Linux version would ignore the `O_CLOEXEC` flag we pass
      to the `open64` function.
      
      Now, we check whether the `CLOEXEC` flag is set on the first file we
      open – if it is, we won't do extra syscalls for every opened file. If it
      is not set, we fall back to the old behavior of unconditionally calling
      `ioctl(…, FIOCLEX)` on newly opened files.
      
      On old Linuxes, this amounts to one extra syscall per process, namely
      the `fcntl(…, F_GETFD)` call to check the `CLOEXEC` flag.
      
      On new Linuxes, this reduces the number of syscalls per opened file by
      one, except for the first file, where it does the same number of
      syscalls as before (`fcntl(…, F_GETFD)` to check the flag instead of
      `ioctl(…, FIOCLEX)` to set it).
      d623f45a
    • B
      Auto merge of #50473 - petrochenkov:pmapi, r=alexcrichton · 2a3f5367
      bors 提交于
      Review proc macro API 1.2
      
      cc https://github.com/rust-lang/rust/issues/38356
      
      Summary of applied changes:
      - Documentation for proc macro API 1.2 is expanded.
      - Renamed APIs: `Term` -> `Ident`, `TokenTree::Term` -> `TokenTree::Ident`, `Op` -> `Punct`, `TokenTree::Op` -> `TokenTree::Punct`, `Op::op` -> `Punct::as_char`.
      - Removed APIs: `Ident::as_str`, use `Display` impl for `Ident` instead.
      - New APIs (not stabilized in 1.2): `Ident::new_raw` for creating a raw identifier (I'm not sure `new_x` it's a very idiomatic name though).
      - Runtime changes:
          - `Punct::new` now ensures that the input `char` is a valid punctuation character in Rust.
          - `Ident::new` ensures that the input `str` is a valid identifier in Rust.
          - Lifetimes in proc macros are now represented as two joint tokens - `Punct('\'', Spacing::Joint)` and `Ident("lifetime_name_without_quote")` similarly to multi-character operators.
      - Stabilized APIs: None yet.
      
      A bit of motivation for renaming (although it was already stated in the review comments):
      - With my compiler frontend glasses on `Ident` is the single most appropriate name for this thing, *especially* if we are doing input validation on construction. `TokenTree::Ident` effectively wraps `token::Ident` or `ast::Ident + is_raw`, its meaning is "identifier" and it's already named `ident` in declarative macros.
      - Regarding `Punct`, the motivation is that `Op` is actively misleading. The thing doesn't mean an operator, it's neither a subset of operators (there is non-operator punctuation in the language), nor superset (operators can be multicharacter while this thing is always a single character). So I named it `Punct` (first proposed in [the original RFC](https://github.com/rust-lang/rfcs/pull/1566), then [by @SimonSapin](https://github.com/rust-lang/rust/issues/38356#issuecomment-276676526)) , together with input validation it's now a subset of ASCII punctuation character category (`u8::is_ascii_punctuation`).
      2a3f5367
    • B
      Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakis · 448cc578
      bors 提交于
      Implement RFC 2056 trivial constraints in where clauses
      
      This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet.
      
      Some things that are worth noting and are maybe not want we want
      
      * `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow.
      * ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~
      
      r? @nikomatsakis
      448cc578
    • B
      Auto merge of #50795 - nrc:update, r=oli-obk · 3ec2058b
      bors 提交于
      Update RLS and Rustfmt
      
      Fixes RLS tests
      
      r? @alexcrichton
      3ec2058b
    • B
      Auto merge of #50750 - est31:master, r=eddyb · 75a00490
      bors 提交于
       Remove ScopeTarget and LoopIdResult
      
      * Remove ScopeTarget in preparation of label-break-value (PR #50045)
      * Replace LoopIdResult by Result which is possible now thanks to commit 8ac65af8 " Implement Encodable and Decodable for Result."
      
      r? @EddyB
      75a00490
    • N
      Update RLS and Rustfmt · 80bfca4a
      Nick Cameron 提交于
      80bfca4a
    • S
      7eefe2b4
    • B
      Auto merge of #50541 - QuietMisdreavus:rustdoc-errors, r=GuillaumeGomez · 3c31e17d
      bors 提交于
      rustdoc: replace most (e)println! statements with structured warnings/errors
      
      Turns out, the rustc diagnostic handler doesn't need a whole lot of setup that we weren't already doing. For errors that occur outside a "dealing with source code" context, we can just use the format/color config we were already parsing and make up a `Handler` that we can emit structured warnings/errors from. So i did that. This will make it way easier to test things with `rustdoc-ui` tests, since those require the JSON error output. (In fact, this PR is a yak shave for a different one where i was trying to do just that. `>_>`)
      3c31e17d
    • B
      Auto merge of #48523 - varkor:generics-ty-generalisations, r=nikomatsakis · e44fc6c5
      bors 提交于
      The Great Generics Generalisation: Ty Edition
      
      Part of the generic parameter refactoring effort, split off from https://github.com/rust-lang/rust/pull/48149. Contains the `ty`-relative refactoring.
      
      r? @EddyB
      e44fc6c5
    • V
      Fix stability annotations for already stable bits of proc macro API 1.1 · dab8c0ab
      Vadim Petrochenkov 提交于
      Remove unnecessary proc-macro-related `feature`s
      dab8c0ab
    • V
      c1061254
    • M
      Make is_global true for latebound regions · be2900c3
      Matthew Jasper 提交于
      be2900c3
    • V
    • V
      780616ed
    • V
      proc_macro: Properly support raw identifiers · f116ab6e
      Vadim Petrochenkov 提交于
      f116ab6e
    • V
      TokenTree: Op -> Punct, Term -> Ident · 47d4089e
      Vadim Petrochenkov 提交于
      47d4089e
    • V
      Extend documentation and add review comments · decc619a
      Vadim Petrochenkov 提交于
      decc619a
    • B
      Auto merge of #50767 - oli-obk:rls_clippy, r=kennytm · f0fdaba0
      bors 提交于
      Don't inject clippy into the rls anymore
      
      r? @kennytm
      
      sorry about breaking nightlies.
      
      The issue is that the `[patch.crates-io]` doesn't work if the versions differ. So every time we update clippy, we can only update it to the verison that rls is depending on.
      
      I'm disabling the injection of clippy into rls for now. I'm not sure how to do this properly. We could
      
      * add a version check, so rls only builds clippy if its dependency clippy is the same as the submodule clippy
      * do something crazy like auto-patching the Cargo.toml of the rls tool repo to just use a path dependency on clippy
      * build crates-io clippy instead of submodule clippy and gate clippy injection on that
          * that's somewhat automatic, and is essentially what is necessary right now, but done manually
      * make clippy 0.1.* instead of 0.0.* and update patch versions for nightly updates and minor version updates for `clippy_lints` api changes.
          * not sure how semver-great this is
      f0fdaba0
    • L
      Rename ret_ty to declared_ret_ty · 0582d025
      leonardo.yvens 提交于
      0582d025
  3. 15 5月, 2018 16 次提交