Commit Graph

49677 Commits

Author SHA1 Message Date
bors
b78b9ae7b3 Auto merge of #30997 - bluss:trait-default, r=nikomatsakis
Fix type parameter default error to mention type and trait definitions

Introduced in PR #30724, needs to mention that type parameter defaults
are legal in trait and type definitions too.
2016-01-23 14:31:26 +00:00
bors
1571c690f0 Auto merge of #31121 - Manishearth:prim-link, r=alexcrichton
We currently nest `<a>` tags which is doubleplusungood. So, for example, `(u8, u8)` will show up
with the left paren linked to the tuple primitive page, and the right paren unlinked, which looks ugly.
2016-01-23 11:38:43 +00:00
Manish Goregaokar
5a26a52a54 Handle generics in raw pointers 2016-01-23 15:32:10 +05:30
bors
332e345240 Auto merge of #30958 - dhodder:master, r=brson
The COPYRIGHT file should be updated to note that Rust no longer ships with AUTHORS.txt.

    $ git log -1 -- AUTHORS.txt
    commit 402749c539
    Author: Brian Anderson <banderson@mozilla.com>
    Date:   Wed Dec 2 22:16:08 2015 +0000

        Remove AUTHORS.txt and add-authors.sh

        Keeping this file up to date requires hours of work every release,
        even with the script. It is a fool's errand and we shall not do it
        any longer.
2016-01-23 09:49:34 +00:00
bors
228afd7251 Auto merge of #30807 - kolloch:patch-1, r=steveklabnik
When I read the book, the following sentence of the reference documentation helped me greatly to understand slices:

"Slices are a view into a block of memory represented as a pointer and a length."

In this commit, I tried to integrate the gist of that into the slice section inside of "primitive-types.md". I am not a native speaker, so feel very free to improve the wording.

r? @steveklabnik
2016-01-23 07:44:17 +00:00
bors
8ff48fea13 Auto merge of #31126 - arielb1:remote-errors, r=eddyb
Also removed an unused and similarly buggy error path.

Fixes #30535

r? @eddyb
2016-01-23 05:54:38 +00:00
bors
93d03edcb8 Auto merge of #31124 - dirk:dirk/display-and-error-impls-for-string-parse-error, r=alexcrichton
Fixes #31106.

- [ ] I wasn't sure of the correct `#[stable(...)]` definition to use here. Happy to fix it if it's incorrect.
- [ ] `ParseError` is sort of an ephemeral non-error, but do let me know if the implementation of `error::Error` for it should return something more descriptive than "parse error".
2016-01-23 04:04:26 +00:00
bors
d63b8e539f Auto merge of #31116 - bluss:expect-out-cold, r=alexcrichton
Use cold functions for panic formatting Option::expect, Result::unwrap, expect

These methods are marked inline, but insert a big chunk of formatting
code, as well as other error path related code, such as
deallocating a std::io::Error if you have one.

We can explicitly separate out that code path into a function that is
never inline, since the panicking case should always be rare.
2016-01-23 00:33:23 +00:00
bors
c2740b6adb Auto merge of #31104 - nrc:save-fix-variant-data, r=alexcrichton 2016-01-22 22:42:33 +00:00
bors
292937607d Auto merge of #31095 - alexcrichton:remove-old-files, r=brson
These are either not used at all today or they're super old and haven't been used in ages, so clean them out.
2016-01-22 20:51:38 +00:00
Dirk Gadsden
365deeb19a Simplify return for error::Error impl for string::ParseError 2016-01-22 14:34:39 -05:00
Ariel Ben-Yehuda
f78ce412ef astconv: don't use as_local_node_id for ids in a Def
Fixes #30535
2016-01-22 21:27:34 +02:00
Dirk Gadsden
49e27f1c5f Implement error::Error and fmt::Display for string::ParseError
Fixes #31106.
2016-01-22 14:01:29 -05:00
bors
cded89a3d1 Auto merge of #30917 - arthurprs:bs_bounds_check, r=alexcrichton
Avoid bounds checking for binary search. All calculated indexes are safe and the branch is useless.
2016-01-22 19:00:15 +00:00
Ulrik Sverdrup
257bff3192 Move cold panic functions in Option and Result
Move functions out of their impl blocks; avoids unnecessary
monomorphization by type parameters that are irrelevant to the message
output.
2016-01-22 19:07:11 +01:00
Ulrik Sverdrup
30be6a666d Use cold functions for panic formatting Option::expect, Result::unwrap etc
Option::expect, Result::unwrap, unwrap_err, expect

These methods are marked inline, but insert a big chunk of formatting
code, as well as other error path related code, such as deallocating
a std::io::Error if you have one.

