about summary refs log tree commit diff
path: root/src/libsyntax/diagnostic.rs
AgeCommit message (Collapse)AuthorLines
2014-06-15Register new snapshotsAlex Crichton-5/+5
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-1/+1
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-2/+2
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-5/+5
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-4/+5
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-6/+10
2014-05-19Reset the terminal color before the newline for diagnosticsKevin Ballard-2/+21
When printing colored diagnostics, we need to reset the terminal before emitting the newline, not after. Otherwise it gets line-buffered and the color won't reset until the next line is printed or the compiler exits. Normally this isn't a problem, but when running rustc in parallel with other processes (e.g. `make -j4`) this can cause the color to leak to other lines.
2014-05-16Update for BoxCorey Richardson-1/+1
2014-05-16syntax: update for libterm falloutCorey Richardson-4/+4
2014-05-15Add compiler flag to configure output coloringHanno Braun-4/+18
This adds the flag --color, which allows the user to force coloring or turn it off. The default behavior stays the same as before (colorize, if output goes to tty). Why this is beneficial is explained in issue #12881. Please note that this commit doesn't include any regression tests. I thought about how I'd write a test for this and it doesn't seem to be worth the effort to me for a UI change like this. Fixes #12881.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-8/+12
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-4/+4
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-3/+3
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-4/+4
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-10/+22
port all code over to use it.
2014-04-06auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,mebors-0/+2
Rebasing of #12526 with a very obscure bug fixed on windows.
2014-04-05Added session.fileline_note() method and support infrastucture for it.Felix S. Klock II-8/+42
Add way to print notes with just file:linenum prefix (preserving integration with source lookup for e.g. vi and emacs) but don't repeat the other span info.
2014-04-04Fix fallout from std::libc separationCorey Richardson-0/+2
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-3/+3
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