Commit Graph

38799 Commits

Author SHA1 Message Date
Keegan McAllister
93b642d974 Use a crate attribute to load plugins
#[plugin] #[no_link] extern crate bleh;

becomes a crate attribute

    #![plugin(bleh)]

The feature gate is still required.

It's almost never correct to link a plugin into the resulting library /
executable, because it will bring all of libsyntax and librustc with it.
However if you really want this behavior, you can get it with a separate
`extern crate` item in addition to the `plugin` attribute.

Fixes #21043.
Fixes #20769.

[breaking-change]
2015-02-09 13:27:27 -08:00
Pierre Baillet
0479d90b77 Update deprecation notice.
- add namespace
- add function parens
2015-02-09 22:20:22 +01:00
Björn Steinbrink
8d8ae09858 Update llvm to rust-llvm-2015-02-09
Fixes #21996
2015-02-09 21:49:37 +01:00
Sean Collins
45f6672861 Make fallback font 'serif', rather than 'sans-serif' fonts 2015-02-09 15:07:47 -05:00
bors
134e00be77 Auto merge of #21876 - nick29581:driver-args, r=huonw
This allows people to write tools which are drop-in replacements for rustc by implementing `CompilerCalls` and three lines of code, rather than having to copy+paste a bunch of args parsing code.

r? @alexcrichton
2015-02-09 19:01:37 +00:00
Felix S. Klock II
a1b3189f48 add test illustrating the feature.
(with multiple impls to further exercise correct trait-matching.)
2015-02-09 19:58:40 +01:00
Felix S. Klock II
d9393c21d7 Given <expr> as Box<Trait>, infer that Box<_> is expected type for <expr>. 2015-02-09 19:55:59 +01:00
Keegan McAllister
5354317037 Process cfg_attr right before stripping cfg
Fixes #22070.
Fixes #19372.
2015-02-09 10:12:14 -08:00
Simonas Kazlauskas
a6e8496601 Deduplicate --crate-type arguments
Crate types from multiple sources appear to be deduplicated properly, but not
deduplicated if they come from the command line arguments. At worst, this used
to cause compiler failures when `--crate-type=lib,rlib` (the same as
`--crate-type=rlib,rlib`, at least at the time of this commit) is provided and
generate the output multiple times otherwise.
2015-02-09 19:51:21 +02:00
Keegan McAllister
0110f5e03c syntax::fold: Allow removing attributes 2015-02-09 09:01:50 -08:00
Alex Crichton
58764bc384 std: Display primitive documentation for char
This ended up just being a forgotten attribute on the `char` module in
libunicode.

Closes #22084
2015-02-09 08:40:36 -08:00
Michael Budde
97a9507232 Fix links to module-level documentation in std::cell
Replace links to `../index.html` with `index.html` as they are
linking to the `std` module and not `std::cell` as intended.
2015-02-09 13:24:01 +01:00
Richo Healey
b6f55efd5b lint: Document the why and how of the no_mangle const lint 2015-02-09 11:56:59 +01:00
we
6a2bad3257 int/uint => isize/usize in liblibc/liballoc/libarena 2015-02-09 10:00:46 +03:00
Nick Cameron
f0e1e09dd9 Review changes 2015-02-09 19:58:49 +13:00
Nick Cameron
cacd6b66f1 Refactor compilation to make it easier to use for tools 2015-02-09 18:00:56 +13:00
bors
0ba9e1fa52 Auto merge of #22059 - Gankro:vec-split, r=alexcrichton 2015-02-09 01:29:19 +00:00
bors
00df3251f6 Auto merge of #21992 - steveklabnik:gh17220, r=alexcrichton
None of the others work, so let's remove them.

Fixes #17220.

