summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2020-12-27Prevent caching projections in the case of cyclesMatthew Jasper-1/+15
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-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-33/+133
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-04fix a couple of clippy warnings:Matthias Krüger-1/+0
filter_next manual_strip redundant_static_lifetimes single_char_pattern unnecessary_cast unused_unit op_ref redundant_closure useless_conversion
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-6/+6
2020-10-30TypeVisitor: use `ControlFlow` in rustc_{infer,lint,trait_selection}LeSeulArtichaut-11/+19
2020-10-29Rollup merge of #78460 - varkor:turbofish-string-generic, r=lcnrYuki Okushi-2/+0
Adjust turbofish help message for const generics Types are no longer special. (This message arguably only makes sense with `min_const_generics` or more, but we'll be there soon.) r? @lcnr
2020-10-28Remove irrelevant FIXMEvarkor-2/+0
2020-10-26Suggest calling await on method call and field accessEsteban Küber-1/+1
When encountering a failing method or field resolution on a `Future`, look at the `Output` and try the same operation on it. If successful, suggest calling `.await` on the `Future`. This had already been introduced in #72784, but at some point they stopped working.
2020-10-26Rollup merge of #78268 - JohnTitor:issue-78262, r=estebankDylan DPC-0/+8
Do not try to report on closures to avoid ICE Fixes #78262
2020-10-25Do not try to report on closures to avoid ICEYuki Okushi-0/+8
2020-10-23Suggest semicolon removal and boxing when appropriateEsteban Küber-8/+27
2020-10-23Add more `.await` suggestions on E0308Esteban Küber-38/+119
2020-10-23Review comments: use newtype instead of `bool`Esteban Küber-2/+3
2020-10-23Account for possible boxable `impl Future` in semicolon removal suggestionsEsteban Küber-14/+32
2020-10-22Reduce diagram mess in 'match arms have incompatible types' errorDavid Tolnay-2/+14
2020-10-21Lift: take self by valueBastian Kauschke-2/+2
2020-10-20review commentsEsteban Küber-1/+1
2020-10-20Tweak "object unsafe" errorsEsteban Küber-15/+22
Fix #77598.
2020-10-19revert workaround #73027SNCPlay42-15/+2
2020-10-17Make it more clear when complaining about async fn's return typesGus Wynn-33/+133
2020-10-16Review commentsJack Huey-1/+1
2020-10-16map_bound_ref -> rebindJack Huey-6/+4
2020-10-16Use map_bound(_ref) instead of Binder::bind when possibleJack Huey-6/+9
2020-10-14Remove unused code from rustc_inferest31-40/+0
2020-10-13Replace absolute paths with relative onesest31-4/+4
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-06Remove unused part of return value from `replace_bound_vars_with_placeholders`Matthew Jasper-14/+6
2020-10-06Separate bounds and predicates for associated/opaque typesMatthew Jasper-13/+18
2020-10-06Rename projection_predicates to item_boundsMatthew Jasper-2/+2
2020-10-05Auto merge of #77171 - VFLashM:better_sso_structures, r=oli-obkbors-8/+8
Better sso structures This change greatly expands interface of MiniSet/MiniMap and renames them because they are no longer "Mini".
2020-09-26Revert "Add an unused field of type `Option<DefId>` to `ParamEnv` struct."Dylan MacKenzie-1/+1
This reverts commit ab83d372ed5b1799d418afe83c468e4c5973cc34.
2020-09-26MiniSet/MiniMap moved and renamed into SsoHashSet/SsoHashMapValerii Lashmanov-8/+8
It is a more descriptive name and with upcoming changes there will be nothing "mini" about them.
2020-09-26Rollup merge of #77211 - est31:remove_unused_allow, r=oli-obkRalf Jung-1/+0
Remove unused #[allow(...)] statements from compiler/
2020-09-26Rollup merge of #77093 - lcnr:const-generics-infer-warning, r=varkorRalf Jung-104/+178
merge `need_type_info_err(_const)` I hoped that this would automatically solve #76737 but it doesn't quite seem like it fixes #77092 r? @varkor
2020-09-26unused intoBastian Kauschke-1/+1
2020-09-26rename functionsBastian Kauschke-12/+12
2020-09-26Remove unused #[allow(...)] statements from compiler/est31-1/+0
2020-09-25Implement `Display` for `DisambiguatedDefPathData` and `DefPathData`marmeladema-1/+1
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-1/+1
2020-09-25Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514Jonas Schievink-1/+1
Updated html_root_url for compiler crates Closes #77103 r? @jyn514
2020-09-24the two hardest things in programming, names and...Bastian Kauschke-79/+115
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-09-23use relevant span when unifying `ConstVarValue`sBastian Kauschke-1/+2
2020-09-23use the correct span when dealing with inference variablesBastian Kauschke-5/+9
2020-09-23unused pathBastian Kauschke-1/+1
2020-09-23merge `need_type_info_err(_const)`Bastian Kauschke-88/+121
2020-09-23Move MiniSet to data_structuresAndreas Jonson-1/+1
remove the need for T to be copy from MiniSet as was done for MiniMap
2020-09-22Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandrybors-60/+1
cache types during normalization partially fixes #75992 reduces the following test from 14 to 3 seconds locally. cc `@Mark-Simulacrum` would it make sense to add that test to `perf`? ```rust #![recursion_limit="2048"] #![type_length_limit="112457564"] pub async fn h0(v: &String, x: &u64) { println!("{} {}", v, x) } pub async fn h1(v: &String, x: &u64) { h0(v, x).await } pub async fn h2(v: &String, x: &u64) { h1(v, x).await } pub async fn h3(v: &String, x: &u64) { h2(v, x).await } pub async fn h4(v: &String, x: &u64) { h3(v, x).await } pub async fn h5(v: &String, x: &u64) { h4(v, x).await } pub async fn h6(v: &String, x: &u64) { h5(v, x).await } pub async fn h7(v: &String, x: &u64) { h6(v, x).await } pub async fn h8(v: &String, x: &u64) { h7(v, x).await } pub async fn h9(v: &String, x: &u64) { h8(v, x).await } pub async fn h10(v: &String, x: &u64) { h9(v, x).await } pub async fn h11(v: &String, x: &u64) { h10(v, x).await } pub async fn h12(v: &String, x: &u64) { h11(v, x).await } pub async fn h13(v: &String, x: &u64) { h12(v, x).await } pub async fn h14(v: &String, x: &u64) { h13(v, x).await } pub async fn h15(v: &String, x: &u64) { h14(v, x).await } pub async fn h16(v: &String, x: &u64) { h15(v, x).await } pub async fn h17(v: &String, x: &u64) { h16(v, x).await } pub async fn h18(v: &String, x: &u64) { h17(v, x).await } pub async fn h19(v: &String, x: &u64) { h18(v, x).await } macro_rules! async_recursive { (29, $inner:expr) => { async { async_recursive!(28, $inner) }.await }; (28, $inner:expr) => { async { async_recursive!(27, $inner) }.await }; (27, $inner:expr) => { async { async_recursive!(26, $inner) }.await }; (26, $inner:expr) => { async { async_recursive!(25, $inner) }.await }; (25, $inner:expr) => { async { async_recursive!(24, $inner) }.await }; (24, $inner:expr) => { async { async_recursive!(23, $inner) }.await }; (23, $inner:expr) => { async { async_recursive!(22, $inner) }.await }; (22, $inner:expr) => { async { async_recursive!(21, $inner) }.await }; (21, $inner:expr) => { async { async_recursive!(20, $inner) }.await }; (20, $inner:expr) => { async { async_recursive!(19, $inner) }.await }; (19, $inner:expr) => { async { async_recursive!(18, $inner) }.await }; (18, $inner:expr) => { async { async_recursive!(17, $inner) }.await }; (17, $inner:expr) => { async { async_recursive!(16, $inner) }.await }; (16, $inner:expr) => { async { async_recursive!(15, $inner) }.await }; (15, $inner:expr) => { async { async_recursive!(14, $inner) }.await }; (14, $inner:expr) => { async { async_recursive!(13, $inner) }.await }; (13, $inner:expr) => { async { async_recursive!(12, $inner) }.await }; (12, $inner:expr) => { async { async_recursive!(11, $inner) }.await }; (11, $inner:expr) => { async { async_recursive!(10, $inner) }.await }; (10, $inner:expr) => { async { async_recursive!(9, $inner) }.await }; (9, $inner:expr) => { async { async_recursive!(8, $inner) }.await }; (8, $inner:expr) => { async { async_recursive!(7, $inner) }.await }; (7, $inner:expr) => { async { async_recursive!(6, $inner) }.await }; (6, $inner:expr) => { async { async_recursive!(5, $inner) }.await }; (5, $inner:expr) => { async { async_recursive!(4, $inner) }.await }; (4, $inner:expr) => { async { async_recursive!(3, $inner) }.await }; (3, $inner:expr) => { async { async_recursive!(2, $inner) }.await }; (2, $inner:expr) => { async { async_recursive!(1, $inner) }.await }; (1, $inner:expr) => { async { async_recursive!(0, $inner) }.await }; (0, $inner:expr) => { async { h19(&String::from("owo"), &0).await; $inner }.await }; } async fn f() { async_recursive!(14, println!("hello")); } fn main() { let _ = f(); } ``` r? `@eddyb` requires a perf run.
2020-09-21Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPCecstatic-morse-10/+8
use if let instead of single match arm expressions use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
2020-09-22Auto merge of #76913 - vandenheuvel:performance_debug, r=lcnrbors-1/+1
Fixing the performance regression of #76244 Issue https://github.com/rust-lang/rust/issues/74865 suggested that removing the `def_id` field from `ParamEnv` would improve performance. PR https://github.com/rust-lang/rust/pull/76244 implemented this change. Generally, [results](https://perf.rust-lang.org/compare.html?start=80fc9b0ecb29050d45b17c64af004200afd3cfc2&end=5ef250dd2ad618ee339f165e9b711a1b4746887d) were as expected: an instruction count decrease of about a percent. The instruction count for the unicode crates increased by about 3%, which `@nnethercote` speculated to be caused by a quirk of inlining or codegen. As the results were generally positive, and for chalk integration, this was also a step in the right direction, the PR was r+'d regardless. However, [wall-time performance results](https://perf.rust-lang.org/compare.html?start=a055c5a1bd95e029e9b31891db63b6dc8258b472&end=7402a394471a6738a40fea7d4f1891666e5a80c5&stat=task-clock) show a much larger performance degradation: 25%, as [mentioned](https://github.com/rust-lang/rust/pull/76244#issuecomment-694459840) by `@Mark-Simulacrum.` This PR, for now, reverts #76244 and attempts to find out, which change caused the regression.