Commit Graph

46086 Commits

Author SHA1 Message Date
Huon Wilson
b03ca7f805 Separate integers into signed and unsigned.
This is necessary to reflect the ARM APIs accurately, since some
functions explicitly take an unsigned parameter and a signed one, of the
same integer shape, so the no-duplicates check will fail unless we
distinguish.
2015-08-29 15:36:16 -07:00
bors
9982314577 Auto merge of #28077 - jonas-schievink:attr-gateage, r=huonw
This allows marking attributes as whitelisted/crate-only independent of
their feature gate status.

Closes #24213
2015-08-29 21:59:24 +00:00
bors
09dd65c2f6 Auto merge of #28090 - mystor:derive-unsafe-trait, r=Manishearth 2015-08-29 19:07:19 +00:00
Michael Layzell
38d450fad2 Allow #[derive()] to generate unsafe trait impls 2015-08-29 14:50:05 -04:00
Alisdair Owens
8ae2b1d7dd add long diagnostics for E0122 2015-08-29 17:20:46 +01:00
Alisdair Owens
9ed30c6214 add diagnostics for E0281 2015-08-29 16:50:35 +01:00
Jonas Schievink
4b571b055d Handle gateage of built-in attributes seperately
This allows marking attributes as whitelisted/crate-only independent of
their feature gate status.

