Commit Graph

29186 Commits

Author SHA1 Message Date
Alex Crichton
8dad7f579e rustdoc: Get [src] links working for inlined dox
These links work by hyperlinking back to the actual documentation page with a
query parameter which will be recognized and then auto-click the appropriate
[src] link.
2014-05-25 01:18:37 -07:00
Alex Crichton
9f13db2cb2 rustdoc: Fix rendering of the 'static bound 2014-05-25 01:18:11 -07:00
Alex Crichton
837d4d8f35 rustdoc: Link to local reexportations of items
Within the documentation for a crate, all hyperlinks to reexported items don't
go across crates, but rather to the items in the crate itself. This will allow
references to Option in the standard library to link to the standard library's
Option, instead of libcore's.

This does mean that other crate's links for Option will still link to libcore's
Option.
2014-05-25 01:18:11 -07:00
Alex Crichton
a96067077a rustdoc: Prevent a segfault when using markdown
The field passed from markdown could sometimes be null, and it wasn't properly
handled.
2014-05-25 01:18:11 -07:00
Alex Crichton
316ef79dc2 rustc: Encode module attributes
This will allow for rustdoc to pick up the documentation on the other end.
2014-05-25 01:18:11 -07:00
Alex Crichton
781e898348 rustdoc: Use csearch for impl loading
The normal analysis passes aren't guaranteed to have loaded all impls, so use
the csearch methods directly to load impls.
2014-05-25 01:18:10 -07:00
Alex Crichton
5ee3d0e1ff rustdoc: Inline reexported modules 2014-05-25 01:18:10 -07:00
Alex Crichton
9181c35ee9 rustdoc: Inline names of function arguments 2014-05-25 01:18:10 -07:00
Alex Crichton
6ee9109c8b rustdoc: Inline argument names of foreign methods 2014-05-25 01:18:10 -07:00
Alex Crichton
ec4f79ff6c rustdoc: Don't show reexported enum variants
For now just assume that the enum type itself is reexported.
2014-05-25 01:17:57 -07:00
Alex Crichton
622c8f7b57 rustdoc: Inline enums across crates 2014-05-25 01:17:57 -07:00
Alex Crichton
c81b511bfd rustdoc: Start inlining structs across crates 2014-05-25 01:17:57 -07:00
Alex Crichton
8b8e70ba1d std: Add doc(noinline) to the prelude reexports 2014-05-25 01:17:34 -07:00
Alex Crichton
712118b9c0 rustdoc: Inline documentation of pub use
This commit teaches rustdoc to inline the documentation for the destination of a
`pub use` statement across crate boundaries. This is intended for the standard
library's facade to show the fact that the facade is just an implementation
detail rather than the api of the standard library itself.

This starts out by inlining traits and functions, but more items will come soon.
The current drawback of this system is that hyperlinks across crates sill go to
the original item's definition rather than the reexported location.
2014-05-25 01:17:14 -07:00
bors
7d76d0ad44 auto merge of #14323 : richo/rust/features/strbuf_to_string, r=huonw
Converts `StrBuf` to `String` throughout rustc and the standard library.

Tests all pass locally, but usual caveats about platforms that aren't OSX apply since I don't have a test environment handy.

@alexcritchon mentioned that @pcwalton may have a patch incoming that should block this?

closes #14312
2014-05-24 21:51:18 -07:00
Richo Healey
553074506e core: rename strbuf::StrBuf to string::String
[breaking-change]
2014-05-24 21:48:10 -07:00
bors
bbb70cdd9c auto merge of #14402 : huonw/rust/arc-field-rename, r=alexcrichton
Paper over privacy issues with Deref by changing field names.

Types that implement Deref can cause weird error messages due to their
private fields conflicting with a field of the type they deref to, e.g.,
previously

    struct Foo { x: int }

    let a: Arc<Foo> = ...;
    println!("{}", a.x);

would complain the the `x` field of `Arc` was private (since Arc has a
private field called `x`) rather than just ignoring it.

This patch doesn't fix that issue, but does mean one would have to write
`a._ptr` to hit the same error message, which seems far less
common. (This patch `_`-prefixes all private fields of
`Deref`-implementing types.)

