Commit Graph

46458 Commits

Author SHA1 Message Date
bors
8ea2198215 Auto merge of #28421 - alexcrichton:msvc-rmake, r=alexcrichton
Work carried over from #27938
2015-09-17 16:22:46 +00:00
Alex Crichton
0675dffac4 rmake: Get all tests passing on MSVC 2015-09-17 08:40:33 -07:00
bors
2be0d0ad92 Auto merge of #28428 - dotdash:same_adjust, r=nikomatsakis
Currently, we're generating adjustments, for example, to get from &[u8]
to &[u8], which is unneeded and kicks us out of trans_into()
into trans() which means an additional stack slot and copy in the
unoptimized code.
2015-09-17 14:40:59 +00:00
Björn Steinbrink
6def06c973 Don't create adjustments from a type to itself
Currently, we're generating adjustments, for example, to get from &[u8]
to &[u8], which is unneeded and kicks us out of trans_into() into
trans() which means an additional stack slot and copy in the unoptimized
code.
2015-09-17 15:10:21 +02:00
bors
c9fc4efd24 Auto merge of #28455 - nrc:span-bang, r=alexcrichton
I can't see how to test this.

Fixes https://github.com/nrc/rustfmt/issues/320
2015-09-17 12:58:22 +00:00
bors
89faafcd67 Auto merge of #28381 - ebfull:aint-fraid-a-no-ghosts-redux, r=me
#27483 redux at Gankro's request.

Fixes #26905, Closes #28239

r? @nrc
2015-09-17 10:11:23 +00:00
bors
d3fc6e1858 Auto merge of #28454 - GSam:master, r=nrc
This is so that the resolution results can be used after analysis, potentially for tool support
2015-09-17 08:28:33 +00:00
bors
6c18dd597f Auto merge of #28438 - apasel422:issue-22872, r=alexcrichton
The original issue was not fixed, but the test passed due to disabled debug assertions.
2015-09-17 05:44:29 +00:00
Nick Cameron
4fbe514985 Fix the span for ! returns 2015-09-17 15:13:51 +12:00
bors
d16129bca5 Auto merge of #28349 - nrc:ast-lints, r=manishearth
r? @nikomatsakis, f? @Manishearth
2015-09-17 03:05:56 +00:00
bors
151ffa48c1 Auto merge of #28453 - dinfuehr:patch-4, r=alexcrichton 2015-09-17 01:24:02 +00:00
Garming Sam
61cb1baab1 Add compiler option to keep mtwt tables
This is so that the resolution results can be used after analysis, potentially for tool support
2015-09-17 13:09:55 +12:00
Dominik Inführ
69fdc0fa49 corrected link to Hasher 2015-09-16 18:01:46 -07:00
Nick Cameron
ed61a64a95 rebasing 2015-09-17 12:16:46 +12:00
Nick Cameron
a642d853aa Change to a multi-trait approach
[breaking-change] for lint authors

You must now implement LateLintPass or EarlyLintPass as well as LintPass and use either register_late_lint_pass or register_early_lint_pass, rather than register_lint_pass.
2015-09-17 12:16:46 +12:00
Nick Cameron
c1084a3ada Changes to tests 2015-09-17 12:16:46 +12:00
Nick Cameron
d21bfff78c Remove hir::ExprParen 2015-09-17 12:16:46 +12:00
Nick Cameron
70c6fb9193 Change the unused parens lint to operate on the AST 2015-09-17 12:16:46 +12:00
Nick Cameron
76856e19ff Add an early lint pass for lints that operate on the AST
There is a minor [breaking-change] for lint authors - some functions which were previously defined on `lint::Context` have moved to a trait - `LintContext`, you may need to import that trait to avoid name resolution errors.
2015-09-17 12:16:46 +12:00
bors
47d125d0f8 Auto merge of #28436 - ranma42:faster-partialord, r=bluss
This branch improves the performance of Ord and PartialOrd methods for slices compared to the iter-based implementation.
Based on the approach used in #26884.
2015-09-16 21:45:46 +00:00
bors
f18c2aaf20 Auto merge of #28432 - aochagavia:docs2, r=alexcrichton
Fixes #28431
2015-09-16 19:02:55 +00:00
Andrew Paseltiner
f5b69b3d9c Remove incorrect test for #22872
The original issue was not fixed, but the test passed due to disabled
debug assertions.
2015-09-16 11:44:41 -04:00
Andrea Canciani
74dc146f42 Explain explicit slicing in slice cmp and partial_cmp methods
The explicit slicing is needed in order to enable additional range
check optimizations in the compiler.
2015-09-16 16:09:23 +02:00
Andrea Canciani
08b9edfe94 Remove inline attribute
Be more conservative with inlining.
2015-09-16 16:09:01 +02:00
Andrea Canciani
369a9dc302 Remove boundary checks in slice comparison operators
In order to get rid of all range checks, the compiler needs to
explicitly see that the slices it iterates over are as long as the
loop variable upper bound.

