Commit Graph

29104 Commits

Author SHA1 Message Date
bors
e402e75f4e auto merge of #14350 : zwarich/rust/let-suggestion, r=pcwalton 2014-05-22 13:31:24 -07:00
bors
8d50d6a93c auto merge of #14346 : alexcrichton/rust/rustdoc-external-crates, r=pcwalton
This commit alters rustdoc to crawl the metadata of upstream libraries in order
to fill in default methods for traits implemented in downstream crates. This,
for example, documents the `insert` function on hash maps.

This is a fairly lossy extraction from the metadata. Documentation and
attributes are lost, but they aren't used anyway. Unfortunately, argument names
are also lost because they are not present in the metadata. Source links are
also lost because the spans are not serialized.

While not perfect, it appears that presenting this documentation through rustdoc
is much better than nothing, so I wanted to land this to allow iteration on it
later on.
2014-05-22 10:31:25 -07:00
Alex Crichton
c746c503f0 rustdoc: Fill in external trait methods
This commit alters rustdoc to crawl the metadata of upstream libraries in order
to fill in default methods for traits implemented in downstream crates. This,
for example, documents the `insert` function on hash maps.

This is a fairly lossy extraction from the metadata. Documentation and
attributes are lost, but they aren't used anyway. Unfortunately, argument names
are also lost because they are not present in the metadata. Source links are
also lost because the spans are not serialized.

While not perfect, it appears that presenting this documentation through rustdoc
is much better than nothing, so I wanted to land this to allow iteration on it
later on.
2014-05-22 09:46:22 -07:00
bors
3c9f2a5d0a auto merge of #14354 : EdorianDark/rust/master, r=huonw
It seemed to me, that [T] was deprecated and i am trying to help.
2014-05-22 08:51:20 -07:00
bors
9411cec580 auto merge of #14349 : richo/rust/docs/win64_calling_convention, r=alexcrichton
Wikipedia suggests that windows on x64 has it's own calling convention (Supported by the fact that we implement it)

source: http://en.wikipedia.org/wiki/X86_calling_conventions#x86-64_calling_conventions
2014-05-22 07:16:22 -07:00
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
Dirk Leifeld
6787e22c08 Remove allow(deprecated_owned_vector) lint 2014-05-22 13:19:44 +02: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
Richo Healey
e5d883101c docs: Add win64 calling convention 2014-05-22 00:05:56 -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
Cameron Zwarich
516a177273 Add a suggestion to use a let binding on some borrowck errors. 2014-05-21 22:04:22 -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