Commit Graph

53119 Commits

Author SHA1 Message Date
Niko Matsakis
9355a91224 assert we get at least two rendered lines back 2016-05-02 13:05:14 -04:00
Alex Crichton
71e63296a2 rustc: Handle concurrent create_dir requests
The compiler created a directory as part of `-Z incremental` but that may be
hierarchically used concurrently so we need to protect ourselves against that.
2016-05-02 09:38:07 -07:00
bors
d80497e628 Auto merge of #33308 - ollie27:wingnu_jemalloc, r=alexcrichton
Fix alloc_jemalloc on windows gnu targets

jemalloc prefixes the symbols by default on Windows so we need to account
for that to avoid link errors such as: `undefined reference to 'mallocx'`
when using alloc_jemalloc.
2016-05-02 09:16:23 -07:00
Niko Matsakis
db8a9a92b3 avoid double panic 2016-05-02 11:49:26 -04:00
Niko Matsakis
9d151a71c0 do not fail if len(rendered_lines) is == 1
also handle more rendered-lines
2016-05-02 11:49:26 -04:00
jonathandturner
f359aa2762 Fix unicode test to use original error format 2016-05-02 11:49:26 -04:00
Niko Matsakis
64e0819fc2 patch travis failure 2016-05-02 11:49:26 -04:00
Niko Matsakis
95576b8ec4 update unit tests 2016-05-02 11:49:26 -04:00
Niko Matsakis
2ba5fac1a4 fix rebase flaws 2016-05-02 11:49:26 -04:00
Jonathan Turner
5974e5b294 Fix up error-pattern style test 2016-05-02 11:49:26 -04:00
Jonathan Turner
79f61a4532 Finish up with 'old school' error mode 2016-05-02 11:49:25 -04:00
Jonathan Turner
84cb56f8ee Add back in a 'old school' error format 2016-05-02 11:49:25 -04:00
Niko Matsakis
49dfac4872 move "lint level defined here" into secondary note
It does not help you to understand the error, just explains why you are
seeing it, so it is clearly secondary.
2016-05-02 11:49:25 -04:00
Niko Matsakis
89d086be74 change color of warning to YELLOW 2016-05-02 11:49:25 -04:00
Niko Matsakis
790043b44e fix snippet tests MORE! 2016-05-02 11:49:25 -04:00
Niko Matsakis
8a9ad72c1d Nit: use Range::contains 2016-05-02 11:49:25 -04:00
Niko Matsakis
ba12ed06ed fix tests better 2016-05-02 11:49:25 -04:00
Niko Matsakis
5db4d620f2 Nit: remove push_primary_span, which was never called 2016-05-02 11:49:25 -04:00
Niko Matsakis
883b969909 Nit: add comment 2016-05-02 11:49:25 -04:00
Niko Matsakis
1fdbfcdbd0 only emit ^ at the start of a multi-line error
as a result, simplify elision code
2016-05-02 11:49:25 -04:00
Niko Matsakis
24f4b151b1 Nit: use last_mut better 2016-05-02 11:49:25 -04:00
Niko Matsakis
94841bea7b Nit: in emitter.rs 2016-05-02 11:49:25 -04:00
Niko Matsakis
f6496cd370 Nit: address various style nits 2016-05-02 11:49:24 -04:00
Niko Matsakis
d5529f000d Nit: do not use RLK 2016-05-02 11:49:24 -04:00
Niko Matsakis
d58a4becf3 Nit: do not import variants from Style 2016-05-02 11:49:24 -04:00
Niko Matsakis
e56121c584 Do not import variants from RenderedLineKind 2016-05-02 11:49:24 -04:00
Niko Matsakis
9a9c9afbe2 Fix whitespace 2016-05-02 11:49:24 -04:00
Niko Matsakis
5adfe5bffe Nit: comments should be uppercase letter 2016-05-02 11:49:24 -04:00
Niko Matsakis
8013eebf2c fix error message in librustc_driver tests 2016-05-02 11:49:24 -04:00
Niko Matsakis
1067850e6a refactor the Emitter trait
There is now a CoreEmitter that everything desugars to, but without
losing any information. Also remove RenderSpan::FileLine. This lets the
rustc_driver tests build.
2016-05-02 11:49:24 -04:00
Niko Matsakis
9d022f2993 rewrite span-length to include strings
It is way easier to copy-and-paste strings from the output
than to figure out how to reproduce them from first
principles.
2016-05-02 11:49:24 -04:00
Niko Matsakis
47143945cc delete the json-errors test
It's primary purpose was to check that json worked at all,
but compiletest does that now.
2016-05-02 11:49:24 -04:00
Niko Matsakis
71c6f81309 change errors from Yellow to Magenta
The Yellow text is very hard to read with a white background.
2016-05-02 11:49:24 -04:00
Niko Matsakis
41a652e094 WIP factor out RudimentaryEmitter 2016-05-02 11:49:24 -04:00
Niko Matsakis
489a6c95bf replace fileline_{help,note} with {help,note}
The extra filename and line was mainly there to keep the indentation
relative to the main snippet; now that this doesn't include
filename/line-number as a prefix, it is distracted.
2016-05-02 11:49:23 -04:00
Niko Matsakis
1ff1887cc9 thread tighter span for closures around
Track the span corresponding to the `|...|` part of the closure.
2016-05-02 11:47:10 -04:00
Niko Matsakis
e416518e68 update test cases to reflect new messages 2016-05-02 11:47:10 -04:00
Niko Matsakis
d9a947ce8f use new note_expected_found API
This API pulls the "expected type foo, found type bar" out after the
main snippet. There are some other places where it makes sense, but this
is a start.
2016-05-02 11:47:10 -04:00
Niko Matsakis
11dc974a38 refactor to use new snippet code and model
Major changes:
- Remove old snippet rendering code and use the new stuff.
- Introduce `span_label` method to add a label
- Remove EndSpan mode and replace with a fn to get the last
  character of a span.
