Commit Graph

27176 Commits

Author SHA1 Message Date
Laurent Bonnans
2d754b49da fs: use an iterative algorithm for 'rmdir_recursive'
For now, the windows version uses stat, just as before.
We should switch back to lstat as soon as #12795 is closed.
2014-03-10 19:27:59 +01:00
Laurent Bonnans
0fcd5d5455 fs: use an iterative algorithm for 'mkdir_recursive'
as requested in #6109
2014-03-10 19:24:28 +01:00
Piotr Czarnecki
b0e855a758 libstd: Update docs for slice_shift_char and {shift,pop}_{char,byte} 2014-03-10 13:55:02 +01:00
Piotr Czarnecki
262d1543db libstd: Add unit tests for slice_shift_char 2014-03-10 13:55:02 +01:00
Piotr Czarnecki
0349f2ae8a libstd: Change slice_shift_char, shift_char, pop_char, shift_byte and pop_byte to return an Option instead of failing 2014-03-10 13:55:02 +01:00
Dmitry Promsky
43a8f7b3e9 syntax: fixed ICEs and incorrect line nums when reporting Spans at the end of the file.
CodeMap.span_to_* perform a lookup of a BytePos(sp.hi), which lands into the next filemap if the last byte of range denoted by Span is also the last byte of the filemap, which results in ICEs or incorrect error reports.

    Example:
        ````

        pub fn main() {
            let mut num = 3;
            let refe = &mut num;
            *refe = 5;
            println!("{}", num);
        }````

(note the empty line in the beginning and the absence of newline at the end)

The above would have caused ICE when trying to report where "refe" borrow ends.
The above without an empty line in the beginning would have reported borrow end to be the first line.

Most probably, this is also responsible for (at least some occurrences of) issue #8256.

The issue is fixed by always adding a newline at the end of non-empty filemaps in case there isn't a new line there already.
2014-03-10 02:28:04 +04:00
Brian Anderson
952380904b install.sh: untabify 2014-03-09 14:56:37 -07:00
Brian Anderson
1f7de380ce install.sh: Improve error handling 2014-03-09 14:17:27 -07:00
Brian Anderson
364d4ad1e5 mk: Put all distribution artifacts in dist/
Also, add license docs to installers
2014-03-09 14:17:27 -07:00
Brian Anderson
5e66af6bcc mk: forcibly delete dest dir when PREPARE_CLEAN 2014-03-09 14:17:27 -07:00
Brian Anderson
b2eef52ce3 mk: Tweak the status messages for prepare.mk to say 'prepare', not 'install' 2014-03-09 14:17:27 -07:00
Brian Anderson
e302bbe635 mk: Use the correct permissions for man pages 2014-03-09 14:17:27 -07:00
Brian Anderson
60a2aedbbb Add /dist/ to .gitignore 2014-03-09 14:17:27 -07:00
Brian Anderson
16ec0ab542 configure: Create the dist directory 2014-03-09 14:17:26 -07:00
Brian Anderson
67ebf8abdf mk: dist-installer builds a binary installer 2014-03-09 14:17:26 -07:00
Brian Anderson
111137b5f5 mk: Optionally clean the destination when preparing install image 2014-03-09 14:17:26 -07:00
Brian Anderson
c8bc65f19f mk: Put man pages in correct directory 2014-03-09 14:17:26 -07:00
Brian Anderson
99746d43c1 Bugfixes and cleanup to configure script 2014-03-09 14:17:26 -07:00
Adrien Tétar
7979ae5367 doc: CSS fixes
- fixup and refactor highlighting code
- have a proper print stylesheet
2014-03-09 18:45:11 +01:00
Adrien Tétar
9eadcacdd7 doc: have a real switch b/w LaTeX compilers 2014-03-09 18:44:59 +01:00
Edward Wang
abfde39b0e borrowck: classify expressions as assignees, uses or both
- Repurposes `MoveData.assignee_ids` to mean only `=` but not `+=`, so
  that borrowck effectively classifies all expressions into assignees,
  uses or both.
- Removes two `span_err` in liveness analysis, which are now borrowck's
  responsibilities.

