| Age | Commit message (Collapse) | Author | Lines |
|
Improve error message for const extern fn
It's currently ``error: unmatched visibility `pub` ``, which is a nonsensical error in this context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is useful if parsing from stdin or a String and don't want to try and read in a module from another file. Instead we just leave a stub in the AST.
|
|
|
|
This is mostly removing stray ampersands, needless returns and lifetimes.
|
|
|
|
Delete features which are easily removed, in libsyntax
|
|
|
|
|
|
|
|
Minimize single span suggestions into a label
changes
```
14 | println!("☃{}", tup[0]);
| ^^^^^^
|
help: to access tuple elements, use tuple indexing syntax as shown
| println!("☃{}", tup.0);
```
into
```
14 | println!("☃{}", tup[0]);
| ^^^^^^ to access tuple elements, use `tup.0`
```
Also makes suggestions explicit in the backend in preparation of adding multiple suggestions to a single diagnostic. Currently that's already possible, but results in a full help message + modified code snippet per suggestion, and has no rate limit (might show 100+ suggestions).
|
|
syntax: Parse trait object types starting with a lifetime bound
Fixes https://github.com/rust-lang/rust/issues/39085
This was originally implemented in https://github.com/rust-lang/rust/pull/40043, then reverted, then there was some [agreement](https://github.com/rust-lang/rust/issues/39318#issuecomment-289108720) that it should be supported.
(This is hopefully the last PR related to bound parsing.)
|
|
#37653 support `default impl` for specialization
this commit implements the first step of the `default impl` feature:
> all items in a `default impl` are (implicitly) `default` and hence
> specializable.
In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info
r? @aturon
|
|
`[default] [unsafe] impl` and typecheck
|
|
|
|
|
|
|
|
|
|
|
|
pr review
|
|
|
|
|
|
|
|
this commit implements the first step of the `default impl` feature:
all items in a `default impl` are (implicitly) `default` and hence
specializable.
In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See referenced issue for further info
|
|
|
|
|
|
|
|
libsyntax/parse: fix missing kind error reporting
Fixes #41161.
Fixes #41239.
|
|
Fixes #41161.
Fixes #41239.
|
|
Rollup of 3 pull requests
- Successful merges: #41012, #41280, #41290
- Failed merges:
|
|
|
|
|
|
|
|
|
|
#41158
|
|
Use proper span for tuple index parsed as float
Fix diagnostic suggestion from:
```rust
help: try parenthesizing the first index
| (1, (2, 3)).((1, (2, 3)).1).1;
```
to the correct:
```rust
help: try parenthesizing the first index
| ((1, (2, 3)).1).1;
```
Fix #41081.
|
|
Avoid pointing at two chars so the diagnostic output doesn't display a
multiline span when starting beyond a line end.
|
|
|
|
macros: fix bug parsing `#[derive]` invocations
Fixes #40962 (introduced in #40346).
r? @nrc
|
|
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
|
|
Fix diagnostic suggestion from:
```rust
help: try parenthesizing the first index
| (1, (2, 3)).((1, (2, 3)).1).1;
```
to the correct:
```rust
help: try parenthesizing the first index
| ((1, (2, 3)).1).1;
```
|
|
|
|
|
|
|
|
Add a `TyErr` type to represent unknown types in places where
parse errors have happened, while still able to build the AST.
Initially only used to represent incorrectly written fn arguments and
avoid "expected X parameters, found Y" errors when called with the
appropriate amount of parameters. We cannot use `TyInfer` for this as
`_` is not allowed as a valid argument type.
Example output:
```rust
error: expected one of `:` or `@`, found `,`
--> file.rs:12:9
|
12 | fn bar(x, y: usize) {}
| ^
error[E0061]: this function takes 2 parameters but 3 parameters were supplied
--> file.rs:19:9
|
12 | fn bar(x, y) {}
| --------------- defined here
...
19 | bar(1, 2, 3);
| ^^^^^^^ expected 2 parameters
```
|