]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoExpand documentation for IntoInnerError
Steve Klabnik [Mon, 20 Jul 2015 20:46:34 +0000 (16:46 -0400)]
Expand documentation for IntoInnerError

Mostly adding examples.

8 years agoAuto merge of #26887 - andreastt:blur_help_dialogue, r=steveklabnik
bors [Mon, 20 Jul 2015 13:30:15 +0000 (13:30 +0000)]
Auto merge of #26887 - andreastt:blur_help_dialogue, r=steveklabnik

Blurs the document's background when the help dialogue is present,
making the contents of the dialogue stand out more.

8 years agolibrustdoc: blur page when help dialogue is present
Andreas Tolfsen [Wed, 8 Jul 2015 13:52:58 +0000 (14:52 +0100)]
librustdoc: blur page when help dialogue is present

Blurs the document's background when the help dialogue is present,
making the contents of the dialogue stand out more.

8 years agoAuto merge of #27118 - apasel422:issue-20825, r=alexcrichton
bors [Mon, 20 Jul 2015 10:20:58 +0000 (10:20 +0000)]
Auto merge of #27118 - apasel422:issue-20825, r=alexcrichton

closes #20825

8 years agoAuto merge of #27044 - nrc:graphviz-style, r=@pnkfelix
bors [Mon, 20 Jul 2015 07:07:25 +0000 (07:07 +0000)]
Auto merge of #27044 - nrc:graphviz-style, r=@pnkfelix

r? @pnkfelix

8 years agoAuto merge of #27038 - ktossell:narrow_doc_ip_ranges, r=alexcrichton
bors [Mon, 20 Jul 2015 04:52:12 +0000 (04:52 +0000)]
Auto merge of #27038 - ktossell:narrow_doc_ip_ranges, r=alexcrichton

Ipv4Addr::is_documentation() matches 513 /24 blocks when it should only match 3.

8 years agographviz: support style attributes
Nick Cameron [Tue, 14 Jul 2015 22:17:37 +0000 (10:17 +1200)]
graphviz: support style attributes

8 years agoAuto merge of #27132 - apasel422:issue-23491, r=arielb1
bors [Mon, 20 Jul 2015 03:19:12 +0000 (03:19 +0000)]
Auto merge of #27132 - apasel422:issue-23491, r=arielb1

closes #23491

8 years agoAuto merge of #27120 - apasel422:associated-item-error, r=arielb1
bors [Mon, 20 Jul 2015 01:46:20 +0000 (01:46 +0000)]
Auto merge of #27120 - apasel422:associated-item-error, r=arielb1

Previously, these would both be labeled as methods.

8 years agoAuto merge of #27065 - marcusklaas:loop-label, r=nrc
bors [Mon, 20 Jul 2015 00:13:22 +0000 (00:13 +0000)]
Auto merge of #27065 - marcusklaas:loop-label, r=nrc

This closes https://github.com/rust-lang/rust/issues/27042.

I'd love to know if there's a way to make a regression test for this!

8 years agoAuto merge of #27133 - apasel422:issue-15919, r=rollup
bors [Sun, 19 Jul 2015 21:36:39 +0000 (21:36 +0000)]
Auto merge of #27133 - apasel422:issue-15919, r=rollup

closes #15919

8 years agoadd test for #15919
Andrew Paseltiner [Sun, 19 Jul 2015 21:04:31 +0000 (17:04 -0400)]
add test for #15919

closes #15919

8 years agoadd test for #23491
Andrew Paseltiner [Sun, 19 Jul 2015 19:46:57 +0000 (15:46 -0400)]
add test for #23491

closes #23491

8 years agoadd separate errors for out-of-place associated consts and types
Andrew Paseltiner [Sat, 18 Jul 2015 23:56:15 +0000 (19:56 -0400)]
add separate errors for out-of-place associated consts and types

Previously, these would both be labeled as methods.

8 years agoAuto merge of #27110 - arthurprs:optintstr, r=Gankro
bors [Sun, 19 Jul 2015 19:04:15 +0000 (19:04 +0000)]
Auto merge of #27110 - arthurprs:optintstr, r=Gankro

I wrote a reasonably optimized version for both functions. Further optimizations are possible but I tried to keep the code size small (which I think is important), it's a road of diminished gains.

The repository used for testing/benchmarks is https://github.com/arthurprs/rust-optimized-inttostr

Benchmarks are ran for 3 different distributions, bellow are string length histograms for the u32 type

* _h (big numbers skew)
[0, 0, 5, 29, 103, 212, 551, 1138, 1887, 3196, 2879]
* _m (slight small number skew):
[0, 2807, 1334, 1057, 905, 821, 772, 707, 627, 605, 365]
* _l (small numbers skew):
[0, 8004, 567, 351, 248, 212, 170, 126, 136, 112, 74]

Tested processors are
* x64 laptop (i7-2670QM)
* x32 server (Digital Ocean E5-2630L-v2)

### Display

It uses a small look up table (200 bytes) and decode up to 4 characters at a time. I also took special precautions to reduce 64bit arithmetic on 32bit architectures and the gains are huge in these cases.

Overall, on modern 64bit CPUs it's pretty much the same speed as the stdlib implementation for very small numbers (0..99), but pulls ahead as the length of the decimal increases. On slight older CPUs (w/ worse ALUs) or 32bit architectures it's pretty much always faster.

