about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer/comments.rs
AgeCommit message (Collapse)AuthorLines
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-03-17std: Tweak some unstable features of `str`Alex Crichton-4/+3
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-4/+4
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-2/+2
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-02-20Addressed PR commentsMarvin Löbel-2/+2
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-3/+3
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-3/+3
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-2/+2
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-2/+2
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-2/+2
2015-02-02Omit integer suffix when unnecessaryAlfie John-3/+3
See PR # 21378 for context
2015-01-26Fallout of io => old_ioAlex Crichton-2/+2
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-2/+2
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-2/+2
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-4/+4
2015-01-18libsyntax: int types -> isizePaul Collier-1/+1
2015-01-18libsyntax: int => i32 in appropriate placesPaul Collier-2/+2
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-1/+1
2015-01-17libsyntax: uint types to usizePaul Collier-4/+4
2015-01-07use slicing sugarJorge Aparicio-8/+8
2015-01-07Replace full slice notation with index callsNick Cameron-8/+8
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3
2014-12-21Fallout of std::str stabilizationAlex Crichton-8/+8
2014-12-19libsyntax: use `#[deriving(Copy)]`Jorge Aparicio-3/+1
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
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-06libsyntax: remove unnecessary `to_string()` callsJorge Aparicio-11/+11
2014-12-06libsyntax: remove unnecessary `as_slice()` callsJorge Aparicio-8/+7
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+2
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-10-29Rename fail! to panic!Steve Klabnik-2/+2
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Move token-to-string functions into print::pprustBrendan Zabarauskas-2/+2
2014-10-28Convert some token functions into methodsBrendan Zabarauskas-1/+1
2014-10-24Add a lint for not using field pattern shorthandsP1start-1/+1
Closes #17792.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-8/+8
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-1/+1
Use `String::from_utf8` instead [breaking-change]
2014-07-09lexer: lex WS/COMMENT/SHEBANG rather than skippingCorey Richardson-4/+4
Now, the lexer will categorize every byte in its input according to the grammar. The parser skips over these while parsing, thus avoiding their presence in the input to syntax extensions.
2014-07-09syntax: doc comments all the thingsCorey Richardson-7/+11
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-1/+1
This commit removes superfluous to_string calls from various places
2014-06-04syntax: methodify the lexerCorey Richardson-0/+424