about summary refs log tree commit diff
path: root/src/libsyntax/codemap.rs
AgeCommit message (Collapse)AuthorLines
2014-10-29Rename fail! to panic!Steve Klabnik-4/+4
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-19Remove a large amount of deprecated functionalityAlex Crichton-18/+21
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-10-09syntax: Convert statics to constantsAlex Crichton-2/+2
2014-10-04Register new snapshotsBjörn Steinbrink-6/+2
2014-09-30librustc: Fix up mutability in method autoderefs if incorrect, andPatrick Walton-0/+5
prefer `Deref` over `DerefMut` in all other circumstances. Closes #12825.
2014-09-28Keep ExpnId abstract by providing conversionsKeegan McAllister-2/+14
2014-09-27Translate inline assembly errors back to source locationsKeegan McAllister-1/+1
Fixes #17552.
2014-09-18Fix fallout in tests from removing the use of Gc in ExpnInfo.Eduard Burtescu-3/+3
2014-09-18syntax: use an index in CodeMap instead of Gc for ExpnInfo.Eduard Burtescu-9/+30
2014-07-21ignore-lexer-test to broken files and remove some tray hyphensCorey Richardson-0/+2
I blame @ChrisMorgan for the hyphens.
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-1/+1
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-09codemap: be less annoying in debug loggingCorey Richardson-5/+4
2014-07-09syntax: doc comments all the thingsCorey Richardson-11/+11
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-2/+2
[breaking-change]
2014-06-13Dump results of analysis phase as CSVNick Cameron-35/+35
Adds the option -Zsave-analysis which will dump the results of syntax and type checking into CSV files. These can be interpreted by tools such as DXR to provide semantic information about Rust programs for code search, cross-reference, etc. Authored by Nick Cameron and Peter Elmers (@pelmers; including enums, type parameters/generics).
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-2/+2
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-3/+3
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-4/+4
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-32/+32
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-11/+11
[breaking-change]
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-39/+56
2014-04-21auto merge of #13435 : edwardw/rust/span, r=brsonbors-0/+11
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-17/+17
2014-04-18Use more precise span when reporting semicolon hintEdward Wang-0/+11
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-5/+6
port all code over to use it.
2014-03-31Switch some tuple structs to pub fieldsAlex Crichton-2/+2
This commit deals with the fallout of the previous change by making tuples structs have public fields where necessary (now that the fields are private by default).
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-29/+29
2014-03-29Register new snapshotFlavio Percoco-18/+0
2014-03-27serialize: use ResultSean McArthur-0/+18
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-27syntax: add a some docs/clarification to the fields of ExpnInfo.Huon Wilson-3/+26
2014-03-23use TotalEq for HashMapDaniel Micay-4/+5
Closes #5283
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-31/+31
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-18libsyntax: librustdoc: ignore utf-8 BOM in .rs filesLiigo Zhuang-1/+10
Closes #12974
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-67/+54
2014-03-10syntax: fixed ICEs and incorrect line nums when reporting Spans at the end ↵Dmitry Promsky-14/+58
of the file. CodeMap.span_to_* perform a lookup of a BytePos(sp.hi), which lands into the next filemap if the last byte of range denoted by Span is also the last byte of the filemap, which results in ICEs or incorrect error reports. Example: ```` pub fn main() { let mut num = 3; let refe = &mut num; *refe = 5; println!("{}", num); }```` (note the empty line in the beginning and the absence of newline at the end) The above would have caused ICE when trying to report where "refe" borrow ends. The above without an empty line in the beginning would have reported borrow end to be the first line. Most probably, this is also responsible for (at least some occurrences of) issue #8256. The issue is fixed by always adding a newline at the end of non-empty filemaps in case there isn't a new line there already.
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-9/+10
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-9/+8
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-6/+6
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-27Fix bytepos_to_file_charpos.Nick Cameron-10/+52
Make bytepos_to_charpos relative to the start of the filemap rather than its previous behaviour which was to be realtive to the start of the codemap, but ignoring multi-byte chars in earlier filemaps. Rename to bytepos_to_file_charpos. Add tests for multi-byte chars.
2014-02-25auto merge of #12522 : erickt/rust/hash, r=alexcrichtonbors-1/+1
This patch series does a couple things: * replaces manual `Hash` implementations with `#[deriving(Hash)]` * adds `Hash` back to `std::prelude` * minor cleanup of whitespace and variable names.
2014-02-24syntax: calculate positions of multibyte characters more correctly.Huon Wilson-3/+4
They are still are not completely correct, since it does not handle graphemes at all, just codepoints, but at least it handles the common case correctly. The calculation was previously very wrong (rather than just a little bit wrong): it wasn't accounting for the fact that every character is 1 byte, and so multibyte characters were pretending to be zero width. cc #8706
2014-02-24std: minor whitespace cleanupErick Tryzelaar-1/+1
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-7/+7
2014-02-19Fix bug with zero-length filemaps and rename bytepos_to_local_charpos to ↵Nick Cameron-8/+78
bytepos_to_charpos.
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-1/+1
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-02libsyntax: Fix tests.Patrick Walton-2/+2
2014-02-02librustc: De-`@str` `NameAndSpan`Patrick Walton-3/+3
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-3/+3