x64 benchmarks
```
test bench::display_h_new_u08     ... bench:      71,041 ns/iter (+/- 2,894)
test bench::display_h_new_u16     ... bench:     378,255 ns/iter (+/- 36,547)
test bench::display_h_new_u32     ... bench:   4,232,483 ns/iter (+/- 509,661)
test bench::display_h_new_u64     ... bench:   5,166,740 ns/iter (+/- 421,124)
test bench::display_h_stdlib_u08  ... bench:      73,536 ns/iter (+/- 5,287)
test bench::display_h_stdlib_u16  ... bench:     451,443 ns/iter (+/- 16,879)
test bench::display_h_stdlib_u32  ... bench:   5,551,070 ns/iter (+/- 518,151)
test bench::display_h_stdlib_u64  ... bench:   8,624,374 ns/iter (+/- 643,701)
test bench::display_l_new_u08     ... bench:      71,547 ns/iter (+/- 504)
test bench::display_l_new_u16     ... bench:     399,727 ns/iter (+/- 28,030)
test bench::display_l_new_u32     ... bench:   4,365,303 ns/iter (+/- 414,414)
test bench::display_l_new_u64     ... bench:   5,302,382 ns/iter (+/- 292,324)
test bench::display_l_stdlib_u08  ... bench:      75,445 ns/iter (+/- 2,487)
test bench::display_l_stdlib_u16  ... bench:     444,313 ns/iter (+/- 16,203)
test bench::display_l_stdlib_u32  ... bench:   5,761,801 ns/iter (+/- 387,186)
test bench::display_l_stdlib_u64  ... bench:   8,790,365 ns/iter (+/- 614,846)
test bench::display_m_new_u08     ... bench:      71,820 ns/iter (+/- 2,956)
test bench::display_m_new_u16     ... bench:     399,649 ns/iter (+/- 20,643)
test bench::display_m_new_u32     ... bench:   4,355,561 ns/iter (+/- 179,189)
test bench::display_m_new_u64     ... bench:   5,070,594 ns/iter (+/- 341,950)
test bench::display_m_stdlib_u08  ... bench:      74,900 ns/iter (+/- 1,909)
test bench::display_m_stdlib_u16  ... bench:     448,788 ns/iter (+/- 20,791)
test bench::display_m_stdlib_u32  ... bench:   5,717,939 ns/iter (+/- 316,824)
test bench::display_m_stdlib_u64  ... bench:   8,787,160 ns/iter (+/- 482,864)
```

x86 benchmarks
```
test bench::display_h_new_u08     ... bench:      94,246 ns/iter (+/- 34,872)
test bench::display_h_new_u16     ... bench:     533,805 ns/iter (+/- 22,499)
test bench::display_h_new_u32     ... bench:   6,127,747 ns/iter (+/- 2,192,789)
test bench::display_h_new_u64     ... bench:  14,994,203 ns/iter (+/- 1,609,345)
test bench::display_h_stdlib_u08  ... bench:     107,233 ns/iter (+/- 8,571)
test bench::display_h_stdlib_u16  ... bench:     631,186 ns/iter (+/- 11,332)
test bench::display_h_stdlib_u32  ... bench:   7,696,344 ns/iter (+/- 957,917)
test bench::display_h_stdlib_u64  ... bench:  45,677,401 ns/iter (+/- 4,991,344)
test bench::display_l_new_u08     ... bench:      95,855 ns/iter (+/- 27,735)
test bench::display_l_new_u16     ... bench:     532,084 ns/iter (+/- 40,479)
test bench::display_l_new_u32     ... bench:   5,973,953 ns/iter (+/- 211,676)
test bench::display_l_new_u64     ... bench:  14,773,064 ns/iter (+/- 1,276,579)
test bench::display_l_stdlib_u08  ... bench:     106,350 ns/iter (+/- 63,963)
test bench::display_l_stdlib_u16  ... bench:     637,746 ns/iter (+/- 101,005)
test bench::display_l_stdlib_u32  ... bench:   7,740,640 ns/iter (+/- 848,478)
test bench::display_l_stdlib_u64  ... bench:  44,846,932 ns/iter (+/- 4,514,694)
test bench::display_m_new_u08     ... bench:      94,549 ns/iter (+/- 13,029)
test bench::display_m_new_u16     ... bench:     546,030 ns/iter (+/- 35,804)
test bench::display_m_new_u32     ... bench:   5,983,924 ns/iter (+/- 1,180,559)
test bench::display_m_new_u64     ... bench:  14,817,873 ns/iter (+/- 2,271,464)
test bench::display_m_stdlib_u08  ... bench:     107,806 ns/iter (+/- 8,805)
test bench::display_m_stdlib_u16  ... bench:     630,714 ns/iter (+/- 6,586)
test bench::display_m_stdlib_u32  ... bench:   7,784,210 ns/iter (+/- 358,601)
test bench::display_m_stdlib_u64  ... bench:  46,223,927 ns/iter (+/- 6,553,176)
```

### from_str_radix (FromStr)

All valid digits are ascii so I modified the function to use the underlining bytes instead and simplified the match to avoid wasting cycles.