We can explicitly separate out that code path into a function that is
never inline, since the panicking case should always be rare.
2016-01-22 19:06:20 +01:00
Manish Goregaokar
9a80bc8530 Correctly output links for primitive types which enclose their contents 2016-01-22 23:15:47 +05:30
bors
8f36038490 Auto merge of #31087 - nikomatsakis:incr-comp-fulfillment-cache, r=arielb1
This is a fix for #30741. It simplifies dep-graph tracking for trait matching. I was experimenting with having a greater resolution here, but decided to pare back to just have one dep node for "trait resolutions on trait `Foo`", which means that adding an impl to the trait `Foo` will invalidate all fns that had to do any trait matching at all on `Foo`. This seems like a reasonable starting place.

Independently, I realized I had neglected to record a dependency from trans on typeck -- this is obviously needed, since trans consumes a bunch of data structures that typeck produces (but which are not currently individually tracked) -- and because trans assumes that typeck has been done. Eventually those are going to go away and be replaced with MIR, which will be tracked, so this edge would presumably be derived automatically then, but it's an obvious enough thing to want for now.

r? @arielb1

cc @michaelwoerister -- this might indirectly fix the problem you observed with the trans cache, though it'd be nice to try and craft an independent test case for that.
2016-01-22 17:09:37 +00:00
arthurprs
7e5b9d7213 Avoid bounds check for slice binary search 2016-01-22 15:08:27 -02:00
bors
e1cb0a3508 Auto merge of #31084 - ranma42:cmd-no-unsafe, r=alexcrichton
Instead of transmuting, use a match; the compiler has learnt how to
optimize it.
2016-01-22 15:18:10 +00:00
bors
188c50c4ac Auto merge of #31080 - dhuseby:updating_libc_dep, r=alexcrichton
this pulls in a fix for the missing O_ACCMODE that was breaking the bsd builds.
2016-01-22 13:27:22 +00:00
bors
e7ce7b6365 Auto merge of #31077 - nagisa:mir-temp-promotion, r=dotdash
Fixes #31002

r? @nikomatsakis
2016-01-22 11:36:50 +00:00
bors
cd1b845492 Auto merge of #31074 - gmbonnet:stage0-libdir, r=alexcrichton
This fixes #27254.

On a 64-bit Linux machine, for example, `configure --libdir=/usr/local/lib64` was creating both `x86_64-unknown-linux-gnu/stage0/lib/rustlib` and `x86_64-unknown-linux-gnu/stage0/lib64/rustlib`. Crates from the stage0 snapshot, like `libcore`, are extracted to `x86_64-unknown-linux-gnu/stage0/lib/rustlib`, but the stage0 compiler was attempting to find them in `x86_64-unknown-linux-gnu/stage0/lib64/rustlib`, which has the highest priority on a 64-bit system.

The issue can be fixed by creating only `x86_64-unknown-linux-gnu/stage0/lib/rustlib`, since this is the only rustlib directory needed for stage0 anyways.
2016-01-22 09:46:17 +00:00
bors
b4a2579cf0 Auto merge of #31072 - arielb1:method-callee-cleanup, r=michaelwoerister
The old code was terribly ugly and was duplicated in several places.

r? @michaelwoerister
2016-01-22 07:55:13 +00:00
bors
00ee90f0f0 Auto merge of #31070 - sfackler:bufreader-box-slice, r=alexcrichton
Saves a word, and also prevents the impl from accidentally changing the
buffer length.

r? @alexcrichton
2016-01-22 06:04:50 +00:00
Nick Cameron
cd2287e2bc save-analysis: emit the right kind of variant 2016-01-22 18:53:23 +13:00
bors
62c8256b9f Auto merge of #31068 - sfackler:bufwriter-panic, r=alexcrichton
We don't want to write the same data twice.

Closes #30888

r? @alexcrichton
2016-01-22 04:13:26 +00:00
bors
5c1d5fcd87 Auto merge of #31064 - retep998:msvc-host-dlls, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/31063

r? @alexcrichton
2016-01-22 02:22:54 +00:00
bors
18b851bc52 Auto merge of #30944 - fhahn:issue-29789-use-constant2, r=nagisa
This PR for  #29789 uses `rustc::repr::mir::Constant` in `ExprKind::Repeat`, which seems to fit quite nicely. Is there a reason for not re-using that type?
2016-01-22 00:31:29 +00:00
Alex Crichton
9e432bd454 etc: Remove old num/libc generation code 2016-01-21 14:48:18 -08:00
Alex Crichton
de4a749567 etc: Remove the mingw-fix-include directory
This isn't used anywhere
2016-01-21 14:47:03 -08:00
Alex Crichton
5a459ea918 etc: Remove old mklldef.py script
The compiler has since gained better support for this, so the script is no
longer necessary
2016-01-21 14:45:53 -08:00
Alex Crichton
5cd9ca90c5 mk: Remove all perf-related targets
I don't believe these have been used at all recently, and I doubt many of them
still work, so remove the stale support.
2016-01-21 14:45:23 -08:00
bors
54475e950c Auto merge of #30882 - petrochenkov:varnamesp, r=nrc
Tuple and unit variants from other crates weren't put into type namespace.
Now variant namespacing is aligned with struct namespacing and is not affected by the variant's crate of origin (struct -> type, tuple/unit -> type/value).
Additionally, struct variants from other crates are put into value namespace (struct variants from local crate were already in it). This is not a necessity, but a future proofing measure.

