Commit Graph

3596 Commits

Author SHA1 Message Date
Richo Healey
4348e23b26 std: Remove String's to_owned 2014-05-27 11:11:15 -07:00
bors
6fad19e16b auto merge of #14439 : thestinger/rust/nonnull, r=luqmana 2014-05-26 01:51:25 -07:00
Daniel Micay
22ab5303ff handle attributes for non-immediate types first
Slices are non-immediate and were not having these attributes applied.
2014-05-26 03:26:02 -04:00
bors
ba77c60270 auto merge of #14300 : cmr/rust/enum-size-lint, r=kballard
See commits for details.
2014-05-26 00:16:27 -07:00
Daniel Micay
0c51149ac9 mark non-immediate by-value parameters as non-null 2014-05-26 02:59:19 -04:00
Richo Healey
553074506e core: rename strbuf::StrBuf to string::String
[breaking-change]
2014-05-24 21:48:10 -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
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
Luqman Aden
3cae434f5c librustc: Consolidate the attribute handling for tagging function arguments and returns. 2014-05-23 22:32:30 -04:00
bors
c329a1fcdc auto merge of #14313 : kballard/rust/tuple_dotdot_match_ice, r=cmr
Fixes #14308.
2014-05-23 11:46:26 -07:00
bors
ad775be8b4 auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballard
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-23 09:11:26 -07:00
Alex Crichton
33573bc0aa syntax: Clean out obsolete syntax parsing
All of these features have been obsolete since February 2014, where most have
been obsolete since 2013. There shouldn't be any more need to keep around the
parser hacks after this length of time.
2014-05-23 09:07:28 -07:00
Corey Richardson
d8467e23e7 rustc: abstract lint level exporting from EnumSizeVariance 2014-05-22 23:01:47 -07:00
Corey Richardson
c327080ee0 rustc: add a lint for large enum variants
It can be easy to accidentally bloat the size of an enum by making one variant
larger than the others. When this happens, it usually goes unnoticed. This
commit adds a lint that can warn when the largest variant in an enum is more
than 3 times larger than the second-largest variant. This requires a little
bit of rejiggering, because size information is only available in trans, but
lint levels are only available in the lint context.

It is allow by default because it's pretty noisy, and isn't really *that*
undesirable.

Closes #10362
2014-05-22 23:01:47 -07:00
Corey Richardson
f122ad08a5 rustc: middle: ty: use doc comments for the tcx 2014-05-22 22:24:56 -07:00
Corey Richardson
3f8cc1683b rustc: middle: lint: use more doc comments 2014-05-22 22:24:54 -07:00
bors
02117dd1bc auto merge of #14357 : huonw/rust/spelling, r=pnkfelix
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`.

```rust
//! a
//! b

fn bar() {}
```
2014-05-22 20:56:18 -07:00
Luqman Aden
90eeb92e10 Update to LLVM head and mark various ptrs as nonnull. 2014-05-22 21:06:24 -04:00
bors
a0960a1223 auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonw 2014-05-22 16:56:23 -07:00
Patrick Walton
e878721d70 libcore: Remove all uses of ~str from libcore.
[breaking-change]
2014-05-22 14:42:02 -07:00
Patrick Walton
5633d4641f libstd: Remove all uses of ~str from libstd 2014-05-22 14:42:02 -07:00
Patrick Walton
36195eb91f libstd: Remove ~str from all libstd modules except fmt and str. 2014-05-22 14:42:01 -07:00
bors
e402e75f4e auto merge of #14350 : zwarich/rust/let-suggestion, r=pcwalton 2014-05-22 13:31:24 -07:00
Huon Wilson
37bd466e58 Spelling/doc formatting fixes. 2014-05-22 22:55:37 +10: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
Cameron Zwarich
516a177273 Add a suggestion to use a let binding on some borrowck errors. 2014-05-21 22:04:22 -07:00
Alex Crichton
1ccc51ce3b doc: Fix some broken links 2014-05-21 20:33:00 -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
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
Huon Wilson
a239663413 rustc: rename the lint level enum for style.
CamelCase all the way!
2014-05-21 21:50:37 +10: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
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
8505b14b00 rustc: Fix a dynamic borrow error in resolve
Closes #8208
Closes #10980
2014-05-20 21:13:50 -07:00
Alex Crichton
aef1a9c57b rustc: Prevant an out of bounds access in typeck
Closes #7092
2014-05-20 20:39:15 -07:00
Kevin Ballard
0718259ae0 Fix LLVM error with tuple struct match using (..)
Consider PatEnums constructed with A(..) to be candidates for tuple
struct patterns, not just ones constructed with A(a,b,c). If these
patterns shouldn't be valid tuple struct patterns (as they're equivalent
to _), this needs to be caught before we get to trans.

Fixes #14308.
2014-05-20 19:52:43 -07:00
Kevin Ballard
d5b5aa4d4a Fix ICE regarding tuple struct matches using (..)
Fixes half of #14308.
2014-05-20 19:52:39 -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 Butler
f9695a6256 rustc: Better resolve errors for &T, &mut T, remove failure condition. 2014-05-20 01:08:05 +01:00
Alex Crichton
6efd16629c rustc: Add official support for weak failure
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-19 11:04:44 -07:00
bors
5d2edddc30 auto merge of #14288 : zwarich/rust/euv-underscore, r=alexcrichton 2014-05-18 23:01:27 -07:00