Commit Graph

50053 Commits

Author SHA1 Message Date
Simonas Kazlauskas
02365fe753 Change successor{,_mut} to return a Vec
This helps to avoid the unpleasant restriction of being unable to have multiple successors in
non-contiguous block of memory.
2016-02-04 15:56:04 +02:00
Simonas Kazlauskas
432460a6fc Synthesize calls to box_free language item
This gets rid of Drop(Free, _) MIR construct by synthesizing a call to language item which
takes care of dropping instead.
2016-02-04 15:56:01 +02:00
bors
7b9d6d3bc8 Auto merge of #31069 - sfackler:file-try-clone, r=alexcrichton
I have it set as stable right now under the rationale that it's extending an existing, stable API to another type in the "obvious" way.

r? @alexcrichton

cc @reem
2016-02-04 11:39:27 +00:00
Steven Fackler
a414b61f92 Add File::try_clone 2016-02-04 09:43:21 +00:00
bors
9c30f12790 Auto merge of #31378 - nagisa:target-man, r=alexcrichton 2016-02-04 09:38:15 +00:00
bors
f511b21dba Auto merge of #31326 - sdleffler:master, r=nikomatsakis
After the truly incredible and embarrassing mess I managed to make in my last pull request, this should be a bit less messy.

Fixes #31267 - with this change, the code mentioned in the issue compiles.

Found and fixed another issue as well - constants of zero-size types, when used in ExprRepeats inside associated constants, were causing the compiler to crash at the same place as #31267. An example of this:
```

struct Bar;

const BAZ: Bar = Bar;

struct Foo([Bar; 1]);

struct Biz;

impl Biz {
    const BAZ: Foo = Foo([BAZ; 1]);
}

fn main() {
    let foo = Biz::BAZ;
    println!("{:?}", foo);
}
```
However, I'm fairly certain that my fix for this is not as elegant as it could be. The problem seems to occur only with an associated constant of a tuple struct containing a fixed size array which is initialized using a repeat expression, and when the element to be repeated provided to the repeat expression is another constant which is of a zero-sized type. The fix works by looking for constants and associated constants which are zero-width and consequently contain no data, but for which rustc is still attempting to emit an LLVM value; it simply stops rustc from attempting to emit anything. By my logic, this should work fine since the only values that are emitted in this case (according to the comments) are for closures with side effects, and constants will never have side effects, so it's fine to simply get rid of them. It fixes the error and things compile fine with it, but I have a sneaking suspicion that it could be done in a far better manner.

r? @nikomatsakis
2016-02-04 06:07:26 +00:00
bors
1096e7ab7a Auto merge of #30962 - Amanieu:non_volatile_atomic, r=alexcrichton
Rust currently emits atomic loads and stores with the LLVM `volatile` qualifier. This is unnecessary and prevents LLVM from performing optimization on these atomic operations.
2016-02-04 02:46:44 +00:00
bors
3c9442fc50 Auto merge of #30796 - GuillaumeGomez:impl_box_error, r=alexcrichton
Fixes #30349
2016-02-04 00:39:55 +00:00
bors
e3bcddb44b Auto merge of #31078 - nbaksalyar:illumos, r=alexcrichton
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846.

Required changes in libc are already merged: https://github.com/rust-lang-nursery/libc/pull/138

Here's a snapshot required to build a stage0 compiler:
https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz
It passes all checks from `make check`.

There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated.

Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409

Thanks!

r? @brson
2016-02-03 22:40:32 +00:00
bors
18c1781a4c Auto merge of #30834 - reem:rwlock-read-guard-map, r=alexcrichton
This is very useful when the RwLock is synchronizing access to a data
structure and you would like to return or store guards which contain
references to data inside the data structure instead of the data structure
itself.
2016-02-03 19:26:05 +00:00
bors
8fc73c703a Auto merge of #31056 - kamalmarhubi:std-process-nul-chars, r=alexcrichton
This reports an error at the point of calling `Command::spawn()` or one of
its equivalents.

Fixes #30858
Fixes #30862
2016-02-03 17:19:10 +00:00
Kamal Marhubi
7c64bf1b9b std: Properly handle interior NULs in std::process
This reports an error at the point of calling `Command::spawn()` or one of
its equivalents.