Closes #12527.
2014-03-09 23:23:28 +08:00
Guillaume Pinot
9e49a077d0 fix shootout-spectralnorm, broken since Arc cannot unwrap. 2014-03-09 14:11:28 +01:00
Adrien Tétar
862acedf51 doc: remove node.js dependency
`prep.js` outputs its own HTML directives, which `pandoc` cannot
recognize when converting the document into LaTeX (this is why the
PDF docs have never been highlighted as of now).

Note that if we were to add the `.rust` class to snippets, we could
probably use pandoc's native highlighting capatibilities i.e. Kate.
2014-03-09 13:45:36 +01:00
bors
62f1d68439 auto merge of #12747 : huonw/rust/rustdoc-markdown, r=alexcrichton
This gives Rustdoc the ability to render our guides, tutorial and manual and modifies the those documents (minor modifications) and makefiles to achieve this.

See commits for more details (especially the makefile rewrite).
2014-03-09 03:06:42 -07:00
Huon Wilson
b4815ad1ba mk: only build PDFs of the manual and tutorial.
This restores the old behaviour (as compared to building PDF versions of
all standalone docs), because some of the guides use unicode characters,
which seems to make pdftex unhappy.
2014-03-09 20:59:43 +11:00
Huon Wilson
bb8ac2159f docs: render rustdoc docs with rustdoc, hack around sundown code-fence
parsing limitations.

