Commit Graph

700 Commits

Author SHA1 Message Date
Huon Wilson
198caa87cd Update users for the std::rand -> librand move. 2014-03-12 11:31:43 +11:00
Huon Wilson
6fa4bbeed4 std: Move rand to librand.
This functionality is not super-core and so doesn't need to be included
in std. It's possible that std may need rand (it does a little bit now,
for io::test) in which case the functionality required could be moved to
a secret hidden module and reexposed by librand.

Unfortunately, using #[deprecated] here is hard: there's too much to
mock to make it feasible, since we have to ensure that programs still
typecheck to reach the linting phase.
2014-03-12 11:31:05 +11:00
bors
74bfa7108a auto merge of #12783 : adrientetar/rust/more-docs, r=alexcrichton
- remove `node.js` dep., it has no effect as of #12747 (1)
- switch between LaTeX compilers, some cleanups
- CSS: fixup the print stylesheet, refactor highlighting code (2)

(1): `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 ([here is](http://adrientetar.github.io/rust-tuts/tutorial/tutorial.pdf) an example of that).

(2): the only real highlighting change is for lifetimes which are now brown instead of red, the rest is just refactor of twos shades of red that look the same.
Also I made numbers highlighting for src in rustdoc a tint more clear so that it is less bothering.

@alexcrichton, @huonw

Closes #9873. Closes #12788.
2014-03-11 12:36:58 -07: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
67ebf8abdf mk: dist-installer builds a binary installer 2014-03-09 14:17:26 -07: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
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
bors
3f3425a555 auto merge of #12663 : MicahChalmer/rust/emacs-remove-ws-bug-warning, r=brson
The incompatibility of rust-mode with global-whitespace-mode warned
about in the README was actually fixed by commit 581b3db3b3.  Remove the
warning from the README and close #3994.
2014-03-02 20:56:30 -08:00
Micah Chalmer
d92fdb27cb Emacs: Remove README warning of old whitespace bug
The incompatibility of rust-mode with global-whitespace-mode warned
about in the README was actually fixed by commit 581b3db3b3.  Remove the
warning from the README and close #3994.
2014-03-02 22:02:18 -05:00
Luca Bruno
1e2f572fb6 librustc: add LLVM LDFLAGS to deps
This commit let librustc automatically pickup LDFLAGS dependencies
inherited from LLVM, which may otherwise result in undefined
references to external symbols under certain linking environment.

A symptom of this issue is eg. a failure when trying to link against
librustc (due to unresolved ffi_*i symbols), while using a system-wide
LLVM.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-02 17:29:54 +01:00
bors
b349fee46e Merge pull request #12308 from kballard/vim-nested-comments
vim: Tweak how comment nesting works

Reviewed-by: brson
2014-03-01 17:36:41 -08:00
Chris Morgan
231832d835 Improve the ctags function regular expression.
Before it would only catch lines starting `fn` or `pub fn`.

Now it can cope with:

- attributes (e.g. `#[test] fn`)
- external functions (e.g. `extern fn`, `extern "C" fn`)
- unsafe functions (e.g. `unsafe fn`)

… and any correct combination of these
(e.g. `#[test] extern "C" unsafe fn`).
2014-02-27 21:04:04 -08:00
Chris Morgan
498a6060ef Update Vim syntax file last change date. 2014-02-27 21:04:04 -08:00
Chris Morgan
879ac43689 Fix Vim section movements for standard Rust style.
(Expressed another way: make `[[` et al. work with the curly brace at
the end of a line as is standard Rust style, not just at the start is it
is by default in Vim, from K&R style.)

This came out of #11492, where a simpler but less effective technique
was initially proposed; some discussion of the techniques, ways and
means can be found there.

There are still a few caveats:

