| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
r? @eddyb or @nrc
|
|
|
|
|
|
|
|
|
|
|
|
error, by moving unexpected let check into the proper if-else clause
|
|
|
|
|
|
in parse_bottom_expr (parser.rs)
|
|
|
|
|
|
This aligns with unicode recommendations and should be stable for all future
unicode releases. See http://unicode.org/reports/tr31/#R3.
This renames `libsyntax::lexer::is_whitespace` to `is_pattern_whitespace`
so potentially breaks users of libsyntax.
|
|
This is achieved by adding the scan_back method. This method looks back
through the source_text of the StringReader until it finds the target
char, returning it's offset in the source. We use this method to find
the offset of the opening single quote, and use that offset as the start
of the error.
Given this code:
```rust
fn main() {
let _ = 'abcd';
}
```
The compiler would give a message like:
```
error: character literal may only contain one codepoint: ';
let _ = 'abcd';
^~
```
With this change, the message now displays:
```
error: character literal may only contain one codepoint: 'abcd';
let _ = 'abcd';
^~~~~~~
```
Fixes #30033
|
|
Fixes #29590.
|
|
[breaking-change]
syntax::errors::Handler::new has been renamed to with_tty_emitter
Many functions which used to take a syntax::errors::ColorConfig, now take a rustc::session::config::ErrorOutputType. If you previously used ColorConfig::Auto as a default, you should now use ErrorOutputType::default().
|
|
Given this code:
fn main() {
let _ = 'abcd';
}
The compiler would give a message like:
error: character literal may only contain one codepoint: ';
let _ = 'abcd';
^~
With this change, the message now displays:
error: character literal may only contain one codepoint: 'abcd'
let _ = 'abcd'
^~~~~~
Fixes #30033
|
|
This PR fixes an ICE due to an DiagnosticsBuilder not being canceld or emitted.
Ideally it would use `Handler::cancel`, but I did not manage to get a `&mut` reference to the diagnostics handler.
|
|
|
|
|
|
|
|
Fixes #30715
|
|
The fundamental problem of duplication was fixed in https://github.com/rust-lang/rust/pull/10891, but the comment was preserved. Closes https://github.com/rust-lang/rust/issues/9762.
|
|
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery.
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
|
|
The fundamental problem of duplication was fixed in https://github.com/rust-lang/rust/pull/10891, but the comment was preserved. Closes https://github.com/rust-lang/rust/issues/9762.
|
|
Fixes #30715
|
|
|
|
|
|
|
|
The current help message is too much about "normal" macros to be used
as general message. Keep it for normal macros, and add custom help and
error messages for macro definitions.
|
|
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
|
|
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.
https://github.com/rust-lang/rust/issues/28777
|
|
|
|
|
|
The current help message is too much about "normal" macros to be used
as general message. Keep it for normal macros, and add custom help and
error messages for macro definitions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This PR is a rebase of the original PR by @eddyb https://github.com/rust-lang/rust/pull/21836 with some unrebasable parts manually reapplied, feature gate added + type equality restriction added as described below.
This implementation is partial because the type equality restriction is applied to all type ascription expressions and not only those in lvalue contexts. Thus, all difficulties with detection of these contexts and translation of coercions having effect in runtime are avoided.
So, you can't write things with coercions like `let slice = &[1, 2, 3]: &[u8];`. It obviously makes type ascription less useful than it should be, but it's still much more useful than not having type ascription at all.
In particular, things like `let v = something.iter().collect(): Vec<_>;` and `let u = t.into(): U;` work as expected and I'm pretty happy with these improvements alone.
Part of https://github.com/rust-lang/rust/issues/23416
|
|
+ Rebase fixes
|
|
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults.
r? @nrc
|
|
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
|
|
|
|
|
|
|