Fixes https://github.com/rust-lang/rust/issues/30858
Fixes https://github.com/rust-lang/rust/issues/30862
2016-02-03 10:54:29 -05:00
bors
b14af1e4ef Auto merge of #31371 - apasel422:docs, r=alexcrichton
r? @steveklabnik
2016-02-03 15:13:39 +00:00
Nikita Baksalyar
fae883c113
Fix broken auto-mac-ios-opt build 2016-02-03 16:45:34 +03:00
bors
2d4e94a501 Auto merge of #31385 - oli-obk:doc/mir, r=nagisa
I didn't change any content, just added another slash so we can see those comments in the docs

r? @steveklabnik
2016-02-03 13:05:18 +00:00
Oliver Schneider
4e44ef1e29 upgrade comments on MIR structures and functions to doc comments 2016-02-03 13:25:07 +01:00
bors
db6f888e78 Auto merge of #31375 - nagisa:path-docs, r=alexcrichton 2016-02-03 10:59:47 +00:00
Simonas Kazlauskas
c5c756bf14 Improve wording of --target help 2016-02-03 12:04:17 +02:00
bors
8c77ffb484 Auto merge of #31338 - dirk:dirk/add-name-bindings-for-bad-imports, r=nrc
WIP implementation of #31209.

The goal is to insert fake/dummy definitions for names that we failed to import so that later resolver stages won't complain about them.
2016-02-03 08:51:31 +00:00
bors
54664f1884 Auto merge of #31263 - dhuseby:fixing_bsd_builds, r=alexcrichton
Something went haywire with github last night and the old PR https://github.com/rust-lang/rust/pull/31230 got closed somehow.  This new PR is to replace the old one.  This incorporates all of the feedback from the other PR.

@alexcrichton I incorporated the suggestion from @semarie and the result is cleaner and clearer.  I think this is ready to go.
2016-02-03 06:38:01 +00:00
Dave Huseby
ca6f920346 trying again at fixing stackp initialization 2016-02-02 21:42:11 -08:00
Dave Huseby
68bfd43eef simplifying get_stack 2016-02-02 21:42:11 -08:00
Dave Huseby
7803c8d688 refactoring get_stack to be cleaner 2016-02-02 21:42:11 -08:00
Dave Huseby
c83128eb60 unifying name_bytes now that the two blocks are the same 2016-02-02 21:42:11 -08:00
Dave Huseby
0153e64d97 Fixes #31229 2016-02-02 21:42:11 -08:00
Dirk Gadsden
026bcbf91e Spelling fix in middle::def::Def 2016-02-02 20:48:56 -08:00
Dirk Gadsden
5ed8e98ea2 Add fake import resolutions & targets for names in bad imports 2016-02-02 20:47:34 -08:00
bors
50df6b9dc5 Auto merge of #31319 - alexcrichton:msvc-backtraces, r=michaelwoerister
This mirrors the behavior of `clang-cl.exe` by adding a `CodeView` global
variable when emitting debug information. This should in turn help stack traces
that are generated when code is compiled with debuginfo enabled.

Closes #28133
2016-02-03 03:06:52 +00:00
bors
a9922419cf Auto merge of #31370 - Manishearth:rollup, r=Manishearth
- Successful merges: #27499, #31220, #31329, #31332, #31347, #31351, #31352, #31366
- Failed merges:
2016-02-03 00:58:37 +00:00
Jonathan Reem
fc875b087c Add issue number to guard map methods. 2016-02-02 16:34:49 -08:00
Simonas Kazlauskas
1a886bc3c9 Improve docs for Path::methods 2016-02-03 01:16:58 +02:00
bors
dea183aa84 Auto merge of #31361 - alexcrichton:revert-mk-changes, r=brson
This reverts commit d03712977d.
2016-02-02 21:57:57 +00:00
Andrew Paseltiner
27319b48eb Correct linked_list::IntoIter doc comment 2016-02-02 16:45:35 -05:00
Manish Goregaokar
1a21dabf27 Rollup merge of #31366 - paulsmith:patch-1, r=steveklabnik
The context of the link is `Result` but it points to the docs on `Option`'s `expect`.
2016-02-03 02:54:25 +05:30
Manish Goregaokar
86650211a9 Rollup merge of #31352 - steveklabnik:gh31154, r=nikomatsakis
Fixes #31154
2016-02-03 02:54:25 +05:30
Manish Goregaokar
5540605cd6 Rollup merge of #31351 - steveklabnik:gh31318, r=alexcrichton
This is a behavior that some find confusing, so it deserves its own example.

