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
Pietro Albini
0aa72ad55d
Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakis
...
libsyntax_pos: A few tweaks
2018-12-06 07:48:53 +01:00
Oliver Scherer
61efc3b71b
Update tests
2018-12-04 10:06:05 +01:00
Vadim Petrochenkov
101467c152
syntax: dyn
is a used keyword now
2018-12-04 00:30:27 +03:00
Eduard-Mihai Burtescu
3369929ddb
tests: use force-host
and no-prefer-dynamic
in all proc_macro tests.
2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
fcca22cb40
tests: move all proc_macro tests from -fulldeps.
2018-11-30 06:15:20 +02:00
Vadim Petrochenkov
d77edb6458
resolve: Fix false-positives from lint absolute_paths_not_starting_with_crate
2018-11-28 22:57:25 +03:00
Vadim Petrochenkov
6f13708299
resolve: Suggest crate::
for resolving ambiguities when appropriate
...
More precise spans for ambiguities from macros
2018-11-27 00:34:25 +03:00
Vadim Petrochenkov
fba116fc5f
Remove duplicate tests for uniform paths
2018-11-27 00:30:50 +03:00
Vadim Petrochenkov
139d109241
Add a couple more tests + address review comments
2018-11-18 13:58:40 +03:00
Vadim Petrochenkov
a5f9bd02b1
resolve: Future-proof against imports referring to local variables and generic parameters
2018-11-18 13:58:39 +03:00
Vadim Petrochenkov
4fc3c13e32
resolve: Avoid sentence breaks in diagnostics
2018-11-18 13:58:36 +03:00
Vadim Petrochenkov
8e88c3470a
resolve: Reintroduce feature gate for uniform paths in imports
2018-11-18 13:57:04 +03:00
Vadim Petrochenkov
a38f903114
Fix ICEs from imports of items not defined in modules
2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
cfd762954b
resolve: Tweak some articles in ambiguity diagnostics
2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
cfe81559ee
resolve: Recover "did you mean" suggestions in imports
2018-11-18 13:57:01 +03:00
Vadim Petrochenkov
4c5d822a8b
resolve: Check resolution consistency for import paths and multi-segment macro paths
2018-11-18 13:55:58 +03:00
Vadim Petrochenkov
07af4ec7a2
resolve: Resolve single-segment imports using in-scope resolution on 2018 edition
2018-11-18 13:51:43 +03:00
Vadim Petrochenkov
f0ea1c6f1e
resolve: Improve diagnostics for resolution ambiguities
2018-11-18 13:51:40 +03:00
David Wood
0d06b8c8e5
Add note linking to Rust 2018 path semantics docs.
...
This commit extends existing path suggestions to link to documentation
on the changed semantics of `use` in Rust 2018.
2018-10-28 09:16:10 +01:00