summary refs log tree commit diff
path: root/src/libsyntax/diagnostic.rs
AgeCommit message (Collapse)AuthorLines
2014-03-27Fix fallout of removing default boundsAlex Crichton-4/+4
This is all purely fallout of getting the previous commit to compile.
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-9/+9
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-22/+20
2014-03-14rustc: make stack traces print for .span_bug/.bug.Huon Wilson-10/+11
Previously a call to either of those to diagnostic printers would defer to the `fatal` equivalents, which explicitly silence the stderr printing, including a stack trace from `RUST_LOG=std::rt::backtrace`. This splits the bug printers out to their own diagnostic type so that things work properly. Also, this removes the `Ok(...)` that was being printed around the subtask's stderr output.
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-2/+2
only lowercase characters
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-2/+2
2014-03-01std: Switch stdout/stderr to buffered by defaultAlex Crichton-2/+2
Similarly to #12422 which made stdin buffered by default, this commit makes the output streams also buffered by default. Now that buffered writers will flush their contents when they are dropped, I don't believe that there's no reason why the output shouldn't be buffered by default, which is what you want in 90% of cases. As with stdin, there are new stdout_raw() and stderr_raw() functions to get unbuffered streams to stdout/stderr.
2014-02-28syntax: Refactor diagnostics to focus on WritersAlex Crichton-101/+109
This commit alters the diagnostic emission machinery to be focused around a Writer for emitting errors. This allows it to not hard-code emission of errors to stderr (useful for other applications).
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-6/+9
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-22Warn about unnecessary parentheses upon assignmentEduard Bopp-1/+1
Closes #12366. Parentheses around assignment statements such as let mut a = (0); a = (1); a += (2); are not necessary and therefore an unnecessary_parens warning is raised when statements like this occur. The warning mechanism was refactored along the way to allow for code reuse between the routines for checking expressions and statements. Code had to be adopted throughout the compiler and standard libraries to comply with this modification of the lint.
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.