Commit Graph

41387 Commits

Author SHA1 Message Date
Nick Cameron
b35a587da1 Reviewer comments 2015-04-14 22:17:08 +12:00
Nick Cameron
4ad4363870 Better explanation of AutoDerefRef 2015-04-14 21:55:42 +12:00
Nick Cameron
73c2e768d6 Rebased 2015-04-14 21:55:42 +12:00
Eduard Burtescu
4e8e64140f eddyb's refactoring of coercions/adjustments 2015-04-14 21:55:42 +12:00
Felix S. Klock II
32d5f742cb typeck: Do high-level structural/signature checks before function body checks.
This avoids various ICEs, e.g. premature calls to cat_expr that yield
the dreaded "cat_expr Errd" ICE.
2015-04-14 11:20:21 +02:00
bors
a9d8065633 Auto merge of #24408 - richo:configure-optimize-default, r=pnkfelix
Optimization is now on by default. Closes #24405
2015-04-14 09:05:22 +00:00
Richo Healey
fd69ac160b configure: Turn optimization back on iff --enable-optimize 2015-04-14 00:58:57 -07:00
Richo Healey
87efd2cd74 configure: Set CFG_<FOO>_PROVIDED if it was supplied
This allows you to distinguish between an option that defaulted, and an
option selected by the user
2015-04-14 00:58:51 -07:00
Richo Healey
71a4ea56c2 configure: Don't disable optimizations when enabling debug
Optimization is now on by default. Closes #24405
2015-04-14 00:07:27 -07:00
bors
a4eb5a66a5 Auto merge of #24295 - contradictioned:master, r=alexcrichton
As i proposed in #24262 (and found acceptance in the IRC channel), added a compiler warning for wrong escaping of curly braces.
2015-04-14 06:54:20 +00:00
bors
5dc8060e3f Auto merge of #24287 - brson:beta, r=steveklabnik
r? @steveklabnik

Should land this, https://github.com/rust-lang/rust/pull/24270, and https://github.com/rust-lang/rust/pull/24245 before rolling another beta.
2015-04-14 04:42:06 +00:00
fenduru
ab93a51068 Point to From trait in error handling guide
Not sure if `From<Error>` is the correct way to reference that trait (maybe `From<E: Error>`?)
2015-04-13 22:01:20 -04:00
Brian Anderson
942c97bce5 Make use of the stability attributes issue a deprecation warning. #22830 2015-04-13 18:42:48 -07:00
Steve Klabnik
00867b312c Fix up nightly installation instructions.
The two-step command left off the nightly flag :frown:

Thanks @mdinger
2015-04-13 21:23:44 -04:00
bors
e6a8124028 Auto merge of #24251 - alexcrichton:unsafe-from-raw-fd, r=aturon
As pointed out in [RFC issue 1043][rfc] it is quite useful to have the standard
I/O types to provide the contract that they are the sole owner of the underlying
object they represent. This guarantee enables writing safe interfaces like the
`MemoryMap` API sketched out in that issue.

[rfc]: https://github.com/rust-lang/rfcs/issues/1043

As constructing objects from these raw handles may end up violating these
ownership gurantees, the functions for construction are now marked unsafe.

[breaking-change]
Closes rust-lang/rfcs#1043
2015-04-14 00:07:50 +00:00
Steve Klabnik
8a65029fac Link RBE more prominently
It's no longer a community based project.

Also, Rust for Rubyists is deprecated at this point, so we shouldn't
link to it anymore.
2015-04-13 18:33:37 -04:00
rundrop1
57e3475794 Update vectors.md
Feel silly because it's just one thing but it was bothering me that the documentation tells you what you're not going to learn now instead of linking to the item in question.  Am total noob pls assist, where is power button. :)
2015-04-13 17:14:53 -05:00
Nick Cameron
01678acf50 Expose visibility for fns in syntax::visit 2015-04-14 09:54:58 +12:00
Aaron Turon
6e0fb70ff6 Generalize spawn beyond unit closures
`thread::spawn` was previously restricted to closures that return `()`,
which limited the utility of joining on a spawned thread. However, there
is no reason for this restriction, and this commit allows arbitrary
return types.

Since it introduces a type parameter to `JoinHandle`, it's technically
a:

[breaking-change]

However, no code is actually expected to break.
2015-04-13 14:48:17 -07:00
Avdi Grimm
810757935e Wording for dynamic languages. 2015-04-13 16:23:57 -04:00
Simonas Kazlauskas
32f7e673c8 Refine read_to_end documentation 2015-04-13 22:41:41 +03:00
Abhishek Chanda
f60f4b7d7c Fix check for globally routable IPv4 address
- Adds two more functions for broadcast address and special
  address classes reserved for documentation