Closes #24213
2015-08-29 11:37:40 +02:00
bors
3f002a4c6e Auto merge of #28080 - huonw:travis++, r=alexcrichton
It is very difficult to find tidy problems in the midst of the output of
the LLVM/jemalloc/etc. build, and travis is great for the former, so
lets remove that problem.
2015-08-29 06:36:51 +00:00
Huon Wilson
91a9260a16 Run tidy by itself on travis.
It is very difficult to find tidy problems in the midst of the output of
the LLVM/jemalloc/etc. build, and travis is great for the former, so
lets remove that problem.
2015-08-28 22:59:00 -07:00
bors
477561de4e Auto merge of #28078 - apasel422:patch-1, r=alexcrichton 2015-08-29 04:58:45 +00:00
bors
e9111e6a0e Auto merge of #28070 - mdchoate:patch-1, r=alexcrichton 2015-08-29 03:20:37 +00:00
Andrew Paseltiner
010b7f3621 Remove superfluous line from Nomicon 2015-08-28 22:07:02 -04:00
bors
d3b367efb3 Auto merge of #28042 - Jake-Shadle:master, r=steveklabnik
Encountered an issue with `pacman` while going through the guide for installing the `mingw` toolchain on Windows with `msys2`, after some googling I found the [solution](https://github.com/Alexpux/MSYS2-packages/issues/163#issuecomment-73555971).

I thought it would be good to update the README so people don't get frustrated. 😃 

r? @steveklabnik
2015-08-29 01:43:16 +00:00
bors
d50352419e Auto merge of #28043 - apasel422:rfc-1194, r=alexcrichton 2015-08-29 00:06:04 +00:00
bors
3c100de75a Auto merge of #27900 - SimonSapin:Chars_as_str, r=alexcrichton
See #27775.

r? @alexcrichton
2015-08-28 22:29:23 +00:00
bors
5d955e1740 Auto merge of #28068 - apasel422:debug-builders, r=sfackler
This appears to have been an oversight, as the structs are stable but only nameable through `core::fmt`.
2015-08-28 20:52:16 +00:00
Simon Sapin
e33650c16f Add .as_str() to str::Chars and str::CharIndices. See #27775. 2015-08-28 22:44:17 +02:00
bors
55ad22fa8f Auto merge of #28067 - apasel422:issue-20803, r=alexcrichton
closes #20803
2015-08-28 19:15:12 +00:00
Michael Choate
645d7ae739 Fix typo in loops.md 2015-08-28 14:34:15 -04:00
Jake Shadle
7ab8ed84fd Update README.md
Use suggested composite command instead of 2 separate commands.
2015-08-28 20:24:13 +02:00
Andrew Paseltiner
f6cfad6848 re-export debug builders in std::fmt 2015-08-28 13:39:25 -04:00
bors
0e8538d477 Auto merge of #28063 - steveklabnik:gh28053, r=alexcrichton
Fixes #28053
2015-08-28 17:15:07 +00:00
Andrew Paseltiner
4f3f55cc66 add test for #20803
closes #20803
2015-08-28 12:54:17 -04:00
Andrew Paseltiner
f9b63d3973 implement RFC 1194 2015-08-28 12:41:54 -04:00
Steve Klabnik
1c44722375 Be explicit about using crates.io's libc crate
Fixes #28053
2015-08-28 11:43:23 -04:00
bors
ab792abf1f Auto merge of #28047 - steveklabnik:doc_print, r=alexcrichton 2015-08-28 13:48:09 +00:00
Cesar Eduardo Barros
73e7a72695 Add issue number to read_exact unstable declarations 2015-08-28 06:33:50 -03:00
Jake Shadle
371c0ead1f Update README.md
Folded in suggestion from @brson to simply put the mirror update step in the regular set of tool chain install commands.
2015-08-28 09:46:23 +02:00
bors
6f28232756 Auto merge of #28054 - zaeleus:ios-imports, r=alexcrichton
This fixes building for ios targets caused by 7925c79.
2015-08-28 04:28:23 +00:00
bors
3a80411415 Auto merge of #28038 - durka:grep-unstable-issue-refs, r=alexcrichton
After submitting #28031, I ran a [script](https://gist.github.com/durka/a5243440697c780f669b) on the rest of src/ and found some anomalies. In this PR are the fixes that I thought were obvious (but I might be wrong!). The others I've submitted in issue #28037.
2015-08-28 02:49:45 +00:00
bors
20a8412e09 Auto merge of #27956 - withoutboats:extend_string, r=alexcrichton
If you have an `Iterator<Item=String>` (say because those items were generated using `.to_string()` or similarly), borrow semantics do not permit you map that to an `Iterator<&'a str>`. These two implementations close a small gap in the `String` API.

At the same time I've also made the names of the parameters to `String`'s `Extend` and `FromIterator` implementations consistent.
2015-08-28 01:06:51 +00:00
Michael Macias
c5ab1166e7 std: Fix backtrace imports for ios targets
This fixes building for ios targets caused by 7925c79.
2015-08-27 18:47:15 -05:00
bors
8dba06aeee Auto merge of #28052 - Manishearth:rollup, r=Manishearth
- Successful merges: #28010, #28013, #28022, #28029, #28033, #28039, #28045, #28048
- Failed merges:
2015-08-27 23:25:38 +00:00
Steve Klabnik
d9819b76d2 Add some examples for the print! macro 2015-08-27 19:02:45 -04:00
Manish Goregaokar
a63cd9b5a1 Rollup merge of #28048 - steveklabnik:doc_unimplemented, r=alexcrichton 2015-08-28 03:38:38 +05:30
Manish Goregaokar
1c7c6adf5f Rollup merge of #28045 - apasel422:iter, r=sfackler 2015-08-28 03:38:38 +05:30
Manish Goregaokar
07d1a22ce5 Rollup merge of #28039 - birkenfeld:option_result_ref_intoiter, r=alexcrichton
Fixes #27996.

Does this need any `#[stable]`/`#[unstable]` attributes?
2015-08-28 03:38:37 +05:30
Manish Goregaokar
0833d87762 Rollup merge of #28033 - Manishearth:compilerexpn, r=eddyb
We were using them for every expansion, instead of using `Name`.

Also converted `CompilerExpansion` into an enum so its nicer to use and takes up less space.

Will profile later, but this should be a small improvement in memory usage.

r? @eddyb
2015-08-28 03:38:37 +05:30
Manish Goregaokar
aebe352794 Rollup merge of #28029 - tshepang:unusual, r=steveklabnik 2015-08-28 03:38:37 +05:30
Manish Goregaokar
ab3dc54bcf Rollup merge of #28022 - steveklabnik:gh27936, r=alexcrichton
Fixes #27936
2015-08-28 03:38:37 +05:30
Manish Goregaokar
71ecc42eed Rollup merge of #28013 - artemshitov:rustbook-scrolling, r=steveklabnik
As of now, when you open a page in the Rust book and other books made with `rustbook`, you cannot scroll with your keyboard, whether using spacebar or arrow keys, unless you explicitly focus on the content div by clicking.

This PR fixes the issue by removing the bound on the content div size and by sticking the TOC with `position: fixed` rather than restricting the content to the window height.

r? @steveklabnik
2015-08-28 03:38:36 +05:30
Manish Goregaokar
a3b32ebda4 Rollup merge of #28010 - GuillaumeGomez:patch-2, r=Manishearth
r? @Manishearth
2015-08-28 03:38:36 +05:30
Manish Goregaokar
25cbb4385e Move ExpnInfo to Name 2015-08-28 03:37:13 +05:30
bors
79dd92fc16 Auto merge of #27930 - barosl:path_max, r=alexcrichton
This PR rewrites the code that previously relied on `PATH_MAX`.

On my tests, even though the user gives the buffer length explicitly, both Linux's glibc and OS X's libc seems to obey the hard limit of `PATH_MAX` internally. So, to truly remove the limitation of `PATH_MAX`, the related system calls should be rewritten from scratch in Rust, which this PR does not try to do.

However, eliminating the need of `PATH_MAX` is still a good idea for various reasons, such as: (1) they might change the implementation in the future, and (2) some platforms don't have a hard-coded `PATH_MAX`, such as GNU Hurd.

More details are in the commit messages.

Fixes #27454.

r? @alexcrichton
2015-08-27 21:47:33 +00:00
bors
abfa081c10 Auto merge of #27999 - dotdash:lt, r=eddyb
The major change here is in the tiny commit at the end and makes it so that we no longer emit lifetime intrinsics for allocas for function arguments. They are live for the whole function anyway, so the intrinsics add no value. This makes the resulting IR more clear, and reduces the peak memory usage and LLVM times by about 1-4%, depending on the crate.

The remaining changes are just preparatory cleanups and fixes for missing lifetime intrinsics.
2015-08-27 20:09:15 +00:00
Barosl Lee
6065678e62 Use a different buffer doubling logic for std::sys::os::getcwd
Make `std::sys::os::getcwd` call `Vec::reserve(1)` followed by
`Vec::set_len` to double the buffer. This is to align with other similar
functions, such as:

- `std::sys_common::io::read_to_end_uninitialized`
- `std::sys::fs::readlink`

Also, reduce the initial buffer size from 2048 to 512. The previous size was
introduced with 4bc26ce in 2013, but it seems a bit excessive. This is
probably because buffer doubling was not implemented back then.
2015-08-28 04:48:03 +09:00
Barosl Lee
7723550fdd Reduce the reliance on PATH_MAX
- Rewrite `std::sys::fs::readlink` not to rely on `PATH_MAX`

It currently has the following problems:

1. It uses `_PC_NAME_MAX` to query the maximum length of a file path in
the underlying system. However, the meaning of the constant is the
maximum length of *a path component*, not a full path. The correct
constant should be `_PC_PATH_MAX`.

2. `pathconf` *may* fail if the referred file does not exist. This can
be problematic if the file which the symbolic link points to does not
exist, but the link itself does exist. In this case, the current
implementation resorts to the hard-coded value of `1024`, which is not
ideal.

3. There may exist a platform where there is no limit on file path
lengths in general. That's the reaon why GNU Hurd doesn't define
`PATH_MAX` at all, in addition to having `pathconf` always returning
`-1`. In these platforms, the content of the symbolic link can be
silently truncated if the length exceeds the hard-coded limit mentioned
above.

4. The value obtained by `pathconf` may be outdated at the point of
actually calling `readlink`. This is inherently racy.

This commit introduces a loop that gradually increases the length of the
buffer passed to `readlink`, eliminating the need of `pathconf`.

- Remove the arbitrary memory limit of `std::sys::fs::realpath`

As per POSIX 2013, `realpath` will return a malloc'ed buffer if the
second argument is a null pointer.[1]

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

- Comment on functions that are still using `PATH_MAX`

There are some functions that only work in terms of `PATH_MAX`, such as
`F_GETPATH` in OS X. Comments on them for posterity.
2015-08-28 04:46:55 +09:00
bors
17b6fcd458 Auto merge of #28031 - durka:patch-6, r=alexcrichton
It was pointing at the issue for `placement_new_protocol`.
2015-08-27 18:30:47 +00:00
Barosl Lee
4ff44ff8fa libc: Fix constants used by libc::pathconf
`_PC_NAME_MAX` is necessary to use `libc::pathconf`. Its value is fixed
to 3 currently, but actually it varies with the platform.

* _PC_NAME_MAX == 3

Linux (glibc): https://sourceware.org/git/?p=glibc.git;a=blob;f=bits/confname.h;h=1c714dfbf9398b8a600f9b69426a7ad8c7e89ab4;hb=HEAD#l32
NaCl (newlib): 373135ec52/newlib/libc/include/sys/unistd.h (430)

* _PC_NAME_MAX == 4

Android (Bionic): 7e919daeaa/libc/include/unistd.h (L59)
FreeBSD: https://svnweb.freebsd.org/base/head/sys/sys/unistd.h?revision=239347&view=markup#l127
NetBSD: http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/unistd.h
OS X: http://opensource.apple.com/source/xnu/xnu-2782.10.72/bsd/sys/unistd.h

This commit fixes this, and also addes the `_PC_PATH_MAX` constant
needed by further commits.
2015-08-28 03:15:15 +09:00
Steve Klabnik
59653c10a6 Some extra examples for the unimplemented! macro 2015-08-27 14:14:06 -04:00