Commit Graph

628 Commits

Author SHA1 Message Date
Niko Matsakis 5f886342be syntax: fix up dynamic borrow errors in libsyntax 2013-05-01 21:50:32 -04:00
bors 55fbc47af1 auto merge of #6148 : erickt/rust/remove-drop, r=pcwalton
The drop block has been deprecated for quite some time. This patch series removes support for parsing it and all the related machinery that made drop work.

As a side feature of all this, I also added the ability to annote fields in structs. This allows comments to be properly associated with an individual field. However, I didn't update `rustdoc` to integrate these comment blocks into the documentation it generates.
2013-05-01 09:18:59 -07:00
Erick Tryzelaar 3e3e2f0025 allow parsing attributes on struct fields 2013-05-01 07:49:41 -07:00
Erick Tryzelaar c2e1f47955 rustc: remove the rest of drop
Removes:

ast::struct_def::dtor
syntax::ast::ii_dtor
syntax::visit::fk_dtor
syntax::ast_map::node_dtor
syntax:struct_dtor
2013-05-01 07:49:41 -07:00
Erick Tryzelaar 7d6d0029ba syntax: remove parsing destructors 2013-05-01 07:49:41 -07:00
Niko Matsakis 84861101ec rustc: print out filename/line-number when a borrow fails 2013-05-01 09:14:47 -04:00
Brendan Zabarauskas ee26c7c433 Revert rename of Div to Quot 2013-05-01 15:40:05 +10:00
Niko Matsakis 418f991118 allover: numerous unused muts etc 2013-04-30 14:10:21 -04:00
Patrick Walton 670ab8ac36 librustc: Change labels to use the lifetime notation '. 2013-04-29 14:30:57 -07:00
Patrick Walton f30f54e9d0 librustc: Remove the concept of modes from the compiler.
This commit does not remove `ty::arg`, although that should be
possible to do now.
2013-04-29 14:30:55 -07:00
John Clements 41af279233 parser comments 2013-04-28 09:51:16 -07:00
John Clements 2985f74ff3 s/one_tuple/trailing_comma (more accurate name) 2013-04-28 09:51:16 -07:00
John Clements aa346401ba removed unneeded argument to parse_record 2013-04-28 09:51:16 -07:00
John Clements d2aee7b3e6 s/parse_purity/parse_unsafety 2013-04-28 09:51:16 -07:00
John Clements 1abc1be81a remove 3-line used-once function 2013-04-28 09:51:16 -07:00
John Clements 7ef92ba246 rename parse_instance_var to parse_name_and_ty
the name no longer made sense. perhaps this could just be inlined.
2013-04-28 09:51:15 -07:00
John Clements 2a74c58588 remove obsolete semicolon from list of suggestions 2013-04-28 09:51:15 -07:00
John Clements 915e76a974 rename parse_single_class_item as well 2013-04-28 09:51:15 -07:00
John Clements 968089e422 rename parse_class_item to parse_struct_decl_field
two problems with the old name: they're not called classes any more, and
the word "item" has a specific connotation in the parser
2013-04-28 09:51:15 -07:00
John Clements b82724db22 needs_comma was always true 2013-04-28 09:51:15 -07:00
John Clements 703390150a fix for parsing x() as identifier pattern 2013-04-28 09:51:15 -07:00
John Clements 5119597dc6 hard to read the implied double negative 2013-04-28 09:51:15 -07:00
John Clements 5411cbf656 remove unused flag to parse_local fn 2013-04-28 09:51:14 -07:00
John Clements 63397b8519 remove unused RESTRICT_NO_CALL_EXPRS restriction 2013-04-28 09:51:14 -07:00
John Clements 2733a1f14b undo abstraction over whether to parse attrs in a block
In principle, it seems like a nice idea to abstract over the two
functions that parse blocks (one with inner attrs allowed, one not).
However, the existing one wound up making things more complex than
just having two separate functions, especially after the obsolete
syntax is (will be) removed.
2013-04-28 09:51:14 -07:00
John Clements ab03c1e422 refactoring to split foreign_items from items 2013-04-28 09:51:14 -07:00
John Clements fa5ba17c89 parser comments
parser comments
2013-04-28 09:51:14 -07:00
John Clements 1b4ced8bcb get rid of prec.rs
prec.rs no longer had much to do with precedence; the token->binop
function fits better in token.rs, and the one-liner defining the
precedence of 'as' can go next to the other precedence stuff in
ast_util.rs
2013-04-28 09:51:14 -07:00
John Clements 9f8d30a128 reindent in parser 2013-04-28 09:49:21 -07:00
John Clements a818648aa9 remove unnecessary function 2013-04-28 09:49:20 -07:00
John Clements 71c0bd5c5d simplify, based on invariant that items_allowed != foreign_items_allowed 2013-04-28 09:49:20 -07:00
John Clements ae4e09f71a adding parse_path 2013-04-28 09:49:20 -07:00
John Clements 28b285764c comments, helper function for tests, more informative error message 2013-04-28 09:49:20 -07:00
John Clements 50a7f5483b refactor parse_fn_decl 2013-04-28 09:49:20 -07:00
John Clements 2b7f1a4f24 parser comments only 2013-04-28 09:49:20 -07:00
John Clements c73a9c9cd0 refactoring mod.rs 2013-04-28 09:49:20 -07:00
Daniel Micay f792baba42 only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
bors b8441ca8a6 auto merge of #6007 : pcwalton/rust/use-mod, r=brson
r? @brson
2013-04-22 18:36:50 -07:00
bors aba93c6b60 auto merge of #5966 : alexcrichton/rust/issue-3083, r=graydon
Closes #3083.

