Commit Graph

46654 Commits

Author SHA1 Message Date
Nick Howell
9f770a7536 rustbook: Inline javascript.rs into build.rs
There's no need for javascript.rs now that its contents were moved into
.js files.

Also, adjust a couple variable names and some indentation in build.rs.
2015-09-24 22:43:18 -04:00
Nick Howell
115ec662b5 Add 'use strict' to playpen.js 2015-09-24 22:35:04 -04:00
Nick Howell
c8f5f6f70f Replace occurrences of "rust-book" with "rustbook" 2015-09-24 22:34:01 -04:00
Nick Howell
5ac899c8c2 Cleanup rustbook.js and add 'use strict'
Mostly indentation fixes, but a little refactoring, too.
2015-09-24 21:59:43 -04:00
bors
f0666b45dd Auto merge of #28598 - semarie:openbsd-unbreak, r=alexcrichton
separate use code between openbsd/netbsd

netbsd use c_int and c_uint, but openbsd not, resulting a unused_import
error.

r? @alexcrichton 

problem introduced by #28543
2015-09-24 00:02:07 +00:00
bors
4f15e465e5 Auto merge of #28596 - sanxiyn:dedup-unused, r=alexcrichton
Fix #22599.
2015-09-23 21:41:09 +00:00
bors
afae2ff723 Auto merge of #28569 - semarie:stdcpp-tests, r=alexcrichton
extend the search path of libraries to /usr/local/lib in `run-make`
testsuite. It should permit to find libstdc++.so on usual directory.

r? @alexcrichton
2015-09-23 18:55:01 +00:00
bors
edeb4f1c86 Auto merge of #28603 - steveklabnik:small_config_fix, r=alexcrichton
We don't actually probe for javac in all circumstances, so if you have
javac installed, but don't have antlr4 installed, and you're on Mac OS
X, then you'll get a message that javac is missing, even though that's
wrong.

To fix this, let's just be a bit more generic in the message, so that
it's the same no matter what part of the lexer tests you're missing.

cc
https://www.reddit.com/r/rust/comments/3m199d/running_make_check_on_the_source_code_says_javac/
2015-09-23 16:07:04 +00:00
Steve Klabnik
f78115434c Make lexer tooling message more generic
We don't actually probe for javac in all circumstances, so if you have
javac installed, but don't have antlr4 installed, and you're on Mac OS
X, then you'll get a message that javac is missing, even though that's
wrong.

To fix this, let's just be a bit more generic in the message, so that
it's the same no matter what part of the lexer tests you're missing.

cc
https://www.reddit.com/r/rust/comments/3m199d/running_make_check_on_the_source_code_says_javac/
2015-09-23 11:43:49 -04:00
Sébastien Marie
3b42b60bf6 unbreak openbsd after netbsd integration
separate use code between openbsd/netbsd.

netbsd use c_int and c_uint, but openbsd not, resulting a unused_import
error.
2015-09-23 09:39:50 +02:00
bors
07ca1ab1ec Auto merge of #28585 - ranma42:simpler-panic, r=alexcrichton
This is part of some cleanup I did while investigating #28129.
This also ensures that `on_panic` is run even if the user has registered too many callbacks.
2015-09-23 03:56:27 +00:00
Seo Sanghyeon
54792febe0 Do not traverse RHS of assignment twice for unused variables lint
walk_expr includes call to visit_expr for subexpressions.
2015-09-23 11:52:37 +09:00
bors
cefe5f25b2 Auto merge of #28580 - wesleywiser:split_out_type_lints, r=alexcrichton
Move out the `TypeLimits` and `ImproperCTypes` lints into a separate module. 

Part of #22206
2015-09-23 02:11:18 +00:00
bors
b2f379cdc2 Auto merge of #28535 - petrochenkov:name, r=nrc
Part of https://github.com/rust-lang/rust/issues/6993