This further improves the performance of slice comparison:

```
test u8_cmp          ... bench:       4,761 ns/iter (+/- 1,203)
test u8_lt           ... bench:       4,579 ns/iter (+/- 649)
test u8_partial_cmp  ... bench:       4,768 ns/iter (+/- 761)
test u16_cmp         ... bench:       4,607 ns/iter (+/- 580)
test u16_lt          ... bench:       4,681 ns/iter (+/- 567)
test u16_partial_cmp ... bench:       4,607 ns/iter (+/- 967)
test u32_cmp         ... bench:       4,448 ns/iter (+/- 891)
test u32_lt          ... bench:       4,546 ns/iter (+/- 992)
test u32_partial_cmp ... bench:       4,415 ns/iter (+/- 646)
test u64_cmp         ... bench:       4,380 ns/iter (+/- 1,184)
test u64_lt          ... bench:       5,684 ns/iter (+/- 602)
test u64_partial_cmp ... bench:       4,663 ns/iter (+/- 1,158)
```
2015-09-16 15:27:14 +02:00
Andrea Canciani
bf9254a75e Reuse cmp in totally ordered types
Instead of manually defining it, `partial_cmp` can simply wrap the
result of `cmp` for totally ordered types.
2015-09-16 15:25:51 +02:00
Andrea Canciani
d04b8b5818 Improve PartialOrd for slices
Reusing the same idea as in #26884, we can exploit the fact that the
length of slices is known, hence we can use a counted loop instead of
iterators, which means that we only need a single counter, instead of
having to increment and check one pointer for each iterator.

Using the generic implementation of the boolean comparison operators
(`lt`, `le`, `gt`, `ge`) provides further speedup for simple
types. This happens because the loop scans elements checking for
equality and dispatches to element comparison or length comparison
depending on the result of the prefix comparison.

```
test u8_cmp          ... bench:      14,043 ns/iter (+/- 1,732)
test u8_lt           ... bench:      16,156 ns/iter (+/- 1,864)
test u8_partial_cmp  ... bench:      16,250 ns/iter (+/- 2,608)
test u16_cmp         ... bench:      15,764 ns/iter (+/- 1,420)
test u16_lt          ... bench:      19,833 ns/iter (+/- 2,826)
test u16_partial_cmp ... bench:      19,811 ns/iter (+/- 2,240)
test u32_cmp         ... bench:      15,792 ns/iter (+/- 3,409)
test u32_lt          ... bench:      18,577 ns/iter (+/- 2,075)
test u32_partial_cmp ... bench:      18,603 ns/iter (+/- 5,666)
test u64_cmp         ... bench:      16,337 ns/iter (+/- 2,511)
test u64_lt          ... bench:      18,074 ns/iter (+/- 7,914)
test u64_partial_cmp ... bench:      17,909 ns/iter (+/- 1,105)
```

```
test u8_cmp          ... bench:       6,511 ns/iter (+/- 982)
test u8_lt           ... bench:       6,671 ns/iter (+/- 919)
test u8_partial_cmp  ... bench:       7,118 ns/iter (+/- 1,623)
test u16_cmp         ... bench:       6,689 ns/iter (+/- 921)
test u16_lt          ... bench:       6,712 ns/iter (+/- 947)
test u16_partial_cmp ... bench:       6,725 ns/iter (+/- 780)
test u32_cmp         ... bench:       7,704 ns/iter (+/- 1,294)
test u32_lt          ... bench:       7,611 ns/iter (+/- 3,062)
test u32_partial_cmp ... bench:       7,640 ns/iter (+/- 1,149)
test u64_cmp         ... bench:       7,517 ns/iter (+/- 2,164)
test u64_lt          ... bench:       7,579 ns/iter (+/- 1,048)
test u64_partial_cmp ... bench:       7,629 ns/iter (+/- 1,195)
```
2015-09-16 12:00:56 +02:00
Andrea Canciani
1614173b58 Specialize PartialOrd for totally ordered primitive types
Knowing the result of equality comparison can enable additional
optimizations in LLVM.

Additionally, this makes it obvious that `partial_cmp` on totally
ordered types cannot return `None`.
2015-09-16 11:26:56 +02:00
bors
8dfb89067a Auto merge of #28353 - GuillaumeGomez:error_codes, r=Manishearth
r? @Manishearth 

