Commit Graph

50409 Commits

Author SHA1 Message Date
est31
205f836ab8 Fix reference info about parent doc block comments
Block comments don't have to be in the format `/*! ... !*/`
in order to be read as doc comments about the parent block.
The format `/*! ... */` is enough.
2016-01-28 18:39:39 +01:00
bors
552bf75e7d Auto merge of #31257 - tmiasko:track-errors-fix, r=nikomatsakis
r? @nrc
2016-01-28 17:20:04 +00:00
Tomasz Miąsko
b3e30b5fc3 Fix checking if there have been new errors. 2016-01-28 14:35:00 +01:00
bors
10de8826cd Auto merge of #31241 - tshepang:fix, r=steveklabnik 2016-01-28 11:00:55 +00:00
bors
a891c72976 Auto merge of #31171 - dirk:dirk/safety-section-in-cstring-docs, r=steveklabnik
Also a minor language tweak to the documentation of the `ffi::CString::from_raw` function.
2016-01-28 09:03:00 +00:00
Tomasz Miąsko
9a30ecdf11 libsyntax: fix pretty printing of macro with braces
Pretty printing of macro with braces but without terminated semicolon
removed more boxes from stack than it put there, resulting in panic.
This fixes the issue #30731.
2016-01-28 09:19:43 +01:00
bors
035f4cca00 Auto merge of #31240 - durka:follow-set-docs, r=pnkfelix
Missed as part of #31152, but the list had other mistakes as well.

r? @pnkfelix
2016-01-28 07:06:29 +00:00
Alex Crichton
1a910a0ff3 mk: Remove the -mfpu=vfp4 argument from arm iOS
Unfortunately older clang compilers don't support this argument, so the
bootstrap will fail. We don't actually really need to optimized the C code we
compile, however, as currently we're just compiling jemalloc and not much else.
2016-01-27 22:34:26 -08:00
Jeffrey Seyfried
d2d2144656 Refactor away NameSearchType 2016-01-28 05:07:40 +00:00
Jeffrey Seyfried
1fcde2bdbc Add test for #31212 2016-01-28 05:06:23 +00:00
Jeffrey Seyfried
6ba35cecf6 Resolve: Fix an ICE that occurs when an identifier refers to an indeterminate import (i.e. one that is not resolved and not known to have failed) 2016-01-28 05:06:17 +00:00
Prayag Verma
8c96f37a98 Mention initial copyright year 2016-01-28 09:44:04 +05:30
bors
1c06f64ac2 Auto merge of #31225 - mbrubeck:btreeset-size-hint, r=Gankro
None
2016-01-28 02:21:58 +00:00
Dirk Gadsden
9cfa1916fa Fix formatting in documentation of ffi::CString 2016-01-27 15:07:22 -08:00
bors
38e23e8f7b Auto merge of #31243 - Manishearth:rollup, r=Manishearth
- Successful merges: #30689, #31186, #31219, #31222, #31226
- Failed merges:
2016-01-27 21:32:58 +00:00
Tshepang Lekhonkhobe
bbdef0ce59 rustfmt syntax::parse 2016-01-27 21:45:14 +02:00
Manish Goregaokar
5e7dfa7094 Rollup merge of #31226 - steveklabnik:gh30954, r=Manishearth
Fixes #30954
2016-01-28 00:48:32 +05:30
Manish Goregaokar
d7c57e1fdd Rollup merge of #31222 - durka:patch-15, r=steveklabnik
r? @steveklabnik
2016-01-28 00:48:32 +05:30
Manish Goregaokar
3e56732322 Rollup merge of #31219 - mbrubeck:missing-docs, r=steveklabnik
The missing_docs lint only applies to public items in public modules, so this
example code did not actually generate any warnings or errors.
2016-01-28 00:48:32 +05:30
Manish Goregaokar
cb3680c080 Rollup merge of #31186 - gchp:contributing, r=alexcrichton
I recently wrote a blog post on contributing to the Rust compiler which
gained some interest. It was mentioned in a comment on Reddit that it
would be useful to integrate some of the information from that post to
the official contributing guide.

