Commit Graph

74786 Commits

Author SHA1 Message Date
Guillaume Gomez
af140ecdbc
Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkor
fix more typos found by codespell.
2018-02-18 13:21:01 +01:00
Guillaume Gomez
b7791b0c7e
Rollup merge of #48274 - GuillaumeGomez:remove-hoedown, r=QuietMisdreavus
Remove hoedown from rustdoc

Finally the time has come!

r? @QuietMisdreavus
2018-02-18 13:20:59 +01:00
Guillaume Gomez
715030fd01
Rollup merge of #48273 - alercah:file-warning, r=joshtriplett
Add a warning to File about mutability.

Fixes #47708.
2018-02-18 13:20:58 +01:00
Guillaume Gomez
8093b20201
Rollup merge of #48194 - GuillaumeGomez:doc-test-command, r=Mark-Simulacrum
Doc test command

r? @Mark-Simulacrum
2018-02-18 13:20:57 +01:00
bors
1ad094d81c Auto merge of #47687 - SimonSapin:panic-impl, r=sfackler
RFC 2070 part 1: PanicInfo and Location API changes

This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html
Tracking issue: https://github.com/rust-lang/rust/issues/44489

* Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`.
* Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`.
* Implement `Display` for `PanicInfo` and `Location`
2018-02-18 06:02:35 +00:00
Jeffrey Seyfried
4294528b5d Improve hygiene when privacy-checking struct expression or struct constructor fields. 2018-02-17 21:48:35 -08:00
Jeffrey Seyfried
ba8d6d18d0 Fix span bug. 2018-02-17 21:48:35 -08:00
Michael Lamparski
42df8c56cc unused_unsafe: don't label irrelevant fns 2018-02-17 22:31:14 -05:00
bors
e8f03b9438 Auto merge of #47544 - U007D:master, r=nikomatsakis
Relax termination_trait's error bound

As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr
2018-02-18 03:12:14 +00:00
csmoe
4370a5877c fix tyvar_behind_raw_pointer error code 2018-02-18 11:07:52 +08:00
Corey Farwell
472dcdb4ec Fix broken documentation link. 2018-02-17 20:57:00 -05:00
Corey Farwell
0a798bd952 Unify 'Platform-specific behavior' documentation headings. 2018-02-17 20:54:26 -05:00
QuietMisdreavus
d8d4c583be fix E0260 error index doctest 2018-02-17 16:51:39 -06:00
QuietMisdreavus
b3d6597855 move manual "extern crate" statements outside auto "fn main" in doctests 2018-02-17 16:51:39 -06:00
Guillaume Gomez
6661ebb4bd Remove useless comment 2018-02-17 23:47:45 +01:00
bors
5313e8728f Auto merge of #47408 - eddyb:deref-danger, r=nikomatsakis
Don't promote to 'static the result of dereferences.

This is a **breaking change**, removing copies out of dereferences from rvalue-to-`'static` promotion.

With miri we won't easily know whether the dereference itself would see the same value at runtime as miri (e.g. after mutating a `static`) or even if it can be interpreted (e.g. integer pointers).
One alternative to this ban is defining at least *some* of those situations as UB, i.e. you shouldn't have a reference in the first place, and you should work through raw pointers instead, to avoid promotion.

