Commit Graph

176 Commits

Author SHA1 Message Date
Patrick Walton
7f8f3dcf17 libsyntax: Remove uses of ~str from libsyntax, and fix fallout 2014-05-08 08:38:23 -07:00
bors
a1ad41b93d auto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonw
This PR is primarily motivated by (and fixes) #12926.

We currently only have a span for the individual item itself and not for the referred contents. This normally does not cause a problem since both are located in the same file; it *is* possible that the contained statement or item is located in the other file (the syntax extension can do that), but even in that case the syntax extension should be located in the same file as the item. The module item (i.e. `mod foo;`) is the only exception here, and thus warrants a special treatment.

Rustdoc would now distinguish `mod foo;` from `mod foo {...}` by checking if the span for the module item and module contents is in different files. If it's the case, we'd prefer module contents over module item. There are alternative strategies, but as noted above we will have some corner cases if we don't record the contents span explicitly.
2014-04-28 05:21:46 -07:00
Kang Seonghoon
dee21a67b8 syntax: Mod records the span for inner contents.
this is useful when the module item and module contents are defined
from different files (like rustdoc). in most cases the original span
for the module item would be used; in other cases, the span for
module contents is available separately at the `inner` field.
2014-04-27 14:52:30 +09:00
Kang Seonghoon
b03547bac1 syntax: ViewItemUse no longer contains multiple view paths.
it reflected the obsolete syntax `use a, b, c;` and did not make
past the parser (though it was a non-fatal error so we can continue).
this legacy affected many portions of rustc and rustdoc as well,
so this commit cleans them up altogether.
2014-04-26 22:33:45 +09:00
bors
70647ccc6d auto merge of #13713 : edwardw/rust/methodcall-span, r=alexcrichton
Specifically, the method parameter cardinality mismatch or missing
method error message span now gets method itself exactly. It was the
whole expression.

Closes #9390
Closes #13684
Closes #13709
2014-04-24 07:06:26 -07:00
Steven Fackler
1452c9c04a Allow attributes on match arms
RFC: 0008-match-arm-attributes
2014-04-23 21:48:22 -07:00
Edward Wang
899f222386 Calibrate span for method call error messages
Specifically, the method parameter cardinality mismatch or missing
method error message span now gets method itself exactly. It was the
whole expression.

Closes #9390
Closes #13684
Closes #13709
2014-04-24 06:16:46 +08:00
Nick Cameron
f78add10cd Support unsized types with the type keyword 2014-04-23 12:30:58 +12:00
Nick Cameron
c3b2f2b0c6 Add a span to ast::TyParam 2014-04-23 12:30:58 +12:00
Kasey Carrothers
0bf4e900d4 Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and updated associated variable and function names. 2014-04-10 15:22:00 -07:00
Eduard Burtescu
7c48e53c1e syntax: remove obsolete mutability from ExprVec and ExprRepeat. 2014-04-04 13:23:03 -07:00
Alex Crichton
57e0908af3 syntax: Remove AbiSet, use one Abi
This change removes the AbiSet from the AST, converting all usage to have just
one Abi value. The current scheme selects a relevant ABI given a list of ABIs
based on the target architecture and how relevant each ABI is to that
architecture.

Instead of this mildly complicated scheme, only one ABI will be allowed in abi
strings, and pseudo-abis will be created for special cases as necessary. For
example the "system" abi exists for stdcall on win32 and C on win64.

Closes #10049
2014-04-03 13:43:45 -07:00
Marvin Löbel
c356e3ba6a Removed deprecated functions map and flat_map for vectors and slices. 2014-03-30 03:47:04 +02:00
Sean McArthur
f1739b14a1 serialize: use Result
All of Decoder and Encoder's methods now return a Result.

Encodable.encode() and Decodable.decode() return a Result as well.

fixes #12292
2014-03-27 17:41:55 -07:00
Alex Crichton
f3682b5639 syntax: Fix fallout of removing get() 2014-03-22 08:48:20 -07:00
Huon Wilson
e33676b793 Migrate all users of opt_vec to owned_slice, delete opt_vec.
syntax::opt_vec is now entirely unused, and so can go.
2014-03-22 09:54:18 +11:00
Alex Crichton
da3625161d Removing imports of std::vec_ng::Vec
It's now in the prelude.
2014-03-20 09:30:14 -07:00
Daniel Micay
14f656d1a7 rename std::vec_ng -> std::vec
Closes #12771
2014-03-20 04:25:32 -04:00
Eduard Burtescu
871e570810 De-@ codemap and diagnostic. 2014-03-17 09:53:08 +02:00
Felix S. Klock II
586b619c76 Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.
There is a broader revision (that does this across the board) pending
in #12675, but that is awaiting the arrival of more data (to decide
whether to keep OptVec alive by using a non-Vec internally).