- Operator-pending mode behaves differently to the standard behaviour:
  if inside curly braces, it should delete up to and including the
  closing of the outermost curly brace (that doesn't seem to me
  consistent with documented behaviour, but it's what it does). Actual
  behaviour (the more logical and consistent, in my opinion): up to the
  start of the next outermost curly brace.

- With folding enabled (`set fdm=syntax`), `[[` and `]]` do not behave
  as they should: the default behaviour treats an entire closed fold as
  one line for these purposes while this code does not (I explicitly
  `set nofoldenable` in the function—the side-effects are worse with
  folds enabled), leading to unexpected behaviour, the worst of which is
  `[[` and/or `]]` not working in visual mode on a closed fold (visual
  mode keeps it at the extreme end of the region line of the folded
  region, so it's always going back to the opening line of that fold and
  immediately being shoved back to the end by visual mode).

- `[[` and `]]` are operating inside comments, whereas the standard
  behaviour skips comments.

- The viewport position is sometimes changed when it should not be
  necessary.
2014-02-27 21:04:04 -08:00
Chris Morgan
0a663a2d31 Update prelude items in Vim syntax. 2014-02-27 21:04:04 -08:00
Chris Morgan
eda5755a9d Downgrade do to a reserved keyword in Vim.
This means it gets highlighted as Error by default.
2014-02-27 21:04:04 -08:00
Chris Morgan
e0088ef80b Highlight the mod in extern mod x; as Error.
Just like the bare keyword `crate` is highlighted as Error (a little
dubious, actually, given macros), `mod` is invalid after `extern`: it's
obsolete syntax.
2014-02-27 21:04:03 -08:00
Brian Leibig
bbec2c54ed Add new target 'make dist-osx' to create a .pkg installer for OS X 2014-02-27 19:59:02 -08:00
bors
780adfffc3 auto merge of #12486 : MicahChalmer/rust/emacs-fixes-round-3, r=brson
I've added details in the description of each comment as to what it does, which I won't redundantly repeat here in the PR.  They all relate to indentation in the emacs rust-mode.

What I will note here is that this closes #8787.  It addresses the last remaining case (not in the original issue description but in a comment), of indenting `match` statements.  With the changes here, I believe every problem described in the issue description or comments of #8787 is addressed.
2014-02-26 20:01:42 -08:00
bors
34a224f4a1 auto merge of #12530 : alexcrichton/rust/make-check-no-rpath, r=brson
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-25 07:56:35 -08:00
Kevin Ballard
bc35eb78e2 vim: Tweak how comment nesting works
Don't try to match line comments inside of a comment block. That makes
no sense and can highlight differently for people who override their
highlights.

Similarly, don't match a doc-comment inside of a comment block. It
shouldn't be highlighted differently unless it's actually a doc-comment
(and nested comments are obviously not doc comments).

Fixes #12307.
2014-02-24 21:03:05 -08:00
Huon Wilson
efaf4db24c Transition to new Hash, removing IterBytes and std::to_bytes. 2014-02-24 07:44:10 +11:00
Alex Crichton
2a14e084cf Move std::{trie, hashmap} to libcollections
These two containers are indeed collections, so their place is in
libcollections, not in libstd. There will always be a hash map as part of the
standard distribution of Rust, but by moving it out of the standard library it
makes libstd that much more portable to more platforms and environments.

This conveniently also removes the stuttering of 'std::hashmap::HashMap',
although 'collections::HashMap' is only one character shorter.
2014-02-23 00:35:11 -08:00
Micah Chalmer
04dc3e4985 Fix typo in emacs ERT test 2014-02-22 23:35:33 -05:00
Micah Chalmer
55b3c1917f Emacs: indent relative to enclosing block
This changes the indent to calculate positions relative to the enclosing
block (or braced/parenthesized expression), rather than by an absolute
nesting level within the whole file.  This allows things like this to
work:

    let x =
        match expr {
            Pattern => ...
        }

With the old method, only one level of nesting would be added within the
match braces, so "Pattern" would have ended up aligned with the match.

The other change is that multiple parens/braces on the same line only
increase the indent once.  This is a very common case for passing
closures/procs.  The absolute nesting method would do this:

    spawn(proc() {
            // Indented out two indent levels...
    })

whereas the code in this commit does this:

    spawn(proc() {
        // Indented out only one level...
    })
2014-02-22 23:06:46 -05:00
Micah Chalmer
45008f9b3e Emacs: stay at the correct position when indenting
When indenting a non-blank line, stay at the same cursor position
relative to the content after indenting.
2014-02-22 22:55:30 -05:00
Micah Chalmer
7fbcda1c65 Fix emacs indentation of multi-line match patterns
Aligns to the same column if the previous line ends in a single '|' (but
not a '||').
2014-02-22 13:11:48 -05:00
Erick Tryzelaar
d223dd1e57 std: rewrite Hash to make it more generic
This patch merges IterBytes and Hash traits, which clears up the
confusion of using `#[deriving(IterBytes)]` to support hashing.
Instead, it now is much easier to use the new `#[deriving(Hash)]`
for making a type hashable with a stream hash.

Furthermore, it supports custom non-stream-based hashers, such as
if a value's hash was cached in a database.

This does not yet replace the old IterBytes-hash with this new
version.
2014-02-21 21:33:23 -08:00
Alex Crichton
e26ba3605a mk: Get "make check" passing with --disable-rpath
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-21 16:35:05 -08:00
Brendan Zabarauskas
3a9eca3a7b Move std::num::Integer to libnum 2014-02-22 01:45:29 +11:00
bors
b0ce960609 auto merge of #12321 : bjz/rust/remove-real, r=alexcrichton
This is part of the effort to simplify `std::num`, as tracked in issue #10387. It is also a step towards a proper IEEE-754 trait (see #12281).
2014-02-17 22:16:51 -08:00
Derek Guenther
b609d57b02 Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
bors
57d273f65e auto merge of #12284 : brson/rust/install, r=alexcrichton
Work toward #9876.

This adds `prepare.mk`, which is simply a more heavily-parameterized `install.mk`, then uses `prepare` to implement both `install` and the windows installer (`dist`). Smoke tested on both Linux and Windows.
2014-02-17 03:26:51 -08:00
Brendan Zabarauskas
876eb931dc Remove Real trait and move methods into Float
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-17 02:23:33 +11:00
Brendan Zabarauskas
f450b2b379 Remove CloneableTuple and ImmutableTuple traits
These are adequately covered by the Tuple2 trait.
2014-02-17 00:57:56 +11:00
Brian Anderson
508cb29dc4 mk: Base the windows dist target on prepare.mk 2014-02-15 14:18:00 -08:00
Alex Crichton
a41b0c2529 extern mod => extern crate
This was previously implemented, and it just needed a snapshot to go through
2014-02-14 22:55:21 -08:00
Kevin Ballard
33b2b8a16f Add crate keyword to gedit language spec 2014-02-14 15:37:22 -08:00
Kevin Ballard
fff12220af Add crate to emacs and kate modefiles 2014-02-14 14:37:07 -08:00
Kevin Ballard
c718e0e254 Add CheckedDiv to vim syntax 2014-02-14 12:02:18 -08:00
Kevin Ballard
84c60186fc Update vim syntax for extern crate 2014-02-14 11:27:53 -08:00
Brian Anderson
6784179352 Stop looping on error waiting for android test results
These seem to be causing iloops on the bots. Let's rather see the errors.
2014-02-13 21:19:06 -08:00
Florian Hahn
f62460c1f5 Change xfail directives in compiletests to ignore, closes #11363 2014-02-11 18:23:20 +01:00
Alex Crichton
c2ae62faee Revert non-license changes as part of 0ebe112b
The commit accidentally modified the snapshot script which changed its behavior
and is currently blocking a snapshot.
2014-02-10 18:00:40 -08:00
Kevin Ballard
086c0dd33f Delete send_str, rewrite clients on top of MaybeOwned<'static>
Declare a `type SendStr = MaybeOwned<'static>` to ease readibility of
types that needed the old SendStr behavior.

Implement all the traits for MaybeOwned that SendStr used to implement.
2014-02-07 22:31:52 -08:00
Huon Wilson
b89afe2af7 Update docs and tests for #[deriving(Show)]. 2014-02-08 13:53:21 +11:00
Derek Guenther
730bdb6403 Added tests to make tidy 2014-02-07 12:49:24 -06:00
Alex Crichton
6e7968b10a Redesign output flags for rustc
This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
--lib, and --bin flags from rustc, adding the following flags:

* --emit=[asm,ir,bc,obj,link]
* --crate-type=[dylib,rlib,staticlib,bin,lib]

The -o option has also been redefined to be used for *all* flavors of outputs.
This means that we no longer ignore it for libraries. The --out-dir remains the
same as before.

The new logic for files that rustc emits is as follows:

1. Output types are dictated by the --emit flag. The default value is
   --emit=link, and this option can be passed multiple times and have all
   options stacked on one another.
2. Crate types are dictated by the --crate-type flag and the #[crate_type]
   attribute. The flags can be passed many times and stack with the crate
   attribute.
3. If the -o flag is specified, and only one output type is specified, the
   output will be emitted at this location. If more than one output type is
   specified, then the filename of -o is ignored, and all output goes in the
   directory that -o specifies. The -o option always ignores the --out-dir
   option.
4. If the --out-dir flag is specified, all output goes in this directory.
5. If -o and --out-dir are both not present, all output goes in the current
   directory of the process.
6. When multiple output types are specified, the filestem of all output is the
   same as the name of the CrateId (derived from a crate attribute or from the
   filestem of the crate file).

Closes #7791
Closes #11056
Closes #11667
2014-02-06 11:14:13 -08:00
Adrien Tétar
0ebe112b3b etc: add missing license boilerplates 2014-02-05 19:53:53 +01:00