Commit Graph

51282 Commits

Author SHA1 Message Date
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
Jeffrey Seyfried
1a6092e05c Forbid use Trait::* 2016-03-09 05:18:07 +00: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
mitaa
ae7fca1e1f Check for doc(inline) instead of .*(inline) 2016-03-09 02:05:39 +01:00
Ruud van Asseldonk
c306853eda Regenerate x86 platform intrinsics
The exact command used was:

    $ cd src/etc/platform-intrinsics/x86
    $ python2 ../generator.py --format compiler-defs -i info.json   \
      sse.json sse2.json sse3.json ssse3.json sse41.json sse42.json \
      avx.json avx2.json fma.json                                   \
      > ../../../librustc_platform_intrinsics/x86.rs
2016-03-09 01:18:46 +01:00
Ruud van Asseldonk
51b5300b3f Define AVX conversion intrinsics
This defines the following intrinsics:

 * `_mm256_cvtepi32_pd`
 * `_mm256_cvtepi32_ps`
 * `_mm256_cvtpd_epi32`
 * `_mm256_cvtpd_ps`
 * `_mm256_cvtps_epi32`
 * `_mm256_cvtps_pd`
 * `_mm256_cvttpd_epi32`
 * `_mm256_cvttps_epi32`

Intel reference: https://software.intel.com/en-us/node/514130.
2016-03-09 01:18:46 +01:00
Ruud van Asseldonk
37efeae886 Define AVX broadcast intrinsics
This defines `_mm256_broadcast_ps` and `_mm256_broadcast_pd`. The `_ss`
and `_sd` variants are not supported by LLVM. In Clang these intrinsics
are implemented as inline functions in C++.

Intel reference: https://software.intel.com/en-us/node/514144.

Note: the argument type should really be "0hPc" (a pointer to a vector
of half the width), but internally the LLVM intrinsic takes a pointer to
a signed integer, and for any other type LLVM will complain. This means
that a transmute is required to call these intrinsics.

The AVX2 broadcast intrinsics `_mm256_broadcastss_ps` and
`_mm256_broadcastsd_pd` are not available as LLVM intrinsics. In Clang
they are implemented using the shufflevector builtin.
2016-03-09 01:18:46 +01:00
Jeffrey Seyfried
e742da0c71 Add regression test 2016-03-09 00:14:20 +00: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
Jeffrey Seyfried
87708b7b1f Refactor away check_ribs 2016-03-08 23:28:34 +00:00
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