x64 benchmarks
```
test bench::from_str_h_new_u08    ... bench:      28,153 ns/iter (+/- 624)
test bench::from_str_h_new_u16    ... bench:     223,513 ns/iter (+/- 11,554)
test bench::from_str_h_new_u32    ... bench:   3,098,935 ns/iter (+/- 231,022)
test bench::from_str_h_new_u64    ... bench:   5,009,900 ns/iter (+/- 341,961)
test bench::from_str_h_stdlib_u08 ... bench:      34,033 ns/iter (+/- 2,068)
test bench::from_str_h_stdlib_u16 ... bench:     248,785 ns/iter (+/- 14,208)
test bench::from_str_h_stdlib_u32 ... bench:   4,150,536 ns/iter (+/- 266,070)
test bench::from_str_h_stdlib_u64 ... bench:   6,817,997 ns/iter (+/- 449,838)
test bench::from_str_l_new_u08    ... bench:      27,552 ns/iter (+/- 1,500)
test bench::from_str_l_new_u16    ... bench:     234,360 ns/iter (+/- 13,144)
test bench::from_str_l_new_u32    ... bench:   3,140,261 ns/iter (+/- 248,175)
test bench::from_str_l_new_u64    ... bench:   5,176,583 ns/iter (+/- 350,416)
test bench::from_str_l_stdlib_u08 ... bench:      35,060 ns/iter (+/- 2,154)
test bench::from_str_l_stdlib_u16 ... bench:     252,135 ns/iter (+/- 23,461)
test bench::from_str_l_stdlib_u32 ... bench:   4,154,599 ns/iter (+/- 369,606)
test bench::from_str_l_stdlib_u64 ... bench:   6,892,767 ns/iter (+/- 213,030)
test bench::from_str_m_new_u08    ... bench:      28,252 ns/iter (+/- 1,384)
test bench::from_str_m_new_u16    ... bench:     231,051 ns/iter (+/- 16,540)
test bench::from_str_m_new_u32    ... bench:   3,166,504 ns/iter (+/- 134,418)
test bench::from_str_m_new_u64    ... bench:   5,103,195 ns/iter (+/- 218,912)
test bench::from_str_m_stdlib_u08 ... bench:      35,012 ns/iter (+/- 2,735)
test bench::from_str_m_stdlib_u16 ... bench:     250,967 ns/iter (+/- 14,708)
test bench::from_str_m_stdlib_u32 ... bench:   4,101,845 ns/iter (+/- 205,802)
test bench::from_str_m_stdlib_u64 ... bench:   6,823,001 ns/iter (+/- 267,215)
```

x86 benchmarks
```
test bench::from_str_h_new_u08    ... bench:      23,682 ns/iter (+/- 3,590)
test bench::from_str_h_new_u16    ... bench:     190,916 ns/iter (+/- 29,688)
test bench::from_str_h_new_u32    ... bench:   2,649,952 ns/iter (+/- 308,576)
test bench::from_str_h_new_u64    ... bench:  23,458,434 ns/iter (+/- 2,327,427)
test bench::from_str_h_stdlib_u08 ... bench:      45,551 ns/iter (+/- 6,968)
test bench::from_str_h_stdlib_u16 ... bench:     313,739 ns/iter (+/- 17,175)
test bench::from_str_h_stdlib_u32 ... bench:   4,615,669 ns/iter (+/- 470,766)
test bench::from_str_h_stdlib_u64 ... bench:  30,589,482 ns/iter (+/- 2,278,996)
test bench::from_str_l_new_u08    ... bench:      23,763 ns/iter (+/- 5,545)
test bench::from_str_l_new_u16    ... bench:     185,472 ns/iter (+/- 33,097)
test bench::from_str_l_new_u32    ... bench:   2,691,307 ns/iter (+/- 473,886)
test bench::from_str_l_new_u64    ... bench:  22,952,593 ns/iter (+/- 1,963,742)
test bench::from_str_l_stdlib_u08 ... bench:      45,285 ns/iter (+/- 16,337)
test bench::from_str_l_stdlib_u16 ... bench:     313,624 ns/iter (+/- 6,643)
test bench::from_str_l_stdlib_u32 ... bench:   4,595,679 ns/iter (+/- 1,876,361)
test bench::from_str_l_stdlib_u64 ... bench:  30,434,683 ns/iter (+/- 1,901,996)
test bench::from_str_m_new_u08    ... bench:      23,812 ns/iter (+/- 1,505)
test bench::from_str_m_new_u16    ... bench:     185,553 ns/iter (+/- 19,788)
test bench::from_str_m_new_u32    ... bench:   2,614,920 ns/iter (+/- 66,230)
test bench::from_str_m_new_u64    ... bench:  23,241,778 ns/iter (+/- 3,474,077)
test bench::from_str_m_stdlib_u08 ... bench:      45,634 ns/iter (+/- 1,436)
test bench::from_str_m_stdlib_u16 ... bench:     316,479 ns/iter (+/- 21,212)
test bench::from_str_m_stdlib_u32 ... bench:   4,609,147 ns/iter (+/- 487,068)
test bench::from_str_m_stdlib_u64 ... bench:  30,165,173 ns/iter (+/- 1,601,830)
```

8 years agoAuto merge of #27100 - tshepang:better-names, r=Gankro
bors [Sun, 19 Jul 2015 16:33:43 +0000 (16:33 +0000)]
Auto merge of #27100 - tshepang:better-names, r=Gankro

