Commit Graph

41805 Commits

Author SHA1 Message Date
bors
9266d599f4 Auto merge of #24021 - pnkfelix:fn-params-outlive-body, r=nikomatsakis
Encode more precise scoping rules for function params

Function params outlive everything in the body (incl temporaries).  Thus if we assign them their own `CodeExtent`, the region inference can properly show that it is sound to have temporaries with destructors that reference the parameters (because such temporaries will be dropped before the parameters are dropped).

Fix #23338
2015-04-08 12:57:58 +00:00
John Gallagher
1a44b3875d Add Homogenous Aggregates for AArch64 codegen
Closes #24154
2015-04-08 08:53:48 -04:00
Felix S. Klock II
86c5faf42b Address review nit by making map_id take an FnMut. 2015-04-08 13:55:01 +02:00
bors
926f38e588 Auto merge of #23998 - nrc:impl-self, r=nikomatsakis
Closes #23909

r? @nikomatsakis (or anyone else, really)
2015-04-08 09:58:05 +00:00
bors
3a66c7f626 Auto merge of #24120 - aturon:range-perf, r=alexcrichton
A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
Closes #24119
cc #24014 

r? @alexcrichton
2015-04-08 07:02:06 +00:00
Seo Sanghyeon
e2ff1881b2 Address review comments 2015-04-08 15:02:12 +09:00
Richo Healey
a329a61b9b alloc: impl fmt::Pointer for Rc, Arc and Box
Closes #24091
2015-04-07 22:50:36 -07:00
bors
ce97c197c2 Auto merge of #24078 - whipsch:extra-token-msg, r=huonw
Addresses issue #22425.  See `src/test/compile-fail/macro-incomplete-parse.rs` for a relevant test:

    macro-incomplete-parse.rs:15:9: 15:10 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:15         , //~ ERROR macro expansion ignores token `,`
                                         ^
    macro-incomplete-parse.rs:27:1: 27:17 note: caused by the macro expansion here; the usage of `ignored_item` is likely invalid in this context
    macro-incomplete-parse.rs:27 ignored_item!();
                                 ^~~~~~~~~~~~~~~~
    macro-incomplete-parse.rs:20:14: 20:15 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:20     () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
                                              ^
    macro-incomplete-parse.rs:30:5: 30:21 note: caused by the macro expansion here; the usage of `ignored_expr` is likely invalid in this context
    macro-incomplete-parse.rs:30     ignored_expr!();
                                     ^~~~~~~~~~~~~~~~
    macro-incomplete-parse.rs:24:14: 24:15 error: macro expansion ignores token `,` and any following
    macro-incomplete-parse.rs:24     () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
                                              ^
    macro-incomplete-parse.rs:32:9: 32:23 note: caused by the macro expansion here; the usage of `ignored_pat` is likely invalid in this context
    macro-incomplete-parse.rs:32         ignored_pat!() => (),
                                         ^~~~~~~~~~~~~~

This does not address the case of improper expansion inside of an impl { } as seen in issue #21607.


I'm not sure if the note text is ideal, but it can be refined if needed.
2015-04-08 04:10:12 +00:00
York Xiang
c9454b1a02 Update "let is used to introduce variables" paragraph 2015-04-08 10:29:11 +08:00
Steve Klabnik
0027253f18 Import real content. 2015-04-07 22:16:02 -04:00
Alex Crichton
262527601e rustdoc: Add a test for should_fail in doctests
Closes #23744
2015-04-07 17:54:35 -07:00
Alex Crichton
77d164d809 rustdoc: Index inherent methods on primitives
The set of types which can have an inherent impl changed slightly and rustdoc
just needed to catch up to understand what it means to see a `impl str`!

Closes #23511
2015-04-07 17:54:35 -07:00
Alex Crichton
1b568ba0fd std: Hide facade extension traits in docs
These traits are currently all just unstable parts of the facade which are
implementation details for primitives further up the facade. This may make it
more difficult to find what set of methods you get if only linking to libcore,
but for now that's also unstable behavior.

Closes #22025
2015-04-07 17:54:35 -07:00
Alex Crichton
f651bea822 std: Reorganize thread::local a bit
Make the structure more amenable to what rustdoc is expecting to ensure that
everything renders all nice and pretty in the output.

