Commit Graph

124 Commits

Author SHA1 Message Date
Andy Russell 9f88d75710
reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
Val Markovic 2155adbc3a Moving more build-pass tests to check-pass
One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).

Helps with #62277
2020-04-23 20:21:38 -07:00
RoccoDev b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Vadim Petrochenkov 66d7a88c41 resolve: `directive` -> `import` 2020-03-07 19:30:57 +03:00
Eduard-Mihai Burtescu 4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
varkor 24a2929ed1 Normalise notes with the/is 2020-01-24 16:24:50 +00:00
Vadim Petrochenkov 642669c74d Update tests 2020-01-09 21:23:12 +03:00
Tomasz Miąsko 427952e808 Make error and warning annotations mandatory in UI tests
This change makes error and warning annotations mandatory in UI tests.
The only exception are tests that use error patterns to match compiler
output and don't have any annotations.
2019-11-10 21:01:02 +01:00
Tomasz Miąsko 0501d8ab0d Use check-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
Esteban Küber 0baf61bfdb Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
2019-10-24 12:26:01 -07:00
Esteban Küber 4bb771615e Bring attention to suggestions when the only difference is capitalization 2019-10-13 21:48:39 -07:00
Alexander Regueiro 13b61b50d9 Fixed grammar in one diagnostic and blessed tests. 2019-09-30 01:15:25 +01:00
Mazdak Farrokhzad 8926301d11
Rollup merge of #64054 - estebank:unused-import-is-to-eager, r=petrochenkov
Always emit unresolved import errors and hide unused import lint

Fix https://github.com/rust-lang/rust/issues/63724.

r? @petrochenkov
2019-09-09 22:18:10 +02:00
Esteban Küber 5799fb419c Give method not found a primary span label 2019-09-08 18:27:02 -07:00
Esteban Küber 9a561872c4 Always emit unresolved import errors and hide unused import lint 2019-09-08 11:11:26 -07:00
Vadim Petrochenkov e18ad70d2b diagnostics: Describe crate root modules in `DefKind::Mod` as "crate" 2019-08-10 23:17:20 +03:00
BO41 fd7ac6b17e Deprecate `try!` macro
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
2019-08-09 02:29:44 +00:00
Vadim Petrochenkov 8eaf17bca2 Introduce built-in macros through libcore 2019-07-26 13:09:54 +03:00
Samy Kacimi e5e1397adb
normalize use of backticks in compiler messages for librustc/lint
https://github.com/rust-lang/rust/issues/60532
2019-07-17 22:49:48 +02:00
Yuki Okushi c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
Matthew Jasper d5f80c8414 Improve the explicit_outlives_requirements lint
* Don't use Strings to compare parameters
* Extend the lint to lifetime bounds
* Extend the lint to enums and unions
* Use the correct span for where clauses in tuple structs
* Try to early-out where possible
2019-06-18 22:54:51 +01:00
David Wood 8869bc5ada
Do not suggest use over extern crate w/ alias.
This commit stops `unused_extern_crates` lints from occuring on `extern
crate` statements that alias the crate as the suggestion to change to a
`use` statement would result in the aliased name no longer being added
to the prelude, thereby causing compilation errors if other imports
expected this to be the case.
2019-04-25 08:06:49 +01:00
varkor f571b9548d Update ui tests 2019-04-22 19:50:11 +01:00
varkor 7f0f0e31ec Remove double trailing newlines 2019-04-22 16:57:01 +01:00
Andy Russell b6f148c8bd
hide `--explain` hint if error has no extended info 2019-04-18 13:29:28 -04:00
Mazdak Farrokhzad bdb264ff5f
Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton
Stabilize the `alloc` crate.

This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-14 00:23:25 +02:00
Simon Sapin fc928a18ba Stabilize the `alloc` crate.
This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-12 20:07:30 +02:00
Andy Russell bbdeafc13c
clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
Fabian Drinck 6e7b45e12b Replace REDUNDANT_IMPORT with UNUSED_IMPORTS 2019-03-30 22:37:02 +01:00
Fabian Drinck f9272364bf Edit ui tests 2019-03-30 22:37:02 +01:00
Fabian Drinck d04e83fe2c Bless tests 2019-03-30 22:37:02 +01:00
Esteban Küber 1b0ab0b8a9 Tweak spans for E0599 2019-03-23 13:05:29 -07:00
Vadim Petrochenkov 47ee538a28 resolve: Account for new importable entities 2019-03-16 16:08:05 +03:00
Vadim Petrochenkov fa72a81bea Update tests 2019-03-11 23:10:26 +03:00
Andy Russell 4bbe8839dd
use structured suggestions for E0432 2019-03-09 11:05:30 -05:00
Vadim Petrochenkov 250935d0c7 Fix a hole in generic parameter import future-proofing
Add some tests for buggy derive helpers
2019-01-12 16:18:55 +03:00
Vadim Petrochenkov 79134c0517 Stabilize `uniform_paths` 2019-01-12 16:18:55 +03:00
Vadim Petrochenkov 2f3db49c3d resolve: Prohibit use of imported tool modules 2019-01-12 16:18:20 +03:00
Vadim Petrochenkov bf1e70cd1f resolve: Prohibit use of imported non-macro attributes 2019-01-12 16:18:20 +03:00
Vadim Petrochenkov 099b3d86f9 resolve: Assign `pub` and `pub(crate)` visibilities to `macro_rules` items 2019-01-12 16:17:26 +03:00
Esteban Küber 2cd0d14eb1 Address review comments
- Suggest raw ident escaping in all editions
- Keep primary label in all cases
2018-12-31 08:24:00 -08:00
Esteban Küber 833f12ebd7 Suggest using raw identifiers in 2018 edition when using keywords 2018-12-31 08:24:00 -08:00
bors 59183180f7 Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkov
Implement RFC 2338, "Type alias enum variants"

This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following.

```rust
#![feature(type_alias_enum_variants)]

enum Foo {
    Bar(i32),
    Baz { i: i32 },
}

type Alias = Foo;

fn main() {
    let t = Alias::Bar(0);
    let t = Alias::Baz { i: 0 };
    match t {
        Alias::Bar(_i) => {}
        Alias::Baz { i: _i } => {}
    }
}
```

Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern.

Fixes issues #56199 and #56611.

N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible.

```rust
Option::<u8>::None; // OK
Option::None::<u8>; // OK, but lint in near future (hard error next edition?)
Alias::<u8>::None; // OK
Alias::None::<u8>; // Error
```

I do not know if this will need an FCP, but let's start one if so.
2018-12-29 21:03:11 +00:00
bors 419044956a Auto merge of #57181 - petrochenkov:impice3, r=estebank
resolve: Fix another ICE in import validation

Imports are allowed to have ambiguous resolutions as long as all of them have same `Def`.
As it turned out, it's possible for different `Module`s to have same `Def` when `extern crate` items are involved.

Fixes https://github.com/rust-lang/rust/issues/56596
2018-12-29 12:55:48 +00:00
Vadim Petrochenkov 2af1d6f4dd resolve: Fix another ICE in import validation 2018-12-29 00:15:19 +03:00
Vadim Petrochenkov ce73bc7d47 resolve: Fix an ICE in import validation 2018-12-28 05:43:31 +03:00
Alexander Regueiro 58a5756f4d Fixed more tests. 2018-12-26 21:40:21 +00:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Andy Russell 6474de904c
make non_camel_case_types an early lint 2018-12-24 12:58:52 -05:00
Vadim Petrochenkov 7c901ba537 Stabilize `underscore_imports` 2018-12-17 22:43:00 +03:00