8 years agoAuto merge of #27111 - AlisdairO:diagnostics253, r=Manishearth
bors [Sun, 19 Jul 2015 14:06:22 +0000 (14:06 +0000)]
Auto merge of #27111 - AlisdairO:diagnostics253, r=Manishearth

As per topic :-).

Part of #24407.
r? @Manishearth

8 years agooptimize from_str_radix
arthurprs [Sat, 18 Jul 2015 21:59:38 +0000 (18:59 -0300)]
optimize from_str_radix

8 years agoAuto merge of #27101 - steveklabnik:doc_no_mutability_root, r=Gankro
bors [Sun, 19 Jul 2015 12:31:35 +0000 (12:31 +0000)]
Auto merge of #27101 - steveklabnik:doc_no_mutability_root, r=Gankro

And some other outdated language. @echochamber came asking about these docs
on IRC today, and they're a bit weird. I've updated them to be less ambiguous
and use contemporary terminology.

8 years agoAuto merge of #27099 - AlisdairO:diagnostics3, r=Manishearth
bors [Sun, 19 Jul 2015 09:01:20 +0000 (09:01 +0000)]
Auto merge of #27099 - AlisdairO:diagnostics3, r=Manishearth

Per the title.  I've linked to the reference at http://doc.rust-lang.org/reference.html#type-parameters-1, but I'm not sure that's such a good link - but there doesn't seem to be a great deal of explanation elsewhere in the reference either...

8 years agoreplace word function with method
Alisdair Owens [Sun, 19 Jul 2015 08:59:43 +0000 (09:59 +0100)]
replace word function with method

8 years agoAuto merge of #27121 - apasel422:issue-21332, r=Gankro
bors [Sun, 19 Jul 2015 07:26:24 +0000 (07:26 +0000)]
Auto merge of #27121 - apasel422:issue-21332, r=Gankro

closes #21332

8 years agodoc: use 'index' and 'value' in place of 'i' and 't'
Tshepang Lekhonkhobe [Fri, 17 Jul 2015 19:28:25 +0000 (21:28 +0200)]
doc: use 'index' and 'value' in place of 'i' and 't'

8 years agoAuto merge of #27122 - nham:tweak-cow-docs, r=Gankro
bors [Sun, 19 Jul 2015 04:56:33 +0000 (04:56 +0000)]
Auto merge of #27122 - nham:tweak-cow-docs, r=Gankro

It seems slightly more consistent to say 'Clones' here instead of 'Copies'. The docs for the `ToOwned` trait talk about cloning and not copying.

8 years ago'Copies' => 'Clones' in Cow method docs.
Nick Hamann [Sun, 19 Jul 2015 03:54:55 +0000 (22:54 -0500)]
'Copies' => 'Clones' in Cow method docs.

It seems slightly more consistent to say 'Clones' here instead of 'Copies'.
The docs for the `ToOwned` trait talk about cloning and not copying.

8 years agosplit "has incompatible type for trait" errors into multiple lines
Andrew Paseltiner [Sun, 19 Jul 2015 01:14:36 +0000 (21:14 -0400)]
split "has incompatible type for trait" errors into multiple lines

closes #21332

8 years agoFix documentation IP ranges: e.g., 192.0.2.* instead of 192.*.2.*.
Ken Tossell [Tue, 14 Jul 2015 01:28:29 +0000 (21:28 -0400)]
Fix documentation IP ranges: e.g., 192.0.2.* instead of 192.*.2.*.

Add Ipv4Addr tests to verify doc address checking.

8 years agooptimize integer formatting
arthurprs [Sat, 18 Jul 2015 21:58:42 +0000 (18:58 -0300)]
optimize integer formatting

8 years agoAuto merge of #27117 - apasel422:issue-14821, r=Gankro
bors [Sat, 18 Jul 2015 22:41:29 +0000 (22:41 +0000)]
Auto merge of #27117 - apasel422:issue-14821, r=Gankro

closes #14821

8 years agoadd tests for #20825
Andrew Paseltiner [Sat, 18 Jul 2015 22:03:30 +0000 (18:03 -0400)]
add tests for #20825

closes #20825

8 years agoadd test for #14821
Andrew Paseltiner [Sat, 18 Jul 2015 21:40:15 +0000 (17:40 -0400)]
add test for #14821

closes #14821

8 years agooops, forgot to fix method name
Alisdair Owens [Sat, 18 Jul 2015 19:46:47 +0000 (20:46 +0100)]
oops, forgot to fix method name

8 years agoFix to 80 char width, change to single space after period
Alisdair Owens [Sat, 18 Jul 2015 19:34:12 +0000 (20:34 +0100)]
Fix to 80 char width, change to single space after period

8 years agofix up crate/trait discrepancy, clarify language
Alisdair Owens [Sat, 18 Jul 2015 19:26:08 +0000 (20:26 +0100)]
fix up crate/trait discrepancy, clarify language

8 years agoAdd details on PhantomData
Alisdair Owens [Sat, 18 Jul 2015 17:42:00 +0000 (18:42 +0100)]
Add details on PhantomData

8 years agoAdd diagnostics for E0253
Alisdair Owens [Sat, 18 Jul 2015 16:25:29 +0000 (17:25 +0100)]
Add diagnostics for E0253

