Commit Graph

51350 Commits

Author SHA1 Message Date
Jeffrey Seyfried
210109cf7b Include the crate root in the ribs 2016-03-08 23:28:34 +00:00
Jeffrey Seyfried
7f3491c39d Fix name resolution in lexical scopes 2016-03-08 23:28:33 +00:00
Nathan Kleyn
118b975c80 Add missing documentation examples for BinaryHeap.
As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.
2016-03-08 23:27:24 +00:00
Nathan Kleyn
99eee832e0 Add missing documentation examples for BTreeSet.
As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeSet` collection
type.

This is part of issue #29348.
2016-03-08 22:53:54 +00:00
Nathan Kleyn
a8df890437 Add missing documentation examples for BTreeMap.
As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeMap` collection
type.

This is part of issue #29348.
2016-03-08 22:44:40 +00:00
Jeffrey Seyfried
e2171bff75 Add regression test 2016-03-08 21:58:48 +00:00
Jeffrey Seyfried
ad28c28f46 Stop treating a type alias like a module or enum (preventing use TypeAlias::*) 2016-03-08 21:50:20 +00:00
Alex Crichton
3e6fed3a7a rustbuild: Add the error-index-generator
This adds a step and a rule for building the error index as part of rustbuild.
2016-03-08 13:44:14 -08:00
Alex Crichton
e9cb96a56a rustdoc: Don't inline all impls all at once
Right now whenever rustdoc inlines a struct or enum from another crate it ends
up inlining *all* `impl` items found in the other crate at the same time. The
rationale for this was to discover all trait impls which are otherwise not
probed for. This unfortunately picks up a lot of impls of public traits for
private types, causing lots of broken links.

This commit instead hoards all of those inlined impls into a temporary storage
location which is then selectively drawn from whenever we inline a new type.
This should ensure that we still inline all relevant impls while avoiding all
private ones.
2016-03-08 13:44:14 -08:00
Alex Crichton
8aa268e731 std: Fix rustdoc links with std::fmt::Alignment
This is actually a reexported implementation detail in the `rt::v1` module but
rustdoc doesn't like reexporting items from `doc(hidden)` modules. Do what we'd
end up doing anyway from an API perspective and make a public-facing `enum` that
can be retranslated under the hood if necessary.
2016-03-08 13:44:14 -08:00
Alex Crichton
73db76015e doc: Fix a bunch of broken links
A few categories:

* Links into compiler docs were just all removed as we're not generating
  compiler docs.
* Move up one more level to forcibly go to std docs to fix inlined documentation
  across the facade crates.
2016-03-08 13:44:14 -08:00
Alex Crichton
16fefc5ead rustbuild: Fix stage1 rustdoc
Just always build stage1 rustdoc, it's really not that much more to build as
it's essentially just one library.
2016-03-08 13:44:14 -08:00
Alex Crichton
defd1b3392 rustbuild: Add a link checker for documentation
Add a script to get run which verifies that `href` links in documents are
correct. We're always getting a steady stream of "fix a broken link" PRs and
issue reports, and we should probably just nip them all in the bud.
2016-03-08 13:44:14 -08:00
arcnmx
dbe23899cc cover more linux targets in libstd cargobuild 2016-03-08 16:15:58 -05:00
Alex Crichton
f7b7535fd7 rustbuild: Fixup calling rustdoc in various stages
The stage0 rustdoc comes from the snapshot, and we need a shim like with `rustc`
to pass `--cfg` for now.
2016-03-08 11:52:11 -08:00
Alex Crichton
0788cd23ea rustbuild: Use an enum to indicate destination
Instead of using a `is_std: bool`, instead use a more well-typed and
self-documenting enum to indicate the mode in which Cargo is being invoked.
2016-03-08 11:52:10 -08:00
Alex Crichton
ee6df13f0c rustbuild: Move rustbook to a src/tools directory
We've actually got quite a few tools that are compiled as part of our build,
let's start housing them all in a `tools` directory.
2016-03-08 11:52:09 -08:00
Alex Crichton
4d3d29dff3 rustbuild: Refactor adding steps manually
Use a macro so it automatically picks up new steps.
2016-03-08 11:51:49 -08:00
Alex Crichton
6a541937dc rustbuild: Add crate documentation generation
Run `cargo doc` to generate all documentation for the standard library, and also
add a target which generates documentation for the compiler as well (but don't
enable it by default).
2016-03-08 11:51:47 -08:00
Steve Klabnik
33fe4d10fc Rollup merge of #32115 - tclfs:patch-1, r=apasel422
Update a spelling inconsistency

L26: "zero cost" -> "zero-cost"
2016-03-08 21:44:12 +03:00
Steve Klabnik
bf9610ddbb Rollup merge of #32103 - timmontague:patch-1, r=alexcrichton
Fixed link in ownership documentation

Changed "[vector]" to a link to the vector documentation.
2016-03-08 21:44:11 +03:00
Steve Klabnik
13ba07b854 Rollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichton
Clarify documentation for string slicing (Index impls)

Clarify documentation for string slicing (Index impls)

- Mention the sugared syntax for the implementations, since it's not
  apparent from the docs that `Index<Range<usize>>` corresponds to
  `&self[a..b]`.
- Be specific in that start <= end and end <= len

This is just one fix in response to #32057
2016-03-08 21:44:11 +03:00
Steve Klabnik
e35e5c434b Rollup merge of #32092 - bluss:operator-overload, r=steveklabnik
Update syntax index with OpAssign traits

book: Update syntax index with OpAssign traits

