Commit Graph

49565 Commits

Author SHA1 Message Date
Steven Fackler
5d2275d53e Implement Any for unsized types
This is a bit weird since unsized types can't be used in trait objects,
but Any is *also* used as pure marker trait since Reflect isn't stable.
There are many cases (e.g. TypeMap) where all you need is a TypeId.
2016-01-14 23:02:32 -08:00
bors
a70a60a02b Auto merge of #30763 - gchp:issue/30033, r=nagisa
This is achieved by adding the scan_back method. This method looks back
through the source_text of the StringReader until it finds the target
char, returning it's offset in the source. We use this method to find
the offset of the opening single quote, and use that offset as the start
of the error.

Given this code:

```rust
fn main() {
    let _ = 'abcd';
}
```

The compiler would give a message like:

```
error: character literal may only contain one codepoint: ';
let _ = 'abcd';
             ^~
```
With this change, the message now displays:

```
error: character literal may only contain one codepoint: 'abcd';
let _ = 'abcd';
        ^~~~~~~
```

Fixes #30033
2016-01-15 06:38:26 +00:00
bors
d8869d3487 Auto merge of #30711 - nrc:json-errs, r=huonw
The compiler can emit errors and warning in JSON format. This is a more easily machine readable form then the usual error output.

Closes #10492, closes #14863.
2016-01-15 01:52:01 +00:00
Nick Cameron
82f8e5ce84 Address reviewer comments
[breaking-change]

`OptLevel` variants are no longer `pub use`ed by rust::session::config. If you are using these variants, you must change your code to prefix the variant name with `OptLevel`.
2016-01-15 14:49:25 +13:00
Luke Jones
52786de3ed Clarify what a crate is, within the "Getting Started" chapter.
* ref: Issue #30825
Small punctuation change in "Crates and Modules".
2016-01-15 14:18:50 +13:00
Jeffrey Seyfried
a353490e6f resolve: Remove record_exports, fixes #4953 2016-01-14 22:51:58 +00:00
Michael Wu
a4f91e5fed Support generic associated consts 2016-01-14 17:35:55 -05:00
bors
2fb0c5ebcf Auto merge of #30916 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30712, #30895, #30902, #30903, #30909, #30910, #30911, #30912, #30914
- Failed merges:
2016-01-14 22:23:59 +00:00
Brian Anderson
ca81d3dddc rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_derive
cc #30346
2016-01-14 22:20:39 +00:00
Nick Cameron
11dcb48c6a Add a test
And fix bustage in make check
2016-01-15 10:24:12 +13:00
Nick Cameron
b976d9e666 Implement JSON error emission
[breaking-change]

syntax::errors::Handler::new has been renamed to with_tty_emitter

Many functions which used to take a syntax::errors::ColorConfig, now take a rustc::session::config::ErrorOutputType. If you previously used ColorConfig::Auto as a default, you should now use ErrorOutputType::default().
2016-01-15 10:24:12 +13:00
Nick Cameron
fd46c78f8f Add an --output option for specifying an error emitter 2016-01-15 10:24:12 +13:00
Nick Cameron
acfccc515b Add a JSON error emitter 2016-01-15 10:20:30 +13:00
bors
c12c42de0a Auto merge of #30913 - brson:nogold, r=alexcrichton
This reverts commit 34dc0e0739.

cc #30783 #30784 #29974

r? @alexcrichton
2016-01-14 20:32:13 +00:00
Steve Klabnik
6ab39ff098 Rollup merge of #30914 - tshepang:easier-description, r=steveklabnik
This function returns the size on the stack, not that of the value
that may be allocated on the heap.
2016-01-14 14:58:35 -05:00
Steve Klabnik
9ffb84a784 Rollup merge of #30912 - tshepang:remove-distraction, r=steveklabnik 2016-01-14 14:58:35 -05:00
Steve Klabnik
9b10d0e1e5 Rollup merge of #30911 - tshepang:missing-word, r=Manishearth
Also, whitespace fixes
2016-01-14 14:58:35 -05:00
Steve Klabnik
958bff100a Rollup merge of #30910 - tshepang:improve-description, r=steveklabnik 2016-01-14 14:58:35 -05:00
Steve Klabnik
b3950b7ca5 Rollup merge of #30909 - tshepang:a-better-name, r=steveklabnik
For a moment, I got confused by thinking the summary was referring to the same `x`
2016-01-14 14:58:34 -05:00
Steve Klabnik
f1a0fd127a Rollup merge of #30903 - steveklabnik:no_std_stable, r=alexcrichton
This feature is partially stabilized, so describe each part in the appropriate place.

r? @alexcrichton @brson

It would be nice to backport this to beta, since this is the first release where this is true. I try really hard to not do doc backports, but this isn't very large, and might be worth making an exception, I dunno.
2016-01-14 14:58:34 -05:00
Steve Klabnik
72ebb193a9 Rollup merge of #30902 - tomaka:patch-1, r=steveklabnik 2016-01-14 14:58:34 -05:00
Steve Klabnik
c88574a32b Rollup merge of #30895 - gchp:contrib, r=alexcrichton
'B' labels are for blockers, not issues which belong elsewhere.