8 years agoAuto merge of #27096 - apasel422:issue-26217, r=nikomatsakis
bors [Sat, 18 Jul 2015 11:02:58 +0000 (11:02 +0000)]
Auto merge of #27096 - apasel422:issue-26217, r=nikomatsakis

closes #26217

r? @nikomatsakis

8 years agoInclude label in the span of loops
Marcus Klaas [Thu, 16 Jul 2015 07:22:57 +0000 (09:22 +0200)]
Include label in the span of loops

8 years agoAuto merge of #27088 - tamird:fix-ios-build, r=alexcrichton
bors [Sat, 18 Jul 2015 08:25:10 +0000 (08:25 +0000)]
Auto merge of #27088 - tamird:fix-ios-build, r=alexcrichton

Fixes #26939.

8 years agoAuto merge of #27085 - Ryman:gh17546, r=alexcrichton
bors [Sat, 18 Jul 2015 06:02:50 +0000 (06:02 +0000)]
Auto merge of #27085 - Ryman:gh17546, r=alexcrichton

This also changes how variant values are printed in errors, they are no
longer printed in their parent scope. As far as I can tell, this is
leftover from pre-namespacing of enums.

Closes #17546.

8 years agoAuto merge of #27074 - steveklabnik:gh27014, r=alexcrichton
bors [Sat, 18 Jul 2015 03:42:01 +0000 (03:42 +0000)]
Auto merge of #27074 - steveklabnik:gh27014, r=alexcrichton

Fixes #27014

r? @alexcrichton

I'm not 100% sure there's not a better way to do this, but it works.

Also, I wasn't sure how, where, or if to write a test for this.

8 years agoAuto merge of #26955 - Gankro:raw-vec, r=bluss,alexcrichton
bors [Fri, 17 Jul 2015 23:58:52 +0000 (23:58 +0000)]
Auto merge of #26955 - Gankro:raw-vec, r=bluss,alexcrichton

Per the top level comment:

A low-level utility for more ergonomically allocating, reallocating, and deallocating a
a buffer of memory on the heap without having to worry about all the corner cases
involved. This type is excellent for building your own data structures like Vec and VecDeque.
In particular:

* Produces heap::EMPTY on zero-sized types
* Produces heap::EMPTY on zero-length allocations
* Catches all overflows in capacity computations (promotes them to "capacity overflow" panics)
* Guards against 32-bit systems allocating more than isize::MAX bytes
* Guards against overflowing your length
* Aborts on OOM
* Avoids freeing heap::EMPTY
* Contains a ptr::Unique and thus endows the user with all related benefits

This type does not in anyway inspect the memory that it manages. When dropped it *will*
free its memory, but it *won't* try to Drop its contents. It is up to the user of RawVec
to handle the actual things *stored* inside of a RawVec.

Note that a RawVec always forces its capacity to be usize::MAX for zero-sized types.
This enables you to use capacity growing logic catch the overflows in your length
that might occur with zero-sized types.

However this means that you need to be careful when roundtripping this type
with a `Box<[T]>`: `cap()` won't yield the len. However `with_capacity`,
`shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
field. This allows zero-sized types to not be special-cased by consumers of
this type.

Edit:
fixes #18726 and fixes #23842

8 years agoRemove confusing 'mutability root' term
Steve Klabnik [Fri, 17 Jul 2015 22:50:42 +0000 (18:50 -0400)]
Remove confusing 'mutability root' term

And some other outdated language. @echochamber came asking about these docs
on IRC today, and they're a bit weird. I've updated them to be less ambiguous
and use contemporary terminology.

8 years agoAuto merge of #27098 - Manishearth:rollup, r=Manishearth
bors [Fri, 17 Jul 2015 22:27:37 +0000 (22:27 +0000)]
Auto merge of #27098 - Manishearth:rollup, r=Manishearth

- Successful merges: #26777, #27067, #27071, #27081, #27091, #27094, #27095
- Failed merges:

8 years agonit
Manish Goregaokar [Fri, 17 Jul 2015 21:36:35 +0000 (03:06 +0530)]
nit

8 years agoRollup merge of #27095 - tshepang:space, r=alexcrichton
Manish Goregaokar [Sat, 18 Jul 2015 02:43:16 +0000 (08:13 +0530)]
Rollup merge of #27095 - tshepang:space, r=alexcrichton

8 years agoRollup merge of #27094 - tamird:DRY-search-focus, r=brson
Manish Goregaokar [Sat, 18 Jul 2015 02:43:16 +0000 (08:13 +0530)]
Rollup merge of #27094 - tamird:DRY-search-focus, r=brson

Following up on comment from #26977.

r? @brson

8 years agoRollup merge of #27091 - steveklabnik:doc_tests_glob, r=Gankro
Manish Goregaokar [Sat, 18 Jul 2015 02:43:16 +0000 (08:13 +0530)]
Rollup merge of #27091 - steveklabnik:doc_tests_glob, r=Gankro

Globs used to be a feature you'd turn on, but now they're not, so this sounds
a bit odd.

8 years agoRollup merge of #27081 - rick68:patch-15, r=alexcrichton
Manish Goregaokar [Sat, 18 Jul 2015 02:43:16 +0000 (08:13 +0530)]
Rollup merge of #27081 - rick68:patch-15, r=alexcrichton

improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.

8 years agoRollup merge of #27071 - AlisdairO:diagnostics, r=Manishearth
Manish Goregaokar [Sat, 18 Jul 2015 02:43:15 +0000 (08:13 +0530)]
Rollup merge of #27071 - AlisdairO:diagnostics, r=Manishearth

Added some detailed diagnostics for E0364 and E0365.

8 years agoRollup merge of #27067 - GuillaumeGomez:patch-1, r=cmr
Manish Goregaokar [Sat, 18 Jul 2015 02:43:15 +0000 (08:13 +0530)]
Rollup merge of #27067 - GuillaumeGomez:patch-1, r=cmr

Now the macro argument list can be finished by a comma (not sure this is correct english...).

cc @tamird
r? @bluss

8 years agoRollup merge of #26777 - barosl:macro-doc-escapes, r=pnkfelix
Manish Goregaokar [Sat, 18 Jul 2015 02:43:15 +0000 (08:13 +0530)]
Rollup merge of #26777 - barosl:macro-doc-escapes, r=pnkfelix

Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE.

Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways.

Fixes #25929.
Fixes #25943.

8 years agoAdd diagnostics for E0392
Alisdair Owens [Fri, 17 Jul 2015 21:20:53 +0000 (22:20 +0100)]
Add diagnostics for E0392

8 years agoWrite diagnostics for E0364 and E0365
Alisdair Owens [Thu, 16 Jul 2015 18:21:11 +0000 (19:21 +0100)]
Write diagnostics for E0364 and E0365

8 years agoclarify that `T` does not contain `'a`
Andrew Paseltiner [Fri, 17 Jul 2015 20:02:43 +0000 (16:02 -0400)]
clarify that `T` does not contain `'a`