cc #12808
2014-05-24 18:56:19 -07:00
Huon Wilson
9698221f91 Paper over privacy issues with Deref by changing field names.
Types that implement Deref can cause weird error messages due to their
private fields conflicting with a field of the type they deref to, e.g.,
previously

    struct Foo { x: int }

    let a: Arc<Foo> = ...;
    println!("{}", a.x);

would complain the the `x` field of `Arc` was private (since Arc has a
private field called `x`) rather than just ignoring it.

This patch doesn't fix that issue, but does mean one would have to write
`a._ptr` to hit the same error message, which seems far less
common. (This patch `_`-prefixes all private fields of
`Deref`-implementing types.)

cc #12808
2014-05-25 10:23:37 +10:00
bors
07563be6eb auto merge of #14373 : sfackler/rust/unused-attr, r=huonw
The compiler now tracks which attributes were actually looked at during the compilation process and warns for those that were unused.

Some things of note:

* The tracking is done via thread locals, as it made the implementation more straightforward. Note that this shouldn't hamper any future parallelization as each task can have its own thread local state which can be merged for the lint pass. If there are serious objections to this, I can restructure things to explicitly pass the state around.
* There are a number of attributes that have to be special-cased and globally whitelisted. This happens for four reasons:
  * The `doc` and `automatically_derived` attributes are used by rustdoc, but not by the compiler.
  * The crate-level attributes `license`, `desc` and `comment` aren't currently used by anything.
  * Stability attributes as well as `must_use` are checked only when the tagged item is used, so we can't guarantee that the compiler's looked at them.
  * 12 attributes are used only in trans, which happens after the lint pass.

#14300 is adding infrastructure to track lint state through trans, which this lint should also be able to use to handle the last case. For the other attributes, the right solution would probably involve a specific pass to mark uses that occur in the correct context. For example, a `doc` attribute attached to a match arm should generate a warning, but will not currently.

RFC: 0002-attribute-usage
2014-05-24 17:21:20 -07:00
Steven Fackler
3347993264 Changes from feedback 2014-05-24 16:49:47 -07:00
Steven Fackler
864c5016ae Get "make check" to work with unused-attribute
There's a fair number of attributes that have to be whitelisted since
they're either looked for by rustdoc, in trans, or as needed. These can
be cleaned up in the future.
2014-05-24 16:49:46 -07:00
Steven Fackler
24f98c6d7a Whitelist doc attributes
This is a bit overly permissive but should be okay for now.
2014-05-24 16:49:46 -07:00
Steven Fackler
e0648093d8 Port more stuff to mark used attributes 2014-05-24 16:49:46 -07:00
Steven Fackler
50181add04 First sketch of lint pass
Enough attributes are marked to cleanly compile an empty library.
2014-05-24 16:08:36 -07:00
Steven Fackler
c305473d3c Add AttrId to Attribute_ 2014-05-24 16:08:36 -07:00
bors
6304a27b80 auto merge of #14401 : aochagavia/rust/pr4, r=alexcrichton
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait.

* Renamed `to_lower` to `to_lowercase`
* Renamed `to_upper` to `to_uppercase`
* Renamed `is_alpha` to `is_alphabetic`
* Renamed `is_alnum` to `is_alphanumeric`
* Renamed `is_lower` to `is_lowercase`
* Renamed `is_upper` to `is_uppercase`

[breaking-change]
2014-05-24 14:26:23 -07:00
Adolfo Ochagavía
e998958672 Update ascii functions used elsewhere 2014-05-24 22:00:18 +02:00
bors
43f942f886 auto merge of #14378 : huonw/rust/deque-adjustments, r=alexcrichton
Might as well remove the duplication/`forget` call.
2014-05-24 12:51:24 -07:00
bors
b546fff784 auto merge of #14405 : aochagavia/rust/pr5, r=cmr 2014-05-24 10:51:25 -07:00
Adolfo Ochagavía
9088a56db1 Removed unnecessary macro declaration 2014-05-24 18:11:30 +02:00
bors
39c1ecd411 auto merge of #14396 : vhbit/rust/opaque-mutex, r=alexcrichton
On some systems (iOS for example) mutex is represented by opaque data structure which doesn't play well with simple data copy. Therefore mutex should be initialized from magic static value and filled by OS only when it landed RC.

