Commit Graph

45640 Commits

Author SHA1 Message Date
Guillaume Gomez
c3d147eea6 Add a guard example for E0416 2015-08-07 15:23:00 +02:00
Guillaume Gomez
5aa6c155a3 Improve examples of E0102 2015-08-07 15:07:20 +02:00
bors
ab77c1d8d0 Auto merge of #27551 - arielb1:adt-def, r=nikomatsakis
This ended up being a bigger refactoring than I thought, as I also cleaned a few ugly points in rustc. There are still a few areas that need improvements.

Performance numbers:
```
Before:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After:
545.27user 5.49system 7:10.22elapsed 128%CPU (0avgtext+0avgdata 1145348maxresident)k
llvm-time: 387.119
```

A good 5% perf improvement. Note that after this patch >70% of the time is spent in LLVM - Amdahl's law is in full effect.

Passes make check locally.

r? @nikomatsakis
2015-08-07 12:23:06 +00:00
Victor Berger
5847ea7619 Customize error messages for self glob imports. 2015-08-07 14:18:20 +02:00
Ariel Ben-Yehuda
eedb1cc576 rename ADTDef to AdtDef etc. 2015-08-07 15:03:09 +03:00
Ariel Ben-Yehuda
62cd3cc46b stop using skip_binder 2015-08-07 13:57:39 +03:00
Ariel Ben-Yehuda
7d32533eab add documentation 2015-08-07 13:48:29 +03:00
bors
9bba711063 Auto merge of #27576 - rust-lang:steveklabnik-patch-1, r=Gankro
1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.

r? @Gankro
2015-08-07 05:57:24 +00:00
bors
b77d2f5ac7 Auto merge of #27558 - mlalic:patch-1, r=brson
r? @steveklabnik
2015-08-07 04:21:47 +00:00
bors
871fd5eb73 Auto merge of #27552 - tshepang:misc, r=brson 2015-08-07 02:46:43 +00:00
diaphore
2daa1b7530 Trim trailing newline from FormatMessageW 2015-08-07 03:49:31 +02:00
bors
1181679c8f Auto merge of #27574 - brson:cache-staged-api, r=huonw
This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s
2015-08-07 01:12:15 +00:00
Steve Klabnik
ad9a0713fd Remove reference to diabetes
1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.
2015-08-06 20:18:49 -04:00
Brian Anderson
fd142bb741 Cache a linear search for the #[staged_api] attribute.
This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s
2015-08-06 16:53:05 -07:00
Brian Anderson
e0d7497fb8 Revert "Revert "Fix missing_docs lint for const and static.""
This reverts commit 9191a78955.
2015-08-06 16:36:44 -07:00
bors
68f79288bf Auto merge of #27566 - rubymeow:master, r=steveklabnik
I got a bit confused reading the guide over why all of a sudden there was an asterisk in the code. I was explained what it was there for in the IRC, and I think it should added it to the docs to prevent any further confusion!
2015-08-06 20:45:39 +00:00
bors
11deb083f5 Auto merge of #27296 - jroesch:type-macros, r=huonw
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message.

@nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-06 19:11:17 +00:00
Guillaume Gomez
2a08cff97c Add another example for E0412 2015-08-06 20:57:36 +02:00
Ruby
d3e089f08b fixed the few nits! 2015-08-06 19:55:53 +01:00
Ruby
855f1ff321 Explained asterisk on & and &mut reference 2015-08-06 19:29:03 +01:00
Steve Klabnik
8c4dc18d2a Add opaque structs to TRPL:FFI
Fixes #27303
2015-08-06 13:51:52 -04:00
Guillaume Gomez
99796a6c9c Update E0423 example 2015-08-06 19:46:09 +02:00
bors
fb92de75c1 Auto merge of #27556 - taliesinb:tarpl-clarity-2, r=Gankro
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.

r? @Gankro
2015-08-06 17:36:21 +00:00
Ariel Ben-Yehuda
015300109d cache Ty::is_simd 2015-08-06 18:26:00 +03:00
Ariel Ben-Yehuda
612760bea0 fix dropck overflow error message
Perf numbers:

Before this patchset:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After this patch:
557.84user 5.73system 7:22.10elapsed 127%CPU (0avgtext+0avgdata 1142848maxresident)k
llvm-time: 385.834