Closes #23705
Closes #23910
2015-04-07 17:54:35 -07:00
Alex Crichton
61d0365aac rustdoc: Handle duplicate reexports listed
This ends up causing duplicate output in rustdoc. The source of these duplicates
is that the item is defined in both resolve namespaces, so it's listed twice.

Closes #23207
2015-04-07 17:54:35 -07:00
Alex Crichton
dbaa242418 rustdoc: Handle tests with bare # marks
Strip them from output like other `# `-starting lines.

Closes #23106
2015-04-07 17:54:34 -07:00
Alex Crichton
11b1ff1900 book: Fix a hyperlink to CONFIGS.md
Right now rustdoc replaces the string ".md)" with ".html)" to fix links between
markdown files, so use a different syntax that doesn't get caught in the
crossfire.

Closes #22900
2015-04-07 17:54:34 -07:00
Alex Crichton
ed276caeec mk: Stop documenating non-facade crates
This commit ceases documentation-by-default of crates such as `term`,
`serialize`, and `alloc`. Crates like `term` and `rand` have duplicates on
`crates.io` and the search index entries generated in the local tree end up
only leading to confusion. Crates like the entire compiler infrastructure,
`flate`, or `rbml` don't need to be documented in such a prominent location.

This change also means that doc tests will no longer be run for crates beyond
the facade (e.g. `serialize` or `term`), but there were very few doc tests in
there to begin with.

Closes #22168
2015-04-07 17:54:34 -07:00
Alex Crichton
2b9076ee19 rustdoc: Encode ABI in all methods
This commit ensures that the ABI of functions is propagated all the way through
to the documentation.

Closes #22038
2015-04-07 17:54:34 -07:00
Alex Crichton
6950f68870 rustdoc: Simplify predicates with paren notation
This change is aimed at improving cross-crate (inlined) notation of generic
closures. The change modifies `simplify::where_predicates` to handle
parenthesized notation as well as starting to handle supertrait bounds as well.
This was necessary because all output constraints of closures are bound to
`FnOnce` but most trait bounds are that of `FnMut`.

Close #21801
2015-04-07 17:54:34 -07:00
Alex Crichton
d7fcee8347 rustdoc: Detect provided methods on inlined traits
Closes #23864
2015-04-07 17:54:34 -07:00
Alex Crichton
947f1b66cb book: Emit links to play.rust-lang.org to run examples
Had to fix a bug in `--markdown-playground-url` for markdown files in rustdoc as
well as adding some necessary JS to the rustbook output as well.

Closes #21553
2015-04-07 17:54:34 -07:00
Alex Crichton
0f3183f42b rustdoc: Don't duplicate inlined impl blocks
Closes #21474
2015-04-07 17:54:34 -07:00
Alex Crichton
ec412c2a94 rustdoc: Add a test for #21092
Close #21092
2015-04-07 17:54:34 -07:00
Alex Crichton
75ef0832ae rustdoc: Improve handling inlined associated types
* All bounds are now discovered through the trait to be inlined.
* The `?Sized` bound now renders correctly for inlined associated types.
* All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a
  hyperlink to the trait `B`. This should improve at least how the docs look at
  least.
* Supertrait bounds are now separated and display as the source lists them.

Closes #20727
Closes #21145
2015-04-07 17:54:34 -07:00
Alex Crichton
11f26f9995 rustdoc: Simplify cross-crate where clauses
Add a custom module to rustdoc which simplifies the output of `middle::ty` into
a more readable form which tends to be written down anyway!

Closes #20646
2015-04-07 17:54:34 -07:00
Alex Crichton
8874fd4962 rustdoc: Show impls for references to types
It's somewhat common to impl traits for `&T` and `&mut T` so show these on the
pages for `T` to ensure they're listed somewhere at least.

Closes #20175
2015-04-07 17:54:34 -07:00
Alex Crichton
8f6855c8c8 rustdoc: Render methods/impls for bare traits
This renders a "Methods" and "Trait Implementations" section for each item
implemented for a bare trait itself.

Closes #19055
2015-04-07 17:54:34 -07:00
Alex Crichton
ba402312fe std: Deny most warnings in doctests
Allow a few specific ones but otherwise this helps ensure that our examples are
squeaky clean!