- Modifies the globally routable IP check to include these
  new functions

Fixes #24314
2015-04-13 12:38:09 -07:00
Aaron Turon
6399bb425b De-stabilize thread::scoped and friends
Issue #24292 demonstrates that the `scoped` API as currently offered can
be memory-unsafe: the `JoinGuard` can be moved into a context that will
fail to execute destructors prior to the stack frame being popped (for
example, by creating an `Rc` cycle).

This commit reverts the APIs to `unstable` status while a long-term
solution is worked out.

(There are several possible ways to address this issue; it's not a
fundamental problem with the `scoped` idea, but rather an indication
that Rust doesn't currently provide a good way to ensure that
destructors are run within a particular stack frame.)

[breaking-change]
2015-04-13 12:15:28 -07:00
Avdi Grimm
ab8c884b34 Refer to Ruby/Python/JS as "dynamically evaluated"
"Dynamically typed" didn't seem like a relevant distinction; there are statically-compiled dynamically-typed languages. Another term that might work here (despite being notoriously vague) is "scripting languages".
2015-04-13 14:03:24 -04:00
Andrew Paseltiner
6fa16d6a47 pluralize doc comment verbs and add missing periods 2015-04-13 13:57:51 -04:00
Erick Tryzelaar
951db77267 syntax: Publically expose printing where clauses, and add attr_to_string 2015-04-13 10:49:34 -07:00
bors
f55e66aaed Auto merge of #24198 - alexcrichton:windows-readlink, r=aturon
The current implementation of using GetFinalPathNameByHandle actually reads all
intermediate links instead of just looking at the current link. This commit
alters the behavior of the function to use a different API which correctly reads
only one level of the soft link.

[breaking-change]
2015-04-13 17:39:14 +00:00
Ariel Ben-Yehuda
39543e91f5 Don't try to suggest fields of an enum
Fixes #24365
2015-04-13 19:29:23 +03:00
bors
588d37c653 Auto merge of #24362 - alexcrichton:issue-24334, r=huonw
Make sure the unstable `scoped` modules isn't named the same as the `scoped`
function.

cc #24334
2015-04-13 14:57:13 +00:00
pez
883bb6568d remove duplicated linux sysconf mod 2015-04-13 15:17:45 +01:00
Manuel Hoffmann
4abade50d7 Added a help span which informs the user about the escaping of curly braces in a format string if a wrongly escaped one is detected in a string. 2015-04-13 15:56:10 +02:00
pez
6f54ce9aa5 added _SC_NPROCESSORS_ONLN constants for linux and macos for fix #24374 2015-04-13 14:24:47 +01:00
bors
b9ed9e2a32 Auto merge of #24351 - michaelwoerister:named-tuple-fields, r=alexcrichton
This PR makes `rustc` emit field names for tuple fields in DWARF. Formerly there was no way of directly accessing the fields of a tuple in GDB and LLDB since there is no C/C++ equivalent to this. Now, the debugger sees the name `__{field-index}` for tuple fields. So you can type for example `some_tuple_val.__2` to get the third tuple component.
When pretty printers are used (e.g. via `rust-gdb` or `rust-lldb`) these artificial field names will not clutter tuple rendering (which was the main motivation for not doing this in the past).

Solves #21948.
2015-04-13 12:39:49 +00:00
Björn Steinbrink
e891f29b95 Fix ICE when returning a variable whose declaration is unreachable
Fixes #24353
2015-04-13 13:07:41 +02:00
bors
3cac76bcf2 Auto merge of #24344 - gfxmonk:update-libbacktrace, r=pnkfelix
On linux, certain crashes can cause rust's backtrace generation code to consume huge amounts of memory (multiple gigabytes) when trying to generate a backtrace (e.g. servo/servo#5340).

I tracked this down to a bug in libbacktrace's allocation strategy when processing large binaries, and thankfully it's already been fixed upstream.

The change which fixes this specific issue is r210256, and is discussed here:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00547.html

I assume we'd prefer to update libbacktrace wholesale, rather than cherry-picking individual patches, so this PR updates libbacktrace to the latest code from svn://gcc.gnu.org/svn/gcc/trunk/libbacktrace (r220112).

I've copied the upstream code and reapplied the parts of the following commits which touch src/libbacktrace:

 - cd8f31759f
 - fcb30a0b67

