diff options
| author | bors <bors@rust-lang.org> | 2021-02-12 14:40:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-12 14:40:27 +0000 |
| commit | d416093209d0dd77a4cdeb5a2f1b5de1316787ec (patch) | |
| tree | 5346fc9e189c71ddfd57402bb3bf9dce8653a1a1 /compiler | |
| parent | a118ee2c13cc96ceb27bd5030c1cca1052377604 (diff) | |
| parent | ff8b7f20d9e5e9bb4257f4fc1a41075ad8c5ec1a (diff) | |
| download | rust-d416093209d0dd77a4cdeb5a2f1b5de1316787ec.tar.gz rust-d416093209d0dd77a4cdeb5a2f1b5de1316787ec.zip | |
Auto merge of #82025 - JohnTitor:rollup-cohp0gy, r=JohnTitor
Rollup of 16 pull requests Successful merges: - #79983 (fix indefinite article in cell.rs) - #81831 (Don't display `mut` in arguments for functions documentation) - #81947 (Relax ItemCtxt::to_ty lifetime) - #81954 (RELEASES.md 1.50: Group platform support notes together) - #81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir) - #81959 (Fix assosiated typo) - #81964 (Fix documentation not showing on localStorage error) - #81968 (bootstrap: fix wrong docs installation path) - #81990 (Make suggestion of changing mutability of arguments broader) - #81994 (Improve long explanation for E0542 and E0546) - #81997 (dist: include src/build_helper as part of the crate graph for rustc-dev) - #82003 (Stack probes: fix error message) - #82004 (clean up clean::Static struct) - #82011 (Fix private intra-doc warnings on associated items) - #82013 (Tell user how to fix CI file being not up to date) - #82017 (Fix typo in mod.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0542.md | 2 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0546.md | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 31 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/collect.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/lib.rs | 3 |
8 files changed, 22 insertions, 24 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0542.md b/compiler/rustc_error_codes/src/error_codes/E0542.md index dbbc34a71be..7cb58f9d0cb 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0542.md +++ b/compiler/rustc_error_codes/src/error_codes/E0542.md @@ -19,7 +19,7 @@ fn _stable_const_fn() {} fn _deprecated_fn() {} ``` -To fix the issue you need to provide the `since` field. +To fix this issue, you need to provide the `since` field. Example: ``` #![feature(staged_api)] diff --git a/compiler/rustc_error_codes/src/error_codes/E0546.md b/compiler/rustc_error_codes/src/error_codes/E0546.md index 0073357b5ea..a33dcb7a9ac 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0546.md +++ b/compiler/rustc_error_codes/src/error_codes/E0546.md @@ -13,7 +13,7 @@ fn unstable_fn() {} fn stable_fn() {} ``` -To fix the issue you need to provide the `feature` field. +To fix this issue, you need to provide the `feature` field. Example: ``` #![feature(staged_api)] diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index ee12c0e786d..251f8c0afe6 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -285,7 +285,7 @@ impl<'hir> Map<'hir> { let owner = self.tcx.hir_owner_nodes(id.owner); owner.and_then(|owner| { let node = owner.nodes[id.local_id].as_ref(); - // FIXME(eddyb) use a single generic type insted of having both + // FIXME(eddyb) use a single generic type instead of having both // `Entry` and `ParentedNode`, which are effectively the same. // Alternatively, rewrite code using `Entry` to use `ParentedNode`. node.map(|node| Entry { diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs index 0467bf76afe..98450f5a547 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs @@ -540,7 +540,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { ); } - // Attempt to search similar mutable assosiated items for suggestion. + // Attempt to search similar mutable associated items for suggestion. // In the future, attempt in all path but initially for RHS of for_loop fn suggest_similar_mut_method_for_for_loop(&self, err: &mut DiagnosticBuilder<'_>) { let hir = self.infcx.tcx.hir(); diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 7a93bac72ca..0e55c4ec0b7 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -589,7 +589,7 @@ impl StackProbeType { Ok(StackProbeType::InlineOrCall { min_llvm_version_for_inline }) } _ => Err(String::from( - "`kind` expected to be one of `inline-or-none`, `call` or `inline-or-call`", + "`kind` expected to be one of `none`, `inline`, `call` or `inline-or-call`", )), } } diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 756281450d7..3233d1e048b 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -468,22 +468,21 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { trait_ref, obligation.cause.body_id, ); - } else { - if !have_alt_message { - // Can't show anything else useful, try to find similar impls. - let impl_candidates = self.find_similar_impl_candidates(trait_ref); - self.report_similar_impl_candidates(impl_candidates, &mut err); - } - // Changing mutability doesn't make a difference to whether we have - // an `Unsize` impl (Fixes ICE in #71036) - if !is_unsize { - self.suggest_change_mut( - &obligation, - &mut err, - trait_ref, - points_at_arg, - ); - } + } else if !have_alt_message { + // Can't show anything else useful, try to find similar impls. + let impl_candidates = self.find_similar_impl_candidates(trait_ref); + self.report_similar_impl_candidates(impl_candidates, &mut err); + } + + // Changing mutability doesn't make a difference to whether we have + // an `Unsize` impl (Fixes ICE in #71036) + if !is_unsize { + self.suggest_change_mut( + &obligation, + &mut err, + trait_ref, + points_at_arg, + ); } // If this error is due to `!: Trait` not implemented but `(): Trait` is diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index e5045f906df..66d158b0ee9 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -280,7 +280,7 @@ impl ItemCtxt<'tcx> { ItemCtxt { tcx, item_def_id } } - pub fn to_ty(&self, ast_ty: &'tcx hir::Ty<'tcx>) -> Ty<'tcx> { + pub fn to_ty(&self, ast_ty: &hir::Ty<'_>) -> Ty<'tcx> { AstConv::ast_ty_to_ty(self, ast_ty) } diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index fd44bafab6f..542fa1a5acc 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -421,8 +421,7 @@ pub fn hir_ty_to_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'_>) -> Ty<'tcx> { let env_node_id = tcx.hir().get_parent_item(hir_ty.hir_id); let env_def_id = tcx.hir().local_def_id(env_node_id); let item_cx = self::collect::ItemCtxt::new(tcx, env_def_id.to_def_id()); - - astconv::AstConv::ast_ty_to_ty(&item_cx, hir_ty) + item_cx.to_ty(hir_ty) } pub fn hir_trait_to_predicates<'tcx>( |