This takes a similar approach to #5797 where a set is present on the `tcx` of used mutable definitions. Everything is by default warned about, and analyses must explicitly add mutable definitions to this set so they're not warned about.

Most of this was pretty straightforward, although there was one caveat that I ran into when implementing it. Apparently when the old modes are used (or maybe `legacy_modes`, I'm not sure) some different code paths are taken to cause spurious warnings to be issued which shouldn't be issued. I'm not really sure how modes even worked, so I was having a lot of trouble tracking this down. I figured that because they're a legacy thing that I'd just de-mode the compiler so that the warnings wouldn't be a problem anymore (or at least for the compiler).

Other than that, the entire compiler compiles without warnings of unused mutable variables. To prevent bad warnings, #5965 should be landed (which in turn is waiting on #5963) before landing this. I figured I'd stick it out for review anyway though.
2013-04-22 15:36:51 -07:00
Patrick Walton 25129ee81c librustc: Remove use mod from the language 2013-04-22 12:32:59 -07:00
Brendan Zabarauskas 01eb5e8ad3 Rename Div operator trait to Quot and Modulo operator trait to Rem 2013-04-22 01:58:53 +10:00
Alex Crichton fd97cac251 syntax: remove unused 'mut' variables 2013-04-20 21:03:24 -04:00
Alex Crichton 3c7aea3a6a syntax: de-mode and prepare for de-modeing rustc 2013-04-19 23:21:52 -04:00
John Clements e7aa24de18 add self.token_to_str and is_any_keyword convenience abstractions 2013-04-16 10:06:06 -07:00
John Clements 7e4cd09e2e added MTWT functions 2013-04-16 10:06:06 -07:00
John Clements 1083ae6b06 better error message on failure to parse type 2013-04-16 10:06:06 -07:00
John Clements 9deb2f2dfa libsyntax comments only 2013-04-10 09:15:08 -07:00
John Clements 09bcd3837c unneccessary since tjc's commit 78ec6fe30c, fixing #2804 2013-04-10 09:15:08 -07:00
John Clements 48e7bda826 path -> Path 2013-04-10 09:15:04 -07:00
Niko Matsakis d28f734412 Refactor so that references to traits are not represented using a type with a
bare function store (which is not in fact a kind of value) but rather
ty::TraitRef.  Removes many uses of fail!() and other telltale signs of
type-semantic mismatch.

cc #4183 (not a fix, but related)
2013-04-05 05:36:02 -04:00