Commit graph

158 commits

Author SHA1 Message Date
Dylan DPC
44e526b2c3
Rollup merge of #80732 - spastorino:trait-inheritance-self2, r=nikomatsakis
Allow Trait inheritance with cycles on associated types take 2

This reverts the revert of #79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in #80648 and #79811.
For easier review I'd say, check only the last commit, the first one is just a revert of the revert of #79209 which was already approved.

This also could be considered part or the actual fix of #79560 but I guess for that to be closed and fixed completely we would need to land #80648 and #79811 too.

r? `@nikomatsakis`
cc `@Aaron1011`
2021-02-09 02:39:50 +01:00
Santiago Pastorino
8d17c6a85d
Anonymize late bound regions on transitive bounds that define assoc type 2021-02-08 16:47:51 -03:00
Santiago Pastorino
fd092557ce
Adapt to latest master changes by using PredicateKind 2021-02-05 18:56:57 -03:00
Santiago Pastorino
7aa602b84c
Revert "Auto merge of #79637 - spastorino:revert-trait-inheritance-self, r=Mark-Simulacrum"
This reverts commit b4def89d76, reversing
changes made to 7dc1e852d4.
2021-02-05 18:56:56 -03:00
Eric Huss
bb22eaf39e tidy: Run tidy style against markdown files. 2021-02-04 09:01:50 -08:00
Jack Huey
7edb3ad39b
Rollup merge of #81655 - matsujika:suggest-accessing-field-rewording, r=estebank
Improve wording of suggestion about accessing field

Follow-up to #81504

The compiler at this moment suggests "you might have meant to use field `b` of type `B`", sounding like it's type `B` which has the field `b`.
r? ```@estebank```
2021-02-02 16:01:48 -05:00
Jack Huey
c1623a2ee7
Rollup merge of #80593 - jackh726:chalk-upgrade, r=nikomatsakis
Upgrade Chalk

~~Blocked on rust-lang/chalk#670~~
~~Now blocked on rust-lang/chalk#680 and release~~

In addition to the straight upgrade, I also tried to fix some tests by properly returning variables and max universes in the solution. Unfortunately, this actually triggers the same perf problem that rustc traits code runs into in `canonicalizer`. Not sure what the root cause of this problem is, or why it's supposed to be solved in chalk.

r? ```@nikomatsakis```
2021-02-02 16:01:32 -05:00
Mark Rousskov
d5b760ba62 Bump rustfmt version
Also switches on formatting of the mir build module
2021-02-02 09:09:52 -05:00
Hirochika Matsumoto
bad0f288d3 Improve wording of suggestion about accessing field 2021-02-02 15:16:07 +09:00
Jack Huey
4b64bc1fc9 Upgrade Chalk 2021-02-01 10:37:45 -05:00
Jonas Schievink
853cfd462f
Rollup merge of #81504 - matsujika:suggestion-field-access, r=estebank
Suggest accessing field when appropriate

Fix #81222

r? ``@estebank``
2021-02-01 14:29:37 +01:00
Jonas Schievink
9e8753e2bb
Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor
Rename NLL* to Nll* accordingly to C-CASE

Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.
2021-02-01 14:29:35 +01:00
Hirochika Matsumoto
f45a99361a Rustfmt 2021-01-31 16:52:46 +09:00
Hirochika Matsumoto
a292ac7177 Fix prefix of debug log 2021-01-31 16:49:33 +09:00
Hirochika Matsumoto
6bc9634de3 Rename function to suggest_accessing_field_where_appropriate 2021-01-30 14:25:43 +09:00
Hirochika Matsumoto
2ce2d145c2 Account for union 2021-01-30 14:18:50 +09:00
Hirochika Matsumoto
08d31e0f09 Remove logging iterator 2021-01-30 13:50:44 +09:00
Hirochika Matsumoto
9e4ed337c7 Suggest accessing field when code compiles with it 2021-01-29 06:52:49 +09:00
Hirochika Matsumoto
f8e0e78d75 Rename NLL* to Nll* accordingly to C-CASE 2021-01-28 16:18:25 +09:00
Yuki Okushi
446edd1e1a
Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis
Refractor a few more types to `rustc_type_ir`

In the continuation of #79169, ~~blocked on that PR~~.

This PR:
 - moves `IntVarValue`, `FloatVarValue`, `InferTy` (and friends) and `Variance`
 - creates the `IntTy`, `UintTy` and `FloatTy` enums in `rustc_type_ir`, based on their `ast` and `chalk_ir` equilavents, and uses them for types in the rest of the compiler.

~~I will split up that commit to make this easier to review and to have a better commit history.~~
EDIT: done, I split the PR in commits of 200-ish lines each

r? `````@nikomatsakis````` cc `````@jackh726`````
2021-01-28 15:09:02 +09:00
LeSeulArtichaut
50e1ae15e9 Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
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