1. 19 3月, 2019 14 次提交
    • M
      Rollup merge of #59275 - regexident:docs-self, r=joshtriplett · 1ec1c5da
      Mazdak Farrokhzad 提交于
      Replaced self-reflective explicit types with clearer `Self` or `Self::…` in stdlib docs
      
      Many docs examples use explicit types instead of the semantically more clear `Self`/`Self::…` aliases.
      
      By using the latter it's clear that the value's type depends on either `Self`, or an associated type of `Self`, instead of some constant type. It's also more consistent (and I'd argue correct), as the current docs aren't really consistent in this, as can be seen from the diff.
      
      This is a best effort PR, as I was basically going through the docs manually, looking for offending examples. I'm sure I missed a few. Gotta start somewhere.
      1ec1c5da
    • M
      Rollup merge of #59252 - lcnr:mailmap, r=Centril · 05e8051d
      Mazdak Farrokhzad 提交于
      add self to mailmap
      05e8051d
    • M
      Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkov · 8ebe2acb
      Mazdak Farrokhzad 提交于
      Be more discerning on when to attempt suggesting a comma in a macro invocation
      
      Fix #58796.
      8ebe2acb
    • M
      Rollup merge of #58939 - taeguk:fix-doc-about-pin, r=rkruppe · 61ff8879
      Mazdak Farrokhzad 提交于
      Fix a tiny error in documentation of std::pin.
      
      `new_unmoved` must be `mut` for passing to `std::mem::swap`.
      61ff8879
    • M
      Rollup merge of #58812 - jonhoo:floor_v_trunc, r=alexcrichton · 5abd9c7d
      Mazdak Farrokhzad 提交于
      Clarify distinction between floor() and trunc()
      
      `floor()` rounds towards `-INF`, `trunc()` rounds towards 0.
      This PR clarifies this in the examples.
      5abd9c7d
    • M
      Rollup merge of #58778 - xfix:exact_size_case_mapping_iter, r=SimonSapin · fff85861
      Mazdak Farrokhzad 提交于
      Implement ExactSizeIterator for ToLowercase and ToUppercase
      fff85861
    • M
      Rollup merge of #57847 - clarcharr:dbg_no_params, r=Centril · d4ef74b2
      Mazdak Farrokhzad 提交于
      dbg!() without parameters
      
      Fixes #57845.
      d4ef74b2
    • M
      Rollup merge of #57729 -... · c1975dbd
      Mazdak Farrokhzad 提交于
      Rollup merge of #57729 - pnkfelix:issue-55748-pat-types-are-constraints-on-bindings-too, r=nikomatsakis
      
      extra testing of how NLL handles wildcard type `_`
      
      test that wildcard type `_` is not duplicated by `type Foo<X> = (X, X);` and potentially instantiated at different types when used in type ascriptions in let bindings.
      
      (NLL's handling of this for the type ascription *expression form* is currently broken, or at least differs from what AST-borrowck does. I'll file a separate bug about that. Its not something critical to address since that expression is guarded by `#![feature(type_ascription)]`.)
      
      cc #55748
      c1975dbd
    • M
      Rollup merge of #56348 - matklad:todo-macro, r=withoutboats · d4dd8604
      Mazdak Farrokhzad 提交于
      Add todo!() macro
      
      The primary use-case of `todo!()` macro is to be a much easier to type
      alternative to `unimplemented!()` macro.
      
      EDIT: hide unpopular proposal about re-purposing unimplemented
      
      <details>
      However, instead of just replacing `unimplemented!()`, it gives it a
      more nuanced meaning: a thing which is intentionally left
      unimplemented and which should not be called at runtime. Usually,
      you'd like to prevent such cases statically, but sometimes you, for
      example, have to implement a trait only some methods of which are
      applicable. There are examples in the wild of code doing this thing,
      and in this case, the current message of `unimplemented`, "not *yet*
      implemented" is slightly misleading.
      
      With the addition of TODO, you have three nuanced choices for a
      `!`-returning macro (in addition to a good-old panic we all love):
      
        * todo!()
        * unreachable!()
        * unimplemented!()
      
      Here's a rough guideline what each one means:
      
      - `todo`: use it during development, as a "hole" or placeholder. It
        might be a good idea to add a pre-commit hook which checks that
        `todo` is not accidentally committed.
      
      - `unreachable!()`: use it when your code can statically guarantee
        that some situation can not happen. If you use a library and hit
        `unreachable!()` in the library's code, it's definitely a bug in the
        library. It's OK to have `unreachable!()` in the code base,
        although, if possible, it's better to replace it with
        compiler-verified exhaustive checks.
      
      - `unimplemented!()`: use it when the type checker forces you to
        handle some situation, but there's a contract that a callee must not
        actually call the code. If you use a library and hit
        `unimplemented!()`, it's probably a bug in your code, though
        it *could* be a bug in the library (or library docs) as well. It is
        ok-ish to see an `unimplemented!()` in real code, but it usually
        signifies a clunky, eyebrow-rising API.
      </details>
      d4dd8604
    • K
      Update since annotation for ExactSizeIterator for ToUppercase/Lowercase · 8f261a6a
      Konrad Borowski 提交于
      This functionality was added in 1.35.0, not 1.34.0.
      8f261a6a
    • B
      Auto merge of #59279 - mati865:clippy, r=Xanewok · ef4d1c41
      bors 提交于
      Update clippy
      
      Fixes https://github.com/rust-lang/rust/issues/59218
      
      cc @Xanewok
      ef4d1c41
    • B
      Auto merge of #56462 - Zoxc:query-macro, r=oli-obk · 3bf064be
      bors 提交于
      Define queries using a proc macro
      
      cc @rust-lang/compiler
      3bf064be
    • M
      Update Clippy, RLS and Rustfmt · 986f88b8
      Mateusz Mikuła 提交于
      986f88b8
    • A
      Add todo!() macro · 9d408d97
      Aleksey Kladov 提交于
      The use-case of `todo!()` macro is to be a much easier to type
      alternative to `unimplemented!()` macro.
      9d408d97
  2. 18 3月, 2019 13 次提交
  3. 17 3月, 2019 13 次提交