Commit Graph

29096 Commits

Author SHA1 Message Date
bors
9ac9148bbd auto merge of #14335 : tbu-/rust/pr_doc_strsplit, r=pnkfelix
In particular, show examples for splitting the empty string and using `splitn`
with a count of 0.

Fix #14222.
2014-05-22 05:26:22 -07:00
bors
e7e5e9ce96 auto merge of #14345 : alexcrichton/rust/rustdoc-many-impls, r=pcwalton
Right now, when you look in the "Implementors" section for traits, you only see
implementors within that crate. This commit modifies that section to include
implementors from neighboring crates as well.

For example, the Container trait currently says that it is only implemented by
strings and slices, but it is in fact implemented by nearly all containers.

Implementation-wise, this change generates an "implementors cache" similarly to
the search index where each crate will append implementors to the files. When
the page for a trait is loaded, it will load its specific cache file, rendering
links for all upstream types which implement the trait.
2014-05-22 02:51:21 -07:00
bors
022a7b3cfb auto merge of #14322 : thestinger/rust/secret_santa_heap, r=alexcrichton 2014-05-22 01:06:25 -07:00
bors
22e2204c3d auto merge of #14321 : alexcrichton/rust/ices, r=pcwalton
Also adding tests for fixed ICEs
2014-05-21 23:31:27 -07:00
bors
f78eb14341 auto merge of #14307 : kballard/rust/vim_prelude_mutablecloneablevector, r=cmr
Add slice::MutableCloneableVector to the prelude. It's the only slice
trait that's currently missing.

Update rust.vim to match the latest prelude and current set of keywords.
Also teach it to handle box placement expressions specially.
2014-05-21 20:11:27 -07:00
bors
257a73ce82 auto merge of #14301 : alexcrichton/rust/remove-unsafe-arc, r=brson
This type can be built with `Arc<Unsafe<T>>` now that liballoc exists.
2014-05-21 17:31:29 -07:00
Alex Crichton
06eb9765fe rustdoc: Show types for traits across crates
Right now, when you look in the "Implementors" section for traits, you only see
implementors within that crate. This commit modifies that section to include
implementors from neighboring crates as well.

For example, the Container trait currently says that it is only implemented by
strings and slices, but it is in fact implemented by nearly all containers.

Implementation-wise, this change generates an "implementors cache" similarly to
the search index where each crate will append implementors to the files. When
the page for a trait is loaded, it will load its specific cache file, rendering
links for all upstream types which implement the trait.
2014-05-21 16:41:58 -07:00
Alex Crichton
fdf935a524 std,green: Mark some queue types as NoShare 2014-05-21 16:36:57 -07:00
Daniel Micay
f1ce693e61 alter exchange_free for sized deallocation
The support for sized deallocation is nearly complete. The only known
missing pieces are `Box<str>`, `Box<[T]>` and `proc`.
2014-05-21 16:16:17 -04:00
Daniel Micay
945019830b migrate from exchange_malloc to allocate
This is now only used internally by the compiler.
2014-05-21 16:16:17 -04:00
bors
5f3f0918ad auto merge of #14334 : brson/rust/deoxidize, r=alexcrichton
Using `rustc` instead of e.g. `compile` makes it clear this is a rust build step.
2014-05-21 13:11:28 -07:00
bors
83eefa88c1 auto merge of #14328 : Sawyer47/rust/remove-fixmes, r=alexcrichton 2014-05-21 11:36:29 -07:00
Tobias Bucher
dcc2305664 Add examples for edge cases of str.split/str.splitn
In particular, show examples for splitting the empty string and using `splitn`
with a count of 0.

Fix #14222.
2014-05-21 20:05:55 +02:00
Brian Anderson
7c8c544731 mk: Replace 'oxidize' with 'rustc'. Closes #13781 2014-05-21 11:01:59 -07:00
bors
96670e9723 auto merge of #14320 : kballard/rust/fix_stdlib_inject_attrs, r=alexcrichton
The #[phase(syntax,link)] attribute on `extern crate std` needs to be an
outer attribute so it can pretty-print properly.

Also add `#![no_std]` and `#[feature(phase)]` so compiling the
pretty-printed source will work.
2014-05-21 09:46:27 -07:00
Alex Crichton
0d4b840523 rustc: Fix an ICE with box-placement syntax
Closes #14084
2014-05-21 09:16:14 -07:00
Alex Crichton
a016aa2405 rustc: Turn a Box ICE into an error
Closes #14092
2014-05-21 09:16:11 -07:00
bors
803e92de89 auto merge of #14326 : huonw/rust/tiny-fixes, r=pnkfelix
The changes to flowgraph make invalid invocations slightly more forgiving by (trying to) provide slightly more information and by avoiding the ICE message.
2014-05-21 08:06:27 -07:00
Piotr Jawniak
fe7cc81087 Remove two outdated FIXMEs from complex.rs 2014-05-21 16:04:35 +02:00
bors
1edb0e5364 auto merge of #14324 : zecozephyr/rust/docfix, r=luqmana 2014-05-21 06:21:25 -07:00
Huon Wilson
feb91f3216 rustc: improve error messages from wrong --pretty flowgraph use.
This defers to .fatal and .span_fatal for errors (rather than `fail!`
which prints the ICE message). It also adds the span lookup when an id
doesn't correspond to a block, to show what it is pointing at.

