Eduard Burtescu
af3795721c
syntax: parse const fn
for free functions and inherent methods.
2015-05-21 11:47:30 -04:00
Sean Patrick Santos
29eb550ee6
Get associated consts working in match patterns.
2015-04-23 21:02:29 -06:00
Sean Patrick Santos
b5499775d6
Structural changes for associated constants
...
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23 21:02:25 -06:00
Nick Cameron
01678acf50
Expose visibility for fns in syntax::visit
2015-04-14 09:54:58 +12:00
Niko Matsakis
49b76a087b
Fallout in libsyntax
2015-04-01 11:22:39 -04:00
Eduard Burtescu
9da918548d
syntax: move MethMac to MacImplItem and combine {Provided,Required}Method into MethodTraitItem.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
ce10fa8d12
syntax: rename TypeMethod to MethodSig and use it in MethDecl.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
f98b176314
syntax: gather common fields of impl & trait items into their respective types.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
98491827b9
syntax: move indirection around {Trait,Impl}Item, from within.
2015-03-11 23:39:15 +02:00
Eduard Burtescu
d31b9ebef5
Implement <T>::method
UFCS expression syntax.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
ffb8092ccf
syntax: use a single Path for Trait::Item in QPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
004df413aa
syntax: don't use TraitRef in QPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
a817c69297
syntax: don't store a secondary NodeId for TyPath.
2015-02-24 14:14:16 +02:00
Flavio Percoco
d38aab397e
Rename DefTrait to DefaultImpl
2015-02-22 02:14:25 +01:00
Flavio Percoco
6a2f16e136
Add support for default trait impls in libsyntax
2015-02-22 02:14:24 +01:00
Jorge Aparicio
17bc7d8d5b
cleanup: replace as[_mut]_slice()
calls with deref coercions
2015-02-05 13:45:01 -05:00
Niko Matsakis
0431134119
Remove the explicit closure kind syntax from the parser and AST;
...
upgrade the inference based on expected type so that it is able to
infer the fn kind in isolation even if the full signature is not
available (and we could perhaps do better still in some cases, such as
extracting just the types of the arguments but not the return value).
2015-02-03 11:56:16 -05:00
Jorge Aparicio
d5d7e6565a
for x in xs.iter()
-> for x in &xs
2015-02-02 13:40:18 -05:00
Eduard Burtescu
7cece8725b
syntax: fix fallout of merging ast::ViewItem into ast::Item.
2015-01-21 16:27:26 +02:00
Eduard Burtescu
2cdc86c180
syntax: add fully qualified UFCS expressions.
2015-01-15 18:51:14 +02:00
Alex Crichton
7975fd9cee
rollup merge of #20482 : kmcallister/macro-reform
...
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-05 19:01:17 -08:00
Alex Crichton
bb5e16b4b8
rollup merge of #20554 : huonw/mut-pattern
...
Conflicts:
src/librustc_typeck/check/_match.rs
2015-01-05 18:38:51 -08:00
Keegan McAllister
c9f0ff3813
Reserve the keyword 'macro'
2015-01-05 18:21:14 -08:00
Jorge Aparicio
714a5b7f5e
remove TyClosure
2015-01-05 17:22:15 -05:00
Huon Wilson
bf6c007760
Change &
pat to only work with &T, and &mut
with &mut T.
...
This implements RFC 179 by making the pattern `&<pat>` require matching
against a variable of type `&T`, and introducing the pattern `&mut
<pat>` which only works with variables of type `&mut T`.
The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match
through a `&T` or a `&mut T` that binds the variable `x` to have type
`T` and to be mutable. This should be rewritten as follows, for example,
for &mut x in slice.iter() {
becomes
for &x in slice.iter() {
let mut x = x;
Due to this, this is a
[breaking-change]
Closes #20496 .
2015-01-05 16:14:17 +11:00
Flavio Percoco
8b883ab268
Add syntax for negative implementations of traits
...
This commit introduces the syntax for negative implmenetations of traits
as shown below:
`impl !Trait for Type {}`
cc #13231
Part of RFC #3
2015-01-04 23:16:13 +01:00
Jorge Aparicio
351409a622
sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs
2015-01-03 22:54:18 -05:00
Alex Crichton
4459b1dced
rollup merge of #20341 : nikomatsakis/impl-trait-for-trait-2
...
Conflicts:
src/librustc/middle/traits/mod.rs
src/libstd/io/mod.rs
src/test/run-pass/builtin-superkinds-self-type.rs
2015-01-02 11:13:05 -08:00
Niko Matsakis
1b3734f8ae
Fix fallout from change, adding explicit Sized
annotations where necessary.
2015-01-02 12:06:59 -05:00
Seo Sanghyeon
f2a06f760b
Make type in ast::Local optional
2015-01-02 20:55:31 +09:00
Niko Matsakis
3657ae13f5
Don't normalize associated types when in region binders, wait until we instantiate
...
them. Also fix some assertions and handling of builtin bounds.
2014-12-30 09:36:22 -05:00
Alex Crichton
2a8547783f
rollup merge of #20194 : nick29581/dst-syntax
...
Part of #19607 .
r? @nikomatsakis
2014-12-29 16:35:59 -08:00
Nick Cameron
4e2afb0052
Remove ExprSlice by hacking the compiler
...
[breaking-change]
The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-30 13:06:25 +13:00
Nick Cameron
ed8f503911
Add hypothetical support for ranges with only an upper bound
...
Note that this doesn't add the surface syntax.
2014-12-30 13:06:24 +13:00
Huon Wilson
5e5cc6749e
Slash the ast::Stmt type from 104 to 24 bytes.
...
(on platforms with 64-bit pointers.)
The StmtMac variant is rather large and also fairly rare, so let's
optimise the common case.
2014-12-29 23:55:25 +11:00
Nick Cameron
e656081b70
Accept ?Sized
as well as Sized?
...
Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
2014-12-26 10:16:24 +13:00
Nick Cameron
8a357e1d87
Add syntax for ranges
2014-12-24 09:12:45 +13:00
Jared Roesch
d87b308b67
Add support for multiple region bounds in where clauses
2014-12-20 03:54:39 -08:00
Jared Roesch
e0cac488ac
Add parser support for generalized where clauses
...
Implement support in the parser for generalized where clauses,
as well as the conversion of ast::WherePredicates to
ty::Predicate in `collect.rs`.
2014-12-20 02:48:17 -08:00
Jorge Aparicio
86f8c127dd
libsyntax: use #[deriving(Copy)]
2014-12-19 10:51:00 -05:00
Niko Matsakis
c2ca1a4b62
Make all predicates higher-ranked, not just trait references.
2014-12-19 03:29:30 -05:00
Alex Crichton
a02885e167
rollup merge of #19918 : pnkfelix/ast-refactor-make-place-in-exprbox-an-option
...
This is to allow us to migrate away from UnUniq in a followup commit,
and thus unify the code paths related to all forms of `box`.
2014-12-17 11:50:30 -08:00
Felix S. Klock II
7d4e7f0795
AST refactor: make the place in ExprBox an option.
...
This is to allow us to migrate away from UnUniq in a followup commit,
and thus unify the code paths related to all forms of `box`.
2014-12-16 14:30:30 +01:00
Seo Sanghyeon
4df66cd014
Resolve lifetimes in associated types
2014-12-15 22:31:38 +09:00
Niko Matsakis
22f777ba2e
Parse unsafe impl
but don't do anything particularly interesting with the results.
2014-12-14 11:11:55 -05:00
Niko Matsakis
5686a91914
Parse unsafe trait
but do not do anything with it beyond parsing and integrating into rustdoc etc.
2014-12-14 11:11:55 -05:00
Niko Matsakis
092d04a40a
Rename FnStyle trait to Unsafety.
2014-12-14 11:11:55 -05:00
Niko Matsakis
d258d68db6
Remove proc
types/expressions from the parser, compiler, and
...
language. Recommend `move||` instead.
2014-12-14 04:21:56 -05:00
Nick Cameron
397dda8aa0
Add support for equality constraints on associated types
2014-12-12 19:11:59 +13:00
Niko Matsakis
096a28607f
librustc: Make Copy
opt-in.
...
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.
A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.
For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.
This breaks code like:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
Change this code to:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
impl Copy for Point2D {}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
This is the backwards-incompatible part of #13231 .
Part of RFC #3 .
[breaking-change]
2014-12-08 13:47:44 -05:00