**EDIT**: The other *may seem* to be to add some analysis which whitelists references-to-constant-values and assume any values produced by arbitrary computation to not be safe to promote dereferences thereof - but that means producing a reference from an associated constant or `const fn` would necessarily obscure it, and in the former case, this could still impact code that runs on stable today. What we do today to track "references to statics" only works because we restrict taking a reference to a `static` at all to other `static`s (which, again, are currently limited in that they can't be read at compile-time) and to runtime-only `fn`s (*not* `const fn`s).

I'm primarily opening this PR with a conservative first approximation (e.g. `&(*r).a` is not allowed, only reborrows are, and in the old borrow only implicit ones from adjustments, at that) for cratering.

r? @nikomatsakis
2018-02-17 19:32:25 +00:00
Mark Mansi
6ad328ca77 Move macro-at-most-once-rep-ambig test to ui test 2018-02-17 11:42:11 -06:00
Guillaume Gomez
c5be497888 Fix unstable book 2018-02-17 18:27:46 +01:00
Vitali Lovich
d549db8031 Fix tidy violation 2018-02-17 09:17:58 -08:00
Matthias Krüger
4452446292 fix more typos found by codespell. 2018-02-17 17:38:49 +01:00
Guillaume Gomez
8e46927235 Add command to launch only doc tests 2018-02-17 16:58:14 +01:00
Guillaume Gomez
de8b429420 Update to last repository version 2018-02-17 16:31:07 +01:00
Seiichi Uchida
8e9fa57055 Revert unintentional submodule updates 2018-02-18 00:21:33 +09:00
Seiichi Uchida
291c51b9c8 Fix up tests and typos 2018-02-18 00:10:40 +09:00
Seiichi Uchida
b5099a708d Replace dummy spans with empty spans 2018-02-18 00:10:40 +09:00
Seiichi Uchida
d6bdf296a4 Change ast::Visibility to Spanned type 2018-02-18 00:10:40 +09:00
Seiichi Uchida
0bddba9248 Add a span field to Visibility::Restricted
This span covers the whole visibility expression: e.g. `pub (in path)`.
2018-02-18 00:10:40 +09:00
Seiichi Uchida
01a70c6589 Add a closing parenthesis to the span of Visibility::Crate 2018-02-18 00:10:40 +09:00
bors
f6216b2d55 Auto merge of #48294 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 8 pull requests

- Successful merges: #48095, #48152, #48234, #48239, #48243, #48260, #48284, #48286
- Failed merges:
2018-02-17 14:31:32 +00:00
moe
2cf683edc0
Merge branch 'master' into inform_type_annotations 2018-02-17 22:22:26 +08:00
csmoe
0be2dc8d9b fix stderr 2018-02-17 14:18:53 +00:00
Alexis Hunt
ec905975b8 Wording fixes from review for File. 2018-02-17 08:47:03 -05:00
Guillaume Gomez
47db61a3c3
Rollup merge of #48286 - SergioBenitez:master, r=BurntSushi
Clarify contiguity of Vec's elements.

Small doc changes for clarity.
2018-02-17 14:45:28 +01:00
Guillaume Gomez
c4f0011353
Rollup merge of #48284 - crawford:string, r=sfackler
Remove unneeded string allocations
2018-02-17 14:45:27 +01:00
Guillaume Gomez
7dd8c090e4
Rollup merge of #48260 - dns2utf8:add_link_to_yield, r=kennytm
[doc] Add link to yield_now

A convenient link.
2018-02-17 14:45:26 +01:00
Guillaume Gomez
01c7f3a345
Rollup merge of #48243 - rust-lang:steveklabnik-patch-1, r=kennytm
spelling fix in comment

r? @Manishearth
2018-02-17 14:45:24 +01:00
Guillaume Gomez
3672caf662
Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus
Fix condvar example

Fixes #48230.

r? @QuietMisdreavus
2018-02-17 14:45:23 +01:00
Guillaume Gomez
62d6ba4638
Rollup merge of #48234 - zombiezen:patch-1, r=steveklabnik
Remove "empty buffer" doc in read_until

This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.
2018-02-17 14:45:22 +01:00
Guillaume Gomez
6db06f593b
Rollup merge of #48152 - antoyo:primitive-docs-relevant, r=QuietMisdreavus
Primitive docs relevant

This fixes the documentation to show the right types in the examples for many integer methods.

I need to check if the result is correct before we merge.
2018-02-17 14:45:21 +01:00
Guillaume Gomez
8aa2852399
Rollup merge of #48095 - QuietMisdreavus:doctest-assembly, r=GuillaumeGomez
add unit tests for rustdoc's processing of doctests

cc #42018

There's a lot of things that rustdoc will do to massage doctests into something that can be compiled, and a lot of options that can be toggled to affect this. Hopefully this list of tests can show off that functionality.

The first commit is slightly unrelated but doesn't touch public functionality, because i found that if you have a manual `fn main`, it adds an extra line break at the end, whereas it would trim this extra line break if it were putting a `fn main` in automatically. That first commit makes it trim out that whitespace ahead of time.
2018-02-17 14:45:20 +01:00
bors
b298607864 Auto merge of #47956 - retep998:is-nibbles, r=BurntSushi
This is the ideal FileType on Windows. You may not like it, but this is what peak performance looks like.

Theoretically this would fix https://github.com/rust-lang/rust/issues/46484

The current iteration of this PR should not cause existing code to break, but instead merely improves handling around reparse points. Specifically...

* Reparse points are considered to be symbolic links if they have the name surrogate bit set. Name surrogates are reparse points that effectively act like symbolic links, redirecting you to a different directory/file. By checking for this bit instead of specific tags, we become much more general in our handling of reparse points, including those added by third parties.
* If something is a reparse point but does not have the name surrogate bit set, then we ignore the fact that it is a reparse point because it is actually a file or directory directly there, despite having additional handling by drivers due to the reparse point.
* For everything which is not a symbolic link (including non-surrogate reparse points) we report whether it is a directory or a file based on the presence of the directory attribute bit.
* Notably this still preserves invariant that when `is_symlink` returns `true`, both `is_dir` and `is_file` will return `false`. The potential for breakage was far too high.
* Adds an unstable `FileTypeExt` to allow users to determine whether a symbolic link is a directory or a file, since `FileType` by design is incapable of reporting this information.
2018-02-17 11:32:16 +00:00
bors
b85bd51c94 Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
add transform for uniform array move out

reworked second step for fix #34708
previous try #46686
r? @nikomatsakis
2018-02-17 08:44:41 +00:00
bors
507a46a4aa Auto merge of #47917 - davidtwco:issue-47703, r=nikomatsakis
Fixes NLL: error from URL crate

Fixes #47703.

r? @nikomatsakis
2018-02-17 05:53:55 +00:00
Vitali Lovich
b1f04a3a2e Fix unit test compilation
Also fix some code snippets in documentation.
2018-02-16 20:00:18 -08:00
bors
554fe71ac6 Auto merge of #47906 - Zoxc:nocycle, r=nikomatsakis
Add a `fatal_cycle` attribute for queries which indicates that they will cause a fatal error on query cycles

This moves us towards the goal of having cycle errors be non-fatal by not relying on the default implementation of `ty::maps::values::Value` which aborts on errors.

r? @nikomatsakis
2018-02-17 02:58:21 +00:00
Sergio Benitez
22aecb9c6e Clarify contiguity of Vec's elements. 2018-02-16 17:08:08 -08:00
Alex Crawford
c670ae67b6 Remove unneeded string allocations 2018-02-16 15:23:28 -08:00
Guillaume Gomez
5bd5bc3f21 Remove hoedown from rustdoc
Is it really time? Have our months, no, *years* of suffering come to an end? Are we finally able to cast off the pall of Hoedown? The weight which has dragged us down for so long?

-----

So, timeline for those who need to catch up:

* Way back in December 2016, [we decided we wanted to switch out the markdown renderer](https://github.com/rust-lang/rust/issues/38400). However, this was put on hold because the build system at the time made it difficult to pull in dependencies from crates.io.
* A few months later, in March 2017, [the first PR was done, to switch out the renderers entirely](https://github.com/rust-lang/rust/pull/40338). The PR itself was fraught with CI and build system issues, but eventually landed.
* However, not all was well in the Rustdoc world. During the PR and shortly after, we noticed [some differences in the way the two parsers handled some things](https://github.com/rust-lang/rust/issues/40912), and some of these differences were major enough to break the docs for some crates.
* A couple weeks afterward, [Hoedown was put back in](https://github.com/rust-lang/rust/pull/41290), at this point just to catch tests that Pulldown was "spuriously" running. This would at least provide some warning about spurious tests, rather than just breaking spontaneously.
* However, the problems had created enough noise by this point that just a few days after that, [Hoedown was switched back to the default](https://github.com/rust-lang/rust/pull/41431) while we came up with a solution for properly warning about the differences.
* That solution came a few weeks later, [as a series of warnings when the HTML emitted by the two parsers was semantically different](https://github.com/rust-lang/rust/pull/41991). But that came at a cost, as now rustdoc needed proc-macro support (the new crate needed some custom derives farther down its dependency tree), and the build system was not equipped to handle it at the time. It was worked on for three months as the issue stumped more and more people.
  * In that time, [bootstrap was completely reworked](https://github.com/rust-lang/rust/pull/43059) to change how it ordered compilation, and [the method by which it built rustdoc would change](https://github.com/rust-lang/rust/pull/43482), as well. This allowed it to only be built after stage1, when proc-macros would be available, allowing the "rendering differences" PR to finally land.
  * The warnings were not perfect, and revealed a few [spurious](https://github.com/rust-lang/rust/pull/44368) [differences](https://github.com/rust-lang/rust/pull/45421) between how we handled the renderers.
  * Once these were handled, [we flipped the switch to turn on the "rendering difference" warnings all the time](https://github.com/rust-lang/rust/pull/45324), in October 2017. This began the "warning cycle" for this change, and landed in stable in 1.23, on 2018-01-04.
  * Once those warnings hit stable, and after a couple weeks of seeing whether we would get any more reports than what we got from sitting on nightly/beta, [we switched the renderers](https://github.com/rust-lang/rust/pull/47398), making Pulldown the default but still offering the option to use Hoedown.

And that brings us to the present. We haven't received more new issues from this in the meantime, and the "switch by default" is now on beta. Our reasoning is that, at this point, anyone who would have been affected by this has run into it already.
2018-02-16 23:17:15 +01:00
Mazdak Farrokhzad
6e27aa88a7 core::iter::repeat_with: fix spelling, s/not/note 2018-02-16 22:14:32 +01:00
Jonathan A. Kollasch
ebec5e3906 Add powerpc-unknown-netbsd target 2018-02-16 14:29:24 -06:00