about summary refs log tree commit diff
path: root/src/libsyntax/diagnostic.rs
AgeCommit message (Collapse)AuthorLines
2014-02-20Mass rename if_ok! to try!Alex Crichton-21/+21
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-07Removed @self and @Trait.Eduard Burtescu-35/+28
2014-02-03syntax: Remove io_error usageAlex Crichton-48/+64
2014-02-02Move term, terminfo out of extra.xales-1/+1
cc #8784
2014-01-30Remove Times traitBrendan Zabarauskas-3/+4
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-23Make some borrow checker errors more user friendlyKiet Tran-12/+76
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-18rustc: Clean up error reportingAlex Crichton-2/+7
This commit re-works how the monitor() function works and how it both receives and transmits errors. There are a few cases in which the compiler can abort: 1. A normal compiler error. In this case, the compiler raises a FatalError as the failure value of the task. If this happens, then the monitor task does nothing. It ignores all stderr output of the child task and it also suppresses the failure message of the main task itself. This means that on a normal compiler error just the error message itself is printed. 2. A normal internal compiler error. These are invoked from sess.span_bug() and friends. In these cases, they follow the same path (raising a FatalError), but they will also print an ICE message which has a URL to go report a bug. 3. An actual compiler bug. This happens whenever anything calls fail!() instead of going through the session itself. In this case, we print out stuff about RUST_LOG=2 and we by default capture all stderr and print via warn!() so it's only printed out with the RUST_LOG var set.
2014-01-11Various READMEs and docs cleanupAdrien Tétar-1/+1
Noticeably closes #11428.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-35/+37
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-2/+1
2014-01-03libsyntax: De-`@mut` the handlerPatrick Walton-16/+16
2014-01-03libsyntax: De-`@mut` `HandlerT::err_count`Patrick Walton-7/+8
2014-01-03librustc: De-`@mut` the span handlerPatrick Walton-13/+10
2014-01-01syntax::diagnostic: Remove @ from Emitterklutzy-12/+12
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-66/+38
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2013-12-07syntax: print expansion info from #[attribute] macros in the correctHuon Wilson-1/+6
format. Previously, any attempt to use this information from inside something like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-6/+2
2013-11-24libextra: Remove @mut from term.Luqman Aden-23/+30
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-3/+5
2013-11-11Move std::rt::io to std::ioAlex Crichton-1/+1
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-1/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-10-24Remove even more of std::ioAlex Crichton-20/+18
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22auto merge of #10006 : alexcrichton/rust/another-massive-rename, r=brsonbors-2/+2
Drop the `2` suffix on all of them, updating all code in the process of doing so. This is a completely automated change, and it's dependent on the snapshots going through.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-2/+2
Who doesn't like a massive renaming?
2013-10-21syntax: Add the Bug Report HOWTO URL to the ICE messageTim Chevalier-1/+5
And also reference the bug report HOWTO in CONTRIBUTING.md
2013-10-09option: rewrite the API to use compositionDaniel Micay-2/+2
2013-09-30syntax: Remove usage of fmt!Alex Crichton-10/+10
2013-09-23libsyntax: Remove some more `@fn` usesPatrick Walton-7/+0
2013-09-23librustc: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-31/+43
2013-09-18Register new snapshotsAlex Crichton-1/+1
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-21/+21
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-9/+9
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-1/+1
2013-08-03remove obsolete `foreach` keywordDaniel Micay-3/+3
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-2/+1
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-2/+2
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-22new snapshotDaniel Micay-3/+0
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-4/+4
2013-07-14Don't re-parse terminfo (twice!) on every compiler diagnosticKevin Ballard-2/+19
Stuff the term::Terminal into TLS to avoid re-parsing for every single message we want to color. Fixes #6827.
2013-07-14Highlight rustc's warnings/errors in bold instead of bright whiteKevin Ballard-14/+15
Clang actually highlights using bold, not using bright white. Match clang on this so our diagnostics are still readable on terminals with a white background.
2013-07-09bright white for the message, similar to clangLenny222-1/+1
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-4/+4
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-9/+18
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-27Convert vec::[mut_]slice to methods, remove vec::const_slice.Huon Wilson-2/+1
2013-06-26Refactor extra::term a bitKevin Ballard-6/+6
Move all the colors into a nested mod named color instead of prefixing with "color_". Define a new type color::Color, and make this a u16 instead of a u8 (to allow for easy comparisons against num_colors, which is a u16). Remove color_supported and replace it with num_colors. Teach fg() and bg() to "dim" bright colors down to the normal intensity if num_colors isn't high enough. Remove unnecessary copies, and fix a bug where a terminfo parse failure would try to use the wrong error and end up failing.
2013-06-26Make ^~~~~ colour dependent on error/warning/note level. Also correct ↵Ben Blum-7/+7
spelling of squigglies.
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+3
2013-06-23vec: remove BaseIter implementationDaniel Micay-1/+1
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-22Merge pull request #7230 from Blei/green-squiggleDaniel Micay-13/+20
syntax::diagnostics: Color the ^~~~ in green for better visibility