Commit Graph

51172 Commits

Author SHA1 Message Date
Eduard Burtescu
eb926dd4b7 typeck: Unify if-else blocks, match arms and array elements by coercing where possible. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
d2c6bef493 typeck: Remove the redundant "unifier" from check_expr_with_unifier. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
ad91f19957 typeck: Support multiple expressions getting coerced at the same type. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
3ff4c347c7 typeck: don't wastefully clone expressions for cast checks. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
dbab236a9e typeck: Remove Coerce::unpack_actual_value. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
dc37664c94 infer: Take the origin in report_mismatched_types. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
871a1e1cf8 typeck: rename mk_assignty to coercion::try. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
2b1bd80f34 infer: Remove redundant commit_if_ok calls. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
1b7fb17745 Test that function types are actually zero-sized. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
61a77b38e2 tests: Avoid transmuting from fn item types. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
644d6390be typeck: Use TyFnDef for methods. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
847f00738b typeck: Introduce reification for fn ptr casts. 2016-03-09 16:45:29 +02:00
Eduard Burtescu
8f07f8a4fa trans: Reify functions & methods to fn ptrs only where necessary. 2016-03-09 16:45:28 +02:00
Eduard Burtescu
c284099f56 trans: Remove unused ref_id from monomorphic_fn. 2016-03-09 16:45:28 +02:00
Eduard Burtescu
0c01f6e149 trans: Move type_of_fn_from_ty callers to type_of. 2016-03-09 16:45:28 +02:00
Eduard Burtescu
e4e1242769 Print fn type parameters for TyFnDef. 2016-03-09 16:45:28 +02:00
Eduard Burtescu
ffa0860467 Track fn type and lifetime parameters in TyFnDef. 2016-03-09 16:45:28 +02:00
Eli Friedman
b423a0f9ef Split TyBareFn into TyFnDef and TyFnPtr.
There's a lot of stuff wrong with the representation of these types:
TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to
represent method calls, TyFnDef in the sub-expression of a cast isn't
correctly reified, and probably some other stuff I haven't discovered yet.
Splitting them seems like the right first step, though.
2016-03-09 16:45:28 +02:00
bors
cbbd3d9b92 Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrc
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-09 05:25:48 -08:00
bors
4b868411af Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc
Show clearer error message when #![deny(warnings)] escalates a warning

Addresses #30730
2016-03-09 03:34:55 -08:00
bors
bb868f17fa Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis
Make errors for unnecessary visibility qualifiers consistent

This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919).

r? @nikomatsakis
2016-03-09 01:45:33 -08:00
Steve Klabnik
78484696fc Remove inaccurate claim about inline assembly
It's not like GCC's.

Fixes #20213
2016-03-09 03:52:35 -05:00
Steve Klabnik
aaca3175ba Add other primitive types to the reference
Fixes #31628
2016-03-09 03:42:36 -05:00
Steve Klabnik
0f426aa916 Small grammar fix in Guessing Game
When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912
2016-03-09 03:37:19 -05:00
Steve Klabnik
df550de689 Clarify that try_unwrap needs exactly one
Fixes #31950
2016-03-09 03:33:51 -05:00
bors
e1704f76ef Auto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakis
tests: add test for empty <>

Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it:

```
user@UNIT-326 [12:53:45] [~/projects/rust] [diamonds-and-rust]
-> % grep "<>" -R src/test
src/test/compile-fail/generic-type-params-name-repr.rs:    // And don't print <> at all when there's just defaults.
src/test/debuginfo/issue22656.rs:// when trying to handle a Vec<> or anything else that contains zero-sized
```

So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)
2016-03-08 23:34:34 -08:00
Dirk Gadsden
46dc35e477 Link to actual CSPRNG in hash::SipHasher documentation 2016-03-08 21:52:44 -08:00
bors
d289e1a145 Auto merge of #31981 - achanda:unspecified-ip, r=alexcrichton
Exclude 0.0.0.0 from the list of globally routable addresses
2016-03-08 21:13:29 -08:00
Alex Crichton
6afa32a250 std: Don't always create stdin for children
For example if `Command::output` or `Command::status` is used then stdin is just
immediately closed. Add an option for this so as an optimization we can avoid
creating pipes entirely.

This should help reduce the number of active file descriptors when spawning
processes on Unix and the number of active handles on Windows.
2016-03-08 17:45:44 -08:00
Alex Crichton
d46c99abe8 std: Funnel read_to_end through to one location
This pushes the implementation detail of proxying `read_to_end` through to
`read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle`
implementations on Unix/Windows. This way intermediate layers will also be able
to take advantage of this optimized implementation.

This commit also adds the optimized implementation for `ChildStdout` and
`ChildStderr`.
2016-03-08 17:45:44 -08:00
bors
567937d626 Auto merge of #32126 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #31772, #32083, #32084, #32092, #32099, #32103, #32115
- Failed merges:
2016-03-08 16:13:19 -08: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
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
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