This is a work in progress.
2015-09-16 08:51:30 +00:00
Adolfo Ochagavía
804f024eda Simplify sample code for {Option, Result}::iter_mut
Fixes #28431
2015-09-16 10:17:38 +02:00
Guillaume Gomez
e6f6da119e End of adding error codes in librustc 2015-09-16 08:44:29 +02:00
bors
1fe126af2e Auto merge of #28420 - christopherdumas:intergrate_error_burnstushi, r=steveklabnik
This was pointed out by @filsmick and @swatteau in #28412.
2015-09-16 05:48:49 +00:00
bors
0f1f5fc746 Auto merge of #28417 - apasel422:issue-23036, r=arielb1
Closes #23036.
2015-09-16 04:07:07 +00:00
bors
405f8f1f25 Auto merge of #28401 - christopherdumas:beginners_manuel, r=Gankro
r? @steveklabnik
2015-09-16 02:18:01 +00:00
bors
fc4d566b43 Auto merge of #28399 - nrc:attrs, r=nikomatsakis
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-16 00:35:24 +00:00
Nick Cameron
e9f1b06329 Use ast attributes every where (remove HIR attributes).
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-16 10:57:06 +12:00
bors
9bc1fae4aa Auto merge of #28426 - brson:ver, r=alexcrichton 2015-09-15 22:52:59 +00:00
bors
5e44115970 Auto merge of #28408 - brson:relnotes, r=aturon
I'd love to have any tips about highlights and lang stuff I missed. Sadly, this needs to be merged *tomorrow*.

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)
2015-09-15 21:10:16 +00:00
Brian Anderson
cedde0fc8a Bump to 1.5 2015-09-15 14:05:10 -07:00
Brian Anderson
f57bb9df28 1.3 release notes 2015-09-15 13:50:07 -07:00
christopherdumas
e66a1dcde9 Fixe heading 2015-09-15 10:37:52 -07:00
christopherdumas
0b7e048378 Fix option link and anchor links. 2015-09-15 10:37:02 -07:00
bors
d2e13e822a Auto merge of #28263 - christopherdumas:add_help_E0118, r=nikomatsakis
Contributing to the Rust error explanations. Should I also add a better error for it by default?
2015-09-15 16:43:41 +00:00
bors
8a19b234c7 Auto merge of #28413 - arielb1:deduplication, r=eddyb
clean a few things discovered during my split_ty work

r? @eddyb
2015-09-15 15:01:05 +00:00
Andrew Paseltiner
4e25329c5e Add test for #23036
Closes #23036.
2015-09-15 10:14:11 -04:00
bors
3887ca27f1 Auto merge of #28407 - mmcco:master, r=alexcrichton
…e len is actually one more than the length of argv[0]. However, this is precarious and should probably be replaced with more robust logic.
2015-09-15 13:18:13 +00:00
bors
7161530fc4 Auto merge of #28406 - petrochenkov:primitive, r=eddyb
This was missing from https://github.com/rust-lang/rust/pull/27451

r? @eddyb
2015-09-15 11:35:11 +00:00
bors
6d154af14a Auto merge of #28393 - arielb1:required-because-it-appears, r=nikomatsakis
new error style:
```
path.rs:4:6: 4:7 error: the trait `core::marker::Sized` is not implemented for the type `[u8]` [E0277]
path.rs:4 fn f(p: Path) {}
               ^
path.rs:4:6: 4:7 help: run `rustc --explain E0277` to see a detailed explanation
path.rs:4:6: 4:7 note: `[u8]` does not have a constant size known at compile-time
path.rs:4:6: 4:7 note: required because it appears within the type `std::sys::os_str::Slice`
path.rs:4:6: 4:7 note: required because it appears within the type `std::ffi::os_str::OsStr`
path.rs:4:6: 4:7 note: required because it appears within the type `std::path::Path`
path.rs:4:6: 4:7 note: all local variables must have a statically known size
path.rs:7:5: 7:36 error: the trait `core::marker::Send` is not implemented for the type `alloc::rc::Rc<()>` [E0277]
path.rs:7     foo::<BTreeMap<Rc<()>, Rc<()>>>();
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
path.rs:7:5: 7:36 help: run `rustc --explain E0277` to see a detailed explanation
path.rs:7:5: 7:36 note: `alloc::rc::Rc<()>` cannot be sent between threads safely
path.rs:7:5: 7:36 note: required because it appears within the type `collections::btree::node::Node<alloc::rc::Rc<()>, alloc::rc::Rc<()>>`
path.rs:7:5: 7:36 note: required because it appears within the type `collections::btree::map::BTreeMap<alloc::rc::Rc<()>, alloc::rc::Rc<()>>`
path.rs:7:5: 7:36 note: required by `foo`
error: aborting due to 2 previous errors
```

Fixes #21793 
Fixes #23286

r? @nikomatsakis
2015-09-15 09:52:04 +00:00
bors
8320345221 Auto merge of #28268 - petrochenkov:fnptr, r=alexcrichton
Closes https://github.com/rust-lang/rust/issues/26082
2015-09-15 08:09:20 +00:00
bors
a7b3eed750 Auto merge of #28395 - ebfull:fix-associated-item-resolution, r=arielb1
Fixes #28344
2015-09-15 06:25:38 +00:00