Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c38ca44

Browse files
committed
Auto merge of rust-lang#116769 - matthiaskrgr:rollup-1ivruaq, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#115955 (Stabilize `{IpAddr, Ipv6Addr}::to_canonical`) - rust-lang#116033 (report `unused_import` for empty reexports even it is pub) - rust-lang#116172 (Broaden the consequences of recursive TLS initialization) - rust-lang#116341 (Implement sys::args for UEFI) - rust-lang#116522 (use `PatKind::Error` when an ADT const value has violation) - rust-lang#116732 (Make x capable of resolving symlinks) - rust-lang#116755 (Remove me from libcore review rotation) - rust-lang#116760 (Remove trivial cast in `guaranteed_eq`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 64368d0 + fe8ff72 commit c38ca44

File tree

47 files changed

+347
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+347
-74
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ pub mod visit;
5353

5454
pub use self::ast::*;
5555
pub use self::ast_traits::{AstDeref, AstNodeWrapper, HasAttrs, HasNodeId, HasSpan, HasTokens};
56-
pub use self::format::*;
5756

5857
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5958

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ mod utils;
5050

5151
pub use self::create_scope_map::compute_mir_scopes;
5252
pub use self::metadata::build_global_var_di_node;
53-
pub use self::metadata::extend_scope_to_file;
5453

5554
#[allow(non_upper_case_globals)]
5655
const DW_TAG_auto_variable: c_uint = 0x100;

compiler/rustc_codegen_llvm/src/mono_item.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::llvm;
66
use crate::type_of::LayoutLlvmExt;
77
use rustc_codegen_ssa::traits::*;
88
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
9-
pub use rustc_middle::mir::mono::MonoItem;
109
use rustc_middle::mir::mono::{Linkage, Visibility};
1110
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
1211
use rustc_middle::ty::{self, Instance, TypeVisitableExt};

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ mod arg_matrix;
44
mod checks;
55
mod suggestions;
66

7-
pub use _impl::*;
87
use rustc_errors::ErrorGuaranteed;
9-
pub use suggestions::*;
108

119
use crate::coercion::DynamicCoerceMany;
1210
use crate::{Diverges, EnclosingBreakables, Inherited};

compiler/rustc_infer/src/traits/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use rustc_span::Span;
1919

2020
pub use self::FulfillmentErrorCode::*;
2121
pub use self::ImplSource::*;
22-
pub use self::ObligationCauseCode::*;
2322
pub use self::SelectionError::*;
2423

2524
pub use self::engine::{TraitEngine, TraitEngineExt};

compiler/rustc_middle/src/mir/terminator.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ use rustc_hir::LangItem;
33
use smallvec::SmallVec;
44

55
use super::{BasicBlock, InlineAsmOperand, Operand, SourceInfo, TerminatorKind, UnwindAction};
6-
pub use rustc_ast::Mutability;
76
use rustc_macros::HashStable;
87
use std::iter;
98
use std::slice;
109

11-
pub use super::query::*;
1210
use super::*;
1311

1412
impl SwitchTargets {

compiler/rustc_middle/src/ty/assoc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
pub use self::AssocItemContainer::*;
2-
31
use crate::ty;
42
use rustc_data_structures::sorted_map::SortedIndexMultiMap;
53
use rustc_hir as hir;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ impl<'tcx> ConstToPat<'tcx> {
198198
// We errored. Signal that in the pattern, so that follow up errors can be silenced.
199199
let kind = PatKind::Error(e);
200200
return Box::new(Pat { span: self.span, ty: cv.ty(), kind });
201+
} else if let ty::Adt(..) = cv.ty().kind() && matches!(cv, mir::Const::Val(..)) {
202+
// This branch is only entered when the current `cv` is `mir::Const::Val`.
203+
// This is because `mir::Const::ty` has already been handled by `Self::recur`
204+
// and the invalid types may be ignored.
205+
let err = TypeNotStructural { span: self.span, non_sm_ty };
206+
let e = self.tcx().sess.emit_err(err);
207+
let kind = PatKind::Error(e);
208+
return Box::new(Pat { span: self.span, ty: cv.ty(), kind });
201209
} else if !self.saw_const_match_lint.get() {
202210
if let Some(mir_structural_match_violation) = mir_structural_match_violation {
203211
match non_sm_ty.kind() {

compiler/rustc_mir_dataflow/src/framework/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ mod visitor;
4848
pub use self::cursor::{AnalysisResults, ResultsClonedCursor, ResultsCursor, ResultsRefCursor};
4949
pub use self::direction::{Backward, Direction, Forward};
5050
pub use self::engine::{Engine, EntrySets, Results, ResultsCloned};
51-
pub use self::lattice::{JoinSemiLattice, MaybeReachable, MeetSemiLattice};
51+
pub use self::lattice::{JoinSemiLattice, MaybeReachable};
5252
pub use self::visitor::{visit_results, ResultsVisitable, ResultsVisitor};
5353

5454
/// Analysis domains are all bitsets of various kinds. This trait holds

compiler/rustc_resolve/src/check_unused.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ struct UnusedImportCheckVisitor<'a, 'b, 'tcx> {
5959
base_use_tree: Option<&'a ast::UseTree>,
6060
base_id: ast::NodeId,
6161
item_span: Span,
62-
base_use_is_pub: bool,
6362
}
6463

6564
struct ExternCrateToLint {
@@ -146,7 +145,6 @@ impl<'a, 'b, 'tcx> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
146145
// because this means that they were generated in some fashion by the
147146
// compiler and we don't need to consider them.
148147
ast::ItemKind::Use(..) if item.span.is_dummy() => return,
149-
ast::ItemKind::Use(..) => self.base_use_is_pub = item.vis.kind.is_pub(),
150148
ast::ItemKind::ExternCrate(orig_name) => {
151149
self.extern_crate_items.push(ExternCrateToLint {
152150
id: item.id,
@@ -173,7 +171,7 @@ impl<'a, 'b, 'tcx> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
173171
self.base_use_tree = Some(use_tree);
174172
}
175173

176-
if self.base_use_is_pub {
174+
if self.r.effective_visibilities.is_exported(self.r.local_def_id(id)) {
177175
self.check_import_as_underscore(use_tree, id);
178176
return;
179177
}
@@ -332,7 +330,6 @@ impl Resolver<'_, '_> {
332330
base_use_tree: None,
333331
base_id: ast::DUMMY_NODE_ID,
334332
item_span: DUMMY_SP,
335-
base_use_is_pub: false,
336333
};
337334
visit::walk_crate(&mut visitor, krate);
338335

0 commit comments

Comments
 (0)