r? @brson
2015-02-08 23:24:33 +00:00
Piotr Czarnecki
89b2e9f6f3 syntax: Fix integer underflow in diagnostic
Fixes #22091
2015-02-08 23:26:12 +01:00
Nick Cameron
8122ce81d0 Accept quantification of lifetimes outside the self type in where clauses.
Closes #20022
2015-02-09 09:29:53 +13:00
Alexander Korolkov
34afe5e193 Rename Show to Debug, String to Display
Update reference.md:
 - derive() no longer supports Zero trait
 - derive() now supports Copy trait
2015-02-08 20:00:30 +03:00
Vojtech Kral
dca49e06b1 Move native thread name setting from thread_info to Thread, fixes #21911 2015-02-08 17:49:20 +01:00
bors
012e9643e4 Auto merge of #22046 - mneumann:dragonfly-libstd-fixes, r=huonw 2015-02-08 16:47:12 +00:00
we
6457c9fce2 Fix issue #20427 2015-02-08 19:29:47 +03:00
Carol Nichols
8379062be5 Correct fns exp2 that were calling exp
Fixes #22080.
2015-02-08 10:57:23 -05:00
bors
bfdcd34e82 Auto merge of #22054 - LeoTestard:include-parse-errors, r=alexcrichton
Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.
2015-02-08 14:41:02 +00:00
Sébastien Marie
8fb426469a adapt run-make test suite for openbsd
- c-link-to-rust-staticlib: use EXTRACFLAGS defined by tools.mk for
  choose the good libraries to link to.

- no-stack-check: disabled for openbsd (no segmented stacks here)

- symbols-are-reasonable: use portable grep pattern

- target-specs: use POSIX form for options when invoking grep

- use-extern-for-plugins: disable as OpenBSD only support x86_64 for now
2015-02-08 14:18:03 +01:00
Simonas Kazlauskas
61b4823b77 Add a test for mainless emit targets 2015-02-08 14:41:07 +02:00
bors
725cc06464 Auto merge of #22011 - fhahn:separate-parse-fail-tests, r=nikomatsakis
This PR moves all `compile-fail` tests that fail at the parsing stage to a `parse-fail` directory, in order to use the tests in the `parse-fail` directory to test if the new LALR parser rejects the same files as the Rust parser. I also adjusted the `testparser.py` script to handle the tests in `parse-fail` differently.

However during working on this, I discovered, that Rust's parser sometimes fails during parsing, but does not return a nonzero return code, e.g. compiling `/test/compile-fail/doc-before-semi.rs` with `-Z parse-only` prints an error message, but returns status code 0. Compiling the same file without `-Z parse-only`, the same error message is displayed, but error code 101 returned. I'll look into that over the next week.
2015-02-08 12:35:03 +00:00
bors
d4a66e9b09 Auto merge of #21970 - michaelwoerister:lang-item-call-debug-locs, r=brson
Resolves some issues caused by the recent LLVM update (which itself solved some issues).