I have not reapplied f5765793b6 or d51047ded0, as those are both cosmetic cleanups applied to the entire codebase. For this directory, it seems worthwhile diverging as little as possible from upstream, to reduce the effort of future updates. But I can add them as well if preferred.
2015-04-13 10:23:58 +00:00
kgv
c3c83bfda4 Arity link has moved to primitive-types.md. 2015-04-13 12:11:37 +03:00
bors
524547551c Auto merge of #24339 - lfairy:remove-regex-data, r=alexcrichton
The regex crate keeps its own tables now (rust-lang/regex#41) so we
don't need them here.

[breaking-change]
2015-04-13 08:08:23 +00:00
bors
49798c597f Auto merge of #24323 - rprichard:panic-line-type, r=alexcrichton
There are syntax extensions that call `std::rt::begin_unwind` passing it a `usize`.  I updated the syntax extension to instead pass `u32`, but for bootstrapping reasons, I needed to create a `#[cfg(stage0)]` version of `std::rt::begin_unwind` and therefore also `panic!`.
2015-04-13 05:55:50 +00:00
Ryan Prichard
861556390e Remove pretty-expanded from tests that use format_args!
Now that the internals of `format_args!` are unstable, tests that use it
don't compile after pretty-printing (unless they also declare the necessary
feature).
2015-04-12 22:01:55 -07:00
Ryan Prichard
9cdc9e9c61 Destabilize format_args! internals.
Arguments, Formatters, and the various format traits remain stable. The
format_args! macro uses #[allow_internal_unstable] to allow it access to
the unstable things in core::fmt.

Destabilized things include a "v1" in their name:
 * core::fmt::rt
 * core::fmt::rt::v1 (the module and all contents)
 * core::fmt::ArgumentV1
 * core::fmt::ArgumentV1::new
 * core::fmt::ArgumentV1::from_usize
 * core::fmt::Arguments::new_v1
 * core::fmt::Arguments::new_v1_formatted

The unstable message was copied from that of std::io::_print.
2015-04-12 22:01:55 -07:00
Ryan Prichard
bd26307411 Use the ecx.call_site() span for generating refs to format_args! internals
`format_args!` uses `#[allow_internal_unstable]` to access internal
functions and structs that are marked unstable. For this to work, the
spans on AST nodes referencing unstable internals must be equal (same
lo/hi values) to the `format_args!` call site, so that the stability
checker can recognize that the AST node was generated by the macro.
2015-04-12 22:01:55 -07:00
Alex Crichton
dc1f216227 std: Work around a stability bug in thread
Make sure the unstable `scoped` modules isn't named the same as the `scoped`
function.

cc #24334
2015-04-12 21:43:25 -07:00
bors
0cf99c3e06 Auto merge of #24315 - richo:make-debug-helper, r=pnkfelix
Also add docs because not being able to discover these things is the pits.

This was lifted from http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html , and solves a problem I've solved myself a *lot* of times, often in massively inferior ways.

Super open to documenting it somewhere other than nitty-gritty, which isn't immediately obvious.
2015-04-13 02:50:13 +00:00
Barosl Lee
cef96b95f2 rustdoc: Prevent '/' from showing the help dialog
Only '?' should do that.

Fixes #24289.
2015-04-13 10:33:50 +09:00
bors
47def3ef27 Auto merge of #23849 - bcoopers:master, r=pnkfelix
Right now, if the user requests to increase the vector size via reserve() or push_back() and the request brings the attempted memory above usize::MAX, we panic.

With this change there is only a panic if the minimum requested memory that could meet the requirement is above usize::MAX- otherwise it simply requests its largest capacity possible, usize::MAX.
2015-04-13 00:34:21 +00:00
Chris Wong
5308ac939a Remove regex module from libunicode
The regex crate keeps its own tables now (rust-lang/regex#41) so we
don't need them here.

[breaking-change]
2015-04-13 10:30:10 +12:00
Robin Kruppe
219f61bdd8 Make Debug include the - in -0.0 2015-04-12 23:39:03 +02:00
bors
c3947061d6 Auto merge of #24349 - Manishearth:rollup, r=Manishearth
- Successful merges: #24072, #24233, #24321, #24339, #24341, #24342, #24347
- Failed merges:
2015-04-12 20:50:19 +00:00
Manish Goregaokar
72dc6fcbe7 Rollup merge of #24347 - xamgore:master, r=huonw
Docs meant that ParseIntError is returned though the function returns ParseFloatError.
2015-04-13 02:21:02 +05:30
Michael Woerister
03f9269496 Add a name for tuple fields in debuginfo so that they can be accessed in debuggers. 2015-04-12 20:44:25 +02:00