Closes #18199
2015-04-07 17:54:34 -07:00
Alex Crichton
179719d450 rustdoc: Allowing specifying attrs for doctests
This adds support in rustdoc to blanket apply crate attributes to all doc tests
for a crate at once. The syntax for doing this is:

    #![doc(test(attr(...)))]

Each meta item in `...` will be applied to each doctest as a crate attribute.

cc #18199
2015-04-07 17:54:34 -07:00
Alex Crichton
641bca06c8 rustdoc: Link "Trait Implementations" to sources
All methods listed in "Trait Implementations" now hyperlink to the source trait
instead of themselves, allowing easy browsing of the documentation of a trait
method.

Closes #17476
2015-04-07 17:54:34 -07:00
Alex Crichton
fcc89ea500 rustdoc: Only hide possibly private modules
If an empty public module has no documentation, it shouldn't emit a page that's
just a redirect loop to itself!

Closes #16265
2015-04-07 17:54:34 -07:00
Alex Crichton
c47bb7cd50 rustdoc: Add a test for fixed issue #16019
Closes #16019
2015-04-07 17:54:34 -07:00
Alex Crichton
a30f28edad rustdoc: Add a test for fixed issue #15347
Closes #15347
2015-04-07 17:54:34 -07:00
Alex Crichton
9ad133b4a1 rustdoc: Add a primitive page for raw pointers
Closes #15318
2015-04-07 17:54:33 -07:00
Alex Crichton
c9c7be78db mk: Pass the same flags to rustdoc as rustc
This ensures that def ids don't drift too much over time.

Closes #15309
2015-04-07 17:54:33 -07:00
Alex Crichton
29299d56c9 rustdoc: Add a test for #15169 2015-04-07 17:54:33 -07:00
Alex Crichton
458102eefa rustdoc: Run external traits through filters
This ensures that all external traits are run through the same filters that the
rest of the AST goes through, stripping hidden function as necessary.

Closes #13698
2015-04-07 17:54:33 -07:00
Alex Crichton
d3647fe815 test: Move all run-make rustdoc tests to test/rustdoc 2015-04-07 17:54:33 -07:00
Alex Crichton
10359de405 compiletest: Add support for running rustdoc tests
Add a new test directory called 'rustdoc' where all files inside are documented
and run against the `htmldocck` script to have assertions about the output.
2015-04-07 17:54:33 -07:00
bors
dd6c4a8f15 Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichton
Previously it could not be implemented for types outside `libcore/iter.rs` due
to coherence issues.
2015-04-08 00:42:10 +00:00
Dave Huseby
5c3aa01045 disabling a test that is failing on bitrig. 2015-04-07 17:07:20 -07:00
Steve Klabnik
f354c8a580 New TOC 2015-04-07 19:44:49 -04:00
Aaron Turon
dddcbcfeac Fix range performance regression
A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
cc #24014
2015-04-07 16:20:55 -07:00
Tobias Bucher
97f24a8596 Make sum and product inherent methods on Iterator
In addition to being nicer, this also allows you to use `sum` and `product` for
iterators yielding custom types aside from the standard integers.

Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this
is a breaking change.

[breaking-change]
2015-04-08 00:26:35 +02:00
Ralph Giles
9a51c63a2f rustup: let RUSTUP_PREFIX env override default prefix.
The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib

Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.
2015-04-07 14:05:02 -07:00
Hajime Morrita
334422184e Fix a typo 2015-04-07 13:19:17 -07:00
bors
d9146bf8ba Auto merge of #24169 - Manishearth:rollup, r=Manishearth
- Successful merges: #24132, #24139, #24147, #24148, #24150, #24166
- Failed merges:
2015-04-07 19:49:59 +00:00
Manish Goregaokar
4e067f5273 Rollup merge of #24166 - lgvz:email, r=steveklabnik 2015-04-08 01:19:38 +05:30
Manish Goregaokar
c4bd1c2bb2 Rollup merge of #24150 - wg:master, r=alexcrichton
This fix allows the gdb debuginfo tests to pass on FreeBSD when using the newer 7.8 package.
2015-04-08 01:19:38 +05:30