For this code, the representation of lifetime lists needs to be the
same in both ScopeChain and in the ast and ty structures.  So it
seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper
empty representation than the current `vec` code.
2014-03-12 08:05:20 +01:00
Felix S. Klock II
189c0085d1 alpha-rename .ident to .name in Lifetime, including in rustdoc. 2014-03-12 08:02:32 +01:00
Huon Wilson
c3b9047040 syntax: make match arms store the expr directly.
Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an
`ast::Block` (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes #3085.
2014-03-03 22:48:42 +11:00
Patrick Walton
198cc3d850 libsyntax: Fix errors arising from the automated ~[T] conversion 2014-03-01 22:40:52 -08:00
Patrick Walton
58fd6ab90d libsyntax: Mechanically change ~[T] to Vec<T> 2014-03-01 22:40:52 -08:00
Eduard Burtescu
05e4d944a9 Replace callee_id with information stored in method_map. 2014-02-26 16:06:45 +02:00
bors
edf351e9f7 auto merge of #12451 : edwardw/rust/ident-2-name, r=cmr
Closes #7743.
2014-02-22 22:01:54 -08:00
Erick Tryzelaar
0135b521ad syntax: add syntax extension helper to make simple view items 2014-02-21 19:57:03 -08:00
Edward Wang
7607332805 Represent lifetimes as Names instead of Idents
Closes #7743.
2014-02-22 04:05:33 +08:00
Eduard Burtescu
6e84023596 Removed the obsolete ast::CallSugar (previously used by do). 2014-02-14 07:48:13 -08:00
Eduard Burtescu
b2d30b72bf Removed @self and @Trait. 2014-02-07 00:38:33 +02:00
Patrick Walton
8e52b85d5a libsyntax: De-@str literal strings in the AST 2014-02-02 01:44:48 +11:00
Patrick Walton
70c5a0fbf7 libsyntax: Introduce an InternedString type to reduce @str in the
compiler and use it for attributes
2014-02-02 01:44:47 +11:00
Eduard Burtescu
7d967741c3 Implement default type parameters in generics. 2014-01-30 19:28:41 +02:00
Eduard Burtescu
15ba0c310a Demote self to an (almost) regular argument and remove the env param.
Fixes #10667 and closes #10259.
2014-01-27 14:31:24 +02:00
Salem Talha
cc61fc0994 Removed all instances of XXX in preparation for relaxing of FIXME rule 2014-01-26 14:42:53 -05:00
Simon Sapin
bada25e425 [std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behavior 2014-01-21 15:48:47 -08:00
Steven Fackler
328b47d837 Load macros from external modules 2014-01-16 15:01:48 -08:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
Patrick Walton
82a09b9a04 librustc: Remove @mut support from the parser 2014-01-03 14:02:01 -08:00
klutzy
9cdad685a3 syntax::codemap: Add static DUMMY_SP
It replaces `dummy_sp()`.
2014-01-01 19:51:35 +09:00
Steven Fackler
8143662836 Start passing around &mut ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
3965dddf49 Make ast_fold take &mut self 2013-12-29 23:41:05 -08:00
Steven Fackler
0607c138ca Stop using @ExtCtxt 2013-12-28 21:16:03 -07:00
Alex Crichton
282f3d99a5 Test fixes and rebase problems
Note that this removes a number of run-pass tests which are exercising behavior
of the old runtime. This functionality no longer exists and is thoroughly tested
inside of libgreen and libnative. There isn't really the notion of "starting the
runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24 19:59:53 -08:00
Seo Sanghyeon
4a13364010 Remove obsolete mutability from ast::Ty 2013-12-17 03:01:40 +09:00
Eduard Burtescu
a9c4b18b18 Box Block, fn_decl, variant and Ty in the AST, as they were inflating critical enum sizes. 2013-12-01 00:00:39 +02:00
Patrick Walton
efc512362b libsyntax: Remove all non-proc do syntax. 2013-11-26 08:24:18 -08:00
Niko Matsakis
1f4faaee40 Generalize AST and ty::Generics to accept multiple lifetimes. 2013-11-08 19:42:46 -05:00
Luqman Aden
c669ccf3d3 libsyntax/librustc: Allow calling variadic foreign functions. 2013-11-04 23:53:11 -05:00
Marvin Löbel
54f4dcd76a Prepared std::sys for removal, and made begin_unwind simpler
- `begin_unwind` is now generic over any `T: Any + Send`.
- Every value you fail with gets boxed as an `~Any`.
- Because of implementation details, `&'static str` and `~str` are still
  handled specially behind the scenes.
- Changed the big macro source string in libsyntax to a raw string
  literal, and enabled doc comments there.
2013-10-30 21:19:18 +01:00