about summary refs log tree commit diff
path: root/src/libsyntax/codemap.rs
AgeCommit message (Collapse)AuthorLines
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
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-2/+2
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-1/+1
2014-01-23auto merge of #11718 : ktt3ja/rust/borrowck-error-msg, r=brsonbors-4/+0
A mutable and immutable borrow place some restrictions on what you can with the variable until the borrow ends. This commit attempts to convey to the user what those restrictions are. Also, if the original borrow is a mutable borrow, the error message has been changed (more specifically, i. "cannot borrow `x` as immutable because it is also borrowed as mutable" and ii. "cannot borrow `x` as mutable more than once" have been changed to "cannot borrow `x` because it is already borrowed as mutable"). In addition, this adds a (custom) span note to communicate where the original borrow ends. ```rust fn main() { match true { true => { let mut x = 1; let y = &x; let z = &mut x; } false => () } } test.rs:6:21: 6:27 error: cannot borrow `x` as mutable because it is already borrowed as immutable test.rs:6 let z = &mut x; ^~~~~~ test.rs:5:21: 5:23 note: previous borrow of `x` occurs here; the immutable borrow prevents subsequent moves or mutable borrows of `x` until the borrow ends test.rs:5 let y = &x; ^~ test.rs:7:10: 7:10 note: previous borrow ends here test.rs:3 true => { test.rs:4 let mut x = 1; test.rs:5 let y = &x; test.rs:6 let z = &mut x; test.rs:7 } ^ ``` ```rust fn foo3(t0: &mut &mut int) { let t1 = &mut *t0; let p: &int = &**t0; } fn main() {} test.rs:3:19: 3:24 error: cannot borrow `**t0` because it is already borrowed as mutable test.rs:3 let p: &int = &**t0; ^~~~~ test.rs:2:14: 2:22 note: previous borrow of `**t0` as mutable occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `**t0` until the borrow ends test.rs:2 let t1 = &mut *t0; ^~~~~~~~ test.rs:4:2: 4:2 note: previous borrow ends here test.rs:1 fn foo3(t0: &mut &mut int) { test.rs:2 let t1 = &mut *t0; test.rs:3 let p: &int = &**t0; test.rs:4 } ^ ``` For the "previous borrow ends here" note, if the span is too long (has too many lines), then only the first and last lines are printed, and the middle is replaced with dot dot dot: ```rust fn foo3(t0: &mut &mut int) { let t1 = &mut *t0; let p: &int = &**t0; } fn main() {} test.rs:3:19: 3:24 error: cannot borrow `**t0` because it is already borrowed as mutable test.rs:3 let p: &int = &**t0; ^~~~~ test.rs:2:14: 2:22 note: previous borrow of `**t0` as mutable occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `**t0` until the borrow ends test.rs:2 let t1 = &mut *t0; ^~~~~~~~ test.rs:7:2: 7:2 note: previous borrow ends here test.rs:1 fn foo3(t0: &mut &mut int) { ... test.rs:7 } ^ ``` (Sidenote: the `span_end_note` currently also has issue #11715)
2014-01-23Make some borrow checker errors more user friendlyKiet Tran-4/+0
A mutable and immutable borrow place some restrictions on what you can with the variable until the borrow ends. This commit attempts to convey to the user what those restrictions are. Also, if the original borrow is a mutable borrow, the error message has been changed (more specifically, i. "cannot borrow `x` as immutable because it is also borrowed as mutable" and ii. "cannot borrow `x` as mutable more than once" have been changed to "cannot borrow `x` because it is already borrowed as mutable"). In addition, this adds a (custom) span note to communicate where the original borrow ends.
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-6/+3
2014-01-21Remove unnecessary parentheses.Huon Wilson-1/+1
2014-01-15libsyntax: Remove the obsolete ability to parse from substrings.Patrick Walton-42/+8
This was used by the quasiquoter.
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-6/+6
2014-01-03libsyntax: De-`@mut` `CodeMap::files`Patrick Walton-16/+28
2014-01-03libsyntax: De-`@mut` `FileMap::multibyte_chars`Patrick Walton-4/+6
2014-01-03libsyntax: De-`@mut` `FileMap::lines`Patrick Walton-10/+14
2014-01-02Output columns 1-based. Fixes #10848Jan Niklas Hasse-2/+2
2014-01-01syntax::codemap: Add static DUMMY_SPklutzy-8/+5
It replaces `dummy_sp()`.
2013-12-12Add --dep-info to write Makefile-compatible dependency info.Jack Moffitt-0/+4
When --dep-info is given, rustc will write out a `$input_base.d` file in the output directory that contains Makefile compatible dependency information for use with tools like make and ninja.
2013-12-08Remove dead codesKiet Tran-7/+0
2013-12-07syntax: print expansion info from #[attribute] macros in the correctHuon Wilson-1/+15
format. Previously, any attempt to use this information from inside something like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
2013-11-20Make BytePos 32-bitSeo Sanghyeon-5/+7
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-7/+7
Who doesn't like a massive renaming?
2013-09-30syntax: Remove usage of fmt!Alex Crichton-10/+10
2013-09-14These impls, at least, can be avoided by deriving Ord.Lindsey Kuper-16/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-27/+27
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-2/+2
Closes #5495
2013-08-05auto merge of #8278 : cmr/rust/workaround, r=brsonbors-4/+11
2013-08-03remove obsolete `foreach` keywordDaniel Micay-3/+3
this has been replaced by `for`
2013-08-03Work around #8256, do not fail the task, just return NoneCorey Richardson-4/+11
2013-08-02replace `range` with an external iteratorDaniel Micay-2/+1
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-4/+7
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-1/+1
2013-07-05Do not rely on newtype enum dereferenceSeo Sanghyeon-7/+2
2013-06-29Use more deriving(IterBytes) in libsyntax.Ben Blum-46/+7
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+3
2013-06-23vec: remove BaseIter implementationDaniel Micay-2/+2
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-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-11/+11
This almost removes the StringRef wrapper, since all strings are Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts several things to be &'static str (the lint table and the intrinsics table). There are many instances of .to_managed(), unfortunately.
2013-06-10std: convert character-based str::find_* to methods. Add .slice_{to,from} ↵Huon Wilson-6/+5
methods.
2013-06-10std: remove str::{len, slice, is_empty} in favour of methods.Huon Wilson-3/+3
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-15/+11
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+3
2013-05-23core: remove iter_bytes helper functionsErick Tryzelaar-4/+8
2013-05-22librustc: Change `std` to `extra` throughout libsyntax and librustcPatrick Walton-1/+1
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-19Register snapshotsBrian Anderson-48/+0
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-2/+2
2013-05-16syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].Huon Wilson-3/+1
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-14syntax: add IterBytes impls for some ast typesErick Tryzelaar-0/+60