8 years agotreat `for<'a> T: 'a` as `T: 'static`
Andrew Paseltiner [Fri, 17 Jul 2015 17:46:33 +0000 (13:46 -0400)]
treat `for<'a> T: 'a` as `T: 'static`

closes #26217

8 years agodoc: add missing space
Tshepang Lekhonkhobe [Fri, 17 Jul 2015 18:55:11 +0000 (20:55 +0200)]
doc: add missing space

8 years agoAuto merge of #27045 - nikomatsakis:better-object-defaults-error, r=pnkfelix
bors [Fri, 17 Jul 2015 18:35:50 +0000 (18:35 +0000)]
Auto merge of #27045 - nikomatsakis:better-object-defaults-error, r=pnkfelix

Transition to the new object lifetime defaults, replacing the old defaults completely.

r? @pnkfelix

This is a [breaking-change] as specified by [RFC 1156][1156] (though all cases that would break should have been receiving warnings starting in Rust 1.2). Types like `&'a Box<Trait>` (or `&'a Rc<Trait>`, etc) will change from being interpreted as `&'a Box<Trait+'a>` to `&'a Box<Trait+'static>`. To restore the old behavior, write the `+'a` explicitly. For example, the function:

```rust
trait Trait { }
fn foo(x: &Box<Trait>) { ... }
```

would be rewritten as:

```rust
trait Trait { }
fn foo(x: &'a Box<Trait+'a>) { ... }
```

if one wanted to preserve the current typing.

[1156]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md

8 years agoDRY
Tamir Duberstein [Fri, 17 Jul 2015 18:35:09 +0000 (14:35 -0400)]
DRY

8 years agofix pretty printers to handle new Vec
Alexis Beingessner [Fri, 17 Jul 2015 17:41:32 +0000 (10:41 -0700)]
fix pretty printers to handle new Vec

8 years agoClean up some wording around globs.
Steve Klabnik [Fri, 17 Jul 2015 17:15:06 +0000 (13:15 -0400)]
Clean up some wording around globs.

Globs used to be a feature you'd turn on, but now they're not, so this sounds
a bit odd.

8 years agoAuto merge of #27076 - alexcrichton:update-llvm, r=brson
bors [Fri, 17 Jul 2015 16:18:52 +0000 (16:18 +0000)]
Auto merge of #27076 - alexcrichton:update-llvm, r=brson

LLVM has recently created their 3.7 release branch, and this PR updates us to that point. This should hopefully mean that we're basically compatible with the upcoming 3.7 release. Additionally, there are a number of goodies on this branch.

* This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957
  which should help us bootstrap farther on 32-bit MSVC targets.
* There is better support for writing multiple flavors of archives, allowing us
  to use the built-in LLVM support instead of the system `ar` on all current
  platforms of the compiler.