This is the start of my efforts to integrate what I wrote with the
official guide.

This commit adds information on the build system. It is not a complete
guide on the build system, but it should be enough to provide a good
starting place for those wishing to contribute.
2016-01-28 00:48:31 +05:30
Manish Goregaokar
b29628ac91 Rollup merge of #30689 - Manishearth:lifetime-bound, r=steveklabnik
We should have stuff on this in the book somewhere too

r? @steveklabnik
2016-01-28 00:48:31 +05:30
Tshepang Lekhonkhobe
699c581b84 doc: insert missing chars 2016-01-27 20:56:18 +02:00
Alex Burka
fd4d013a2c trpl: fix macro follow sets 2016-01-27 13:26:47 -05:00
bors
b2f4c5c596 Auto merge of #31224 - bluss:deque-hashing, r=Gankro
Hash VecDeque in its slice parts

Use .as_slices() for a more efficient code path in VecDeque's Hash impl.

This still hashes the elements in the same order.

Before/after timing of VecDeque hashing 1024 elements of u8 and
u64 shows that the vecdeque now can match the Vec
(test_hashing_vec_of_u64 is the Vec run).

```
before

test test_hashing_u64        ... bench:  14,031 ns/iter (+/- 236) = 583 MB/s
test test_hashing_u8         ... bench:   7,887 ns/iter (+/- 65) = 129 MB/s
test test_hashing_vec_of_u64 ... bench:   6,578 ns/iter (+/- 76) = 1245 MB/s

after

running 5 tests
test test_hashing_u64        ... bench:   6,495 ns/iter (+/- 52) = 1261 MB/s
test test_hashing_u8         ... bench:     851 ns/iter (+/- 16) = 1203 MB/s
test test_hashing_vec_of_u64 ... bench:   6,499 ns/iter (+/- 59) = 1260 MB/s
```
2016-01-27 16:25:36 +00:00
bors
8256c470a5 Auto merge of #31089 - fhahn:macro-ice, r=pnkfelix
This is a  work in progress PR that potentially should fix #29084, #28308, #25385, #28288, #31011. I think this may also adresse parts of  #2887.