It also makes the argument parser slightly looser, so that passing
`--pretty flowgraph` recognises the `flowgraph` part and suggests to use
an integer.
2014-05-21 22:41:23 +10:00
Huon Wilson
dd5365af2c rustc: ng -> gn, fix a typo in a string. 2014-05-21 21:53:41 +10:00
Huon Wilson
a239663413 rustc: rename the lint level enum for style.
CamelCase all the way!
2014-05-21 21:50:37 +10:00
bors
a400b31ff5 auto merge of #14319 : kballard/rust/rename_rng_choose_option, r=alexcrichton
Rng.choose() is used so rarely that it doesn't necessitate having two
methods, especially since the failing, non-option variant also requires
Clone.

[breaking-change]
2014-05-21 04:26:23 -07:00
Jonathan Bailey
e549601bc8 Updated doc with correct type. 2014-05-21 02:48:23 -07:00
bors
082075d050 auto merge of #14316 : kballard/rust/range_inclusive_no_toprimitive, r=alexcrichton 2014-05-21 02:46:23 -07:00
bors
4605232f26 auto merge of #14315 : kballard/rust/stdreader_isatty, r=alexcrichton
StdWriter has .isatty(). StdReader can trivially vend the same function,
and someone asked today on IRC how to call isatty() on stdin.
2014-05-21 01:11:25 -07:00
bors
4afc15e30c auto merge of #14259 : alexcrichton/rust/core-mem, r=brson
Excluding the functions inherited from the cast module last week (with marked
stability levels), these functions received the following treatment.

* size_of - this method has become #[stable]
* nonzero_size_of/nonzero_size_of_val - these methods have been removed
* min_align_of - this method is now #[stable]
* pref_align_of - this method has been renamed without the
  `pref_` prefix, and it is the "default alignment" now. This decision is in line
  with what clang does (see url linked in comment on function). This function
  is now #[stable].
