Commit Graph

31 Commits

Author SHA1 Message Date
Michael Woerister 39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
Esteban Küber 4c80170782 Point at only one char on Span::next_point
Avoid pointing at two chars so the diagnostic output doesn't display a
multiline span when starting beyond a line end.
2017-04-10 14:03:17 -07:00
Ariel Ben-Yehuda cee0508021 Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez
Identify missing item category in `impl`s

```rust
struct S;
impl S {
    pub hello_method(&self) {
        println!("Hello");
    }
}
fn main() { S.hello_method(); }
```

```rust
error: missing `fn` for method declaration
 --> file.rs:3:4
  |
3 |     pub hello_method(&self) {
  |        ^ missing `fn`
```

Fix #40006. r? @pnkfelix CC @jonathandturner @GuillaumeGomez
2017-04-05 23:01:06 +00:00
Esteban Küber dedb7bbbbf Merge branch 'master' into issue-32540 2017-04-04 08:13:27 -07:00
Esteban Küber 8f31e191c6 Merge branch 'master' into issue-40006 2017-04-03 05:07:49 -07:00
Jeffrey Seyfried f08d5ad4c5 Refactor how spans are combined in the parser. 2017-03-29 11:17:59 +00:00
Jeffrey Seyfried ec7c0aece1 Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
Jeffrey Seyfried 496996c2af Remove code in syntax::codemap. 2017-03-29 00:41:10 +00:00
Jeffrey Seyfried 1979f96549 Move syntax::ext::hygiene to syntax_pos::hygiene. 2017-03-29 00:41:08 +00:00
Esteban Küber b477682dca Fix unittests 2017-03-27 19:13:03 -07:00
Esteban Küber 78ae8feebb Improve wording and spans for unexpected token
* Point at where the token was expected instead of the last token
  successfuly parsed.
* Only show `unexpected token` if the next char and the unexpected token
  don't have the same span.
* Change some cfail and pfail tests to ui test.
* Don't show all possible tokens in span label if they are more than 6.
2017-03-25 15:36:59 -07:00
Niko Matsakis d9aaca71cc store typeck lints in the TypeckTables
Otherwise they are a "hidden output"
2017-02-02 20:38:16 -05:00
Alex Crichton 9b0b5b45db Remove not(stage0) from deny(warnings)
Historically this was done to accommodate bugs in lints, but there hasn't been a
bug in a lint since this feature was added which the warnings affected. Let's
completely purge warnings from all our stages by denying warnings in all stages.
This will also assist in tracking down `stage0` code to be removed whenever
we're updating the bootstrap compiler.
2016-12-29 21:07:20 -08:00
Alex Crichton 2186660b51 Update the bootstrap compiler
Now that we've got a beta build, let's use it!
2016-11-30 10:38:08 -08:00
Esteban Küber a820d99eb2 Group unused import warnings per path list
Given a file

```rust
use std::collections::{BinaryHeap, BTreeMap, BTreeSet};

fn main() {}
```

Show a single warning, instead of three for each unused import:

```nocode
warning: unused imports, #[warn(unused_imports)] on by default
 --> foo.rs:1:24
  |
1 | use std::collections::{BinaryHeap, BTreeMap, BTreeSet};
  |                        ^^^^^^^^^^  ^^^^^^^^  ^^^^^^^^
```

Include support for lints pointing at `MultilineSpan`s, instead of just
`Span`s.
2016-11-08 17:44:21 -08:00
Niko Matsakis f652651275 retool EarlyLint to track a Diagnostic 2016-11-01 14:07:45 -04:00
Felix S. Klock II 3f639a0f11 Do not intern filemap to entry w/ mismatched length. Fix #37274 (I think). 2016-10-28 17:16:34 +02:00
Nick Cameron 9bc6d26092 Stabilise ?
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-12 08:40:22 +13:00
bors 6ad10844db Auto merge of #36585 - jonathandturner:misc_error_touchups, r=nrc
Add the ability to merge spans to codemap

This PR adds the ability to merge Spans.  To do so, it builds on the Codemap's ability to verify the locations of spans, namely that following can be verified:

* the expn_id of both spans much match
* the lhs span needs to end on the same line the rhs span begins
* the lhs span must start at or before the rhs span

If all of these are met, a new span is returned that is min(lo), max(hi) of the two spans.

This PR also removes an older Span merge, as this new functionality subsumes it.

r? @nrc
2016-09-21 22:40:51 -07:00
Eduard Burtescu 221d1a97e5 serialize: allow specifying the default behavior for specializations. 2016-09-20 20:08:06 +03:00
Eduard Burtescu fc363cb482 rustc_metadata: go only through rustc_serialize in astencode. 2016-09-20 20:07:54 +03:00
Jonathan Turner 2ea3ab3a90 Add the ability to merge spans to codemap 2016-09-19 12:31:56 -07:00
Michael Woerister e355ec1c6a incr.comp.: Add stable hashing of HIR spans to ICH. 2016-09-01 09:43:44 -04:00
Jonathan Turner 61865384b8 Replace local backtrace with def-use, repair std macro spans 2016-08-17 14:26:14 -07:00
Manish Goregaokar 6ea3ef7ac2 Rollup merge of #35094 - mcarton:multispan, r=jonathandturner
Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f.

That commit removed the only way to make a suggestion with more than one substitute. That feature is not used directly by rustc but exists and is used by Clippy. Bring it back until we come up with a better solution (suggestions don't use span labels, so it would make sense for them to use their own type).
Rational there: https://github.com/Manishearth/rust-clippy/pull/1119.

r? @jonathandturner
Cc @Manishearth
2016-07-30 13:44:47 +05:30
mcarton 6dc98cf099 Revert "Remove unused methods from MultiSpan"
This reverts commit f7019a4e2f.

This removed the only way to make a suggestion with more than one
substitute. Bring it back until we come up with a better solution.
2016-07-28 19:33:31 +02:00
cgswords 5553901146 Adressed PR comments. 2016-07-25 14:27:10 -07:00
Jonathan Turner f7019a4e2f Remove unused methods from MultiSpan 2016-07-21 12:38:15 -07:00
Jonathan Turner 71ec2867e3 Implement latest rfc style using simpler rendering 2016-07-14 07:57:46 -04:00
Jonathan Turner 2829fbc638 Address comments and fix travis warning 2016-06-23 08:07:35 -04:00
Jonathan Turner 6ae3502134 Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00