Commit Graph

58 Commits

Author SHA1 Message Date
Daniel Micay 14f656d1a7 rename std::vec_ng -> std::vec
Closes #12771
2014-03-20 04:25:32 -04:00
Daniel Micay ce620320a2 rename std::vec -> std::slice
Closes #12702
2014-03-20 01:30:27 -04: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
Brendan Zabarauskas 3cc95314c3 Remove std::default::Default from the prelude 2014-02-24 21:22:26 -08:00
Huon Wilson efaf4db24c Transition to new Hash, removing IterBytes and std::to_bytes. 2014-02-24 07:44:10 +11:00
mr.Shu ee3fa68fed Fixed error starting with uppercase
Error messages cleaned in librustc/middle

Error messages cleaned in libsyntax

Error messages cleaned in libsyntax more agressively

Error messages cleaned in librustc more aggressively

Fixed affected tests

Fixed other failing tests

Last failing tests fixed
2014-02-08 20:59:38 +01:00
Nathaniel Herman d9fadbc04f Make mut_last return Option instead of failing on empty vector (and add a test for mut_last) 2014-01-30 18:41:57 -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
Simon Sapin aa66b91767 [std::vec] Rename .last_opt() to .last(), drop the old .last() behavior 2014-01-21 15:48:46 -08:00
Palmer Cox 3fd8c8b330 Rename iterators for consistency
Rename existing iterators to get rid of the Iterator suffix and to
give them names that better describe the things being iterated over.
2014-01-18 01:15:15 -05:00
Niko Matsakis 419ac4a1b8 Issue #3511 - Rationalize temporary lifetimes.
Major changes:

- Define temporary scopes in a syntax-based way that basically defaults
  to the innermost statement or conditional block, except for in
  a `let` initializer, where we default to the innermost block. Rules
  are documented in the code, but not in the manual (yet).
  See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
  us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
  cleanup in a more comprehensive way.
2014-01-15 18:34:38 -05:00
Erik Price 5731ca3078 Make 'self lifetime illegal.
Also remove all instances of 'self within the codebase.

This fixes #10889.
2013-12-11 10:54:06 -08:00
Patrick Walton 492677ec1e libsyntax: Change all uses of &fn to ||. 2013-11-19 12:40:19 -08:00
Niko Matsakis 1f4faaee40 Generalize AST and ty::Generics to accept multiple lifetimes. 2013-11-08 19:42:46 -05:00
Alex Crichton daf5f5a4d1 Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00
Alex Crichton af3b132285 syntax: Remove usage of fmt! 2013-09-30 23:21:19 -07:00
Erick Tryzelaar f1374a7044 libsyntax: add Default implementation to OptVec 2013-09-12 18:54:12 -07:00
Alex Crichton 930885d5e5 Forbid pub/priv where it has no effect
Closes #5495
2013-08-12 23:20:46 -07:00
Erick Tryzelaar 09f4c9af13 Merge branch 'enum-method-privacy' of https://github.com/michaelwoerister/rust into rollup
Conflicts:
	src/libsyntax/opt_vec.rs
2013-08-10 12:59:52 -07:00
Erick Tryzelaar 68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Erick Tryzelaar fad7857c7b Mass rename of .consume{,_iter}() to .move_iter()
cc #7887
2013-08-10 07:01:07 -07:00
Michael Woerister 2c9922aa49 Enable privacy check for enum methods. 2013-08-07 14:30:00 +02:00
Niko Matsakis dc38e1616a Generalize the ty::substs struct so that it can represent
multiple lifetime parameters, and not just one. Also add an option
for erasing lifetimes, which makes trans code somewhat simpler
and cleaner.
2013-07-24 16:52:57 -04:00
Patrick Walton 99b33f7219 librustc: Remove all uses of "copy". 2013-07-17 14:57:51 -07:00
James Miller 46a1f54666 De-manage OptVec<TyParamBounds> 2013-07-07 22:51:10 +12:00
Kevin Ballard e6f9b08610 Implement size_hint() on all remaining Iterators
Add size_hint() to the Iterators in libextra and the Iterator in
libsyntax.