The problem in this issues seems to be that when transcribing macro arguments, we just clone the argument Nonterminal, which still has to original spans. This leads to the unprintable spans. One solution would be to update the spans of the inserted argument to match the argument in the macro definition. So for [this testcase](https://github.com/rust-lang/rust/compare/master...fhahn:macro-ice?expand=1#diff-f7def7420c51621640707b6337726876R2) the error message would be displayed in the macro definition:

    src/test/compile-fail/issue-31011.rs:4:12: 4:22 error: attempted access of field `trace` on type `&T`, but no field with that name was found
    src/test/compile-fail/issue-31011.rs:4         if $ctx.trace {

Currently I've added a very simple `update_span` function, which updates the span of the outer-most expression of a `NtExpr`, but this `update_span` function should be updated to handle all Nonterminals. But I'm pretty new to the macro system and would like to check if this approach makes sense, before doing that.
2016-01-27 12:12:52 +00:00
Florian Hahn
ecb7b01a08 Add NOTE test annotations 2016-01-27 11:48:46 +01:00
Florian Hahn
e533ed91be Avoid storing interolated token in Parser.last_token 2016-01-27 11:28:33 +01:00
bors
b8b18aac12 Auto merge of #31206 - nrc:early-save, r=nikomatsakis
r? @nikomatsakis
2016-01-27 10:17:55 +00:00
Florian Hahn
47bfd8c93c Turn interpolated_or_expr_span into a function 2016-01-27 10:47:33 +01:00
bors
aba11b3206 Auto merge of #31020 - regexident:fix_16884, r=brson
Changes error message from displaying first found missing constructor witness to showing up to 10, if necessary.

Fixes issue #16884.
2016-01-27 07:32:00 +00:00
bors
a186eb2fb2 Auto merge of #30859 - aliclark:musl-nx-issue, r=brson
This explicitly adds an option telling the linker on these platforms to make the stack and heap non-executable (should already be the case for Windows, and likely OS X).

Without this option there is some risk of accidentally losing NX protection, as the linker will not enable NX if any of the binary's constituent objects don't contain the .note.GNU-stack header.

We're not aware of any users who would want a binary with executable stack or heap, but in future this could be made possible by passing a flag to disable the protection, which would also help document the fact to the crate's users.

Edit: older discussion of previous quickfix to add a .note.GNU-stack header to libunwind's assembly:

Short term solution for issue #30824 to ensure that object files generated from assembler contain the .note.GNU-stack header.

When this header is not present in any constituent object files, the linker refrains from making the stack NX in the final executable.

Further actions:

I'll try to get this change merged in with upstream too, and then update these instructions to just compile the fixed version.

It seems a good idea to use issue #30824 or some other issue to add a test that similar security regressions can be automatically caught in future.
2016-01-27 03:30:14 +00:00
Stepan Koltsov
641267e4c2 Allow #[repr(i32)] for univariant enum
```
#[repr(i32)]
enum Univariant {
    X = 17
}
```

Fixes #10292
2016-01-27 04:50:04 +03:00
bors
b694d1b1d1 Auto merge of #30487 - jonas-schievink:more-attrs-lint-fixes, r=alexcrichton
`LateContext` already does this, looks like this was just forgotten in #29850.

Found while investigating #30326 (but doesn't fix it)
2016-01-27 01:30:28 +00:00
Ulrik Sverdrup
aeb3aba951 collections: Use slices parts in PartialEq for VecDeque
This improves == for VecDeque by using the slice representation.

This will also improve further if codegen for slice comparison improves.

Benchmark run of 1000 u64 elements, comparing for equality (all equal).
Cpu time to compare the vecdeques is reduced to less than 50% of what it
was before.

```
test test_eq_u64       ... bench:  1,885 ns/iter (+/- 163) = 4244 MB/s
test test_eq_new_u64   ... bench:    802 ns/iter (+/- 100) = 9975 MB/s
```
2016-01-27 00:35:03 +01:00
Ulrik Sverdrup
d3174ce751 collections: Hash VecDeque in its slice parts
Use .as_slices() for a more efficient code path in VecDeque's Hash impl.

This still hashes the elements in the same order.

Before/after timing of VecDeque hashing 1024 elements of u8 and
u64 shows that the vecdeque now can match the Vec
(test_hashing_vec_of_u64 is the Vec run).

before

test test_hashing_u64        ... bench:  14,031 ns/iter (+/- 236) = 583 MB/s
test test_hashing_u8         ... bench:   7,887 ns/iter (+/- 65) = 129 MB/s
test test_hashing_vec_of_u64 ... bench:   6,578 ns/iter (+/- 76) = 1245 MB/s

after

running 5 tests
test test_hashing_u64        ... bench:   6,495 ns/iter (+/- 52) = 1261 MB/s
test test_hashing_u8         ... bench:     851 ns/iter (+/- 16) = 1203 MB/s
test test_hashing_vec_of_u64 ... bench:   6,499 ns/iter (+/- 59) = 1260 MB/s
2016-01-27 00:04:03 +01:00
Steve Klabnik
5c61be68d0 Mention that globs import public symbols
Fixes #30954
2016-01-26 17:47:01 -05:00
bors
4b615854f0 Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brson
This commit removes the `-D warnings` flag being passed through the makefiles to
all crates to instead be a crate attribute. We want these attributes always
applied for all our standard builds, and this is more amenable to Cargo-based
builds as well.

Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)`
attribute currently to match the same semantics we have today
2016-01-26 22:10:10 +00:00
Matt Brubeck
6ff177efea Add size hints for BTreeSet iterators 2016-01-26 14:09:56 -08:00
Alex Burka
2f633b2204 capitalization and associated types 2016-01-26 14:36:48 -05:00
bors
a9e139b66c Auto merge of #31081 - alexcrichton:stabilize-hasher, r=aturon
This commit implements the stabilization of the custom hasher support intended
for 1.7 but left out due to some last-minute questions that needed some
decisions. A summary of the actions done in this PR are:

Stable

* `std:#️⃣:BuildHasher`
* `BuildHasher::Hasher`
* `BuildHasher::build_hasher`
* `std:#️⃣:BuildHasherDefault`
* `HashMap::with_hasher`
* `HashMap::with_capacity_and_hasher`
* `HashSet::with_hasher`
* `HashSet::with_capacity_and_hasher`
* `std::collections::hash_map::RandomState`
* `RandomState::new`

Deprecated

* `std::collections::hash_state`
* `std::collections::hash_state::HashState` - this trait was also moved into
  `std::hash` with a reexport here to ensure that we can have a blanket impl to
  prevent immediate breakage on nightly. Note that this is unstable in both
  location.
* `HashMap::with_hash_state` - renamed
* `HashMap::with_capacity_and_hash_state` - renamed
* `HashSet::with_hash_state` - renamed
* `HashSet::with_capacity_and_hash_state` - renamed

Closes #27713
2016-01-26 19:30:54 +00:00
Alex Burka
638555e64d book: cover UFCS in Syntax Index 2016-01-26 13:43:43 -05:00
Matt Brubeck
e23f8b095b Fix examples that use missing_docs lint
The missing_docs lint only applies to public items in public modules, so this
example code did not actually generate any warnings or errors.
2016-01-26 09:49:26 -08:00
Alex Crichton
cb343c33ac Fix warnings during tests
The deny(warnings) attribute is now enabled for tests so we need to weed out
these warnings as well.
2016-01-26 09:29:28 -08:00
bors
13b5edab63 Auto merge of #30402 - jooert:prettypanic, r=alexcrichton
This splits the output of panics into two lines as proposed in #15239 and adds a
note about how to get a backtrace. Because the default panic message consists of
multiple lines now, this changes the test runner's failure output to not indent
the first line anymore.

Fixes #15239 and fixes #11704.
2016-01-26 16:50:27 +00:00
Alex Crichton
1fa0be2bc0 std: Stabilize custom hasher support in HashMap
This commit implements the stabilization of the custom hasher support intended
for 1.7 but left out due to some last-minute questions that needed some
decisions. A summary of the actions done in this PR are:

Stable

* `std:#️⃣:BuildHasher`
* `BuildHasher::Hasher`
* `BuildHasher::build_hasher`
* `std:#️⃣:BuildHasherDefault`
* `HashMap::with_hasher`
* `HashMap::with_capacity_and_hasher`
* `HashSet::with_hasher`
* `HashSet::with_capacity_and_hasher`
* `std::collections::hash_map::RandomState`
* `RandomState::new`

Deprecated

* `std::collections::hash_state`
* `std::collections::hash_state::HashState` - this trait was also moved into
  `std::hash` with a reexport here to ensure that we can have a blanket impl to
  prevent immediate breakage on nightly. Note that this is unstable in both
  location.
* `HashMap::with_hash_state` - renamed
* `HashMap::with_capacity_and_hash_state` - renamed
* `HashSet::with_hash_state` - renamed
* `HashSet::with_capacity_and_hash_state` - renamed

Closes #27713
2016-01-26 08:39:07 -08:00
Michael Woerister
4d074b8c4c Avoid redundant work for drop-glue translation items in trans::collector 2016-01-26 10:17:54 -05:00
Michael Woerister
9e969808e2 Add caching of external MIR in trans::collector 2016-01-26 10:17:54 -05:00
Michael Woerister
862911df9a Implement the translation item collector.
The purpose of the translation item collector is to find all monomorphic instances of functions, methods and statics that need to be translated into LLVM IR in order to compile the current crate.
So far these instances have been discovered lazily during the trans path. For incremental compilation we want to know the set of these instances in advance, and that is what the trans::collect module provides.
In the future, incremental and regular translation will be driven by the collector implemented here.
2016-01-26 10:17:45 -05:00
Greg Chapple
05f7b59352 Re-worded intro paragraph to be more positive 2016-01-26 14:44:27 +00:00
Greg Chapple
6fd728db6d Updated to reflect comments from review
- Tweaked the build system intro paragraph
- Added some more configure options & explanations
- Added additional make target
2016-01-26 14:29:26 +00:00