about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-08-15syntax: Require issues for unstable featuresAlex Crichton-4/+3
This turns an `#[unstable]` tag without an `issue` annotation into a hard error to ensure that we've always got a tracking issue for unstable features in the standard library.
2015-08-15Auto merge of #27827 - w00ns:for-loop-expn-issue-27639, r=alexcrichtonbors-10/+1
Fixes #27639
2015-08-15Fix issue with for loop expansionw00ns-10/+1
2015-08-15Auto merge of #27841 - jonas-schievink:still-repeating-span, r=alexcrichtonbors-1/+1
Current behaviour demo: http://is.gd/l3FEgo (The span is printed at the start of the source code) This patch moves the span to the use of `$i` in the macro rhs (as the code comment already claims)
2015-08-15Fix span of invalid metavariable repetitionJonas Schievink-1/+1
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-0/+4
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-14Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrcbors-1/+13
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
2015-08-13Auto merge of #27684 - alexcrichton:remove-deprecated, r=aturonbors-8/+18
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-12Introduce a "origin/cause" for new requirements (or bugfixes...) introduced ↵Niko Matsakis-0/+12
by RFC 1214, and issue a warning (and explanatory note) when we encounter such a thing.
2015-08-12Add two new kinds of predicates, WellFormed and ObjectSafe.Niko Matsakis-1/+1
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-8/+18
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-12Auto merge of #27691 - jonas-schievink:for-macro, r=alexcrichtonbors-1/+1
Closes #27004
2015-08-12Fix macro expansion in for loop patternJonas Schievink-1/+1
2015-08-11rollup merge of #27664: birkenfeld/patch-1Alex Crichton-3/+3
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-3/+3
Also fixes a few outdated links.
2015-08-11Auto merge of #27584 - TimNN:macro-eof-span, r=huonwbors-23/+24
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-08-11syntax: fix use of "vector" for [x; n] literal and [x, y] patternsGeorg Brandl-3/+3
2015-08-10syntax: Add a new unstable #[linked_from] attributeAlex Crichton-0/+5
To correctly reexport statically included libraries from a DLL on Windows, the compiler will soon need to have knowledge about what symbols are statically included and which are not. To solve this problem a new unstable `#[linked_from]` attribute is being added and recognized on `extern` blocks to indicate which native library the symbols are coming from. The compiler then keeps track of what the set of FFI symbols are that are included statically. This information will be used in a future commit to configure how we invoke the linker on Windows.
2015-08-10Auto merge of #27338 - alexcrichton:remove-morestack, r=brsonbors-1/+3
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow) r? @brson
2015-08-10Remove morestack supportAlex Crichton-1/+3
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-19/+65
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219). The RFC is not merged yet, but once merged, this could be.
2015-08-10add and use Span.substitute_dummy methodTim Neumann-17/+13
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-3/+3
Also fixes a few outdated links.
2015-08-08rustc: rename multiple imports in a listSean McArthur-19/+65
2015-08-07improve span of erroneous empty macro invocationTim Neumann-22/+27
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-08-06Auto merge of #27296 - jroesch:type-macros, r=huonwbors-2/+105
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message. @nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-04Fix last nitsJared Roesch-1/+2
2015-08-04Address final nitsJared Roesch-2/+4
2015-08-04Actually commit testsJared Roesch-1/+1
2015-08-04Address nitsJared Roesch-1/+0
2015-08-04Add feature gateJared Roesch-21/+35
2015-08-04Update and add test caseJared Roesch-1/+6
Test case from here: https://github.com/freebroccolo/rust/commit/9e93fef3c0e61836a8b56f727eb7a2e94bb4ca09
2015-08-04Extend macro machinery to expand macros in typesJared Roesch-0/+58
Reapplied the changes from https://github.com/freebroccolo/rust/commit/7aafe24139abc2d1f302bbb166bcaa006f12cf4d to a clean branch of master
2015-08-04Make parser recognize macro invocations in typesJared Roesch-2/+15
Reapplied the changes from https://github.com/freebroccolo/rust/commit/8b07abaa6e8ab42d37656dfad89de0eb5810c3b3 to a clean branch of master
2015-08-04Add a macro invocation to the type ASTJared Roesch-0/+11
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540 to a clean branch of master
2015-08-04syntax: Don't assume `std` exists for testsAlex Crichton-14/+9
This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained.
2015-08-03syntax: Implement #![no_core]Alex Crichton-206/+107
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-03Auto merge of #27134 - fhartwig:derive, r=huonwbors-0/+11
Fixes #25022 This adapts the deriving mechanism to not repeat bounds for the same type parameter. To give an example: for the following code: ```rust #[derive(Clone)] pub struct FlatMap<I, U: IntoIterator, F> { iter: I, f: F, frontiter: Option<U::IntoIter>, backiter: Option<U::IntoIter>, } ``` the latest nightly generates the following impl signature: ```rust impl <I: ::std::clone::Clone, U: ::std::clone::Clone + IntoIterator, F: ::std::clone::Clone> ::std::clone::Clone for FlatMap<I, U, F> where I: ::std::clone::Clone, F: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone ``` With these changes, the signature changes to this: ```rust impl <I, U: IntoIterator, F> ::std::clone::Clone for FlatMap<I, U, F> where I: ::std::clone::Clone, F: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone ``` (Nothing in the body of the impl changes) Note that the second impl is more permissive, as it doesn't have a `Clone` bound on `U` at all. There was a compile-fail test that failed due to this. I don't understand why we would want the old behaviour (and nobody on IRC could tell me either), so please tell me if there is a good reason that I missed.
2015-08-01Auto merge of #27447 - eefriedman:parser-cleanup, r=alexcrichtonbors-31/+0
2015-07-31Auto merge of #27432 - sanxiyn:impl-dotdot, r=sfacklerbors-1/+1
Fix #27255.
2015-07-31Fix `impl A .. {}`Seo Sanghyeon-1/+1
2015-07-30Remove unused code in parser.Eli Friedman-31/+0
2015-07-29Feature gate associated type defaultsBrian Anderson-1/+8
There are multiple issues with them as designed and implemented. cc #27364
2015-07-29FormattingBrian Anderson-1/+2
2015-07-29Rollup merge of #27313 - nagisa:illegal-to-invalid, r=pnkfelixSteve Klabnik-17/+17
Improves diagnostics in various locations, namely: * A few error messages that orignally were a mix of an error message and suggestion how to fix it have been split up into two messages: an error and help/hint. * Never report “illegal”. Fixes https://github.com/rust-lang/rust/issues/27288
2015-07-29Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelixbors-20/+38
`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal). This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.
2015-07-29Replace illegal with invalid in most diagnosticsSimonas Kazlauskas-17/+17
2015-07-28Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddybbors-192/+164
this has quite some fallout. but also made lots of stuff more readable imo [breaking-change] for plugin authors
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-192/+164
2015-07-27Turn on `box(PLACE) expr` deprecation warning post-snapshot.Eduard Burtescu-11/+7