2619 Commits

Author SHA1 Message Date
Camille GILLOT
d4e143ed2f Remove ast::{Ident, Name} reexports. 2020-05-08 13:13:15 +02:00
Dylan DPC
53d15401ba
Rollup merge of #71903 - euclio:reword-possible-better, r=petrochenkov
reword "possible candidate" import suggestion

This suggestion has always read a bit awkwardly to me, particularly the "possible better candidate" variant.

This commit rewords the suggestion to be more concise and mention the kind of the suggested item. There isn't a nice way to label individual suggestions, so I opted to use "items" in the case of multiple suggestions.
2020-05-07 21:46:14 +02:00
Dylan DPC
f3691ac066
Rollup merge of #71783 - estebank:async-block-2015, r=tmandry
Detect errors caused by `async` block in 2015 edition

Fix #67204.
2020-05-07 21:46:12 +02:00
Andy Russell
9f88d75710
reword "possible candidate" import suggestion 2020-05-07 00:33:25 -04:00
Esteban Küber
3cf556939e Detect errors caused by async block in 2015 edition 2020-05-05 19:35:20 -07:00
Vadim Petrochenkov
5b84d5ff13 resolve: Relax fresh binding disambiguation slightly to fix regression 2020-05-03 17:39:03 +03:00
Tshepang Lekhonkhobe
3be52b5941 fix rustdoc warnings 2020-05-02 10:41:04 +02:00
Camille GILLOT
e56c400432 Use the query system to allocate. 2020-04-28 11:34:17 +02:00
Dylan DPC
ac62dcef05
Rollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov
Tweak some suggestions in `rustc_resolve`
2020-04-27 03:26:17 +02:00
Dylan DPC
94ac0ac59f
Rollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkov
add message for resolution failure because wrong namespace

closes https://github.com/rust-lang/rust/issues/71406
2020-04-27 03:26:15 +02:00
Esteban Küber
6e3ba6f40f Tweak some suggestions in rustc_resolve 2020-04-26 11:43:43 -07:00
YI
eb8a7031ef use defkind.descr in wrong namespace resolve failure 2020-04-26 10:28:33 +08:00
Dylan DPC
e51cbc8376
Rollup merge of #70043 - mark-i-m:def-kind-more, r=eddyb
Add all remaining `DefKind`s.

r? @eddyb or @Centril

~~I'm not sure if this is what you were thinking of. There are also a few places where I'm not sure what the correct choice is because I don't fully understand the meaning of some variants.~~

~~In general, it feels a bit odd to add some of these as `DefKind`s (e.g. `Arm`) because they don't feel like definitions. Are there things that it makes sense not to add?~~
2020-04-26 01:00:13 +02:00
Dylan DPC
9709785d12
Rollup merge of #71544 - cuviper:filter_map_next, r=Mark-Simulacrum
Replace filter_map().next() calls with find_map()

These are semantically the same, but `find_map()` is more concise.
2020-04-25 18:30:30 +02:00
Josh Stone
4282776b1c Replace filter_map().next() calls with find_map()
These are semantically the same, but `find_map()` is more concise.
2020-04-24 20:03:45 -07:00
Josh Stone
2325c20925 Avoid unused Option::map results
These are changes that would be needed if we add `#[must_use]` to
`Option::map`, per #71484.
2020-04-24 13:58:41 -07:00
Eduard-Mihai Burtescu
95b3c427d4 Remove Option from the return type of def_kind. 2020-04-24 13:44:07 -05:00
mark
cff5b998e0 add a few more DefKinds
make Map::def_kind take LocalDefId

Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>

crates are DefKind::Mod
2020-04-24 13:31:36 -05:00
Dylan DPC
7d8a3ad128
Rollup merge of #71235 - estebank:lt-sugg-2, r=ecstatic-morse
Tweak `'static` suggestion code

Fix #71196.
2020-04-24 13:14:19 +02:00
marmeladema
fe7531579d Address comments from review 2020-04-23 23:14:07 +01:00
marmeladema
bfce24aa67 Modify as_local_hir_id to return a bare HirId 2020-04-23 23:14:07 +01:00
marmeladema
6148db719f Modify as_local_hir_id to accept a LocalDefId instead of a DefId 2020-04-23 23:14:07 +01:00
marmeladema
92fb59d7f3 librustc_middle: return LocalDefId instead of DefId in local_def_id 2020-04-23 23:14:07 +01:00
Dylan DPC
10e47f5b7b
Rollup merge of #71256 - cuviper:must_use_replace, r=estebank
Lint must_use on mem::replace

