1. 21 2月, 2018 9 次提交
    • G
      Rollup merge of #48354 - m0ppers:add-read-until-link, r=aidanhs · d6e649a6
      Guillaume Gomez 提交于
      Add missing link for read_line
      
      Seems I found a missing link 🔗
      
      https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#errors-2
      d6e649a6
    • G
      Rollup merge of #48352 - JakubAdamWieczorek:mailmap, r=petrochenkov · 37463272
      Guillaume Gomez 提交于
      Update .mailmap with my real name
      
      Good morning, the Rust team!
      
      Once upon a time I was a modest-scale contributor. Sadly, various turbulences made me step away from my participation in the project. It's great to see how far it's gone.
      
      I would appreciate it if you accepted this small change to the .mailmap file so that it shows my real name as back then I was using an alias. If doubts arise if I am the same person, I will be happy to provide further evidence. :)
      
      Kind regards.
      37463272
    • G
      Rollup merge of #48335 - Manishearth:shortcut-links, r=QuietMisdreavus · fe1293f8
      Guillaume Gomez 提交于
      Implement implied shortcut links for intra-rustdoc-links
      
      cc https://github.com/rust-lang/rust/issues/43466
      
      Needs https://github.com/google/pulldown-cmark/pull/126
      
      r? @QuietMisdreavus
      fe1293f8
    • G
      Rollup merge of #48325 - frewsxcv:frewxcv-ignore, r=steveklabnik · 27c6ff5c
      Guillaume Gomez 提交于
      Mark doc examples w/ `extern` blocks as `ignore`.
      
      Fixes https://github.com/rust-lang/rust/issues/48218.
      27c6ff5c
    • G
      Rollup merge of #48314 - frewsxcv:frewsxcv-broken-link, r=GuillaumeGomez · cb618ea1
      Guillaume Gomez 提交于
      Fix broken documentation link.
      
      None
      cb618ea1
    • G
      Rollup merge of #48198 - csmoe:inform_type_annotations, r=estebank · ad83b478
      Guillaume Gomez 提交于
      inform user where to give a type annotation
      
      should resolve #47777
      previous pull request https://github.com/rust-lang/rust/pull/47982 was closed because of a mistaken rebase.
      r? @estebank
      ad83b478
    • G
      Rollup merge of #48106 - QuietMisdreavus:teleporting-crates, r=GuillaumeGomez · f0343cbd
      Guillaume Gomez 提交于
      rustdoc: move manual "extern crate" statements outside automatic "fn main"s in doctests
      
      Gated on https://github.com/rust-lang/rust/pull/48095 - I based the branch atop that so i could show off the change in one of its tests, the actual change in this PR is just the last commit
      
      There are a handful of unfortunate assumptions in the way rustdoc processes `extern crate` statements in doctests:
      
      1. In the absence of an `extern crate` statement in the test, if the test also uses the local crate name, it will automatically insert an `extern crate cratename;` statement into the test.
      2. If the doctest *does* include an `extern crate` statement, rustdoc will not automatically insert one, on the assumption that doing so would introduce a duplicate import.
      3. If a doctest does not have the substring `fn main` outside a comment, rustdoc will wrap the whole doctest in a generated `fn main` so it can be compiled.
      
      In short, whenever you write a doctest like this...
      
      ```rust
      //! extern crate my_crate;
      //! my_crate::some_cool_thing();
      ```
      
      ...rustdoc will turn it into (something like) this:
      
      ```rust
      fn main() {
      extern crate my_crate;
      my_crate::some_cool_thing();
      }
      ```
      
      This creates issues when compiled, because now `my_crate` isn't even properly in scope! This forces people who want to have multiple crates in their doctests (or an explicit `extern crate` statement) to also manually include their own `fn main`, so rustdoc doesn't put their imports in the wrong place.
      
      This PR just taps into another processing step rustdoc does to doctests: Whenever you add an `#![inner_attribute]` to the beginning of a doctest, rustdoc will actually splice those out and put it before the generated `fn main`. Now, we can just do the same with `extern crate`s at the beginning, too, and get a much nicer experience.
      
      Now, the above example will be converted into this:
      
      ```rust
      extern crate my_crate;
      fn main() {
      my_crate::some_cool_thing();
      }
      ```
      f0343cbd
    • G
      Rollup merge of #47833 - Aaron1011:final_auto_trait, r=GuillaumeGomez · aec65353
      Guillaume Gomez 提交于
      Generate documentation for auto-trait impls
      
      A new section is added to both both struct and trait doc pages.
      
      On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync.
      
      ![Auto trait implementations for Cloned](https://i.imgur.com/XtTV6IJ.png)
      
      On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library.
      
      ![Auto trait implementors for Send](https://i.imgur.com/3GRBpTy.png)
      
      Synthesized impls for a particular auto trait ('synthetic impls') take generic bounds into account. For example, a type
      ```rust
      struct Foo<T>(T)
      ```
       will have 'impl<T> Send for Foo<T> where T: Send' generated for it.
      
      Manual implementations of auto traits are also taken into account. If we have
      the following types:
      
      ```rust
      struct Foo<T>(T)
      struct Wrapper<T>(Foo<T>)
      unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow
      ```
      
      Then Wrapper will have the following impl generated:
      ```rust
      impl<T> Send for Wrapper<T>
      ```
      reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold
      
      Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls:
      
      ![A ridiculous demonstration type](https://i.imgur.com/TkZMWuN.png)
      
      However, if a type can *never* implement a particular auto trait (e.g. `struct MyStruct<T>(*const T)`), then a negative impl will be generated (in this case, `impl<T> !Send for MyStruct<T>`)
      
      All of this means that a user should be able to copy-paste a syntheticimpl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
      aec65353
    • G
      Rollup merge of #47379 - da-x:master, r=sfackler · 2a32060f
      Guillaume Gomez 提交于
      Derive std::cmp::Reverse as Copy or Clone
      
      If the type parameter is Copy or Clone, then `Reverse` should be too.
      2a32060f
  2. 20 2月, 2018 2 次提交
  3. 19 2月, 2018 17 次提交
  4. 18 2月, 2018 12 次提交