Masaki Hara
e2b95cb70e
Lift some Sized checks.
2018-08-19 08:07:33 +09:00
Esteban Küber
1b5e29ae6f
Do not emit "incorrect close delimiter" twice in the same place
2018-08-15 14:26:03 -07:00
Esteban Küber
2a74d7924a
Tweak unclosed delimiter parser error
2018-08-15 13:18:34 -07:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841 .
2018-08-14 11:12:09 +02:00
Felix Rabe
c74415872c
Fix doc link (again)
...
Similar to #52404 . The link for comparison:
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)
- https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)
- https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)
This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):
rg -l dynamically-sized-types-and-sized
and then replacing all relevant occurrences via:
find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm
(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)
2018-08-05 07:52:29 +02:00
Felix Rabe
88e9af0375
Fix doc link
...
The link for comparison:
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)
This commit is the result of (first) searching via:
find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized
and then replacing all relevant occurrences via:
find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g
find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm
(Note: Commands run on macOS 10.13 (BSD). `sed -i.bak` should work on
GNU/Linux as well, but not tested.)
2018-07-17 14:10:11 +02:00
Rémy Rakic
b8c96ce530
Fix typo in error message E0277
2018-07-10 23:10:13 +02:00
Zack M. Davis
4b1808578a
add dyn to display of dynamic (trait) type names
...
The `dyn Trait` syntax was stabilized in 199ee327 . Resolves #49277 .
2018-06-23 18:10:25 -07:00
Esteban Küber
d4bfae1319
Update message for !Sized types
2018-06-19 17:32:33 -07:00
Esteban Küber
f1dee43887
Add link to book for Sized errors
2018-06-19 15:19:15 -07:00
Esteban Küber
776544f011
Add message to rustc_on_unimplemented attributes in core
2018-06-19 15:19:13 -07:00
Crazycolorz5
c1df62a760
Add closing bracket expectation to sequences, modified appropriate test cases.
2018-06-01 10:05:46 -04:00
John Kåre Alsaker
9cbe3b749d
Update tests
2018-04-16 23:30:36 +02:00
John Kåre Alsaker
b1d872b38e
Update tests
2018-03-16 11:52:46 +01:00
Eric Huss
6aa4dcb9cf
Add empty main() to tests where it is missing.
2018-03-14 12:23:28 -07:00
Eric Huss
b4b7ccbd1c
Add crate name to "main function not found" error message.
...
Fixes #44798 and rust-lang/cargo#4948 .
2018-03-14 11:40:13 -07:00
Guillaume Gomez
2e104a77cf
update tests
2018-03-14 00:53:24 +01:00
Esteban Küber
36baa81be9
Add label to primary span in some parse errors
2018-02-27 10:47:33 -08:00
Vadim Petrochenkov
7ba5fd168a
Update UI tests
2018-02-26 20:24:42 +03:00
Vadim Petrochenkov
fa2d9fc4b9
Update UI tests
2018-02-26 20:24:02 +03:00
Guillaume Gomez
5747fd6611
Update ui tests
2018-02-25 12:15:05 +01:00
John Kåre Alsaker
46a3f2fa18
Change error message for E0391 to "cyclic dependency detected"
2018-02-10 03:28:15 +01:00
Esteban Küber
4a7691692c
Further tweaks to the output
...
- Properly address Variant Ctors
- Show signature if span of trait method without `self` is not available
2018-01-15 12:35:15 -08:00
Esteban Küber
38546ba9fa
Add note when trying to use Self as a ctor
2018-01-15 02:03:03 -08:00
Esteban Küber
ce9ef37fe6
Readd suggestion in enum variants with incorrect args
2018-01-15 02:03:03 -08:00
Esteban Küber
a317da42b1
Suggest the correct syntax for different struct types
2018-01-15 02:03:02 -08:00
Esteban Küber
9bab0f09d3
Hide suggestion to use struct ctor when it is not visible
2018-01-15 02:03:02 -08:00
Ed Schouten
c51f8783f2
Correct for changes in line numbers in expected stderr output.
...
Due to the disable-cloudabi tags being added to the source files, the
expected output of the compiler is altered slightly.
2018-01-02 18:12:10 +01:00
Ed Schouten
3f880912e9
Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.
...
It looks like many of these tests are already disabled on emscripten,
which also doesn't seem to support environment variables and subprocess
spawning. Just add a similar tag for CloudABI. While there, sort some of
the lists of operating systems alphabetically.
2018-01-02 14:11:41 +01:00
Esteban Küber
aaf3e318fc
Do not emit type errors on recovered blocks
...
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-21 14:57:42 -08:00
Vadim Petrochenkov
1f5b201aff
Remove NOTE/HELP annotations from UI tests
2017-12-14 23:26:39 +03:00
Esteban Küber
487daabb52
Fix test
2017-11-27 06:01:16 -08:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests
2017-11-24 11:32:35 +01:00
Oliver Schneider
47c7e430d3
Remove left over dead code from suggestion diagnostic refactoring
2017-11-16 16:36:49 +01:00
Christopher Vittal
109f2dd36b
Add new error comparision to hide desugaring
...
First some background:
To the compiler, the following two signatures in the trait vs the impl
are the same.
```rust
trait Foo {
fn foo(&self, &impl Debug);
}
impl Foo for () {
fn foo<U: Debug>(&self, x: &U) { ... }
}
```
We do not want to allow this, and so we add a new error and check.
The check just tests that all paramters 'syntheticness' match up. As
during collection, the impl Trait parameters are transformed into
anonymous synthetic generics.
Furthermore, causes a check for unused type parameters to be skipped in
check_bounds_are_used if there is already a TyError. Thus, an unused
input will not trigger `type parameter unused` errors.
Update the one test that checked for this error in the case of
a TyError.
2017-11-15 15:46:01 -05:00
bors
a35a3abcda
Auto merge of #45050 - petrochenkov:ambind, r=nikomatsakis
...
resolve: Use same rules for disambiguating fresh bindings in `match` and `let`
Resolve `Unit` as a unit struct pattern in
```rust
struct Unit;
let Unit = x;
```
consistently with
```rust
match x {
Unit => {}
}
```
It was previously an error.
(The change also applies to unit variants and constants.)
Fixes https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054
(This particular change doesn't depend on a fix for the issue mentioned in https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054/4 )
cc @rust-lang/lang
r? @nikomatsakis
2017-11-10 19:10:12 +00:00
Esteban Küber
9dc7abe06d
Detect = -> : typo in let bindings
...
When encountering a let binding type error, attempt to parse as
initializer instead. If successful, it is likely just a typo:
```rust
fn main() {
let x: Vec::with_capacity(10);
}
```
```
error: expected type, found `10`
--> file.rs:3:31
|
3 | let x: Vec::with_capacity(10, 20);
| -- ^^
| ||
| |help: did you mean assign here?: `=`
| while parsing the type for `x`
```
2017-11-03 17:39:16 -07:00
Vadim Petrochenkov
3386757923
Move some tests to UI
2017-11-04 03:09:47 +03:00
Oliver Schneider
74748b11bb
WIP: don't suggest placing use statements into expanded code
2017-08-31 15:45:16 +02:00
Oliver Schneider
f9a07bc11b
Add test for broken suggestion
2017-08-31 13:06:53 +02:00
Alex Crichton
b31998ec93
Merge remote-tracking branch 'origin/master' into gen
2017-08-21 10:41:56 -07:00
Oliver Schneider
e0ba29c413
Improve placement of use suggestions
2017-08-17 18:16:15 +02:00
Alex Crichton
51bb31ad25
Fix tests
2017-07-28 15:46:23 +02:00
Oliver Schneider
401ab612c2
Adjust new suggestions to the suggestion guidelines
2017-07-21 13:59:17 +02:00
gaurikholkar
26a8357f5c
reorder span labels
2017-07-18 00:07:37 +05:30
Oliver Schneider
a9d9a4aab4
Change some helps to suggestions
2017-07-17 10:03:37 +02:00
Esteban Küber
697c85a4f1
Only underline suggestion if it is not the only code being shown
2017-07-06 14:36:49 -07:00
Esteban Küber
eb478e2381
Add extra whitespace for suggestions
2017-07-06 14:36:48 -07:00
Esteban Küber
7c84914635
Make suggestion include the line number
...
When there're more than one suggestions in the same diagnostic, they are
displayed in their own block, instead of inline. In order to reduce
confusion, those blocks now display the line number.
2017-07-06 14:36:48 -07:00
Ariel Ben-Yehuda
fb7ab9e43d
report the total number of errors on compilation failure
...
Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.
This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].
Fixes #42793 .
2017-07-02 16:16:44 +03:00