This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.
2020-04-22 23:19:19 +02:00
Esteban Küber
ad379cd7a6 review comment 2020-04-22 12:12:33 -07:00
Esteban Küber
1f43fc0209 Tweak wording 2020-04-22 12:12:33 -07:00
Esteban Küber
13c1daeb2f Tweak 'static suggestion code
Fix #71196.
2020-04-22 12:12:33 -07:00
YI
bb1eedb026 add message for resolution failure because wrong namespace 2020-04-22 16:05:17 +08:00
Josh Stone
7b005c5fcb Dogfood more or_patterns in the compiler 2020-04-19 07:33:58 -07:00
Tshepang Lekhonkhobe
fcbefae017 remove build warnings
Code blocks that are not annotated are assumed to be Rust
2020-04-18 22:32:23 +02:00
Josh Stone
ccecae5fdd Fix unused results from mem::replace 2020-04-17 13:59:14 -07:00
Matthias Krüger
3837df2992 don't clone types that are copy (clippy::clone_on_copy) 2020-04-16 00:17:38 +02:00
marmeladema
c15e13ae16 Remove DUMMY_HIR_ID 2020-04-14 08:46:07 +01:00
Rustin-Liu
b07e7fe047 Rename AssocKind::Method to AssocKind::Fn
Rename fn_has_self_argument to fn_has_self_parameter

Rename AssocItemKind::Method to AssocItemKind::Fn

Refine has_no_input_arg

Refine has_no_input_arg

Revert has_no_input_arg

Refine suggestion_descr

Move as_def_kind into AssocKind

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

Fix tidy check issue

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-14 07:12:07 +08:00
bors
0c835b0cca Auto merge of #70909 - marmeladema:issue70853/librustc_hir-local-def-id, r=eddyb
librustc_hir: return LocalDefId instead of DefId in local_def_id

Its a first try to remove a few calls to `expect_local` and use `LocalDefId` instead of `DefId` where possible for #70853

This adds some calls to `.to_def_id()` to get a `DefId` back when needed. I don't know if I should push `LocalDefId` even further and change, for example, `Res::Def` to accept a `LocalDefId` instead of a `DefId` as second argument.

cc @ecstatic-morse
2020-04-09 23:22:23 +00:00
Dylan DPC
268f09f9e6
Rollup merge of #70912 - estebank:reduce-type-param-sugg-verbosity, r=davidtwco
Do not suggest adding type param when `use` is already suggested

Fix #70365, cc #70572.
2020-04-08 23:33:46 +02:00
marmeladema
6ae3888b19 librustc_resolve: fixup nit in previous commit 2020-04-08 09:23:58 +01:00
Esteban Küber
a3e54b59f9 Do not suggest adding type param when use is already suggested
Fix #70365, cc #70572.
2020-04-07 18:07:26 -07:00
marmeladema
59e0db69e0 librustc_hir: return LocalDefId instead of DefId in local_def_id 2020-04-08 00:43:56 +01:00
Mazdak Farrokhzad
5a7ad49620 def_collector, visit_fn: account for no body 2020-04-03 17:01:21 +02:00
Dylan DPC
8993358e77
Rollup merge of #70081 - lcnr:issue68387, r=varkor
add `unused_braces` lint

Add the lint `unused_braces` which is warn by default.

`unused_parens` is also extended and now checks anon consts.

closes #68387

r? @varkor
2020-04-01 00:27:20 +02:00
Bastian Kauschke
21c5ccab10 fix internal lint fallout 2020-03-31 19:01:48 +02:00
Mazdak Farrokhzad
9f86d28537 try_resolve_as_non_binding: span_bug -> delay_span_bug 2020-03-30 13:23:26 +02:00
Mazdak Farrokhzad
1ccb0b4a02 rustc -> rustc_middle part 3 (rustfmt) 2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad
0cb9e36090 rustc -> rustc_middle part 2 2020-03-30 07:16:56 +02:00
Mazdak Farrokhzad
7710f2dd5c rustc -> rustc_middle part 1 2020-03-30 07:02:56 +02:00
Esteban Küber
f18a6dcec0 Rename def_span to guess_head_span 2020-03-25 16:45:12 -07:00
Mazdak Farrokhzad
d894f5eaf5
Rollup merge of #70373 - Centril:canon-imports, r=Mark-Simulacrum
normalize some imports & prefer direct ones

r? @Mark-Simulacrum
2020-03-25 06:45:36 +01:00
Mazdak Farrokhzad
917289907d normalize some imports, prefer direct ones. 2020-03-24 22:47:23 +01:00
Vadim Petrochenkov
1fa6be0358 resolve: Remove rustc_attrs as a standalone feature gate
Now it only gates specific built-in attributes
2020-03-24 21:37:29 +03:00