nice 2.5% perf improvement
2015-08-06 18:07:00 +03:00
bors
83f2667fa2 Auto merge of #27434 - jeehoonkang:master, r=Gankro
In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:

- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3): "The malloc and calloc functions return a	pointer	to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
    + Note that the description for `allocm` says "Behavior	is undefined if	size is 0," but it is an experimental API.

r? @Gankro
2015-08-06 15:01:35 +00:00
Ariel Ben-Yehuda
c533f963d9 handle associated types correctly in null pointer optimization
Fixes #27532

Thanks @eefriedman for the test.
2015-08-06 17:31:11 +03:00
Ariel Ben-Yehuda
34942331a3 remove ty::{VariantInfo, FieldTy} 2015-08-06 17:02:23 +03:00
Ariel Ben-Yehuda
49e7432b00 resolve todo 2015-08-06 16:54:44 +03:00
Ariel Ben-Yehuda
4c9971eb0d remove struct_fields & enum_variants from the tcx 2015-08-06 16:54:43 +03:00
Ariel Ben-Yehuda
5f3c1412ad use VariantDef instead of struct_fields 2015-08-06 16:54:40 +03:00
Guillaume Gomez
378aba4743 Add E0416 error explanation 2015-08-06 15:30:33 +02:00
Guillaume Gomez
4840c13f1a Add E0415 error explanation 2015-08-06 15:21:25 +02:00
Ariel Ben-Yehuda
4816e60667 create VariantDef-s (but don't actually use them) 2015-08-06 15:57:52 +03:00
Ariel Ben-Yehuda
213b6d71f5 add variant info to ADTDef, but don't actually use it 2015-08-06 14:17:04 +03:00
Ariel Ben-Yehuda
764310e7bb introduce an ADTDef struct for struct/enum definitions 2015-08-06 14:16:56 +03:00
Ariel Ben-Yehuda
03ee3f5c20 add an Ivar for write-only variables 2015-08-06 14:16:52 +03:00
Victor Berger
3d041bd46d Add test descriptions. 2015-08-06 12:48:42 +02:00
Victor Berger
8e24091f98 Factor inc/dec count methods. 2015-08-06 12:47:10 +02:00
bors
8f3901feab Auto merge of #27555 - dotdash:drop_flag_ty, r=pnkfelix
The drop flags are Lvalue (and thus ByRef) datums that hold a u8 value,
so their value type should be u8, not a pointer to u8.
2015-08-06 10:46:26 +00:00
Guillaume Gomez
59574759a8 Add E0419 error explanation 2015-08-06 12:07:55 +02:00
Marko Lalic
607c70e50f TRPL/lifetimes.md: Fix typo lifteimes -> lifetimes 2015-08-06 11:57:55 +02:00
Guillaume Gomez
6ae31b6f89 Add examples in E0412 2015-08-06 11:57:53 +02:00
Jared Roesch
83e43bb728 Fix expected parse error 2015-08-06 00:46:51 -07:00
bors
859d2954ed Auto merge of #27557 - Manishearth:rollup, r=Manishearth
- Successful merges: #27546, #27550
- Failed merges:
2015-08-06 06:59:19 +00:00
Jeehoon Kang
9bfb8d3add Revise TARPL's description for allocating 0 bytes
In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:

- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3): "The malloc and calloc functions return a	pointer	to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
    + Note that the description for `allocm` says "Behavior	is undefined if	size is 0," but it is an experimental API.
2015-08-06 15:40:41 +09:00
Manish Goregaokar
4e9300c02b Rollup merge of #27550 - tshepang:missing-info, r=brson 2015-08-06 11:42:57 +05:30
Manish Goregaokar
1daad87893 Rollup merge of #27546 - steveklabnik:gh26115, r=brson
Fixes #26115
2015-08-06 11:42:56 +05:30
Taliesin Beynon
2ca3dda3c4 Some rerp-rust improvements.
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.
2015-08-06 02:04:11 -04:00
Björn Steinbrink
38d627fe48 Use the right type for drop flag datums
The drop flags are Lvalue (and thus ByRef) datums that hold a u8 value,
so their value type should be u8, not a pointer to u8.
2015-08-06 07:43:46 +02:00