* This LLVM has SafeStack support
* An [optimization patch](https://github.com/rust-lang/llvm/commit/7cf5e26e18f7d2d8db09c83c76dd727535f281ab) by @pcwalton is included.
* A number of other minor test fixes here and there.

Due to problems dealing with the data layout we pass to LLVM, this PR also takes the time to clean up how we specific this. We no longer specify a data layout to LLVM by default and instead take the default for the target from LLVM to pass to the module that we're building. This should be more robust going into the future, and I'm also not sure we know what any of these arcane strings are any more...

8 years ago[ios] std: avoid `result::fold`
Tamir Duberstein [Fri, 17 Jul 2015 14:05:55 +0000 (10:05 -0400)]
[ios] std: avoid `result::fold`

8 years agoAdd RawVec to unify raw Vecish code
Alexis Beingessner [Fri, 10 Jul 2015 04:57:21 +0000 (21:57 -0700)]
Add RawVec to unify raw Vecish code

8 years agotest: Ignore a failing test on LLDB
Alex Crichton [Fri, 17 Jul 2015 15:28:08 +0000 (08:28 -0700)]
test: Ignore a failing test on LLDB

Re-enabling it is tracked in #27089

8 years agoMerge branch 'generic-enum-disr-fix' of https://github.com/michaelwoerister/rust...
Alex Crichton [Fri, 17 Jul 2015 15:24:11 +0000 (08:24 -0700)]
Merge branch 'generic-enum-disr-fix' of https://github.com/michaelwoerister/rust into update-llvm

8 years agoImprove error message for variant values used as types
Kevin Butler [Fri, 17 Jul 2015 14:16:22 +0000 (15:16 +0100)]
Improve error message for variant values used as types

This also changes how variant values are printed in errors, they are no
longer printed in their parent scope. As far as I can tell, this is
leftover from pre-namespacing of enums.

Closes #17546.

8 years agoAuto merge of #27082 - Manishearth:rollup, r=Manishearth
bors [Fri, 17 Jul 2015 10:26:31 +0000 (10:26 +0000)]
Auto merge of #27082 - Manishearth:rollup, r=Manishearth

- Successful merges: #25993, #27038, #27069, #27070, #27080
- Failed merges: #27034, #27064

8 years agoRollup merge of #27080 - soderstroff:kristof-patch, r=Gankro
Manish Goregaokar [Fri, 17 Jul 2015 13:36:25 +0000 (19:06 +0530)]
Rollup merge of #27080 - soderstroff:kristof-patch, r=Gankro

I fixed a single character typo.
r? @steveklabnik

8 years agoRollup merge of #27069 - Eljay:fix-raw-attr-typo, r=alexcrichton
Manish Goregaokar [Fri, 17 Jul 2015 13:36:24 +0000 (19:06 +0530)]
Rollup merge of #27069 - Eljay:fix-raw-attr-typo, r=alexcrichton

Pretty sure this should apply to the module.

r? @alexcrichton

8 years agoRollup merge of #25993 - nham:fix_23969, r=nikomatsakis
Manish Goregaokar [Fri, 17 Jul 2015 13:36:23 +0000 (19:06 +0530)]
Rollup merge of #25993 - nham:fix_23969, r=nikomatsakis

Adds two error codes, one for duplicate associated constants and one for types. I'm not certain these should each have their own code, but E0201 is already solely for duplicate associated functions so at least it kinda matches. This will lead to somewhat redundant error explanations, but that's nothing new!

Fixes #23969.

8 years agoImprove register_long_diagnostics macro
Guillaume Gomez [Fri, 17 Jul 2015 09:21:05 +0000 (11:21 +0200)]
Improve register_long_diagnostics macro

8 years agoUpdate vec.rs
Wei-Ming Yang [Fri, 17 Jul 2015 07:47:14 +0000 (15:47 +0800)]
Update vec.rs

improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.

8 years agoAuto merge of #27066 - rust-lang:rollup_central, r=steveklabnik
bors [Fri, 17 Jul 2015 05:31:15 +0000 (05:31 +0000)]
Auto merge of #27066 - rust-lang:rollup_central, r=steveklabnik

Everything on this branch has passed check-stage2 on linux.

This is a temporary integration branch until [our buildbot problems](https://internals.rust-lang.org/t/buildbot-is-down-for-a-bit/2365/3) get fixed.
As the day progresses I'll merge more PRs into this branch once I get them through make check.

This branch isn't complete, keeping it up here so more people can merge PRs into integration if they want.

r? @Manishearth

8 years agoFixed typo
Kristof Söderström [Fri, 17 Jul 2015 03:43:36 +0000 (20:43 -0700)]
Fixed typo

8 years agotrans: Clean up handling the LLVM data layout
Alex Crichton [Thu, 16 Jul 2015 22:48:16 +0000 (15:48 -0700)]
trans: Clean up handling the LLVM data layout

Turns out for OSX our data layout was subtly wrong and the LLVM update must have
exposed this. Instead of fixing this I've removed all data layouts from the
compiler to just use the defaults that LLVM provides for all targets. All data
layouts (and a number of dead modules) are removed from the compiler here.
Custom target specifications can still provide a custom data layout, but it is
now an optional key as the default will be used if one isn't specified.

8 years agotrans: Add kind to writeArchive
Alex Crichton [Thu, 16 Jul 2015 07:11:09 +0000 (00:11 -0700)]
trans: Add kind to writeArchive

Updates our LLVM bindings to be able to write out multiple kinds of archives.
This commit also enables using LLVM instead of the system ar on all current
targets.

8 years agorustc_trans: Update LLVMBuildLandingPad signature
Alex Crichton [Tue, 30 Jun 2015 15:56:56 +0000 (08:56 -0700)]
rustc_trans: Update LLVMBuildLandingPad signature

The C API of this function changed so it no longer takes a personality function.
A shim was introduced to call the right LLVM function (depending on which
version we're compiled against) to set the personality function on the outer
function.

The compiler only ever sets one personality function for all generated
functions, so this should be equivalent.

8 years agort: Move personality to functions from their landing pads
Richo Healey [Sat, 27 Jun 2015 21:39:22 +0000 (14:39 -0700)]
rt: Move personality to functions from their landing pads

This is for llvm/cc714e214298cfbf11de65b46de31900d51422cf

8 years agoUpdate LLVM
Alex Crichton [Tue, 30 Jun 2015 15:18:44 +0000 (08:18 -0700)]
Update LLVM

There's a number of goodies in this LLVM update:

* This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957
  which should help us bootstrap farther on 32-bit MSVC targets.
* There is better support for writing multiple flavors of archives, allowing us
  to use the built-in LLVM support instead of the system `ar` on all current
  platforms of the compiler.
* A number of other minor bug fixes and performance improvements to unblock
  various other pieces of work.

8 years agorustdoc: properly capture rustc output
Steve Klabnik [Thu, 16 Jul 2015 19:54:15 +0000 (15:54 -0400)]
rustdoc: properly capture rustc output

When rustc gives an error, there's a ton of extra output from the panic.
Now, we use monitor() to supress the excess output.

Fixes #27014

9 years agoMerge branch 'fix-26673' of https://github.com/nhowell/rust into rollup_central
Steve Klabnik [Thu, 16 Jul 2015 21:55:19 +0000 (17:55 -0400)]
Merge branch 'fix-26673' of https://github.com/nhowell/rust into rollup_central

9 years agoMerge branch 'more-ref-fixes' of https://github.com/tshepang/rust into rollup_central
Steve Klabnik [Thu, 16 Jul 2015 21:55:07 +0000 (17:55 -0400)]
Merge branch 'more-ref-fixes' of https://github.com/tshepang/rust into rollup_central

9 years agoMerge branch 'coercions' of https://github.com/tshepang/rust into rollup_central
Steve Klabnik [Thu, 16 Jul 2015 21:54:57 +0000 (17:54 -0400)]
Merge branch 'coercions' of https://github.com/tshepang/rust into rollup_central

9 years agoMerge branch 'doc_io_traits_enums' of https://github.com/steveklabnik/rust into rollu...
Steve Klabnik [Thu, 16 Jul 2015 21:54:44 +0000 (17:54 -0400)]
Merge branch 'doc_io_traits_enums' of https://github.com/steveklabnik/rust into rollup_central

9 years agoMerge branch 'nopacked' of https://github.com/Stebalien/rust into rollup_central
Steve Klabnik [Thu, 16 Jul 2015 21:53:49 +0000 (17:53 -0400)]
Merge branch 'nopacked' of https://github.com/Stebalien/rust into rollup_central

9 years agoMerge branch 'uint-usize-rustc-docs' of https://github.com/nham/rust into rollup_central
Steve Klabnik [Thu, 16 Jul 2015 21:53:39 +0000 (17:53 -0400)]
Merge branch 'uint-usize-rustc-docs' of https://github.com/nham/rust into rollup_central

9 years agoMerge branch 'fix/doc/rel-prev-next' of https://github.com/vincentbernat/rust into...
Steve Klabnik [Thu, 16 Jul 2015 21:53:26 +0000 (17:53 -0400)]
Merge branch 'fix/doc/rel-prev-next' of https://github.com/vincentbernat/rust into rollup_central

9 years agoMore docs for std::io free functions.
Steve Klabnik [Fri, 10 Jul 2015 17:49:12 +0000 (13:49 -0400)]
More docs for std::io free functions.

9 years agoMore docs for std::io::Write
Steve Klabnik [Thu, 9 Jul 2015 21:13:32 +0000 (17:13 -0400)]
More docs for std::io::Write

9 years agoMore docs for std::io::Seek
Steve Klabnik [Thu, 9 Jul 2015 20:34:32 +0000 (16:34 -0400)]
More docs for std::io::Seek

9 years agoMore docs for std::io::Read
Steve Klabnik [Thu, 9 Jul 2015 20:23:27 +0000 (16:23 -0400)]
More docs for std::io::Read

9 years agoMore docs for std::io::BufRead
Steve Klabnik [Thu, 9 Jul 2015 18:04:30 +0000 (14:04 -0400)]
More docs for std::io::BufRead

9 years agodebuginfo: Fix type description generic enum discriminants.
Michael Woerister [Thu, 16 Jul 2015 08:34:13 +0000 (01:34 -0700)]
debuginfo: Fix type description generic enum discriminants.

9 years agoFix typo in stability attribute.
Lee Jeffery [Thu, 16 Jul 2015 13:36:05 +0000 (14:36 +0100)]
Fix typo in stability attribute.

9 years agoFix diagnostics name clash
Manish Goregaokar [Thu, 16 Jul 2015 11:49:08 +0000 (17:19 +0530)]
Fix diagnostics name clash

9 years agoImprove register_diagnostics macro
Guillaume Gomez [Thu, 16 Jul 2015 11:16:59 +0000 (13:16 +0200)]
Improve register_diagnostics macro

9 years agoFixup test
Manish Goregaokar [Thu, 16 Jul 2015 11:07:30 +0000 (16:37 +0530)]
Fixup test

9 years agoFixup #27046 with pattern bindings
Manish Goregaokar [Thu, 16 Jul 2015 09:51:59 +0000 (15:21 +0530)]
Fixup #27046 with pattern bindings

9 years agoRollup merge of #27046 - nrc:driver-defaults, r=alexcrichton
Manish Goregaokar [Thu, 16 Jul 2015 08:45:34 +0000 (14:15 +0530)]
Rollup merge of #27046 - nrc:driver-defaults, r=alexcrichton