Daiki Ihara
db95b5ca9b
Add suggestion for impl_candidates with E0283
...
Update compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-01-18 21:57:15 +09:00
Jack Huey
dcad9f1893
More review comments
2021-01-16 18:56:37 -05:00
Jack Huey
3dea68de1d
Review changes
2021-01-16 18:56:37 -05:00
Jack Huey
476bd53058
Cleanup
2021-01-16 18:50:34 -05:00
Jack Huey
e76476afe4
Cleanup
2021-01-16 18:40:47 -05:00
Jack Huey
4cd6f85a07
Remove PredicateKind
2021-01-16 18:40:47 -05:00
Jack Huey
8278314a8b
Remove PredicateKind::Atom
2021-01-16 18:40:47 -05:00
LingMan
a56bffb4f9
Use Option::map_or instead of .map(..).unwrap_or(..)
2021-01-14 19:23:59 +01:00
bors
fc93e4719c
Auto merge of #80960 - Dylan-DPC:rollup-89tri8x, r=Dylan-DPC
...
Rollup of 10 pull requests
Successful merges:
- #78901 (diagnostics: Note capturing closures can't be coerced to fns)
- #79588 (Provide more information for HRTB lifetime errors involving closures)
- #80232 (Remove redundant def_id lookups)
- #80662 (Added support for i386-unknown-linux-gnu and i486-unknown-linux-gnu)
- #80736 (use Once instead of Mutex to manage capture resolution)
- #80796 (Update to LLVM 11.0.1)
- #80859 (Fix --pretty=expanded with --remap-path-prefix)
- #80922 (Revert "Auto merge of #76896 - spastorino:codegen-inline-fns2)
- #80924 (Fix rustdoc --test-builder argument parsing)
- #80935 (Rename `rustc_middle::lint::LevelSource` to `LevelAndSource`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-13 04:29:45 +00:00
bors
150d1fee04
Auto merge of #79322 - jyn514:refactor-impl, r=estebank
...
Separate out a `hir::Impl` struct
This makes it possible to pass the `Impl` directly to functions, instead
of having to pass each of the many fields one at a time. It also
simplifies matches in many cases.
See `rustc_save_analysis::dump_visitor::process_impl` or `rustdoc::clean::clean_impl` for a good example of how this makes `impl`s easier to work with.
r? `@petrochenkov` maybe?
2021-01-13 01:40:41 +00:00
Joshua Nelson
a8ff647deb
Separate out a hir::Impl
struct
...
This makes it possible to pass the `Impl` directly to functions, instead
of having to pass each of the many fields one at a time. It also
simplifies matches in many cases.
2021-01-12 20:32:33 -05:00
Esteban Küber
a8a974245e
Provide more information for HRTB lifetime errors involving closures
2021-01-12 13:53:13 -08:00
William Bain
d46c3e3411
Tweak ?
inference error messages
2021-01-10 19:48:11 -05:00
William Bain
62a39ed526
Extract parent def handling for infer failure err
2021-01-10 19:48:11 -05:00
William Bain
b9d9776fea
Refactor cannot infer ...
message rendering
2021-01-10 19:48:10 -05:00
William Bain
0496fdee4f
Note inference failures using ?
conversion
2021-01-10 19:47:57 -05:00
Yuki Okushi
faf8beddef
Rollup merge of #80637 - LingMan:filter, r=oli-obk
...
Use Option::filter instead of open-coding it
`@rustbot` modify labels +C-cleanup +T-compiler
2021-01-05 09:52:42 +09:00
LingMan
203d5025bb
Use Option::filter instead of open-coding it
2021-01-03 05:53:15 +01:00
Matthias Krüger
8a90626a46
reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)
2021-01-02 20:09:17 +01:00
Rémy Rakic
1fc3c4c16d
adjust const generics defaults FIXMEs to the new feature gate
2021-01-01 11:01:01 +01:00
Yuki Okushi
7008911080
FIx ICE on wf check for foreign fns
2020-12-31 11:25:53 +09:00
Yuki Okushi
41fa0dba27
Rollup merge of #80509 - matthiaskrgr:ptr_arg, r=varkor
...
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
2020-12-30 22:49:26 +09:00
Matthias Krüger
bdc9291ed9
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
2020-12-30 13:11:52 +01:00
Yuki Okushi
a309468a8c
Rollup merge of #80348 - matthiaskrgr:less_clones, r=Dylan-DPC
...
remove redundant clones (clippy::redundant_clone)
2020-12-30 18:15:04 +09:00
Dylan DPC
c51172f38a
Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPC
...
use matches!() macro in more places
2020-12-28 14:13:12 +01:00
Matthias Krüger
d12a358673
use matches!() macro in more places
2020-12-24 13:35:12 +01:00
Matthias Krüger
6e852cc4ce
remove redundant clones (clippy::redundant_clone)
2020-12-24 12:59:22 +01:00
Matthew Jasper
2e92b13a60
Prevent caching projections in the case of cycles
...
When normalizing a projection which results in a cycle, we would
cache the result of `project_type` without the nested obligations
(because they're not needed for inference). This would result in
the nested obligations only being handled once in fulfill, which
would avoid the cycle error.
Fixes #79714 , a regresion from #79305 caused by the removal of
`get_paranoid_cache_value_obligation`.
2020-12-20 21:47:51 +00:00
bors
b1964e60b7
Auto merge of #80163 - jackh726:binder-refactor-part-3, r=lcnr
...
Make BoundRegion have a kind of BoungRegionKind
Split from #76814
Also includes making `replace_escaping_bound_vars` only return `T`
Going to r? `@lcnr`
Feel free to reassign
2020-12-20 07:01:00 +00:00
bors
0c11b93f5a
Auto merge of #79635 - lcnr:const-eval-idk, r=oli-obk
...
const_evaluatable_checked: fix occurs check
fixes #79615
this is kind of a hack because we use `TypeRelation` for both the `Generalizer` and the `ConstInferUnifier` but i am not sure if there is a useful way to disentangle this without unnecessarily duplicating some code.
The error in the added test is kind of unavoidable until we erase the unused substs of `ConstKind::Unevaluated`. We talked a bit about this in the cg lazy norm meeting (https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/lazy_normalization_consts )
2020-12-20 00:50:46 +00:00
Jack Huey
5e7095850c
More rebinds
2020-12-19 04:26:35 -05:00
Jack Huey
af3b1cb0b5
Change potentially_qualified to be defined on Binder<PredicateAtom>
2020-12-18 15:57:12 -05:00
Jack Huey
328fcee4af
Make BoundRegion have a kind of BoungRegionKind
2020-12-18 15:27:28 -05:00
Dylan DPC
da89dbb41a
Rollup merge of #80046 - camelid:diag-docs, r=lcnr
...
Add more documentation to `Diagnostic` and `DiagnosticBuilder`
cc `@estebank`
2020-12-18 00:30:20 +01:00
Camelid
10487cd784
Fix typo in method name
...
unsuccessfull -> unsuccessful
2020-12-16 14:59:12 -08:00
Jack Huey
ed80815bf2
Move binder for dyn to each list item
2020-12-11 15:02:46 -05:00
Matthias Krüger
20f8538d1f
simplify if let Some(_) = x to if x.is_some() (clippy::redundant_pattern_matching)
2020-12-08 20:27:49 +01:00
Matthias Krüger
1734f9c291
remove redundant clones
2020-12-05 12:59:54 +01:00
Benjamin Peterson
76ff0f408a
The details of higher-rank sub are in the rustc book not a doc module.
2020-12-03 23:38:36 -06:00
Bastian Kauschke
806c7281ec
add comment to visit_ct_substs
2020-12-02 16:41:01 +01:00
Santiago Pastorino
37354ebc97
Revert "Auto merge of #79209 - spastorino:trait-inheritance-self, r=nikomatsakis"
...
This reverts commit 349b3b324d
, reversing
changes made to b776d1c3e3
.
2020-12-02 12:19:38 -03:00
Bastian Kauschke
71d7550350
const_evaluatable_checked: fix occurs check
2020-12-02 15:31:27 +01:00
Santiago Pastorino
ada7c1f429
Return FxIndexSet instead of FxHashSet to avoid order errors on different platforms
2020-11-27 18:45:34 -03:00
Santiago Pastorino
28446ef19e
Inline elaborate_trait_refs_that_define_assoc_type into transitive_bounds_that_define_assoc_type
2020-11-27 11:23:52 -03:00
Santiago Pastorino
9e0538bd07
Document elaborate_trait_refs_that_define_assoc_type
2020-11-27 11:23:51 -03:00
Santiago Pastorino
2ca4964db5
Allow to self reference associated types in where clauses
2020-11-27 11:23:47 -03:00
Jonas Schievink
9b2117d1f6
Rollup merge of #77758 - Stupremee:turbofish-help-for-const, r=varkor
...
suggest turbofish syntax for uninferred const arguments
When not providing a const generic value, and it can not be inferred, the following suggestion is suggested:
![image](https://user-images.githubusercontent.com/39732259/95616180-af127b80-0a69-11eb-8877-551c815f9627.png )
Resolves #76737
r? ``@varkor``
2020-11-26 13:39:00 +01:00
Jonas Schievink
ee6f42ba94
Thread Constness
through selection
2020-11-22 02:13:53 +01:00
LeSeulArtichaut
f59d03038c
Move rustc_ty
-> rustc_ty_utils
2020-11-19 21:57:29 +01:00
Justus K
4379a43e46
Suggest turbofish for uninferred const argument
2020-11-18 19:23:22 +01:00