Closes #19848
Closes #20798
2015-02-08 10:27:58 +00:00
bors
d4f9ec5662 Auto merge of #21565 - kmcallister:poison, r=alexcrichton
I needed these to implement efficient poisoning in [seqloq](https://github.com/kmcallister/seqloq/tree/poison).
2015-02-08 08:21:44 +00:00
bors
cdaf3a4393 Auto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichton
r? @alexcrichton
2015-02-08 06:15:52 +00:00
bors
f16de18db4 Auto merge of #22044 - caspark:fix-rc-doc-links, r=nikomatsakis
Current link structure is /std/rc/struct.Rc.html so ../index.html ends
up linking to /std/ rather than /std/rc/
2015-02-08 02:30:09 +00:00
bors
74b8740719 Auto merge of #21988 - kmcallister:no-std, r=sfackler
Fixes #21833.

[breaking-change]

r? @alexcrichton 

The tests in #21912 will also need `#[feature(no_std)]`. If you're okay with both PRs, I can merge and test them.
2015-02-08 00:24:03 +00:00
Geoffrey Thomas
bb49195d22 reference.md: Byte string literals start with a 'b'
This was correct in the EBNF, but not in the prose (which seems to have
been copied-and-pasted from regular string literals).
2015-02-07 19:10:32 -05:00
Alexis
dc930b1a52 add split_off to RingBuf 2015-02-07 18:40:14 -05:00
Ulrik Sverdrup
4f61e16032 Fix std::ops::Range size_hint and ExactSizeIterator impls
When self.start > self.end, these iterators simply return None,
so we adjust the size_hint to just return zero in this case.

Certain optimizations can be implemented in and outside libstd if we
know we can trust the size_hint for all inputs to for example
Range<usize>.

This corrects the ExactSizeIterator implementations, which IMO were
unsound and incorrect previously, since they allowed a range like (2..1)
to return a size_hint of -1us in when debug assertions are turned off.
2015-02-08 00:17:04 +01:00
Alexis
d163f1f97b add missing features to libcollections tests 2015-02-07 17:09:07 -05:00
bors
bfaa1a8434 Auto merge of #21874 - nagisa:reference-is-removal, r=steveklabnik
r? @steveklabnik
2015-02-07 21:48:33 +00:00
Alexis
09164f3acf minor fixes to Vec docs and bounds check 2015-02-07 14:58:58 -05:00
Keegan McAllister
312f8bd850 Fix new test 2015-02-07 10:51:25 -08:00
Keegan McAllister
ea85d43903 Make std::fmt a simple re-export from collections 2015-02-07 10:49:58 -08:00
Keegan McAllister
a246b6542a Fake up #![no_std] on pretty-printing; keep it out of AST 2015-02-07 10:49:58 -08:00
Keegan McAllister
d788588dce Feature-gate #![no_std]
Fixes #21833.

[breaking-change]
2015-02-07 10:49:58 -08:00
Keegan McAllister
67350bc868 Don't use std:: paths in syntax extensions when compiling a #![no_std] crate
Fixes #16803.
Fixes #14342.
Fixes half of #21827 -- slice syntax is still broken.
2015-02-07 10:49:57 -08:00
Keegan McAllister
74eef05e7d Use path helper macros in deriving 2015-02-07 10:49:57 -08:00
bors
61626b3063 Auto merge of #21984 - pnkfelix:make-for-loops-a-terminating-scope, r=nikomatsakis
make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR.

In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer.

----

There is one case I know of that this breaks, demonstrated to me by @nikomatsakis  (but it is also a corner-case that is useless in practice).  Here is that case:

```
fn main() {
    let mut foo: Vec<&i8> = Vec::new();
    for i in &[1, 2, 3] { foo.push(i) }
}
```

Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.)

(The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.)

----

So, technically this is a:

[breaking-change]
2015-02-07 18:20:55 +00:00
Leo Testard
8f2ab66ab6 Fix handling of parse errors when using include!().
Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.
2015-02-07 19:14:35 +01:00
bors
ce5aad2f10 Auto merge of #21982 - pnkfelix:extend-Z-print-region-graph, r=nikomatsakis
Extend region-inference graphviz rendering with enclosing relationship as well as the constraint edges.
2015-02-07 16:14:20 +00:00
bors
8661b3dc0f Auto merge of #21971 - pnkfelix:fsk-restrict-fixdsz-array-moves, r=nikomatsakis
Revised version of PR #21930.

Restrictions on moves into and out-from fixed-length arrays.

(There was only one use of this "feature" in the compiler source.)

Note 1: the change to the error message in tests/compile-fail/borrowck-use-in-index-lvalue.rs, where we now report that *w is uninitialized (rather than w), was unintended fallout from the implementation strategy used here. The change appears harmless to me, but I welcome advice on how to bring back the old message, which was slightly cleaner (i.e. less unintelligible) since that the syntactic form *w does not actually appear in the source text.

Note 2: the move out-from restriction to only apply to expr[i], and not destructuring bind (e.g. f([a, b, c]: Array) { ... }) since the latter is compatible with nonzeroing drop, AFAICT.

[breaking-change]
2015-02-07 14:08:38 +00:00