* init - renamed to zeroed and marked #[stable]
* uninit - marked #[stable]
* move_val_init - renamed to overwrite and marked #[stable]
* {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
* swap/replace/drop - marked #[stable]
* size_of_val/min_align_of_val/align_of_val - these functions are marked
  #[unstable], but will continue to exist in some form. Concerns have been
  raised about their `_val` prefix.
2014-05-20 23:31:30 -07:00
Alex Crichton
19dc3b50bd core: Stabilize the mem module
Excluding the functions inherited from the cast module last week (with marked
stability levels), these functions received the following treatment.

* size_of - this method has become #[stable]
* nonzero_size_of/nonzero_size_of_val - these methods have been removed
* min_align_of - this method is now #[stable]
* pref_align_of - this method has been renamed without the
  `pref_` prefix, and it is the "default alignment" now. This decision is in line
  with what clang does (see url linked in comment on function). This function
  is now #[stable].
* init - renamed to zeroed and marked #[stable]
* uninit - marked #[stable]
* move_val_init - renamed to overwrite and marked #[stable]
* {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
* swap/replace/drop - marked #[stable]
* size_of_val/min_align_of_val/align_of_val - these functions are marked
  #[unstable], but will continue to exist in some form. Concerns have been
  raised about their `_val` prefix.

[breaking-change]
2014-05-20 23:06:54 -07:00
Kevin Ballard
23ca66ecd2 Change std inject attributes to outer attributes
The #[phase(syntax,link)] attribute on `extern crate std` needs to be an
outer attribute so it can pretty-print properly.

Also add `#![no_std]` and `#[feature(phase)]` so compiling the
pretty-printed source will work.
2014-05-20 22:44:58 -07:00
Alex Crichton
4aac621b5a test: Add test for fixed issue #12796
Doesn't close #12796 because the error message is awful.
2014-05-20 21:47:12 -07:00
Alex Crichton
827999cd1f test: Add a test for fixed issue #12567
Closes #12567
2014-05-20 21:44:22 -07:00
Alex Crichton
0089215472 rustc: Avoid an unwrap() in check_match
Closes #12369
2014-05-20 21:42:30 -07:00
bors
feb9f302ca auto merge of #14293 : alexcrichton/rust/weak-lang-items, r=brson
This commit is part of the ongoing libstd facade efforts (cc #13851). The
compiler now recognizes some language items as "extern { fn foo(...); }" and
will automatically perform the following actions:

1. The foreign function has a pre-defined name.
2. The crate and downstream crates can only be built as rlibs until a crate
   defines the lang item itself.
3. The actual lang item has a pre-defined name.

This is essentially nicer compiler support for the hokey
core-depends-on-std-failure scheme today, but it is implemented the same way.
The details are a little more hidden under the covers.

In addition to failure, this commit promotes the eh_personality and
rust_stack_exhausted functions to official lang items. The compiler can generate
calls to these functions, causing linkage errors if they are left undefined. The
checking for these items is not as precise as it could be. Crates compiling with
`-Z no-landing-pads` will not need the eh_personality lang item, and crates
compiling with no split stacks won't need the stack exhausted lang item. For
ease, however, these items are checked for presence in all final outputs of the
compiler.

It is quite easy to define dummy versions of the functions necessary:

    #[lang = "stack_exhausted"]
    extern fn stack_exhausted() { /* ... */ }

    #[lang = "eh_personality"]
    extern fn eh_personality() { /* ... */ }

cc #11922, rust_stack_exhausted is now a lang item
cc #13851, libcollections is blocked on eh_personality becoming weak
2014-05-20 21:36:25 -07:00
Alex Crichton
40d3241a4a rustc: Avoid out of bounds in check_match
Closes #12116
2014-05-20 21:34:10 -07:00
Alex Crichton
1b2dd90f1b test: Add a test for fixed issue #11844
Closes #11844
2014-05-20 21:25:49 -07:00
Alex Crichton
f0a1df692e test: Add test for fixed issue #11736
Closes #11736
2014-05-20 21:24:01 -07:00
Alex Crichton
d3a0471490 test: Add a test for fixed issue #10763
Closes #10763
2014-05-20 21:14:20 -07:00
Alex Crichton
8505b14b00 rustc: Fix a dynamic borrow error in resolve
Closes #8208
Closes #10980
2014-05-20 21:13:50 -07:00
Kevin Ballard
b8270c8db2 Remove Rng.choose(), rename Rng.choose_option() to .choose()
Rng.choose() is used so rarely that it doesn't necessitate having two
methods, especially since the failing, non-option variant also requires
Clone.

[breaking-change]
2014-05-20 20:44:45 -07:00
Alex Crichton
aef1a9c57b rustc: Prevant an out of bounds access in typeck
Closes #7092
2014-05-20 20:39:15 -07:00
Alex Crichton
fd88e2b729 syntax: Parse global paths in patterns
Closes #6449
2014-05-20 20:28:00 -07:00
Kevin Ballard
c7454853d2 Remove useless ToPrimitive bound on range_inclusive() 2014-05-20 20:27:34 -07:00
Kevin Ballard
dc921c1433 Add .isatty() method to StdReader
StdWriter has .isatty(). StdReader can trivially vend the same function,
and someone asked today on IRC how to call isatty() on stdin.
2014-05-20 20:05:05 -07:00
bors
f30382d624 auto merge of #13823 : pnkfelix/rust/fsk-fix-13805, r=alexcrichton
Make configure script respect (and save) values for `CC`, `CXX`, `CFLAGS` etc.

I mostly tried to remain backwards compatible with old invocations of
the `configure` script; if you do not want to use `CC` et al., you
should not have to; you can keep using `--enable-clang` and/or
`--enable-ccache`.

The overall intention is to capture the following precedences for
guessing the C compiler:

 1. Value of `CC` at `make` invocation time.
 2. Value of `CC` at `configure` invocation time.
 3. Compiler inferred at configure invocation time (`gcc` or `clang`).

The strategy is to check (at `configure` time) if each of the
environment variables is set, and if so, save its value in a
corresponding `CFG_` variable (e.g. `CFG_CC`).

The `configure` script also does not attempt to infer the compiler if
`CC` is set; but if `--enable-clang` was passed, then it *does* still
attempt to validate that the clang version is compatible.

Then, in the makefiles, if `CC` is not set but `CFG_CC` is, then we
use the `CFG_CC` setting as `CC`.

Fix #13805.
2014-05-20 19:16:15 -07:00
Alex Crichton
54f6eacf34 green: Remove some unsafe code in BasicLoop 2014-05-20 18:51:29 -07:00
bors
e546452727 auto merge of #14305 : tbu-/rust/pr_doc_bytes, r=huonw
Only an example was needed, as the ability to write uints into the string is
already mentioned.

Fix #7102.
2014-05-20 17:36:18 -07:00
bors
6ecf7d97d0 auto merge of #13975 : nikomatsakis/rust/issue-13794-fn-subtyping-and-static, r=pnkfelix
Tweak region inference to ignore constraints like `'a <= 'static`, since they
have no value. This also ensures that we can handle some obscure cases of fn
subtyping with bound regions that we didn't used to handle correctly.

Fixes #13974.
2014-05-20 15:41:20 -07:00
Kevin Ballard
bf0c6d8166 vim: Handle box expressions specially
Attempt to highlight the placement expression in a `box (expr) foo`
expression. Also treat GC as a keyword within the placement expression.

This doesn't work correctly for arbitrary expressions. Notably, this
makes no attempt at balancing delimiters. I believe handling that will
require rewriting the syntax rules to add a region for every pair of
delimiters. That may be a desirable thing to do in the end, because we
can then rewrite our indent rules based on the syntax and get rid of
cindent(), but for the time being, we'll just live with the limitation.
2014-05-20 15:06:53 -07:00
Tobias Bucher
84f43c6acd Add non-utf8 byte to the bytes!() example
Only an example was needed, as the ability to write uints into the string is
already mentioned.

Fix #7102.
2014-05-20 22:53:30 +02:00