Skip deque for the moment, as it's being worked on elsewhere.
2013-07-06 14:14:45 -07:00
Ben Blum 75b80bad63 Use more deriving(IterBytes) in libsyntax. 2013-06-29 03:58:50 -04:00
bors e9ac7194ff auto merge of #7365 : cmr/rust/syntax_cleanup, r=Aatch
Sets the stage for further cleanup (especially mass-slaughter of `@`)
2013-06-25 18:02:02 -07:00
Daniel Micay 5242e8d2ba remove the redundant each method from OptVec 2013-06-25 16:26:23 -04:00
Corey Richardson 0d471d310d great renaming propagation: syntax 2013-06-25 16:15:07 -04:00
Daniel Micay e2e39234cc remove old_iter
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and
written in an ancient dialect of Rust so I've just removed it

this also removes `to_vec` from DList because it's provided by
`std::iter::to_vec`

an Iterator implementation is added for OptVec but some transitional
internal iterator methods are still left
2013-06-24 01:35:11 -04:00
Daniel Micay d2e9912aea vec: remove BaseIter implementation
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
Graydon Hoare d904c72af8 replace #[inline(always)] with #[inline]. r=burningtree. 2013-06-18 14:48:48 -07:00
Daniel Micay e097d5eaba rm CopyableOrderedIter
replaced with OrdIterator
2013-06-15 22:16:21 -04:00
Patrick Walton 18df18c817 libstd: Fix merge fallout. 2013-05-22 21:57:11 -07:00
bors 2e6cda254a auto merge of #6635 : brson/rust/snapshot, r=brson 2013-05-20 02:46:36 -07:00
Brian Anderson 66319b0278 Register snapshots 2013-05-19 23:34:32 -07:00
Steve Klabnik d3f70b141a Fix many warnings. 2013-05-19 21:32:32 -07:00
Huon Wilson 5dc5efefd4 syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute
and remove the majority of the actual code, leaving stubs to refer the user to
the new syntax.
2013-05-16 08:55:57 +10:00
Björn Steinbrink bdc182cc41 Use static string with fail!() and remove fail!(fmt!())
fail!() used to require owned strings but can handle static strings
now. Also, it can pass its arguments to fmt!() on its own, no need for
the caller to call fmt!() itself.
2013-05-14 16:36:23 +02:00
Alex Crichton 5eb6d19803 syntax: Use the new for protocol 2013-05-10 02:46:18 -04:00
Brian Anderson 8081e8debf Register snapshots 2013-05-04 15:43:51 -07:00
bors ea74f6845e auto merge of #6083 : jbclements/rust/parser-cleanup, r=jbclements
r? @pcwalton

A month's worth of parser cleanup here. Much of this is new comments and renaming. A number of these commits also remove unneeded code.  Probably the biggest refactor here is splitting "parse_item_or_view_item" into two functions; it turns out that the only overlap between items in foreign modules and items in regular modules was macros, so this refactor should make things substantially easier for future maintenance.
2013-04-29 00:12:37 -07:00
Daniel Micay 46f91a0fa9 make way for a new iter module 2013-04-28 22:31:39 -04:00
John Clements a2493ad048 change stage1,stage2,stage2 into not(stage0)
With luck, this will allow rust to compile itself without --cfg flags again...
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
Alex Crichton 3c7aea3a6a syntax: de-mode and prepare for de-modeing rustc 2013-04-19 23:21:52 -04:00
Niko Matsakis 49de82cdca Issue #5656: Make &self not mean "&'self self"
Fixes #5656.
Fixes #5541.
2013-04-10 17:32:02 -07:00
Niko Matsakis 9963bd2413 Cleanup substitutions and treatment of generics around traits in a number of ways.
- In a TraitRef, use the self type consistently to refer to the Self type:
  - trait ref in `impl Trait<A,B,C> for S` has a self type of `S`.
  - trait ref in `A:Trait` has the self type `A`
  - trait ref associated with a trait decl has self type `Self`
  - trait ref associated with a supertype has self type `Self`
  - trait ref in an object type `@Trait` has no self type

- Rewrite `each_bound_traits_and_supertraits` to perform
  substitutions as it goes, and thus yield a series of trait refs
  that are always in the same 'namespace' as the type parameter
  bound given as input.  Before, we left this to the caller, but
  this doesn't work because the caller lacks adequare information
  to perform the type substitutions correctly.

- For provided methods, substitute the generics involved in the provided
  method correctly.

- Introduce TypeParameterDef, which tracks the bounds declared on a type
  parameter and brings them together with the def_id and (in the future)
  other information (maybe even the parameter's name!).

- Introduce Subst trait, which helps to cleanup a lot of the
  repetitive code involved with doing type substitution.

- Introduce Repr trait, which makes debug printouts far more convenient.

Fixes #4183.  Needed for #5656.
2013-04-09 08:06:10 -07:00