about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-01-07markers -> markerNick Cameron-1/+1
2015-01-06rollup merge of #20609: cmr/memAlex Crichton-20/+24
2015-01-07falloutNick Cameron-52/+68
2015-01-06Stricter rules surrounding adjacent nonterminals and sequencesCorey Richardson-29/+74
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-64/+139
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-06Implement impl reachability rules. This is a [breaking-change]. TypeNiko Matsakis-0/+10
parameters on impls must now also appear in the trait ref, self type, or some associated type declared on the impl. This ensures that they are constrianed in some way and that the semantics of the trait system are well-defined (always a good thing). There are three major ways to fix this error: 1. Convert the trait to use associated types; most often the type parameters are not constrained because they are in fact outputs of the impl. 2. Move the type parameters to methods. 3. Add an additional type parameter to the self type or trait so that the unused parameter can appear there. In some cases, it is not possible to fix the impl because the trait definition needs to be changed first (and that may be out of your control). In that case, for the time being, you can opt out of these rules by using `#[old_impl_check]` on the impl and adding a `#![feature(old_impl_check)]` to your crate declaration.
2015-01-06Fix fallout in libs. For the most part I just tagged impls as ↵Niko Matsakis-2/+2
`#[old_impl_check]`.
2015-01-07Pretty print empty structs properlyNick Cameron-1/+4
2015-01-07Remove old slicing hacks and make new slicing workNick Cameron-144/+69
2015-01-06test fallout from isize/usizeCorey Richardson-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-412/+413
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-1/+1
[breaking-change]
2015-01-06syntax/rustc: implement isize/usizeCorey Richardson-20/+24
2015-01-06[breaking change] Revert Entry behaviour to take keys by value.Dylan Ede-3/+3
2015-01-06syntax: implement 'macro input future proofing'Corey Richardson-8/+141
See RFC 550 (https://github.com/rust-lang/rfcs/pull/550) for the motivation and details. If this breaks your code, add one of the listed tokens after the relevant non-terminal in your matcher. [breaking-change]
2015-01-05More test fixes!Alex Crichton-24/+6
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-215/+247
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05Merge remote-tracking branch 'nrc/sized-2' into rollupAlex Crichton-43/+49
Conflicts: src/liballoc/boxed.rs src/libcollections/btree/map.rs src/libcollections/slice.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/libstd/collections/hash/map.rs src/libsyntax/parse/obsolete.rs src/test/compile-fail/unboxed-closure-sugar-default.rs src/test/compile-fail/unboxed-closure-sugar-equiv.rs src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs src/test/compile-fail/unboxed-closure-sugar-region.rs src/test/compile-fail/unsized3.rs src/test/run-pass/associated-types-conditional-dispatch.rs
2015-01-05rollup merge of #20556: japaric/no-for-sizedAlex Crichton-4/+14
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs
2015-01-05rollup merge of #20594: nikomatsakis/orphan-orderedAlex Crichton-0/+20
Conflicts: src/libsyntax/feature_gate.rs
2015-01-05rollup merge of #20568: huonw/ungate-AT-globsAlex Crichton-65/+11
These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice. Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
2015-01-05rollup merge of #20554: huonw/mut-patternAlex Crichton-8/+16
Conflicts: src/librustc_typeck/check/_match.rs
2015-01-05rollup merge of #20424: jroesch/tuple-struct-where-clause-fixAlex Crichton-41/+91
Fixes #17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric. r? @nikomatsakis or whoever is appropriate.
2015-01-05rollup merge of #20258: sanxiyn/show-span-2Alex Crichton-3/+49
2015-01-05rollup merge of #20099: P1start/parse-more-macro-opsAlex Crichton-5/+10
Closes #20093.
2015-01-05Un-gate macro_rulesKeegan McAllister-7/+2
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-9/+11
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05Reserve the keyword 'macro'Keegan McAllister-23/+24
2015-01-05Allow selective macro importKeegan McAllister-2/+6
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-60/+15
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-38/+17
2015-01-06Fix the obsolete messageNick Cameron-1/+1
2015-01-06FalloutNick Cameron-3/+3
2015-01-06Obsolete `Sized? T`Nick Cameron-3/+9
[breaking-change] Use `T: ?Sized`
2015-01-06Remove the prefix in ObsoleteSyntax variantsNick Cameron-34/+34
2015-01-05syntax: remove dead codeJorge Aparicio-2/+1
2015-01-05syntax: make the closure type `f: |uint| -> bool` syntax obsoleteJorge Aparicio-16/+18
2015-01-05remove TyClosureJorge Aparicio-57/+2
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-33/+29
2015-01-05Implement new orphan rule that requires that impls of remote traits meet the ↵Niko Matsakis-0/+8
following two criteria: - the self type includes some local type; and, - type parameters in the self type must be constrained by a local type. A type parameter is called *constrained* if it appears in some type-parameter of a local type. Here are some examples that are accepted. In all of these examples, I assume that `Foo` is a trait defined in another crate. If `Foo` were defined in the local crate, then all the examples would be legal. - `impl Foo for LocalType` - `impl<T> Foo<T> for LocalType` -- T does not appear in Self, so it is OK - `impl<T> Foo<T> for LocalType<T>` -- T here is constrained by LocalType - `impl<T> Foo<T> for (LocalType<T>, T)` -- T here is constrained by LocalType Here are some illegal examples (again, these examples assume that `Foo` is not local to the current crate): - `impl Foo for int` -- the Self type is not local - `impl<T> Foo for T` -- T appears in Self unconstrained by a local type - `impl<T> Foo for (LocalType, T)` -- T appears in Self unconstrained by a local type This is a [breaking-change]. For the time being, you can opt out of the new rules by placing `#[old_orphan_check]` on the trait (and enabling the feature gate where the trait is defined). Longer term, you should restructure your traits to avoid the problem. Usually this means changing the order of parameters so that the "central" type parameter is in the `Self` position. As an example of that refactoring, consider the `BorrowFrom` trait: ```rust pub trait BorrowFrom<Sized? Owned> for Sized? { fn borrow_from(owned: &Owned) -> &Self; } ``` As defined, this trait is commonly implemented for custom pointer types, such as `Arc`. Those impls follow the pattern: ```rust impl<T> BorrowFrom<Arc<T>> for T {...} ``` Unfortunately, this impl is illegal because the self type `T` is not local to the current crate. Therefore, we are going to change the order of the parameters, so that `BorrowFrom` becomes `Borrow`: ```rust pub trait Borrow<Sized? Borrowed> for Sized? { fn borrow_from(owned: &Self) -> &Borrowed; } ``` Now the `Arc` impl is written: ```rust impl<T> Borrow<T> for Arc<T> { ... } ``` This impl is legal because the self type (`Arc<T>`) is local.
2015-01-05tweak the obsolete syntax messageJorge Aparicio-2/+2
2015-01-05Reformat metadata for exported macrosKeegan McAllister-74/+57
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05Rename macro_escape to macro_useKeegan McAllister-19/+29
In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now.
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-5/+3
In preparation for the rename.
2015-01-05syntax: obsolete the `for Sized?` syntaxJorge Aparicio-2/+12
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-2/+2
2015-01-05Implement macro re-exportKeegan McAllister-1/+50
Fixes #17103.
2015-01-05Allow leading :: in use itemsKeegan McAllister-0/+4
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-9/+82
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-57/+30
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.