- Stop using `Option<MultiSpan>` and just use an empty `MultiSpan`
- and probably a bunch of other stuff :)
2016-05-02 11:47:10 -04:00
Niko Matsakis
5b150cf0ca add borrowck info inline in main snippet
This uses the new `span_label` APIs
2016-05-02 11:47:10 -04:00
Niko Matsakis
e7c7a18d94 adapt JSON to new model
Each Span now carries a `is_primary` boolean along with an optional
label. If there are multiple labels for a span, it will appear multiple
times.
2016-05-02 11:47:10 -04:00
Niko Matsakis
a20ee76b56 revamp MultiSpan and introduce new snippet code
MultiSpan model is now:

- set of primary spans
- set of span+label pairs

Primary spans render with `^^^`, secondary spans with `---`.

Labels are placed next to the `^^^` or `---` marker as appropriate.
2016-05-02 11:47:09 -04:00
Ryman
9fe3c065b0 libstd: correct the link to functions in io module documentation
Currently the link refers to it's own section of the documentation rather than the list of functions generated by rustdoc.
2016-05-02 15:54:54 +01:00
Georg Brandl
6fed0132f3 middle: reset loop labels while visiting closure
This should fix #31754 and follow-up #25343.  Before the latter, the
closure was visited twice in the context of the enclosing fn, which
made even a single closure with a loop label emit a warning.

With this change, the closure is still visited within the context
of the main fn (which is intended, since it is not a separate item)
but resets the found loop labels while being visited.

Fixes: #31754
2016-05-02 16:48:36 +02:00
Oliver Schneider
ce6ea47d43 refactor infer function
There was no span available in the cast function, but we need to infer the `x` in `x as char` to `u8`.
The spans are now removed from all functions using `infer` and instead added in `eval_const_expr_partial`
2016-05-02 16:40:40 +02:00
Oliver Schneider
f080b13c6b tests 2016-05-02 16:38:49 +02:00
Oliver Schneider
10737a5a45 * as char assumes * to be of type u8 2016-05-02 16:38:33 +02:00
bors
0eb575c702 Auto merge of #33303 - Aatch:mir-coercion-cast, r=arielb1
[MIR] Handle coercion casts properly when building the MIR

Coercion casts (`expr as T` where the type of `expr` can be coerced to
`T`) are essentially no-ops, as the actual work is done by a coercion.
Previously a check for type equality was used to avoid emitting the
redundant cast in the MIR, but this failed for coercion casts of
function items that had lifetime parameters. The MIR trans code doesn't
handle `FnPtr -> FnPtr` casts and produced an error.

Also fixes a bug with type ascription expressions not having any
adjustments applied.

Fixes #33295

/cc @eddyb
2016-05-02 06:58:11 -07:00
Georg Brandl
98d991fac5 parser: change warning into an error on T<A=B, C>
Fixes: #32214
2016-05-02 15:10:28 +02:00
bors
e1a575cb07 Auto merge of #33289 - birkenfeld:chain-find, r=bluss
Implement find() on Chain iterators

This results in a roughly 2x speedup compared to the default impl
"inherited" from Iterator.

Benchmark: https://gist.github.com/birkenfeld/aa9b92cb7d55666dd4821207527eaf5b
2016-05-02 04:46:58 -07:00