Fixes #31318

I think this wording might be a bit strange, but I couldn't come up with anything better. Feedback very welcome.
2016-02-03 02:54:25 +05:30
Manish Goregaokar
688f607352 Rollup merge of #31347 - GuillaumeGomez:fix_E0118, r=Manishearth
r? @eddyb
2016-02-03 02:54:25 +05:30
Manish Goregaokar
f55995bad2 Rollup merge of #31332 - durka:errorck-fileline, r=brson
Small modification to #31288. Shows full path and line number for unused error codes.
2016-02-03 02:54:24 +05:30
Manish Goregaokar
93042f2bfb Rollup merge of #31329 - quodlibetor:no-const-doc-in-stable, r=alexcrichton
Fixes #31098

AFAICT this is the only place where rustdoc explicitly checks if we are on stable before emitting content, so I can't tell if this is the sane way to handle this, or if anything else should be done to make sure that nobody forgets to remove this check when `const` is stabilized.
2016-02-03 02:54:24 +05:30
Manish Goregaokar
ae96e51ac7 Rollup merge of #31220 - steveklabnik:gh30632, r=nikomatsakis
Fixes #30632

I'm not sure if this explanation is good enough. If it is, I will add it to filter as well.
2016-02-03 02:54:24 +05:30
Manish Goregaokar
76e0025078 Rollup merge of #27499 - barosl:macro-doc-raw-str-hashes, r=nikomatsakis
Any documentation comments that contain raw-string-looking sequences may pretty-print invalid code when expanding them, as the current logic always uses the `r"literal"` form, without appending any `#`s.

This commit calculates the minimum number of `#`s required to wrap a comment correctly and appends `#`s appropriately.

Fixes #27489.
2016-02-03 02:54:24 +05:30
Sean Leffler
fb00e60ab1 Added assertion ensuring zero-sized type. 2016-02-02 11:41:19 -08:00
bors
2dc132e4d2 Auto merge of #31312 - alexcrichton:no-le-in-powerpc64le, r=alexcrichton
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the
`target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the
`powerpc64le` target does indeed set the `target_arch` as `powerpc64le`,
causing a bit of inconsistency between theset two.

As these are just the same instance of one instruction set, let's use
`target_endian` to switch between them and only set the `target_arch` as one
value. This should cut down on the number of `#[cfg]` annotations necessary and
all around be a little more ergonomic.
2016-02-02 17:11:48 +00:00
Steve Klabnik
6c907212b4 Add note about temporaries 2016-02-02 11:15:45 -05:00
Paul Smith
b2e887f0aa Fix reference to expect
The context of the link is `Result` but it points to the docs on `Option`'s `expect`.
2016-02-02 08:47:23 -06:00
bors
59b7c907a3 Auto merge of #31254 - tmiasko:macro-pretty-print-fix, r=sfackler
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-02-02 14:00:50 +00:00
bors
ddd1bf594f Auto merge of #30991 - rthomas:master, r=Gankro
Using the test @bluss suggested in #30983
2016-02-02 10:45:06 +00:00
bors
01d44ca74f Auto merge of #31359 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30971, #31202, #31247, #31270, #31281, #31327, #31339, #31340, #31342, #31344, #31345, #31346, #31348
- Failed merges:
2016-02-02 07:28:04 +00:00
Alex Crichton
178d4b0fd3 Revert "mk: fix some undefined variable warnings"
This reverts commit d03712977d.
2016-02-01 23:27:04 -08:00
Ryan Thomas
8aae7f78ce Ensure capacity returned of HashMap is max(capacity, length).
r? @Gankro
2016-02-02 17:17:24 +11:00