Commit Graph

51023 Commits

Author SHA1 Message Date
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
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
bors 388ccda455 Auto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422 2016-03-07 15:45:11 +00:00
bors 2f34986eb0 Auto merge of #32078 - japaric:rustbuild-i686-musl, r=alexcrichton
- make sure we copy the third party objects (crt*.o) to the target stage directory.
- apply the x86_64-musl logic also to the i686-musl target.

---

r? @alexcrichton
2016-03-07 13:46:11 +00:00
bors e079afa00b Auto merge of #31664 - nodakai:reference-negation, r=steveklabnik
It would be great if someone could check my English.
2016-03-07 09:55:36 +00:00
bors 79f914fdb9 Auto merge of #32051 - steveklabnik:gh9447, r=bluss
Fixes #9447
2016-03-07 06:54:36 +00:00
bors 6d262db448 Auto merge of #32066 - ruud-v-a:fma, r=alexcrichton
This adds support for fused multiply-add and multiply-subtract vector intrinsics for 128 and 256-bit vectors of `f32` and `f64`. These correspond to the intrinsics [listed here](https://software.intel.com/en-us/node/523929) except for the `_ss` and `_sd` variants. The intrinsics added are:

 * `fmadd`
 * `fmaddsub`
 * `fmsub`
 * `fmsubadd`
 * `fnmadd`
 * `fnmsub`

The “fma” target feature must be enabled by passing `-C target-feature=+fma` to rustc when using these, otherwise LLVM will complain.

I verified locally that the `x86_mm256_fmadd_ps` and `x86_mm256_fmsub_ps` work.
2016-03-07 04:25:27 +00:00
bors 6eb81a1f3b Auto merge of #32064 - bluss:str-slice-panic, r=alexcrichton
Fix panic on string slicing error to truncate the string

The string may be arbitrarily long, but we want to limit the panic
message to a reasonable length. Truncate the string if it is too long
(simply to char boundary).

Also add details to the start <= end message. I think it's ok to flesh
out the code here, since it's in a cold function.

Fixes #32063
2016-03-07 02:28:09 +00:00
bors 998a6720b6 Auto merge of #32061 - infinity0:master, r=alexcrichton
Adding -Wno-error is more reliable and simple than trying to modify existing
flags. We've been using this in Debian already for the past few releases.
Making this change also encourages future maintainers towards "best practises".
Also take the opportunity to use the same method at all places in the file.
2016-03-07 00:30:09 +00:00
bors 3340cb3df9 Auto merge of #32060 - inrustwetrust:patch-1, r=alexcrichton
Using spaces in the install path causes the issue in #31293.
2016-03-06 22:32:35 +00:00
NODA, Kai 559683cded
reference.md: clarify negation.
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-07 04:42:14 +08:00
Jorge Aparicio f164433a11 update the src/liblibc submodule 2016-03-06 15:34:20 -05:00
bors 979aaafc51 Auto merge of #32056 - nikomatsakis:rustfmt-data-structures, r=alexcrichton 2016-03-06 19:06:56 +00:00
bors 72d588a620 Auto merge of #32055 - mitaa:rdoc-strip-priv-imports, r=alexcrichton
fixes #27104

r? @alexcrichton
2016-03-06 17:08:36 +00:00
Craig M. Brandenburg b517256941 Spelling fix for "because" 2016-03-06 08:37:30 -07:00
bors 71f4658c14 Auto merge of #32048 - bluss:overloaded-assign-op, r=eddyb
Do not trigger unused_assignments for overloaded AssignOps

If `v` were a type with some kind of indirection, so that `v += 1` would
have an effect even if `v` were not used anymore, the unused_assignments lint
would mark a false positive.

This exempts overloaded (non-primitive) assign ops from being treated as
assignments (they are method calls).

The previous compile-fail tests that ensure x += 1 can trigger for
primitive types continue to pass. Added a representative test for the
"view" indirection.

Fixes #31895
2016-03-06 15:10:44 +00:00
Jorge Aparicio 0b7fc0653b rustbuild: fix cross compilation of libstd to i686-unknown-linux-musl
- make sure we copy the third party objects (crt*.o) to the target stage directory.
- apply the x86_64-musl logic also to the i686-musl target.
2016-03-06 08:19:51 -05:00
bors 80922a7ad8 Auto merge of #32041 - arielb1:multiply-inexhaustive, r=eddyb
the assert was invalidated by PR #31020

Fixes #31561

r? @eddyb
2016-03-06 13:13:14 +00:00
bors c116ae35cf Auto merge of #32020 - alexcrichton:stabilize-into-ascii, r=brson
These were intended to land in stable 1.8 but were just waiting for the
implementation PR, so now they're landing. Specifically this PR stabilizes:

* `AsciiExt::into_ascii_uppercase`
* `AsciiExt::into_ascii_lowercase`
* `AsciiExt for Vec<u8>`
* `AsciiExt for String`
2016-03-06 11:16:15 +00:00
bors 21fb3ce71b Auto merge of #31967 - mitaa:rdoc-refactor, r=alexcrichton
This is mostly cleanup of individual code bits and code reuse for `clean::Attribute` handling.

The only change in behaviour should be that emitted sources are now being recorded and queried when trying to create src-links to local source-files.

r? @alexcrichton
2016-03-06 09:16:32 +00:00
mitaa 688e52201e Split out rustdoc pass to strip private imports 2016-03-06 08:18:58 +01:00
bors 8484831d29 Auto merge of #30884 - durka:inclusive-ranges, r=aturon
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges.

This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals.

- For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion.
- I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate.
- There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging.

cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq)
cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254
relevant to #28237 (tracking issue)
2016-03-06 07:16:41 +00:00
bors 45f0ce71c1 Auto merge of #31920 - jseyfried:fix_spurious_privacy_error, r=nikomatsakis
This PR allows using methods from traits that are visible but are defined in an inaccessible module (fixes #18241). For example,
```rust
mod foo {
    pub use foo::bar::Tr;
    mod bar { // This module is inaccessible from `g`
        pub trait Tr { fn f(&self) {} }
    }
}
fn g<T: foo::Tr>(t: T) {
    t.f(); // Currently, this is a privacy error even though `foo::Tr` is visible
}
```

After this PR, it will continue to be a privacy error to use a method from a trait that is not visible. This can happen when a public trait inherits from a private trait (in violation of the `public_in_private` lint) -- see @petrochenkov's example in #28504.
r? @nikomatsakis
2016-03-06 02:29:34 +00:00
bors 52e0bda644 Auto merge of #31889 - alexcrichton:update-jemalloc-again, r=nikomatsakis
Now that 767d85061a is upstream, the relevant deadlocking issue which prompted our downgrade has been resolved. As a result, there's no known issue to *not* upgrade! This also re-enables jemalloc for the pc-windows-gnu target as known issues with that have also been fixed.

Closes #31030
2016-03-05 23:44:51 +00:00
bors 3029e0918d Auto merge of #31726 - jseyfried:improve_import_resolution, r=nikomatsakis
This PR improves the import resolution algorithm.

First, it records that an import succeeded or failed for one namespace (by calling `decrement_outstanding_references_for` and `try_define_child` if successful) even if it is still indeterminate in the other namespace, fixing #31444.

Second, it starts importing bindings from globs as soon as the glob path is determined.
It maintains links from imported modules to their importers so that when a resolution becomes successful in an imported module, a corresponding binding will be added to the importer module.
It also maintains links from importer modules to imported modules so that we can determine if an undefined name is indeterminate or failing by recursively checking this in the imported modules.
This allows, for example:
```rust
mod foo {
    pub mod baz {}
    pub use bar::baz::*;
}

mod bar {
    pub use foo::*;
}
```
It also allows cycles of pub glob imports, although by to the current shadowing rules, the only way for such a cycle to compile is if each participating module defines no names. Incidentally, this PR lays the groundwork for more permissive feature-gated shadowing rules.

Finally, this PR encapsulates almost all implementation details of import resolution in `resolve_imports` (some of which used to be in `lib.rs`) and refactors reexport recording, shadowed trait collecting, some duplicate checking, and the `private_in_public` lint out of the core import resolution algorithm and into a post-processing pass in `resolve_imports`.

r? @nrc
2016-03-05 20:11:37 +00:00
Ulrik Sverdrup 4594f0f67a Fix panic on string slicing error to truncate the string
The string may be arbitrarily long, but we want to limit the panic
message to a reasonable length. Truncate the string if it is too long
(simply to char boundary).

Also add details to the start <= end message. I think it's ok to flesh
out the code here, since it's in a cold function.
2016-03-05 18:11:52 +01:00
bors 07a1803dd3 Auto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichton
[Playground Example](https://play.rust-lang.org/?gist=66fdb4fe1cf4d8aa2ad4&version=stable)
2016-03-05 16:58:20 +00:00
Ruud van Asseldonk a409076df4 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-05 16:37:11 +01:00
Ruud van Asseldonk 0ce0cf1c87 Update platform intrinsic generator script
The file it generates had been modified, but instead the generator
should have been modified, and the file regenerated. This merges the
modifications into the template in the generator.
2016-03-05 16:35:57 +01:00
Ruud van Asseldonk 8872163b32 Define x86 fused multiply-add intrinsics
This defines the following intrinsics for 128 and 256 bit vectors of f32
and f64:

 * `fmadd`
 * `fmaddsub`
 * `fmsub`
 * `fmsubadd`
 * `fnmadd`
 * `fnmsub`

The `_sd` and `_ss` variants are not included yet.

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

The intrinsics there are listed under AVX2, but in the Intel Intrinsic
Guide they are part of the "FMA" technology, and LLVM puts them under
FMA, not AVX2.
2016-03-05 16:33:11 +01:00
Angus Lees 7fdb9fd941 More reliable and consistent method of cancelling -Werror*
Adding -Wno-error is more reliable and simple than trying to modify existing
flags. We've been using this in Debian already for the past few releases.
Making this change also encourages future maintainers towards "best practises".
Also take the opportunity to use the same method at all places in the file.
2016-03-05 14:45:25 +01:00
Niko Matsakis 2529b73087 adopt new header style to sidestep rust-lang-nursery/rustfmt#836 2016-03-05 08:40:37 -05:00
Niko Matsakis 43dc48c7ff apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
John Talling aac9454505 Add note about avoiding spaces in MinGW install path
Using spaces in the install path causes the issue in #31293.
2016-03-05 14:10:25 +01:00
Alex Burka 430b3e1960 remove under/overflow from next_back/next 2016-03-04 18:57:43 -05:00
Alex Burka a928c8360c add underflow/overflow tests 2016-03-04 18:57:22 -05:00
Alex Burka 003120aa19 add more unstable annotations 2016-03-04 18:39:25 -05:00
Steve Klabnik 096409cf8c End stdlib module summaries with a full stop.
Fixes #9447
2016-03-04 17:37:11 -05:00
Ulrik Sverdrup cfe4efd052 Do not trigger unused_variables lint for variable modified through AddAssign
Visit an overloaded += like a method call and not like an assignment.
2016-03-04 22:52:34 +01:00
bors da0ccd8cc9 Auto merge of #32046 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #32002, #32017, #32027, #32035, #32036
- Failed merges:
2016-03-04 21:01:14 +00:00
Jeffrey Seyfried b3572ae15a Finish encapsulating the details of import resolution in resolve_imports 2016-03-04 20:48:55 +00:00