This patch replaces `Ident`s with `Name`s in data structures of HIR and updates the dependent crates to compile and pass `make check`.
Some HIR structures still use `Ident`s, namely `PathSegment`, `PatIdent`, `ExprWhile`, `ExprLoop`, `ExprBreak` and `ExprAgain`,  they need them for resolve (but `PathSegment` is special, see https://github.com/rust-lang/rust/issues/6993#issuecomment-141256292).

r? @nrc
2015-09-23 00:25:42 +00:00
bors
ad82e0ac18 Auto merge of #28504 - Eljay:fix-trait-privacy, r=nrc
Fixes #16264 / #18241.

As far as I can tell, it should be impossible for a trait to be inaccessible if it's in scope, so this check is unnecessary. Are there any cases where this check is actually needed?
2015-09-22 22:42:00 +00:00
bors
ecbd8c3b43 Auto merge of #28369 - ebfull:fix-higher-ranked, r=nikomatsakis
Fixes #28279.

Currently

`common_supertype(*mut for<'a> Fn(&'a usize), *mut for<'a> Fn(&'a usize) + 'static)`

equals `*mut Fn(&usize)` which seems to be caused by `higher_ranked_sub()` allowing region variables to escape the comparison. This prevents inference from working properly with stuff like `Rc<Fn(&T)>`.

r? @nikomatsakis
2015-09-22 20:57:43 +00:00
bors
9c1aaeb7b9 Auto merge of #28543 - gandro:netbsd, r=alexcrichton
These changes introduce the ability to cross-compile working binaries for NetBSD/amd64. Previous support added in PR #26682 shared all its code with the OpenBSD implementation, and was therefore never functional (e.g. linking against non-existing symbols and using wrong type definitions). Nonetheless, the previous patches were a great starting point and made my work significantly easier. 😃 

Because there are no stage0 snapshots for NetBSD (yet), I used a cross-compiler for NetBSD 7.0 RC3 and only tested some toy programs (threading and channels, stack guards, a small TCP/IP echo server and some other platform dependent bits). If someone could point me to documentation on how to generate a stage0 snapshot from a cross-compiler I'm happy to run the full test suite.

A few other notes regarding Rust on NetBSD/amd64:
- To preserve binary compatibility, NetBSD introduces new symbols for system call wrappers on breaking ABI changes and keeps the old (legacy) symbols around, see [this documentation](https://www.netbsd.org/docs/internals/en/chap-processes.html#syscalls_master) for some details. I went ahead and modified the `libc` and `std` crate to use the current (renamed) symbols instead of the legacy ones where I found them, but I might have missed some. Notably using the `sigaction` symbol (deprecated in 1998) instead of `__sigaction14` even triggers SIGSYS (bad syscall) on my amd64 setup. I also changed the type definitions to use the most recent version.
- NetBSD's gdb doesn't really support position independent executables, so you might want to turn that off for debugging, see [NetBSD Problem Report #48250](https://gnats.netbsd.org/48250).
- For binaries invoked using a relative path, NetBSD supports `$ORIGIN` only for short `rpath`s (~64 chars or so, I'm told). If running an executable fails with `execname not specified in AUX vector: No such file or directory`, consider invoking the binary using its full absolute path.
2015-09-22 19:13:39 +00:00
Vadim Petrochenkov
0af8e47546 Fix rebase 2015-09-22 20:46:23 +03:00
Andrea Canciani
c6d277ade6 Remove unwind::register
The `register` function is unstable and it is not used anymore, hence
it can be removed (together with the now-unused `Callback` type and
`static` variables).
2015-09-22 19:00:20 +02:00
Vadim Petrochenkov
45b445e5a3 Restore fold_ident and visit_ident 2015-09-22 19:58:30 +03:00
Vadim Petrochenkov
2a779062d8 Use Names in the remaining HIR structures with exception of...
PathSegment, PatIdent, ExprWhile, ExprLoop, ExprBreak and ExprAgain - they need Idents for resolve
2015-09-22 19:58:29 +03:00
Vadim Petrochenkov
a636a83caa Use Names in path fragments and MacroDef 2015-09-22 19:57:43 +03:00
Sébastien Marie
8474af0321 run-make: search libstdc++ in /usr/local/lib too
extend the search path of libraries to /usr/local/lib in `run-make`
testsuite. It should permit to find libstdc++.so on usual directory.
2015-09-22 18:56:30 +02:00
Vadim Petrochenkov
64fb709f99 Use Names in hir::{Field, ExprMethodCall, ExprField} 2015-09-22 19:53:53 +03:00
Vadim Petrochenkov
a4af958786 Use Names in HIR Items 2015-09-22 19:53:52 +03:00
Vadim Petrochenkov
ae77dbb835 Use Names in HIR visitors and folders 2015-09-22 19:52:53 +03:00
Vadim Petrochenkov
885d224230 Encode/decode Names as strings 2015-09-22 19:45:05 +03:00
bors
2a6f6f26f4 Auto merge of #28584 - ranma42:simpler-innertry, r=alexcrichton
This simplifies a little inner_try and avoids multiple accesses to TLS.
2015-09-22 16:24:06 +00:00
bors
0c05492ee1 Auto merge of #28582 - jedireza:patch-1, r=huonw
Fixed typo in example code.
2015-09-22 12:59:28 +00:00
Sebastian Wicki
428bb164f3 Fix alignment of pthread types on NetBSD 2015-09-22 11:48:00 +02:00
bors
f17cc4cf04 Auto merge of #28578 - gandro:nodefaultlibs, r=alexcrichton
This patch basically adds a target option for omitting the `-nodefaultlibs` flag when invoking the linker. I am not sure if this is the correct or only way to approach this problem, so any feedback is welcome.

Motivation: I'm currently working on a Rust target specification for the [rumprun](/rumpkernel/rumprun) unikernel. rumprun is based on rump kernels and uses NetBSDs libc and drivers to provide a POSIXy environment. It provides its own linker wrapper that generates binaries which can be "baked" into a unikernel after configuration. Using `-nodefaultlibs` on the rumprun linker will prevent it from selecting the search paths for the rumprun libraries. My current target implementation for rumprun is here: gandro/rust@295744b2ee

Currently, only a target that `is_like_windows` will omit the `-nodefaultlibs` flag, but since rumprun is not like Windows otherwise, I think a separate flag makes more sense. This might be a breaking change for target specifications that have the `is_like_windows` option set to true. Such targets need to set `no_default_libraries` to false in order to restore the old behavior.
2015-09-22 09:19:47 +00:00
Andrea Canciani
cf102966de Simplify inner_try in std::rt::unwind::try
Resolve the TLS PANICKING variable just once and re-use it as needed.
2015-09-22 11:07:27 +02:00
Andrea Canciani
cbfa61282f Simplify on_panic callback handling
The registration of `panicking::on_panic` as a general-purpose
callback is overcomplicated and can fail.

Instead, invoking it explicitly removes the need for locking and paves
the way for further improvements.
2015-09-22 11:02:52 +02:00
Lee Jeffery
b3e1aca40f Add UFCS privacy test. 2015-09-22 09:06:43 +01:00
bors
0b089cd2d5 Auto merge of #28574 - Eljay:hoedown-3.0.5, r=alexcrichton
Closes #28251.
2015-09-22 05:20:01 +00:00
Reza Akhavan
6de473addd Update error-handling.md 2015-09-21 21:33:15 -07:00
bors
f07f4ef743 Auto merge of #28427 - DiamondLovesYou:gdb-debug-script-load, r=alexcrichton
This is so LLVM isn't forced to load every byte of it. Also sets the alignment of
the load. Adds a test for the debug script section.

r? @alexcrichton
2015-09-22 03:35:55 +00:00
bors
e9d2587766 Auto merge of #28364 - petrochenkov:usegate, r=alexcrichton
Closes https://github.com/rust-lang/rust/issues/28075
Closes https://github.com/rust-lang/rust/issues/28388

r? @eddyb 
cc @brson
2015-09-22 01:12:26 +00:00
Wesley Wiser
b0bcde4b47 Split out the type lints into a new module
Part of #22206
2015-09-21 20:58:57 -04:00
Sebastian Wicki
920f32becd Add no_default_libraries target linker option
If set to false, `-nodefaultlibs` is not passed to the linker. This
was the default behavior on Windows, but it should be configurable
per target.

This is a [breaking-change] for target specifications that have
the `is_like_windows` option set to true. Such targets need to
set `no_default_libraries` to false in order to restore the old
behavior.
2015-09-22 00:33:40 +02:00
bors
f93ab64d4a Auto merge of #28567 - sanxiyn:save-lto, r=alexcrichton
This is useful for debugging LTO issues, #28066 for example.
2015-09-21 22:32:28 +00:00
Richard Diamond
9a24025661 Avoid loading the whole gdb debug scripts section.
This is so LLVM isn't forced to load every byte of it. Also sets the alignment of
the load. Adds a test for the debug script section.
2015-09-21 15:43:52 -05:00
Eljay
1e71af000c Upgrade hoedown to 3.0.5. 2015-09-21 21:07:45 +01:00
bors
7e8d19b24d Auto merge of #28566 - Ms2ger:AsmDialect, r=sanxiyn 2015-09-21 20:06:50 +00:00
Sebastian Wicki
318cd843d1 Various fixes for NetBSD/amd64 2015-09-21 21:50:54 +02:00
bors
5120f4a3f9 Auto merge of #28562 - llogiq:shootout, r=alexcrichton
Since 1.3.0 the BufWriter has seen tremendous speedups. So when I use it in the shootout benchmarks, I see some nice speedup (which up to 1.2.0 was nixed by the pessimizations during initialization).
2015-09-21 18:21:56 +00:00
bors
547fd5c11e Auto merge of #28531 - whitequark:patch-1, r=Gankro
With -O2, LLVM's inliner can remove this code, but this does not happen
with -O1 and lower. As a result, dropping Vec<u8> was linear with length,
resulting in abysmal performance for large buffers.

See issue #24280.
2015-09-21 16:36:26 +00:00
Seo Sanghyeon
9ba5db6690 Save bitcode before LTO when -C save-temps is given 2015-09-22 00:33:17 +09:00
Ms2ger
184c8a99ed Use ast::AsmDialect's variants qualified, and drop the pointless prefix. 2015-09-21 16:48:25 +02:00
bors
0a96756178 Auto merge of #28565 - apasel422:issue-28561, r=Manishearth
Closes #28561.

r? @Manishearth
2015-09-21 14:45:49 +00:00