Skip to content

Commit 5930afc

Browse files
committed
Auto merge of rust-lang#157913 - JonathanBrouwer:rollup-EUT1OHV, r=JonathanBrouwer
Rollup of 6 pull requests Successful merges: - rust-lang#157029 (stabilize feature `float_algebraic`) - rust-lang#157872 (`suspicious_double_ref_op`: report unadjusted return type) - rust-lang#157877 (Stabilize `nonzero_from_str_radix`) - rust-lang#157900 (Update intrinsics wrapping documentation) - rust-lang#157904 (Add Alice Ryhl to libs review rotation) - rust-lang#157911 (Rename `errors.rs` file to `diagnostics.rs` (10/N))
2 parents 5ff740e + 46ae69c commit 5930afc

35 files changed

Lines changed: 227 additions & 187 deletions

compiler/rustc_lint/src/noop_method_call.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,21 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
145145
},
146146
);
147147
} else {
148+
// Report the method call's return type before adjustments required by its parent.
149+
let unadjusted_expr_ty = cx.typeck_results().expr_ty(expr);
148150
match name {
149151
// If `type_of(x) == T` and `x.borrow()` is used to get `&T`,
150152
// then that should be allowed
151153
sym::noop_method_borrow => return,
152154
sym::noop_method_clone => cx.emit_span_lint(
153155
SUSPICIOUS_DOUBLE_REF_OP,
154156
span,
155-
SuspiciousDoubleRefCloneDiag { ty: expr_ty },
157+
SuspiciousDoubleRefCloneDiag { ty: unadjusted_expr_ty },
156158
),
157159
sym::noop_method_deref => cx.emit_span_lint(
158160
SUSPICIOUS_DOUBLE_REF_OP,
159161
span,
160-
SuspiciousDoubleRefDerefDiag { ty: expr_ty },
162+
SuspiciousDoubleRefDerefDiag { ty: unadjusted_expr_ty },
161163
),
162164
_ => return,
163165
}

compiler/rustc_mir_build/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_errors::{
55
};
66
use rustc_macros::{Diagnostic, Subdiagnostic};
77
use rustc_middle::ty::{self, Ty};
8-
use rustc_pattern_analysis::errors::Uncovered;
8+
use rustc_pattern_analysis::diagnostics::Uncovered;
99
use rustc_pattern_analysis::rustc::RustcPatCtxt;
1010
use rustc_span::{Ident, Span, Symbol};
1111

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::thir::visit::Visitor;
1313
use rustc_middle::thir::*;
1414
use rustc_middle::ty::print::with_no_trimmed_paths;
1515
use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
16-
use rustc_pattern_analysis::errors::Uncovered;
16+
use rustc_pattern_analysis::diagnostics::Uncovered;
1717
use rustc_pattern_analysis::rustc::{
1818
Constructor, DeconstructedPat, MatchArm, RedundancyExplanation, RevealedTy,
1919
RustcPatCtxt as PatCtxt, Usefulness, UsefulnessReport, WitnessPat,

compiler/rustc_passes/src/abi_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::Span;
99
use rustc_target::callconv::FnAbi;
1010

1111
use super::layout_test::ensure_wf;
12-
use crate::errors::{AbiInvalidAttribute, AbiNe, AbiOf, UnrecognizedArgument};
12+
use crate::diagnostics::{AbiInvalidAttribute, AbiNe, AbiOf, UnrecognizedArgument};
1313

1414
pub fn test_abi(tcx: TyCtxt<'_>) {
1515
if !tcx.features().rustc_attrs() {

compiler/rustc_passes/src/check_attr.rs

Lines changed: 76 additions & 67 deletions
Large diffs are not rendered by default.

compiler/rustc_passes/src/check_export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_middle::ty::{
1717
use rustc_session::config::CrateType;
1818
use rustc_span::Span;
1919

20-
use crate::errors::UnexportableItem;
20+
use crate::diagnostics::UnexportableItem;
2121

2222
struct ExportableItemCollector<'tcx> {
2323
tcx: TyCtxt<'tcx>,

compiler/rustc_passes/src/dead.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_session::lint::builtin::{DEAD_CODE, DEAD_CODE_PUB_IN_BINARY};
2626
use rustc_session::lint::{self, Lint, StableLintExpectationId};
2727
use rustc_span::{Symbol, kw};
2828

29-
use crate::errors::{
29+
use crate::diagnostics::{
3030
ChangeFields, DeadCodePubInBinaryNote, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo,
3131
UselessAssignment,
3232
};
@@ -1233,7 +1233,7 @@ impl<'tcx> DeadVisitor<'tcx> {
12331233
&& let Some(variant) =
12341234
maybe_enum.variants().iter().find(|i| i.name == dead_item.name)
12351235
{
1236-
Some(crate::errors::EnumVariantSameName {
1236+
Some(crate::diagnostics::EnumVariantSameName {
12371237
dead_descr: tcx.def_descr(dead_item.def_id.to_def_id()),
12381238
dead_name: dead_item.name,
12391239
variant_span: tcx.def_span(variant.def_id),

compiler/rustc_passes/src/debugger_visualizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_middle::ty::TyCtxt;
1111
use rustc_session::Session;
1212
use rustc_span::sym;
1313

14-
use crate::errors::DebugVisualizerUnreadable;
14+
use crate::diagnostics::DebugVisualizerUnreadable;
1515

1616
impl DebuggerVisualizerCollector<'_> {
1717
fn check_for_debugger_visualizer(&mut self, attrs: &[ast::Attribute]) {

compiler/rustc_passes/src/delegation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_data_structures::fx::FxIndexMap;
22
use rustc_middle::ty::TyCtxt;
33

4-
use crate::errors::GlobOrListDelegationUnusedTargetExpr;
4+
use crate::diagnostics::GlobOrListDelegationUnusedTargetExpr;
55

66
pub fn check_glob_and_list_delegations_target_expr(tcx: TyCtxt<'_>) {
77
let mut delegations_by_group_id = FxIndexMap::default();

compiler/rustc_passes/src/diagnostic_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_middle::ty::TyCtxt;
1616
use rustc_span::Symbol;
1717
use rustc_span::def_id::{DefId, LOCAL_CRATE};
1818

19-
use crate::errors::DuplicateDiagnosticItemInCrate;
19+
use crate::diagnostics::DuplicateDiagnosticItemInCrate;
2020

2121
fn observe_item<'tcx>(tcx: TyCtxt<'tcx>, diagnostic_items: &mut DiagnosticItems, owner: OwnerId) {
2222
let attrs = tcx.hir_attrs(owner.into());

0 commit comments

Comments
 (0)