Initially written for iOS but since landing iOS support might require quite a lot of time I think it is better to split parts which aren't directly related to iOS and merge them in
2014-05-24 04:56:25 -07:00
Huon Wilson
9a8379deb2 std: minor simplification to sync::deque. 2014-05-24 21:44:37 +10:00
Adolfo Ochagavía
f7ccae5f15 Rename functions in Ascii
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait.

* Renamed `to_lower` to `to_lowercase`
* Renamed `to_upper` to `to_uppercase`
* Renamed `is_alpha` to `is_alphabetic`
* Renamed `is_alnum` to `is_alphanumeric`
* Renamed `is_lower` to `is_lowercase`
* Renamed `is_upper` to `is_uppercase`

[breaking-change]
2014-05-24 12:44:36 +02:00
bors
e72a21b2bb auto merge of #14392 : alexcrichton/rust/mem-updates, r=sfackler
* All of the *_val functions have gone from #[unstable] to #[stable]
* The overwrite and zeroed functions have gone from #[unstable] to #[stable]
* The uninit function is now deprecated, replaced by its stable counterpart,
  uninitialized

[breaking-change]
2014-05-24 03:21:24 -07:00
bors
12467989c3 auto merge of #14389 : Ryman/rust/14303, r=alexcrichton
Closes #14303.
2014-05-24 01:41:25 -07:00
bors
6cf430147e auto merge of #14388 : kballard/rust/nonfatal_lexer_errors, r=alexcrichton
Most errors that arise in the lexer can be recovered from. This allows
for more than one syntax error to be reported at a time.
2014-05-24 00:01:25 -07:00
bors
3bec8d7246 auto merge of #14384 : luqmana/rust/mca, r=alexcrichton
Only add `-Qunused-arguments` for clang.
2014-05-23 22:06:23 -07:00
Valerii Hiora
41b65d39ab Fixes problems on systems with opaque mutex
On some systems (iOS for example) mutex is represented by
opaque data structure which doesn't play well with simple
data copy. Therefore mutex should be initialized from
magic static value and filled by OS only when it landed RC.
2014-05-24 08:01:23 +03:00
Alex Crichton
2fd4841724 core: Finish stabilizing the mem module.
* All of the *_val functions have gone from #[unstable] to #[stable]
* The overwrite and zeroed functions have gone from #[unstable] to #[stable]
* The uninit function is now deprecated, replaced by its stable counterpart,
  uninitialized

[breaking-change]
2014-05-23 20:55:57 -07:00
bors
9c870b3d1c auto merge of #14306 : luqmana/rust/up-llvm, r=alexcrichton
We can now mark arguments and returns as `nonnull` in LLVM. It's still somewhat limited by the fact that LLVM loses this information after inlining but it might help in certain cases.
2014-05-23 19:51:20 -07:00
Kevin Ballard
4c9dace5d5 Make most lexer errors non-fatal
Most errors that arise in the lexer can be recovered from. This allows
for more than one syntax error to be reported at a time.
2014-05-23 19:35:08 -07:00
Luqman Aden
3cae434f5c librustc: Consolidate the attribute handling for tagging function arguments and returns. 2014-05-23 22:32:30 -04:00
bors
12e80f1a14 auto merge of #14379 : brson/rust/simd, r=alexcrichton
Followup to https://github.com/mozilla/rust/pull/14331 and https://github.com/mozilla/rust/pull/12524
2014-05-23 18:06:19 -07:00
Luqman Aden
69e246fdc9 Add clang specific flag more selectively. 2014-05-23 17:27:13 -07:00
bors
4462687457 auto merge of #14317 : P1start/rust/lifetime-formatting, r=alexcrichton
This changes certain error messages about lifetimes so that they display lifetimes without an `&`.

Fixes #10291.
2014-05-23 16:31:20 -07:00
Brian Anderson
02d1ce830b core: Derive Show on SIMD types 2014-05-23 15:28:30 -07:00
Brian Anderson
eea66e1697 core: Document simd mod 2014-05-23 15:28:30 -07:00
Brian Anderson
8e58ec5b9d std: Move unstable::finally to std::finally. #1457
[breaking-change]
2014-05-23 15:28:27 -07:00
Brian Anderson
1a1e6c8e73 std: Move simd to core::simd and reexport. #1457
[breaking-change]
2014-05-23 15:27:48 -07:00
Brian Anderson
1240197a5b std: Move running_on_valgrind to rt::util. #1457
[breaking-change]
2014-05-23 15:27:48 -07:00