The traits are stable from Rust 1.8.
2016-03-08 21:44:11 +03:00
Steve Klabnik
477c4c37f0 Rollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichton
Fix typos - mismatching parentheses in comments

Fixes mismatching parentheses in the comments of precision example.

r? @steveklabnik
2016-03-08 21:44:11 +03:00
Steve Klabnik
86fb351059 Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis
reference.md: clarify the limitation of type alias on an enum

Tentatively define the current behavior as the specification.

Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936
2016-03-08 21:44:11 +03:00
Steve Klabnik
be506b256f Rollup merge of #31772 - nodakai:patch-1, r=steveklabnik
Clarify the semantics of enum discriminants

cf. https://doc.rust-lang.org/error-index.html#E0082

> The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration.

It would be great if anyone could check my English.
2016-03-08 21:44:10 +03:00
Pyfisch
d7e406eab8 Remove final note from testing chapter.
The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.
2016-03-08 19:33:27 +01:00
bors
eabfc160f8 Auto merge of #32009 - alexcrichton:trim-fulldeps, r=brson
mk: Distribute fewer TARGET_CRATES

Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.
2016-03-08 07:34:28 -08:00
ggomez
fd4e7a0e1a Add help for E0514 2016-03-08 14:57:23 +01:00
bors
8f0479b2a5 Auto merge of #31995 - alexcrichton:fix-make-clena-empty, r=brson
rustbuild: Fix building from an empty directory

A stray shutil.rmtree happened when it shouldn't have happened, causing the
entire build to fail.
2016-03-08 05:34:37 -08:00
bors
81e0323610 Auto merge of #31957 - GuillaumeGomez:error_display, r=brson
Add error file for E0152

It completes #31818.

However it is not complete yet:
 * test will need to be updated
 * the file name displayed is a bit too unclear.

I'm not sure yet what's the "correct" file name to display. If anyone has an idea on this, it'd be very appreciated.

r? @brson
2016-03-08 03:31:30 -08:00
bors
3af60f831f Auto merge of #31954 - japaric:rfc243, r=nikomatsakis
implement the `?` operator

The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining:
`File::open("foo")?.metadata()?.is_dir()`.

`?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`,
`(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`.

cc #31436

---

cc @aturon @eddyb
2016-03-08 01:31:04 -08:00
mitaa
f1cf2a6fcb rustdoc: correct src-link url 2016-03-08 08:07:57 +01:00
bors
a9ffe67f98 Auto merge of #31606 - Ms2ger:ClosureKind, r=eddyb
Rename ClosureKind variants and stop re-exporting them.
2016-03-07 22:57:38 -08:00
Alex Crichton
063e68b0b6 rustbuild: Add make check and a check target
We'll tack on more steps here later
2016-03-07 22:50:55 -08:00
Tang Chenglong
dc829e2b93 Update a spelling inconsistency
L26: "zero cost" -> "zero-cost"
2016-03-08 13:42:05 +08:00
bors
8b7c3f20e8 Auto merge of #29734 - Ryman:whitespace_consistency, r=Aatch
libsyntax: be more accepting of whitespace in lexer

Fixes #29590.

Perhaps this may need more thorough testing?

r? @Aatch
2016-03-07 20:06:17 -08:00
Jorge Aparicio
2de4932453 update error messages in parse-fail tests 2016-03-07 21:17:31 -05:00
bors
4352a8554f Auto merge of #31986 - ashleysommer:emscripten_fixes, r=alexcrichton
Fix building libstd on emscripten targets.

The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined.
This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets.

This commit also depends needs f1575cff2d applied in order to successfully build libstd with emscripten target.
2016-03-08 01:04:36 +00:00
NODA, Kai
790178f6e5
reference.md: clarify the limitation of type alias on an enum
Cf. rust-lang/rust#26264

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-08 08:46:49 +08:00
Steven Allen
c516335815 Add test case for #32085 2016-03-07 18:00:22 -05:00
Jeffrey Seyfried
4dc4cae79a Add a comment 2016-03-07 22:43:56 +00:00
Steven Allen
6ea8222913 Never return an error after a partial write
If LineWriter fails to flush, return the number of bytes written instead
of an error.

Fixes #32085
2016-03-07 16:35:37 -05:00
Simonas Kazlauskas
e30ff06756 Change MirPass to also take NodeId 2016-03-07 23:21:39 +02:00
Alex Crichton
0d5cfd9117 mk: Distribute fewer TARGET_CRATES
Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.
2016-03-07 13:05:12 -08:00
Ulrik Sverdrup
55671a0290 Clarify documentation for string slicing (Index impls)
- Mention the sugared syntax for the implementations, since it's not
  apparent from the docs that `Index<Range<usize>>` corresponds to
  `&self[a..b]`.
- Be specific in that start <= end and end <= len
2016-03-07 21:05:06 +01:00
Jorge Aparicio
210dd611aa implement the ? operator
The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining:
`File::open("foo")?.metadata()?.is_dir()`.

`?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`,
`(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`.

cc #31436
2016-03-07 14:39:39 -05:00
Alex Crichton
ec58f40463 std: Add impl of FnOnce to AssertRecoverSafe
This was originally intended, but forgot to land by accident!

cc #27719
2016-03-07 11:02:43 -08:00
Tim Montague
150b1c9217 Fixed link
Changed "[vector]" to a link to the vector documentation.
2016-03-07 10:30:25 -08:00
bors
388ccda455 Auto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422 2016-03-07 15:45:11 +00:00