Prompted by this comment on Reddit:
https://www.reddit.com/r/rust/comments/40nzkd/contributing_to_the_rust_compiler_a_short_guide/cyxcjtd
2016-01-14 14:58:34 -05:00
Steve Klabnik
e26279db48 Rollup merge of #30712 - LawrenceWoodman:patch-3, r=steveklabnik
This also repeats the case analysis used.
2016-01-14 14:58:34 -05:00
Tshepang Lekhonkhobe
dfdbbd005a doc: this is more easy to read, and less prone mis-interpretation
This function returns the size on the stack, not that of the value
that may be allocated on the heap.
2016-01-14 21:38:18 +02:00
Brian Anderson
4bcca8bcf7 Revert "Link with ld.gold by default"
This reverts commit 34dc0e0739.
2016-01-14 19:20:11 +00:00
Sébastien Marie
b1d8554698 update blksize_t in raw to reflect libc change under openbsd 2016-01-14 20:15:19 +01:00
Tshepang Lekhonkhobe
f7fb0af729 doc: that suffix serves as mere distraction 2016-01-14 21:08:15 +02:00
Tshepang Lekhonkhobe
049b9e4e80 doc: add missing word
Also, whitespace fixes
2016-01-14 20:56:38 +02:00
Tshepang Lekhonkhobe
80d2be947e doc: "x" is used as variable name on this API, so avoid using it here 2016-01-14 20:54:49 +02:00
Tshepang Lekhonkhobe
7d446ce555 doc: "moves" has a specific meaning in Rust, so avoid using it here 2016-01-14 20:52:51 +02:00
Niko Matsakis
43756934d2 switch the fulfillment context to use the new obligation forest;
this commit won't build because, as of this version, no coinductive
reasoning at all is really supported
2016-01-14 13:00:10 -05:00
Niko Matsakis
0defb158aa implement the obligation forest data structure and add some unit tests 2016-01-14 12:59:50 -05:00
Niko Matsakis
82c43432e0 modify trait checker to track the variables on which trait resolution is
stalled rather than keeping this annoying mark; I checked that the
original compile-time regression that the mark was intended to
fix (https://github.com/rust-lang/rust/issues/18208) was still
reasonable, but I've not done exhaustive measurements to see how
important this "optimization" really is anymore
2016-01-14 12:59:50 -05:00
Vadim Petrochenkov
5f57121fb3 Update libbacktrace to 11b1a9c476b2df514d620d479407f2cf217cb373
Source: https://github.com/gcc-mirror/gcc
2016-01-14 20:58:38 +03:00
Greg Chapple
acc9428c6a Display better snippet for invalid char literal
Given this code:

    fn main() {
        let _ = 'abcd';
    }

The compiler would give a message like:

    error: character literal may only contain one codepoint: ';
    let _ = 'abcd';
                 ^~

With this change, the message now displays:

    error: character literal may only contain one codepoint: 'abcd'
    let _ = 'abcd'
            ^~~~~~

Fixes #30033
2016-01-14 17:34:42 +00:00
tomaka
729e566020 Fix outdated comment 2016-01-14 16:47:29 +01:00
Steve Klabnik
0394418752 Move some #[no_std] info to stable book.
This feature is partially stabilized, so describe each part in the appropriate place.
2016-01-14 10:45:40 -05:00
bors
e5bab5dd00 Auto merge of #30848 - nagisa:mir-no-store-zsts, r=nikomatsakis
Fixes #30831

r? @nikomatsakis
2016-01-14 15:37:07 +00:00
Vadim Petrochenkov
8ea7b88c9b Require stability annotations on fields of tuple variants 2016-01-14 17:08:35 +03:00
Ulrik Sverdrup
cadcd70775 UTF-8 validation: Add missing if conditional for short input
We need to guard that `len` is large enough for the fast skip loop.
2016-01-14 14:59:55 +01:00
bors
02fbf31fb2 Auto merge of #30897 - Manishearth:rollup, r=Manishearth
- Successful merges: #30821, #30869, #30871, #30874, #30879, #30886, #30892
- Failed merges: #30864
2016-01-14 13:42:59 +00:00
Manish Goregaokar
a964c86d45 Rollup merge of #30892 - shepmaster:box-grammar, r=alexcrichton 2016-01-14 19:12:29 +05:30
Manish Goregaokar
92aa326920 Rollup merge of #30886 - ollie27:docs_links, r=steveklabnik
r? @steveklabnik
2016-01-14 19:12:29 +05:30
Manish Goregaokar
f28a43102b Rollup merge of #30879 - durka:collections-range-tracking-issue, r=nagisa
see #27711 and #30877

r? @alexcrichton
2016-01-14 19:12:29 +05:30
Manish Goregaokar
74458cf42a Rollup merge of #30874 - dhuseby:fixing_bitrig_tests, r=alexcrichton
fixes the failing bitrig unit tests.
2016-01-14 19:12:28 +05:30
Manish Goregaokar
9cb4350e63 Rollup merge of #30871 - oli-obk:fix/reference, r=steveklabnik
r? @steveklabnik
2016-01-14 19:12:28 +05:30
Manish Goregaokar
7893031d92 Rollup merge of #30869 - D101101:patch-3, r=huonw
r? @steveklabnik
2016-01-14 19:12:28 +05:30
Manish Goregaokar
07aaca3a07 Rollup merge of #30821 - steveklabnik:gh30819, r=nikomatsakis
Fixes #30819
2016-01-14 19:12:28 +05:30
Greg Chapple
a5836fa48f Fix note about B-prefixed issue labels
'B' labels are for blockers, not issues which belong elsewhere.

Prompted by this comment on Reddit:
https://www.reddit.com/r/rust/comments/40nzkd/contributing_to_the_rust_compiler_a_short_guide/cyxcjtd
2016-01-14 10:47:04 +00:00
bors
5b3a75fe56 Auto merge of #30883 - Manishearth:rollup, r=Manishearth
- Successful merges: #30626, #30662, #30770, #30801, #30818, #30823, #30828, #30835, #30837, #30839, #30845, #30848, #30850, #30851, #30863
- Failed merges:
2016-01-14 06:45:26 +00:00