Sundown parses

    ```
    ~~~

as a valid codeblock (i.e. mismatching delimiters), which made using
rustdoc on its own documentation impossible (since it used nested
codeblocks to demonstrate how testable codesnippets worked).

This modifies those snippets so that they're delimited by indentation,
but this then means they're tested by `rustdoc --test` & rendered as
Rust code (because there's no way to add `notrust` to
indentation-delimited code blocks). A comment is added to stop the
compiler reading the text too closely, but this unfortunately has to be
visible in the final docs, since that's the text on which the
highlighting happens.
2014-03-09 20:59:43 +11:00
Huon Wilson
6d6e2880d2 tutorial: hack a code snippet to make it compile.
This is meant to be compiling a crate, but the crate_id attribute seems
to be upsetting it if the attribute is actually on the crate. I.e. this
makes this test compile by putting the crate_id attribute on a function
and so it's ignored. Such a hack. :(
2014-03-09 19:34:40 +11:00
Huon Wilson
3c4ff1b872 mk: rename check-...-doc-<crate> to check-...-doc-crate-<crate>.
E.g. this stops check-...-doc rules for `rustdoc.md` and `librustdoc`
from stamping on each other, so that they are correctly built and
tested. (Previously only the rustdoc crate was tested.)
2014-03-09 19:34:40 +11:00
Huon Wilson
f7833215b0 mk: rewrite the documentation handling.
This converts it to be very similar to crates.mk, with a single list of
the documentation items creating all the necessary bits and pieces.

Changes include:
- rustdoc is used to render HTML & test standalone docs
- documentation building now obeys NO_REBUILD=1
- testing standalone docs now obeys NO_REBUILD=1
- L10N is slightly less broken (in particular, it shares dependencies
  and code with the rest of the code)
- PDFs can be built for all documentation items, not just tutorial and
  manual
- removes the obsolete & unused extract-tests.py script
- adjust the CSS for standalone docs to use the rustdoc syntax
  highlighting
2014-03-09 19:34:40 +11:00
Huon Wilson
2d7d7e59f9 docs: adjust code blocks to pass with rustdoc.
The changes are basically just because rustdoc runs tests/rendering on
more snippets by default (i.e. everything without a `notrust` tag), and
not anything significant.
2014-03-09 19:34:40 +11:00
Huon Wilson
8e90412048 rustdoc: adding some common feature gates when testing a markdown file.
The manual, tutorial and guides need the feature gates quite often,
unfortunately, so this is the low-cost path to migrating to use
rustdoc. This is only activated for pure-Markdown files.

Preferably this would be avoided: #12773
2014-03-09 19:34:40 +11:00
Huon Wilson
7a70ec1ba6 rustdoc: hardcode each header as a link.
This avoids having to include JS in the guide/tutorial/manual pages just
to get the headers being links. The on-hover behaviour showing the
little section marker § is preserved, because that gives a useful hint
that the heading is a link.
2014-03-09 19:29:49 +11:00
Huon Wilson
f22c96cc88 rustdoc: add table-of-contents recording & rendering, use it with plain
markdown files.

This means that

    # Foo
    ## Bar
    # Baz
    ### Qux
    ## Quz

Gets a TOC like

    1 Foo
       1.1 Bar
    2 Baz
       2.0.1 Qux
       2.1 Quz

This functionality is only used when rendering a single markdown file,
never on an individual module, although it could very feasibly be
extended to allow modules to opt-in to a table of contents (std::fmt
comes to mind).
2014-03-09 19:29:49 +11:00
Huon Wilson
69b8ef806b rustdoc: run on plain Markdown files.
This theoretically gives rustdoc the ability to render our guides,
tutorial and manual (not in practice, since the files themselves need to
be adjusted slightly to use Sundown-compatible functionality).

Fixes #11392.
2014-03-09 19:29:49 +11:00
bors
e959c8794b auto merge of #12777 : sfackler/rust/no_run, r=alexcrichton
This is useful for code that would be expensive to run or has some kind
of external dependency (e.g. a database or server).
2014-03-08 22:41:45 -08:00
bors
5d1d285623 auto merge of #12758 : rgawdzik/rust/master, r=alexcrichton
Refactored get_metadata_section to return a Result<MetadataBlob,~str> instead of a Option<MetadataBlob>. This provides more clarity to the user through the debug output when using --ls.

This is kind of a continuation of my original closed pull request 2 months ago (#11544), but I think the time-span constitutes a new pull request.
2014-03-08 20:51:48 -08:00
Steven Fackler
71cab0410f Add an option to not run rustdoc blocks
This is useful for code that would be expensive to run or has some kind
of external dependency (e.g. a database or server).
2014-03-08 19:57:00 -08:00
bors
5f64adc44b auto merge of #12706 : pongad/rust/issue_12698, r=brson
Fixes #12698
2014-03-08 19:06:48 -08:00
Robert Gawdzik
3bf724e44b Refactored get_metadata_section to return a Result<T,~str>, added error messages. Closes #6615. 2014-03-08 20:46:18 -05:00
bors
e1681df892 auto merge of #12759 : lucab/rust/char-doc, r=alexcrichton
This is mostly a reaction to #12730. If we are going to keep calling them `char`, at least make it clear that they aren't characters but codepoint/scalar.
2014-03-08 17:31:57 -08:00
bors
0017056105 auto merge of #12768 : pnkfelix/rust/fsk-devecing, r=pnkfelix
Change `~[T]` to Vec<T> in librustc.  Rebased and amended version of PR #12716.

Original author (or perhaps I should say meta-author) was @pcwalton, as is reflected in the commits.

I clean up!  :)
2014-03-08 13:01:55 -08:00
Felix S. Klock II
f978c772ba Incorporated review feedback atop pcwalton's original patches.
(Original PR was #12716; feedback was provided by thestinger and me.)
2014-03-08 21:47:12 +01:00
Patrick Walton
15d9acc46c librustdoc: Fix librustdoc for the Vec<T> change. 2014-03-08 21:41:42 +01:00
Felix S. Klock II
43c07244b3 librustc: Fix up fallout from the automatic conversion. 2014-03-08 21:41:32 +01:00
Patrick Walton
3b6e9d4a7a librustc: Automatically change uses of ~[T] to Vec<T> in rustc. 2014-03-08 21:24:27 +01:00
Michael Darakananda
438893b36f Removed DeepClone. Issue #12698. 2014-03-08 15:09:00 -05:00
Patrick Walton
f690cc2c63 libstd: Add some more functionality to Vec<T> 2014-03-08 21:08:59 +01:00
Luca Bruno
331f9077a0 doc: add two missing char methods doc-strings
XID_* property are defined in UAX #31, just reference it here.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-08 09:10:12 +01:00
Luca Bruno
9b3c63bdd5 doc: uniform std::char doc-strings
Uniform and beautify doc-string for current rustdoc output.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-08 09:10:12 +01:00
Luca Bruno
af7c313047 doc: don't refer to 'char' as characters
This seems to be causing some confusion among users. Rust's char are
not 8bit characters, but 32bit UCS-4 codepoint without surrogates
(Unicode Scalar Values as per Unicode glossary).
Make the doc more explicit about it.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-08 09:10:12 +01:00