This fix can result in some new shadowing errors in cross-crate scenarios, crater reports [three regressions](https://github.com/rust-lang/rust/pull/30882#issuecomment-172369883).
[breaking-change]
2016-01-21 22:41:37 +00:00
Florian Hahn
9884ff1dfb Add Debug impl and erase region for TypedConstVal 2016-01-21 22:53:00 +01:00
Florian Hahn
d31027d3bf Introduce and use TypedConstVal for Repeat 2016-01-21 22:47:11 +01:00
Florian Hahn
c78609134c [MIR] use mir::repr::Constant in ExprKind::Repeat, close #29789 2016-01-21 22:46:50 +01:00
bors
46dcffd05b Auto merge of #31052 - bluss:split-at-mut-str, r=alexcrichton
Use raw pointers to avoid aliasing in str::split_at_mut

Introduce private function  from_raw_parts_mut for str to factor out the logic.

We want to use raw pointers here instead of duplicating a &mut str, to
be on safer ground w.r.t rust aliasing rules.

This has already been fixed for slices in PR #27358, issue #27357
2016-01-21 20:51:34 +00:00
Vadim Petrochenkov
ff6b0aac6a resolve: Fix variant namespacing 2016-01-21 23:22:01 +03:00
Ariel Ben-Yehuda
0a01d0b732 add fixme 2016-01-21 22:07:15 +02:00
Andrea Canciani
2f4622a36f Remove unsafe code from core::cmp
Instead of transmuting, use a match; the compiler has learnt how to
optimize it.
2016-01-21 20:49:10 +01:00
Niko Matsakis
56c73e58a2 Indicate that trans is always dependent on typeck 2016-01-21 14:27:29 -05:00
Niko Matsakis
0bdefd7064 Revamp the fulfillment cache tracking to only cache trait-refs, which
was the major use-case, and to update the dep-graph. Other kinds of
predicates are now excluded from the cache because there is no easy way
to make a good dep-graph node for them, and because they are not
believed to be that useful. :)

Fixes #30741. (However, the test still gives wrong result for trans,
for an independent reason which is fixed in the next commit.)
2016-01-21 14:27:29 -05:00
bors
9ae76b363c Auto merge of #31028 - erickt:ast-json, r=michaelwoerister
The protocol for `serialize::{En,De}code` doesn't allow for two integers to be serialized next to each other.

Closes #31025.

cc @michaelwoerister
2016-01-21 19:01:24 +00:00
Dave Huseby
8c4fdc19cb updating the libc dependency to pull in build breaker fixes 2016-01-21 10:05:27 -08:00
bors
c6ba7fee97 Auto merge of #31043 - shahn:arc_weak, r=alexcrichton
This was accidentally introduced in
7e2ffc7090,
b44ee371b8 and
36ba96ea3c.
2016-01-21 17:11:13 +00:00
Simonas Kazlauskas
e74aa2bdff [MIR] Promote temps to alloca on multi-assignment
Fixes #31002
2016-01-21 19:01:43 +02:00
bors
340e7eb2a7 Auto merge of #31024 - oli-obk:move_checks_out_of_librustc, r=arielb1
-    check_const
-    check_static_recursion
-    check_loop
-    check_rvalues

r? @arielb1
2016-01-21 15:21:09 +00:00
Ulrik Sverdrup
ba9a3bc453 core: Use raw pointers to avoid aliasing in str::split_at_mut
Introduce private function from_raw_parts_mut for str to factor out the logic.

We want to use raw pointers here instead of duplicating a &mut str, to
be on safer ground w.r.t rust aliasing rules.
2016-01-21 15:25:49 +01:00
bors
038de0f95e Auto merge of #31057 - bluss:memrchr-fallback, r=alexcrichton
Use the fallback impl for memrchr on non-linux

The memrchr code was never used(!). This brings the memrchr improvements to
non-linux platforms (LineWriter / buffered stdout benefits).

Previous PR #30381
2016-01-21 13:31:43 +00:00