authorbors <bors@rust-lang.org> 2024-06-15 18:52:57 UTC
committerbors <bors@rust-lang.org> 2024-06-15 18:52:57 UTC
log3cf924b934322fd7b514600a7dc84fc517515346
tree20e6f40a6193a78f8d8bdaf3da098a56e8aef206
parent92af831290cf60434aa44ba7c6a5171ec48e98be
parentf788ea47f9f600a3c12c345452f6d079f6eb530d

Auto merge of #126528 - GuillaumeGomez:rollup-6zjs70e, r=GuillaumeGomez

Rollup of 9 pull requests Successful merges: - #126229 (Bump windows-bindgen to 0.57) - #126404 (Check that alias-relate terms are WF if reporting an error in alias-relate) - #126410 (smir: merge identical Constant and ConstOperand types) - #126478 (Migrate `run-make/codegen-options-parsing` to `rmake.rs`) - #126496 (Make proof tree probing and `Candidate`/`CandidateSource` generic over interner) - #126508 (Make uninitialized_error_reported a set of locals) - #126517 (Migrate `run-make/dep-graph` to `rmake.rs`) - #126525 (trait_selection: remove extra words) - #126526 (tests/ui/lint: Move 19 tests to new `non-snake-case` subdir) r? `@ghost` `@rustbot` modify labels: rollup

110 files changed, 1092 insertions(+), 1518 deletions(-)

Cargo.lock+4-4
......@@ -6385,9 +6385,9 @@ dependencies = [
63856385
63866386[[package]]
63876387name = "windows-bindgen"
6388version = "0.56.0"
6388version = "0.57.0"
63896389source = "registry+https://github.com/rust-lang/crates.io-index"
6390checksum = "a28e3ea6330cf17fdcdce8bf08d0549ce93769dca9bedc6c39c36c8c0e17db46"
6390checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
63916391dependencies = [
63926392 "proc-macro2",
63936393 "rayon",
......@@ -6408,9 +6408,9 @@ dependencies = [
64086408
64096409[[package]]
64106410name = "windows-metadata"
6411version = "0.56.0"
6411version = "0.57.0"
64126412source = "registry+https://github.com/rust-lang/crates.io-index"
6413checksum = "3993f7827fff10c454e3a24847075598c7c08108304b8b07943c2c73d78f3b34"
6413checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc"
64146414
64156415[[package]]
64166416name = "windows-sys"
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs+3-3
......@@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
100100 move_site_vec.iter().map(|move_site| move_site.moi).collect();
101101
102102 if move_out_indices.is_empty() {
103 let root_place = PlaceRef { projection: &[], ..used_place };
103 let root_local = used_place.local;
104104
105 if !self.uninitialized_error_reported.insert(root_place) {
105 if !self.uninitialized_error_reported.insert(root_local) {
106106 debug!(
107107 "report_use_of_moved_or_uninitialized place: error about {:?} suppressed",
108 root_place
108 root_local
109109 );
110110 return;
111111 }
compiler/rustc_borrowck/src/lib.rs+1-1
......@@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
566566 fn_self_span_reported: FxIndexSet<Span>,
567567 /// This field keeps track of errors reported in the checking of uninitialized variables,
568568 /// so that we don't report seemingly duplicate errors.
569 uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>,
569 uninitialized_error_reported: FxIndexSet<Local>,
570570 /// This field keeps track of all the local variables that are declared mut and are mutated.
571571 /// Used for the warning issued by an unused mutable local variable.
572572 used_mut: FxIndexSet<Local>,
compiler/rustc_borrowck/src/renumber.rs+1-1
......@@ -113,7 +113,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
113113 }
114114
115115 #[instrument(skip(self), level = "debug")]
116 fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
116 fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
117117 let const_ = constant.const_;
118118 constant.const_ = self.renumber_regions(const_, || RegionCtxt::Location(location));
119119 debug!("constant: {:#?}", constant);
compiler/rustc_borrowck/src/type_check/mod.rs+3-3
......@@ -301,10 +301,10 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
301301 self.sanitize_place(place, location, context);
302302 }
303303
304 fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
305 debug!(?constant, ?location, "visit_constant");
304 fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
305 debug!(?constant, ?location, "visit_const_operand");
306306
307 self.super_constant(constant, location);
307 self.super_const_operand(constant, location);
308308 let ty = self.sanitize_type(constant, constant.const_.ty());
309309
310310 self.cx.infcx.tcx.for_each_free_region(&ty, |live_region| {
compiler/rustc_infer/src/infer/mod.rs+4
......@@ -471,6 +471,10 @@ impl<'tcx> ty::InferCtxtLike for InferCtxt<'tcx> {
471471 {
472472 self.resolve_vars_if_possible(value)
473473 }
474
475 fn probe<T>(&self, probe: impl FnOnce() -> T) -> T {
476 self.probe(|_| probe())
477 }
474478}
475479
476480/// See the `error_reporting` module for more details.
compiler/rustc_middle/src/mir/pretty.rs+2-2
......@@ -1287,7 +1287,7 @@ fn use_verbose(ty: Ty<'_>, fn_def: bool) -> bool {
12871287}
12881288
12891289impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
1290 fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, _location: Location) {
1290 fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, _location: Location) {
12911291 let ConstOperand { span, user_ty, const_ } = constant;
12921292 if use_verbose(const_.ty(), true) {
12931293 self.push("mir::ConstOperand");
......@@ -1415,7 +1415,7 @@ pub fn write_allocations<'tcx>(
14151415 struct CollectAllocIds(BTreeSet<AllocId>);
14161416
14171417 impl<'tcx> Visitor<'tcx> for CollectAllocIds {
1418 fn visit_constant(&mut self, c: &ConstOperand<'tcx>, _: Location) {
1418 fn visit_const_operand(&mut self, c: &ConstOperand<'tcx>, _: Location) {
14191419 match c.const_ {
14201420 Const::Ty(_, _) | Const::Unevaluated(..) => {}
14211421 Const::Val(val, _) => {
compiler/rustc_middle/src/mir/visit.rs+7-7
......@@ -184,12 +184,12 @@ macro_rules! make_mir_visitor {
184184
185185 /// This is called for every constant in the MIR body and every `required_consts`
186186 /// (i.e., including consts that have been dead-code-eliminated).
187 fn visit_constant(
187 fn visit_const_operand(
188188 &mut self,
189189 constant: & $($mutability)? ConstOperand<'tcx>,
190190 location: Location,
191191 ) {
192 self.super_constant(constant, location);
192 self.super_const_operand(constant, location);
193193 }
194194
195195 fn visit_ty_const(
......@@ -597,7 +597,7 @@ macro_rules! make_mir_visitor {
597597 }
598598 InlineAsmOperand::Const { value }
599599 | InlineAsmOperand::SymFn { value } => {
600 self.visit_constant(value, location);
600 self.visit_const_operand(value, location);
601601 }
602602 InlineAsmOperand::Out { place: None, .. }
603603 | InlineAsmOperand::SymStatic { def_id: _ }
......@@ -788,7 +788,7 @@ macro_rules! make_mir_visitor {
788788 );
789789 }
790790 Operand::Constant(constant) => {
791 self.visit_constant(constant, location);
791 self.visit_const_operand(constant, location);
792792 }
793793 }
794794 }
......@@ -867,7 +867,7 @@ macro_rules! make_mir_visitor {
867867 }
868868 }
869869 match value {
870 VarDebugInfoContents::Const(c) => self.visit_constant(c, location),
870 VarDebugInfoContents::Const(c) => self.visit_const_operand(c, location),
871871 VarDebugInfoContents::Place(place) =>
872872 self.visit_place(
873873 place,
......@@ -882,7 +882,7 @@ macro_rules! make_mir_visitor {
882882 _scope: $(& $mutability)? SourceScope
883883 ) {}
884884
885 fn super_constant(
885 fn super_const_operand(
886886 &mut self,
887887 constant: & $($mutability)? ConstOperand<'tcx>,
888888 location: Location
......@@ -1057,7 +1057,7 @@ macro_rules! super_body {
10571057
10581058 for const_ in &$($mutability)? $body.required_consts {
10591059 let location = Location::START;
1060 $self.visit_constant(const_, location);
1060 $self.visit_const_operand(const_, location);
10611061 }
10621062 }
10631063}
compiler/rustc_mir_transform/src/known_panics_lint.rs+3-3
......@@ -706,9 +706,9 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
706706 self.super_operand(operand, location);
707707 }
708708
709 fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
710 trace!("visit_constant: {:?}", constant);
711 self.super_constant(constant, location);
709 fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
710 trace!("visit_const_operand: {:?}", constant);
711 self.super_const_operand(constant, location);
712712 self.eval_constant(constant);
713713 }
714714
compiler/rustc_mir_transform/src/promote_consts.rs+1-1
......@@ -956,7 +956,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> {
956956 }
957957 }
958958
959 fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
959 fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
960960 if constant.const_.is_required_const() {
961961 self.promoted.required_consts.push(*constant);
962962 }
compiler/rustc_mir_transform/src/required_consts.rs+1-1
......@@ -12,7 +12,7 @@ impl<'a, 'tcx> RequiredConstsVisitor<'a, 'tcx> {
1212}
1313
1414impl<'tcx> Visitor<'tcx> for RequiredConstsVisitor<'_, 'tcx> {
15 fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
15 fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
1616 if constant.const_.is_required_const() {
1717 self.required_consts.push(*constant);
1818 }
compiler/rustc_mir_transform/src/reveal_all.rs+2-2
......@@ -49,14 +49,14 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
4949 }
5050
5151 #[inline]
52 fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
52 fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
5353 // We have to use `try_normalize_erasing_regions` here, since it's
5454 // possible that we visit impossible-to-satisfy where clauses here,
5555 // see #91745
5656 if let Ok(c) = self.tcx.try_normalize_erasing_regions(self.param_env, constant.const_) {
5757 constant.const_ = c;
5858 }
59 self.super_constant(constant, location);
59 self.super_const_operand(constant, location);
6060 }
6161
6262 #[inline]
compiler/rustc_monomorphize/src/collector.rs+1-1
......@@ -799,7 +799,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
799799 /// This does not walk the MIR of the constant as that is not needed for codegen, all we need is
800800 /// to ensure that the constant evaluates successfully and walk the result.
801801 #[instrument(skip(self), level = "debug")]
802 fn visit_constant(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
802 fn visit_const_operand(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
803803 // No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`.
804804 let Some(val) = self.eval_constant(constant) else { return };
805805 collect_const_value(self.tcx, val, self.used_items);
compiler/rustc_monomorphize/src/polymorphize.rs+1-1
......@@ -261,7 +261,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
261261 self.super_local_decl(local, local_decl);
262262 }
263263
264 fn visit_constant(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
264 fn visit_const_operand(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
265265 match ct.const_ {
266266 mir::Const::Ty(_, c) => {
267267 c.visit_with(self);
compiler/rustc_smir/src/rustc_smir/builder.rs+6-2
......@@ -52,7 +52,11 @@ impl<'tcx> BodyBuilder<'tcx> {
5252}
5353
5454impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
55 fn visit_constant(&mut self, constant: &mut mir::ConstOperand<'tcx>, location: mir::Location) {
55 fn visit_const_operand(
56 &mut self,
57 constant: &mut mir::ConstOperand<'tcx>,
58 location: mir::Location,
59 ) {
5660 let const_ = constant.const_;
5761 let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) {
5862 Ok(v) => v,
......@@ -63,7 +67,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
6367 };
6468 let ty = constant.ty();
6569 constant.const_ = mir::Const::Val(val, ty);
66 self.super_constant(constant, location);
70 self.super_const_operand(constant, location);
6771 }
6872
6973 fn tcx(&self) -> TyCtxt<'tcx> {
compiler/rustc_smir/src/rustc_smir/convert/mir.rs+3-3
......@@ -328,13 +328,13 @@ impl<'tcx> Stable<'tcx> for mir::Operand<'tcx> {
328328}
329329
330330impl<'tcx> Stable<'tcx> for mir::ConstOperand<'tcx> {
331 type T = stable_mir::mir::Constant;
331 type T = stable_mir::mir::ConstOperand;
332332
333333 fn stable(&self, tables: &mut Tables<'_>) -> Self::T {
334 stable_mir::mir::Constant {
334 stable_mir::mir::ConstOperand {
335335 span: self.span.stable(tables),
336336 user_ty: self.user_ty.map(|u| u.as_usize()).or(None),
337 literal: self.const_.stable(tables),
337 const_: self.const_.stable(tables),
338338 }
339339 }
340340}
compiler/rustc_trait_selection/src/solve/assembly/mod.rs+50-49
......@@ -1,21 +1,21 @@
11//! Code shared by trait and projection goals for candidate assembly.
22
3use derivative::Derivative;
34use rustc_hir::def_id::DefId;
45use rustc_hir::LangItem;
56use rustc_infer::infer::InferCtxt;
67use rustc_infer::traits::query::NoSolution;
78use rustc_middle::bug;
89use rustc_middle::traits::solve::inspect::ProbeKind;
9use rustc_middle::traits::solve::{
10 CandidateSource, CanonicalResponse, Certainty, Goal, MaybeCause, QueryResult,
11};
10use rustc_middle::traits::solve::{Certainty, Goal, MaybeCause, QueryResult};
1211use rustc_middle::traits::BuiltinImplSource;
1312use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams};
1413use rustc_middle::ty::{self, Ty, TyCtxt};
1514use rustc_middle::ty::{fast_reject, TypeFoldable};
1615use rustc_middle::ty::{TypeVisitableExt, Upcast};
1716use rustc_span::{ErrorGuaranteed, DUMMY_SP};
18use std::fmt::Debug;
17use rustc_type_ir::solve::{CandidateSource, CanonicalResponse};
18use rustc_type_ir::Interner;
1919
2020use crate::solve::GoalSource;
2121use crate::solve::{EvalCtxt, SolverMode};
......@@ -26,10 +26,11 @@ pub(super) mod structural_traits;
2626///
2727/// It consists of both the `source`, which describes how that goal would be proven,
2828/// and the `result` when using the given `source`.
29#[derive(Debug, Clone)]
30pub(super) struct Candidate<'tcx> {
31 pub(super) source: CandidateSource<'tcx>,
32 pub(super) result: CanonicalResponse<'tcx>,
29#[derive(Derivative)]
30#[derivative(Debug(bound = ""), Clone(bound = ""))]
31pub(super) struct Candidate<I: Interner> {
32 pub(super) source: CandidateSource<I>,
33 pub(super) result: CanonicalResponse<I>,
3334}
3435
3536/// Methods used to assemble candidates for either trait or projection goals.
......@@ -50,22 +51,22 @@ pub(super) trait GoalKind<'tcx>:
5051 /// [`EvalCtxt::evaluate_added_goals_and_make_canonical_response`]).
5152 fn probe_and_match_goal_against_assumption(
5253 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
53 source: CandidateSource<'tcx>,
54 source: CandidateSource<TyCtxt<'tcx>>,
5455 goal: Goal<'tcx, Self>,
5556 assumption: ty::Clause<'tcx>,
5657 then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>,
57 ) -> Result<Candidate<'tcx>, NoSolution>;
58 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
5859
5960 /// Consider a clause, which consists of a "assumption" and some "requirements",
6061 /// to satisfy a goal. If the requirements hold, then attempt to satisfy our
6162 /// goal by equating it with the assumption.
6263 fn probe_and_consider_implied_clause(
6364 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
64 parent_source: CandidateSource<'tcx>,
65 parent_source: CandidateSource<TyCtxt<'tcx>>,
6566 goal: Goal<'tcx, Self>,
6667 assumption: ty::Clause<'tcx>,
6768 requirements: impl IntoIterator<Item = (GoalSource, Goal<'tcx, ty::Predicate<'tcx>>)>,
68 ) -> Result<Candidate<'tcx>, NoSolution> {
69 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
6970 Self::probe_and_match_goal_against_assumption(ecx, parent_source, goal, assumption, |ecx| {
7071 for (nested_source, goal) in requirements {
7172 ecx.add_goal(nested_source, goal);
......@@ -79,10 +80,10 @@ pub(super) trait GoalKind<'tcx>:
7980 /// since they're not implied by the well-formedness of the object type.
8081 fn probe_and_consider_object_bound_candidate(
8182 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
82 source: CandidateSource<'tcx>,
83 source: CandidateSource<TyCtxt<'tcx>>,
8384 goal: Goal<'tcx, Self>,
8485 assumption: ty::Clause<'tcx>,
85 ) -> Result<Candidate<'tcx>, NoSolution> {
86 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
8687 Self::probe_and_match_goal_against_assumption(ecx, source, goal, assumption, |ecx| {
8788 let tcx = ecx.interner();
8889 let ty::Dynamic(bounds, _, _) = *goal.predicate.self_ty().kind() else {
......@@ -105,7 +106,7 @@ pub(super) trait GoalKind<'tcx>:
105106 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
106107 goal: Goal<'tcx, Self>,
107108 impl_def_id: DefId,
108 ) -> Result<Candidate<'tcx>, NoSolution>;
109 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
109110
110111 /// If the predicate contained an error, we want to avoid emitting unnecessary trait
111112 /// errors but still want to emit errors for other trait goals. We have some special
......@@ -116,7 +117,7 @@ pub(super) trait GoalKind<'tcx>:
116117 fn consider_error_guaranteed_candidate(
117118 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
118119 guar: ErrorGuaranteed,
119 ) -> Result<Candidate<'tcx>, NoSolution>;
120 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
120121
121122 /// A type implements an `auto trait` if its components do as well.
122123 ///
......@@ -125,13 +126,13 @@ pub(super) trait GoalKind<'tcx>:
125126 fn consider_auto_trait_candidate(
126127 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
127128 goal: Goal<'tcx, Self>,
128 ) -> Result<Candidate<'tcx>, NoSolution>;
129 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
129130
130131 /// A trait alias holds if the RHS traits and `where` clauses hold.
131132 fn consider_trait_alias_candidate(
132133 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
133134 goal: Goal<'tcx, Self>,
134 ) -> Result<Candidate<'tcx>, NoSolution>;
135 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
135136
136137 /// A type is `Sized` if its tail component is `Sized`.
137138 ///
......@@ -140,7 +141,7 @@ pub(super) trait GoalKind<'tcx>:
140141 fn consider_builtin_sized_candidate(
141142 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
142143 goal: Goal<'tcx, Self>,
143 ) -> Result<Candidate<'tcx>, NoSolution>;
144 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
144145
145146 /// A type is `Copy` or `Clone` if its components are `Copy` or `Clone`.
146147 ///
......@@ -149,20 +150,20 @@ pub(super) trait GoalKind<'tcx>:
149150 fn consider_builtin_copy_clone_candidate(
150151 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
151152 goal: Goal<'tcx, Self>,
152 ) -> Result<Candidate<'tcx>, NoSolution>;
153 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
153154
154155 /// A type is `PointerLike` if we can compute its layout, and that layout
155156 /// matches the layout of `usize`.
156157 fn consider_builtin_pointer_like_candidate(
157158 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
158159 goal: Goal<'tcx, Self>,
159 ) -> Result<Candidate<'tcx>, NoSolution>;
160 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
160161
161162 /// A type is a `FnPtr` if it is of `FnPtr` type.
162163 fn consider_builtin_fn_ptr_trait_candidate(
163164 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
164165 goal: Goal<'tcx, Self>,
165 ) -> Result<Candidate<'tcx>, NoSolution>;
166 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
166167
167168 /// A callable type (a closure, fn def, or fn ptr) is known to implement the `Fn<A>`
168169 /// family of traits where `A` is given by the signature of the type.
......@@ -170,7 +171,7 @@ pub(super) trait GoalKind<'tcx>:
170171 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
171172 goal: Goal<'tcx, Self>,
172173 kind: ty::ClosureKind,
173 ) -> Result<Candidate<'tcx>, NoSolution>;
174 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
174175
175176 /// An async closure is known to implement the `AsyncFn<A>` family of traits
176177 /// where `A` is given by the signature of the type.
......@@ -178,7 +179,7 @@ pub(super) trait GoalKind<'tcx>:
178179 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
179180 goal: Goal<'tcx, Self>,
180181 kind: ty::ClosureKind,
181 ) -> Result<Candidate<'tcx>, NoSolution>;
182 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
182183
183184 /// Compute the built-in logic of the `AsyncFnKindHelper` helper trait, which
184185 /// is used internally to delay computation for async closures until after
......@@ -186,13 +187,13 @@ pub(super) trait GoalKind<'tcx>:
186187 fn consider_builtin_async_fn_kind_helper_candidate(
187188 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
188189 goal: Goal<'tcx, Self>,
189 ) -> Result<Candidate<'tcx>, NoSolution>;
190 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
190191
191192 /// `Tuple` is implemented if the `Self` type is a tuple.
192193 fn consider_builtin_tuple_candidate(
193194 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
194195 goal: Goal<'tcx, Self>,
195 ) -> Result<Candidate<'tcx>, NoSolution>;
196 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
196197
197198 /// `Pointee` is always implemented.
198199 ///
......@@ -202,7 +203,7 @@ pub(super) trait GoalKind<'tcx>:
202203 fn consider_builtin_pointee_candidate(
203204 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
204205 goal: Goal<'tcx, Self>,
205 ) -> Result<Candidate<'tcx>, NoSolution>;
206 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
206207
207208 /// A coroutine (that comes from an `async` desugaring) is known to implement
208209 /// `Future<Output = O>`, where `O` is given by the coroutine's return type
......@@ -210,7 +211,7 @@ pub(super) trait GoalKind<'tcx>:
210211 fn consider_builtin_future_candidate(
211212 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
212213 goal: Goal<'tcx, Self>,
213 ) -> Result<Candidate<'tcx>, NoSolution>;
214 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
214215
215216 /// A coroutine (that comes from a `gen` desugaring) is known to implement
216217 /// `Iterator<Item = O>`, where `O` is given by the generator's yield type
......@@ -218,19 +219,19 @@ pub(super) trait GoalKind<'tcx>:
218219 fn consider_builtin_iterator_candidate(
219220 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
220221 goal: Goal<'tcx, Self>,
221 ) -> Result<Candidate<'tcx>, NoSolution>;
222 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
222223
223224 /// A coroutine (that comes from a `gen` desugaring) is known to implement
224225 /// `FusedIterator`
225226 fn consider_builtin_fused_iterator_candidate(
226227 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
227228 goal: Goal<'tcx, Self>,
228 ) -> Result<Candidate<'tcx>, NoSolution>;
229 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
229230
230231 fn consider_builtin_async_iterator_candidate(
231232 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
232233 goal: Goal<'tcx, Self>,
233 ) -> Result<Candidate<'tcx>, NoSolution>;
234 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
234235
235236 /// A coroutine (that doesn't come from an `async` or `gen` desugaring) is known to
236237 /// implement `Coroutine<R, Yield = Y, Return = O>`, given the resume, yield,
......@@ -238,27 +239,27 @@ pub(super) trait GoalKind<'tcx>:
238239 fn consider_builtin_coroutine_candidate(
239240 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
240241 goal: Goal<'tcx, Self>,
241 ) -> Result<Candidate<'tcx>, NoSolution>;
242 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
242243
243244 fn consider_builtin_discriminant_kind_candidate(
244245 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
245246 goal: Goal<'tcx, Self>,
246 ) -> Result<Candidate<'tcx>, NoSolution>;
247 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
247248
248249 fn consider_builtin_async_destruct_candidate(
249250 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
250251 goal: Goal<'tcx, Self>,
251 ) -> Result<Candidate<'tcx>, NoSolution>;
252 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
252253
253254 fn consider_builtin_destruct_candidate(
254255 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
255256 goal: Goal<'tcx, Self>,
256 ) -> Result<Candidate<'tcx>, NoSolution>;
257 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
257258
258259 fn consider_builtin_transmute_candidate(
259260 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
260261 goal: Goal<'tcx, Self>,
261 ) -> Result<Candidate<'tcx>, NoSolution>;
262 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>;
262263
263264 /// Consider (possibly several) candidates to upcast or unsize a type to another
264265 /// type, excluding the coercion of a sized type into a `dyn Trait`.
......@@ -270,14 +271,14 @@ pub(super) trait GoalKind<'tcx>:
270271 fn consider_structural_builtin_unsize_candidates(
271272 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
272273 goal: Goal<'tcx, Self>,
273 ) -> Vec<Candidate<'tcx>>;
274 ) -> Vec<Candidate<TyCtxt<'tcx>>>;
274275}
275276
276277impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
277278 pub(super) fn assemble_and_evaluate_candidates<G: GoalKind<'tcx>>(
278279 &mut self,
279280 goal: Goal<'tcx, G>,
280 ) -> Vec<Candidate<'tcx>> {
281 ) -> Vec<Candidate<TyCtxt<'tcx>>> {
281282 let Ok(normalized_self_ty) =
282283 self.structurally_normalize_ty(goal.param_env, goal.predicate.self_ty())
283284 else {
......@@ -324,7 +325,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
324325 pub(super) fn forced_ambiguity(
325326 &mut self,
326327 cause: MaybeCause,
327 ) -> Result<Candidate<'tcx>, NoSolution> {
328 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
328329 // This may fail if `try_evaluate_added_goals` overflows because it
329330 // fails to reach a fixpoint but ends up getting an error after
330331 // running for some additional step.
......@@ -340,7 +341,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
340341 fn assemble_non_blanket_impl_candidates<G: GoalKind<'tcx>>(
341342 &mut self,
342343 goal: Goal<'tcx, G>,
343 candidates: &mut Vec<Candidate<'tcx>>,
344 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
344345 ) {
345346 let tcx = self.interner();
346347 let self_ty = goal.predicate.self_ty();
......@@ -456,7 +457,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
456457 fn assemble_blanket_impl_candidates<G: GoalKind<'tcx>>(
457458 &mut self,
458459 goal: Goal<'tcx, G>,
459 candidates: &mut Vec<Candidate<'tcx>>,
460 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
460461 ) {
461462 let tcx = self.interner();
462463 let trait_impls = tcx.trait_impls_of(goal.predicate.trait_def_id(tcx));
......@@ -479,7 +480,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
479480 fn assemble_builtin_impl_candidates<G: GoalKind<'tcx>>(
480481 &mut self,
481482 goal: Goal<'tcx, G>,
482 candidates: &mut Vec<Candidate<'tcx>>,
483 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
483484 ) {
484485 let tcx = self.interner();
485486 let trait_def_id = goal.predicate.trait_def_id(tcx);
......@@ -552,7 +553,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
552553 fn assemble_param_env_candidates<G: GoalKind<'tcx>>(
553554 &mut self,
554555 goal: Goal<'tcx, G>,
555 candidates: &mut Vec<Candidate<'tcx>>,
556 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
556557 ) {
557558 for (i, assumption) in goal.param_env.caller_bounds().iter().enumerate() {
558559 candidates.extend(G::probe_and_consider_implied_clause(
......@@ -569,7 +570,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
569570 fn assemble_alias_bound_candidates<G: GoalKind<'tcx>>(
570571 &mut self,
571572 goal: Goal<'tcx, G>,
572 candidates: &mut Vec<Candidate<'tcx>>,
573 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
573574 ) {
574575 let () = self.probe(|_| ProbeKind::NormalizedSelfTyAssembly).enter(|ecx| {
575576 ecx.assemble_alias_bound_candidates_recur(goal.predicate.self_ty(), goal, candidates);
......@@ -589,7 +590,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
589590 &mut self,
590591 self_ty: Ty<'tcx>,
591592 goal: Goal<'tcx, G>,
592 candidates: &mut Vec<Candidate<'tcx>>,
593 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
593594 ) {
594595 let (kind, alias_ty) = match *self_ty.kind() {
595596 ty::Bool
......@@ -673,7 +674,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
673674 fn assemble_object_bound_candidates<G: GoalKind<'tcx>>(
674675 &mut self,
675676 goal: Goal<'tcx, G>,
676 candidates: &mut Vec<Candidate<'tcx>>,
677 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
677678 ) {
678679 let tcx = self.interner();
679680 if !tcx.trait_def(goal.predicate.trait_def_id(tcx)).implement_via_object {
......@@ -764,7 +765,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
764765 fn assemble_coherence_unknowable_candidates<G: GoalKind<'tcx>>(
765766 &mut self,
766767 goal: Goal<'tcx, G>,
767 candidates: &mut Vec<Candidate<'tcx>>,
768 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
768769 ) {
769770 let tcx = self.interner();
770771
......@@ -793,7 +794,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
793794 fn discard_impls_shadowed_by_env<G: GoalKind<'tcx>>(
794795 &mut self,
795796 goal: Goal<'tcx, G>,
796 candidates: &mut Vec<Candidate<'tcx>>,
797 candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>,
797798 ) {
798799 let tcx = self.interner();
799800 let trait_goal: Goal<'tcx, ty::TraitPredicate<'tcx>> =
......@@ -841,7 +842,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
841842 #[instrument(level = "debug", skip(self), ret)]
842843 pub(super) fn merge_candidates(
843844 &mut self,
844 candidates: Vec<Candidate<'tcx>>,
845 candidates: Vec<Candidate<TyCtxt<'tcx>>>,
845846 ) -> QueryResult<'tcx> {
846847 // First try merging all candidates. This is complete and fully sound.
847848 let responses = candidates.iter().map(|c| c.result).collect::<Vec<_>>();
compiler/rustc_trait_selection/src/solve/eval_ctxt/probe.rs+45-38
......@@ -1,27 +1,29 @@
11use crate::solve::assembly::Candidate;
22
33use super::EvalCtxt;
4use rustc_infer::infer::InferCtxt;
5use rustc_infer::traits::BuiltinImplSource;
6use rustc_middle::traits::query::NoSolution;
7use rustc_middle::traits::solve::{inspect, CandidateSource, QueryResult};
8use rustc_middle::ty::TyCtxt;
4use rustc_next_trait_solver::solve::{
5 inspect, BuiltinImplSource, CandidateSource, NoSolution, QueryResult,
6};
7use rustc_type_ir::{InferCtxtLike, Interner};
98use std::marker::PhantomData;
109
11pub(in crate::solve) struct ProbeCtxt<'me, 'a, 'tcx, F, T> {
12 ecx: &'me mut EvalCtxt<'a, InferCtxt<'tcx>>,
10pub(in crate::solve) struct ProbeCtxt<'me, 'a, Infcx, I, F, T>
11where
12 Infcx: InferCtxtLike<Interner = I>,
13 I: Interner,
14{
15 ecx: &'me mut EvalCtxt<'a, Infcx, I>,
1316 probe_kind: F,
1417 _result: PhantomData<T>,
1518}
1619
17impl<'tcx, F, T> ProbeCtxt<'_, '_, 'tcx, F, T>
20impl<Infcx, I, F, T> ProbeCtxt<'_, '_, Infcx, I, F, T>
1821where
19 F: FnOnce(&T) -> inspect::ProbeKind<TyCtxt<'tcx>>,
22 F: FnOnce(&T) -> inspect::ProbeKind<I>,
23 Infcx: InferCtxtLike<Interner = I>,
24 I: Interner,
2025{
21 pub(in crate::solve) fn enter(
22 self,
23 f: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> T,
24 ) -> T {
26 pub(in crate::solve) fn enter(self, f: impl FnOnce(&mut EvalCtxt<'_, Infcx>) -> T) -> T {
2527 let ProbeCtxt { ecx: outer_ecx, probe_kind, _result } = self;
2628
2729 let infcx = outer_ecx.infcx;
......@@ -38,7 +40,7 @@ where
3840 tainted: outer_ecx.tainted,
3941 inspect: outer_ecx.inspect.take_and_enter_probe(),
4042 };
41 let r = nested_ecx.infcx.probe(|_| {
43 let r = nested_ecx.infcx.probe(|| {
4244 let r = f(&mut nested_ecx);
4345 nested_ecx.inspect.probe_final_state(infcx, max_input_universe);
4446 r
......@@ -52,30 +54,43 @@ where
5254 }
5355}
5456
55pub(in crate::solve) struct TraitProbeCtxt<'me, 'a, 'tcx, F> {
56 cx: ProbeCtxt<'me, 'a, 'tcx, F, QueryResult<'tcx>>,
57 source: CandidateSource<'tcx>,
57pub(in crate::solve) struct TraitProbeCtxt<'me, 'a, Infcx, I, F>
58where
59 Infcx: InferCtxtLike<Interner = I>,
60 I: Interner,
61{
62 cx: ProbeCtxt<'me, 'a, Infcx, I, F, QueryResult<I>>,
63 source: CandidateSource<I>,
5864}
5965
60impl<'tcx, F> TraitProbeCtxt<'_, '_, 'tcx, F>
66impl<Infcx, I, F> TraitProbeCtxt<'_, '_, Infcx, I, F>
6167where
62 F: FnOnce(&QueryResult<'tcx>) -> inspect::ProbeKind<TyCtxt<'tcx>>,
68 Infcx: InferCtxtLike<Interner = I>,
69 I: Interner,
70 F: FnOnce(&QueryResult<I>) -> inspect::ProbeKind<I>,
6371{
6472 #[instrument(level = "debug", skip_all, fields(source = ?self.source))]
6573 pub(in crate::solve) fn enter(
6674 self,
67 f: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>,
68 ) -> Result<Candidate<'tcx>, NoSolution> {
75 f: impl FnOnce(&mut EvalCtxt<'_, Infcx>) -> QueryResult<I>,
76 ) -> Result<Candidate<I>, NoSolution> {
6977 self.cx.enter(|ecx| f(ecx)).map(|result| Candidate { source: self.source, result })
7078 }
7179}
7280
73impl<'a, 'tcx> EvalCtxt<'a, InferCtxt<'tcx>> {
81impl<'a, Infcx, I> EvalCtxt<'a, Infcx, I>
82where
83 Infcx: InferCtxtLike<Interner = I>,
84 I: Interner,
85{
7486 /// `probe_kind` is only called when proof tree building is enabled so it can be
7587 /// as expensive as necessary to output the desired information.
76 pub(in crate::solve) fn probe<F, T>(&mut self, probe_kind: F) -> ProbeCtxt<'_, 'a, 'tcx, F, T>
88 pub(in crate::solve) fn probe<F, T>(
89 &mut self,
90 probe_kind: F,
91 ) -> ProbeCtxt<'_, 'a, Infcx, I, F, T>
7792 where
78 F: FnOnce(&T) -> inspect::ProbeKind<TyCtxt<'tcx>>,
93 F: FnOnce(&T) -> inspect::ProbeKind<I>,
7994 {
8095 ProbeCtxt { ecx: self, probe_kind, _result: PhantomData }
8196 }
......@@ -83,28 +98,20 @@ impl<'a, 'tcx> EvalCtxt<'a, InferCtxt<'tcx>> {
8398 pub(in crate::solve) fn probe_builtin_trait_candidate(
8499 &mut self,
85100 source: BuiltinImplSource,
86 ) -> TraitProbeCtxt<
87 '_,
88 'a,
89 'tcx,
90 impl FnOnce(&QueryResult<'tcx>) -> inspect::ProbeKind<TyCtxt<'tcx>>,
91 > {
101 ) -> TraitProbeCtxt<'_, 'a, Infcx, I, impl FnOnce(&QueryResult<I>) -> inspect::ProbeKind<I>>
102 {
92103 self.probe_trait_candidate(CandidateSource::BuiltinImpl(source))
93104 }
94105
95106 pub(in crate::solve) fn probe_trait_candidate(
96107 &mut self,
97 source: CandidateSource<'tcx>,
98 ) -> TraitProbeCtxt<
99 '_,
100 'a,
101 'tcx,
102 impl FnOnce(&QueryResult<'tcx>) -> inspect::ProbeKind<TyCtxt<'tcx>>,
103 > {
108 source: CandidateSource<I>,
109 ) -> TraitProbeCtxt<'_, 'a, Infcx, I, impl FnOnce(&QueryResult<I>) -> inspect::ProbeKind<I>>
110 {
104111 TraitProbeCtxt {
105112 cx: ProbeCtxt {
106113 ecx: self,
107 probe_kind: move |result: &QueryResult<'tcx>| inspect::ProbeKind::TraitCandidate {
114 probe_kind: move |result: &QueryResult<I>| inspect::ProbeKind::TraitCandidate {
108115 source,
109116 result: *result,
110117 },
compiler/rustc_trait_selection/src/solve/fulfill.rs+26
......@@ -515,6 +515,32 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
515515 self.with_derived_obligation(obligation, |this| nested_goal.visit_with(this))?;
516516 }
517517
518 // alias-relate may fail because the lhs or rhs can't be normalized,
519 // and therefore is treated as rigid.
520 if let Some(ty::PredicateKind::AliasRelate(lhs, rhs, _)) = pred_kind.no_bound_vars() {
521 if let Some(obligation) = goal
522 .infcx()
523 .visit_proof_tree_at_depth(
524 goal.goal().with(goal.infcx().tcx, ty::ClauseKind::WellFormed(lhs.into())),
525 goal.depth() + 1,
526 self,
527 )
528 .break_value()
529 {
530 return ControlFlow::Break(obligation);
531 } else if let Some(obligation) = goal
532 .infcx()
533 .visit_proof_tree_at_depth(
534 goal.goal().with(goal.infcx().tcx, ty::ClauseKind::WellFormed(rhs.into())),
535 goal.depth() + 1,
536 self,
537 )
538 .break_value()
539 {
540 return ControlFlow::Break(obligation);
541 }
542 }
543
518544 ControlFlow::Break(self.obligation.clone())
519545 }
520546}
compiler/rustc_trait_selection/src/solve/inspect/analyse.rs+14-1
......@@ -278,6 +278,10 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
278278 self.source
279279 }
280280
281 pub fn depth(&self) -> usize {
282 self.depth
283 }
284
281285 fn candidates_recur(
282286 &'a self,
283287 candidates: &mut Vec<InspectCandidate<'a, 'tcx>>,
......@@ -435,9 +439,18 @@ impl<'tcx> InferCtxt<'tcx> {
435439 &self,
436440 goal: Goal<'tcx, ty::Predicate<'tcx>>,
437441 visitor: &mut V,
442 ) -> V::Result {
443 self.visit_proof_tree_at_depth(goal, 0, visitor)
444 }
445
446 fn visit_proof_tree_at_depth<V: ProofTreeVisitor<'tcx>>(
447 &self,
448 goal: Goal<'tcx, ty::Predicate<'tcx>>,
449 depth: usize,
450 visitor: &mut V,
438451 ) -> V::Result {
439452 let (_, proof_tree) = self.evaluate_root_goal(goal, GenerateProofTree::Yes);
440453 let proof_tree = proof_tree.unwrap();
441 visitor.visit_goal(&InspectGoal::new(self, 0, proof_tree, None, GoalSource::Misc))
454 visitor.visit_goal(&InspectGoal::new(self, depth, proof_tree, None, GoalSource::Misc))
442455 }
443456}
compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs+24-24
......@@ -103,7 +103,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
103103 goal: Goal<'tcx, Self>,
104104 assumption: ty::Clause<'tcx>,
105105 then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>,
106 ) -> Result<Candidate<'tcx>, NoSolution> {
106 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
107107 if let Some(projection_pred) = assumption.as_projection_clause() {
108108 if projection_pred.projection_def_id() == goal.predicate.def_id() {
109109 let tcx = ecx.interner();
......@@ -140,7 +140,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
140140 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
141141 goal: Goal<'tcx, NormalizesTo<'tcx>>,
142142 impl_def_id: DefId,
143 ) -> Result<Candidate<'tcx>, NoSolution> {
143 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
144144 let tcx = ecx.interner();
145145
146146 let goal_trait_ref = goal.predicate.alias.trait_ref(tcx);
......@@ -267,14 +267,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
267267 fn consider_error_guaranteed_candidate(
268268 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
269269 _guar: ErrorGuaranteed,
270 ) -> Result<Candidate<'tcx>, NoSolution> {
270 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
271271 Err(NoSolution)
272272 }
273273
274274 fn consider_auto_trait_candidate(
275275 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
276276 goal: Goal<'tcx, Self>,
277 ) -> Result<Candidate<'tcx>, NoSolution> {
277 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
278278 ecx.interner().dcx().span_delayed_bug(
279279 ecx.interner().def_span(goal.predicate.def_id()),
280280 "associated types not allowed on auto traits",
......@@ -285,35 +285,35 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
285285 fn consider_trait_alias_candidate(
286286 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
287287 goal: Goal<'tcx, Self>,
288 ) -> Result<Candidate<'tcx>, NoSolution> {
288 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
289289 bug!("trait aliases do not have associated types: {:?}", goal);
290290 }
291291
292292 fn consider_builtin_sized_candidate(
293293 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
294294 goal: Goal<'tcx, Self>,
295 ) -> Result<Candidate<'tcx>, NoSolution> {
295 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
296296 bug!("`Sized` does not have an associated type: {:?}", goal);
297297 }
298298
299299 fn consider_builtin_copy_clone_candidate(
300300 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
301301 goal: Goal<'tcx, Self>,
302 ) -> Result<Candidate<'tcx>, NoSolution> {
302 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
303303 bug!("`Copy`/`Clone` does not have an associated type: {:?}", goal);
304304 }
305305
306306 fn consider_builtin_pointer_like_candidate(
307307 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
308308 goal: Goal<'tcx, Self>,
309 ) -> Result<Candidate<'tcx>, NoSolution> {
309 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
310310 bug!("`PointerLike` does not have an associated type: {:?}", goal);
311311 }
312312
313313 fn consider_builtin_fn_ptr_trait_candidate(
314314 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
315315 goal: Goal<'tcx, Self>,
316 ) -> Result<Candidate<'tcx>, NoSolution> {
316 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
317317 bug!("`FnPtr` does not have an associated type: {:?}", goal);
318318 }
319319
......@@ -321,7 +321,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
321321 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
322322 goal: Goal<'tcx, Self>,
323323 goal_kind: ty::ClosureKind,
324 ) -> Result<Candidate<'tcx>, NoSolution> {
324 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
325325 let tcx = ecx.interner();
326326 let tupled_inputs_and_output =
327327 match structural_traits::extract_tupled_inputs_and_output_from_callable(
......@@ -364,7 +364,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
364364 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
365365 goal: Goal<'tcx, Self>,
366366 goal_kind: ty::ClosureKind,
367 ) -> Result<Candidate<'tcx>, NoSolution> {
367 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
368368 let tcx = ecx.interner();
369369
370370 let env_region = match goal_kind {
......@@ -454,7 +454,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
454454 fn consider_builtin_async_fn_kind_helper_candidate(
455455 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
456456 goal: Goal<'tcx, Self>,
457 ) -> Result<Candidate<'tcx>, NoSolution> {
457 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
458458 let [
459459 closure_fn_kind_ty,
460460 goal_kind_ty,
......@@ -501,14 +501,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
501501 fn consider_builtin_tuple_candidate(
502502 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
503503 goal: Goal<'tcx, Self>,
504 ) -> Result<Candidate<'tcx>, NoSolution> {
504 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
505505 bug!("`Tuple` does not have an associated type: {:?}", goal);
506506 }
507507
508508 fn consider_builtin_pointee_candidate(
509509 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
510510 goal: Goal<'tcx, Self>,
511 ) -> Result<Candidate<'tcx>, NoSolution> {
511 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
512512 let tcx = ecx.interner();
513513 let metadata_def_id = tcx.require_lang_item(LangItem::Metadata, None);
514514 assert_eq!(metadata_def_id, goal.predicate.def_id());
......@@ -590,7 +590,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
590590 fn consider_builtin_future_candidate(
591591 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
592592 goal: Goal<'tcx, Self>,
593 ) -> Result<Candidate<'tcx>, NoSolution> {
593 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
594594 let self_ty = goal.predicate.self_ty();
595595 let ty::Coroutine(def_id, args) = *self_ty.kind() else {
596596 return Err(NoSolution);
......@@ -626,7 +626,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
626626 fn consider_builtin_iterator_candidate(
627627 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
628628 goal: Goal<'tcx, Self>,
629 ) -> Result<Candidate<'tcx>, NoSolution> {
629 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
630630 let self_ty = goal.predicate.self_ty();
631631 let ty::Coroutine(def_id, args) = *self_ty.kind() else {
632632 return Err(NoSolution);
......@@ -662,14 +662,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
662662 fn consider_builtin_fused_iterator_candidate(
663663 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
664664 goal: Goal<'tcx, Self>,
665 ) -> Result<Candidate<'tcx>, NoSolution> {
665 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
666666 bug!("`FusedIterator` does not have an associated type: {:?}", goal);
667667 }
668668
669669 fn consider_builtin_async_iterator_candidate(
670670 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
671671 goal: Goal<'tcx, Self>,
672 ) -> Result<Candidate<'tcx>, NoSolution> {
672 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
673673 let self_ty = goal.predicate.self_ty();
674674 let ty::Coroutine(def_id, args) = *self_ty.kind() else {
675675 return Err(NoSolution);
......@@ -705,7 +705,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
705705 fn consider_builtin_coroutine_candidate(
706706 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
707707 goal: Goal<'tcx, Self>,
708 ) -> Result<Candidate<'tcx>, NoSolution> {
708 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
709709 let self_ty = goal.predicate.self_ty();
710710 let ty::Coroutine(def_id, args) = *self_ty.kind() else {
711711 return Err(NoSolution);
......@@ -752,14 +752,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
752752 fn consider_structural_builtin_unsize_candidates(
753753 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
754754 goal: Goal<'tcx, Self>,
755 ) -> Vec<Candidate<'tcx>> {
755 ) -> Vec<Candidate<TyCtxt<'tcx>>> {
756756 bug!("`Unsize` does not have an associated type: {:?}", goal);
757757 }
758758
759759 fn consider_builtin_discriminant_kind_candidate(
760760 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
761761 goal: Goal<'tcx, Self>,
762 ) -> Result<Candidate<'tcx>, NoSolution> {
762 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
763763 let self_ty = goal.predicate.self_ty();
764764 let discriminant_ty = match *self_ty.kind() {
765765 ty::Bool
......@@ -811,7 +811,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
811811 fn consider_builtin_async_destruct_candidate(
812812 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
813813 goal: Goal<'tcx, Self>,
814 ) -> Result<Candidate<'tcx>, NoSolution> {
814 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
815815 let self_ty = goal.predicate.self_ty();
816816 let async_destructor_ty = match *self_ty.kind() {
817817 ty::Bool
......@@ -864,14 +864,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
864864 fn consider_builtin_destruct_candidate(
865865 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
866866 goal: Goal<'tcx, Self>,
867 ) -> Result<Candidate<'tcx>, NoSolution> {
867 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
868868 bug!("`Destruct` does not have an associated type: {:?}", goal);
869869 }
870870
871871 fn consider_builtin_transmute_candidate(
872872 _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
873873 goal: Goal<'tcx, Self>,
874 ) -> Result<Candidate<'tcx>, NoSolution> {
874 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
875875 bug!("`BikeshedIntrinsicFrom` does not have an associated type: {:?}", goal)
876876 }
877877}
compiler/rustc_trait_selection/src/solve/trait_goals.rs+32-32
......@@ -39,7 +39,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
3939 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
4040 goal: Goal<'tcx, TraitPredicate<'tcx>>,
4141 impl_def_id: DefId,
42 ) -> Result<Candidate<'tcx>, NoSolution> {
42 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
4343 let tcx = ecx.interner();
4444
4545 let impl_trait_header = tcx.impl_trait_header(impl_def_id).unwrap();
......@@ -94,7 +94,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
9494 fn consider_error_guaranteed_candidate(
9595 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
9696 _guar: ErrorGuaranteed,
97 ) -> Result<Candidate<'tcx>, NoSolution> {
97 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
9898 // FIXME: don't need to enter a probe here.
9999 ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
100100 .enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
......@@ -106,7 +106,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
106106 goal: Goal<'tcx, Self>,
107107 assumption: ty::Clause<'tcx>,
108108 then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>,
109 ) -> Result<Candidate<'tcx>, NoSolution> {
109 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
110110 if let Some(trait_clause) = assumption.as_trait_clause() {
111111 if trait_clause.def_id() == goal.predicate.def_id()
112112 && trait_clause.polarity() == goal.predicate.polarity
......@@ -131,7 +131,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
131131 fn consider_auto_trait_candidate(
132132 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
133133 goal: Goal<'tcx, Self>,
134 ) -> Result<Candidate<'tcx>, NoSolution> {
134 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
135135 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
136136 return Err(NoSolution);
137137 }
......@@ -174,7 +174,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
174174 fn consider_trait_alias_candidate(
175175 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
176176 goal: Goal<'tcx, Self>,
177 ) -> Result<Candidate<'tcx>, NoSolution> {
177 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
178178 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
179179 return Err(NoSolution);
180180 }
......@@ -197,7 +197,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
197197 fn consider_builtin_sized_candidate(
198198 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
199199 goal: Goal<'tcx, Self>,
200 ) -> Result<Candidate<'tcx>, NoSolution> {
200 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
201201 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
202202 return Err(NoSolution);
203203 }
......@@ -212,7 +212,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
212212 fn consider_builtin_copy_clone_candidate(
213213 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
214214 goal: Goal<'tcx, Self>,
215 ) -> Result<Candidate<'tcx>, NoSolution> {
215 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
216216 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
217217 return Err(NoSolution);
218218 }
......@@ -227,7 +227,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
227227 fn consider_builtin_pointer_like_candidate(
228228 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
229229 goal: Goal<'tcx, Self>,
230 ) -> Result<Candidate<'tcx>, NoSolution> {
230 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
231231 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
232232 return Err(NoSolution);
233233 }
......@@ -257,7 +257,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
257257 fn consider_builtin_fn_ptr_trait_candidate(
258258 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
259259 goal: Goal<'tcx, Self>,
260 ) -> Result<Candidate<'tcx>, NoSolution> {
260 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
261261 let self_ty = goal.predicate.self_ty();
262262 match goal.predicate.polarity {
263263 // impl FnPtr for FnPtr {}
......@@ -289,7 +289,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
289289 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
290290 goal: Goal<'tcx, Self>,
291291 goal_kind: ty::ClosureKind,
292 ) -> Result<Candidate<'tcx>, NoSolution> {
292 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
293293 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
294294 return Err(NoSolution);
295295 }
......@@ -330,7 +330,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
330330 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
331331 goal: Goal<'tcx, Self>,
332332 goal_kind: ty::ClosureKind,
333 ) -> Result<Candidate<'tcx>, NoSolution> {
333 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
334334 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
335335 return Err(NoSolution);
336336 }
......@@ -380,7 +380,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
380380 fn consider_builtin_async_fn_kind_helper_candidate(
381381 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
382382 goal: Goal<'tcx, Self>,
383 ) -> Result<Candidate<'tcx>, NoSolution> {
383 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
384384 let [closure_fn_kind_ty, goal_kind_ty] = **goal.predicate.trait_ref.args else {
385385 bug!();
386386 };
......@@ -407,7 +407,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
407407 fn consider_builtin_tuple_candidate(
408408 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
409409 goal: Goal<'tcx, Self>,
410 ) -> Result<Candidate<'tcx>, NoSolution> {
410 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
411411 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
412412 return Err(NoSolution);
413413 }
......@@ -423,7 +423,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
423423 fn consider_builtin_pointee_candidate(
424424 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
425425 goal: Goal<'tcx, Self>,
426 ) -> Result<Candidate<'tcx>, NoSolution> {
426 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
427427 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
428428 return Err(NoSolution);
429429 }
......@@ -435,7 +435,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
435435 fn consider_builtin_future_candidate(
436436 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
437437 goal: Goal<'tcx, Self>,
438 ) -> Result<Candidate<'tcx>, NoSolution> {
438 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
439439 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
440440 return Err(NoSolution);
441441 }
......@@ -461,7 +461,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
461461 fn consider_builtin_iterator_candidate(
462462 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
463463 goal: Goal<'tcx, Self>,
464 ) -> Result<Candidate<'tcx>, NoSolution> {
464 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
465465 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
466466 return Err(NoSolution);
467467 }
......@@ -487,7 +487,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
487487 fn consider_builtin_fused_iterator_candidate(
488488 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
489489 goal: Goal<'tcx, Self>,
490 ) -> Result<Candidate<'tcx>, NoSolution> {
490 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
491491 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
492492 return Err(NoSolution);
493493 }
......@@ -511,7 +511,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
511511 fn consider_builtin_async_iterator_candidate(
512512 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
513513 goal: Goal<'tcx, Self>,
514 ) -> Result<Candidate<'tcx>, NoSolution> {
514 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
515515 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
516516 return Err(NoSolution);
517517 }
......@@ -537,7 +537,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
537537 fn consider_builtin_coroutine_candidate(
538538 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
539539 goal: Goal<'tcx, Self>,
540 ) -> Result<Candidate<'tcx>, NoSolution> {
540 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
541541 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
542542 return Err(NoSolution);
543543 }
......@@ -569,7 +569,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
569569 fn consider_builtin_discriminant_kind_candidate(
570570 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
571571 goal: Goal<'tcx, Self>,
572 ) -> Result<Candidate<'tcx>, NoSolution> {
572 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
573573 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
574574 return Err(NoSolution);
575575 }
......@@ -582,7 +582,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
582582 fn consider_builtin_async_destruct_candidate(
583583 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
584584 goal: Goal<'tcx, Self>,
585 ) -> Result<Candidate<'tcx>, NoSolution> {
585 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
586586 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
587587 return Err(NoSolution);
588588 }
......@@ -595,7 +595,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
595595 fn consider_builtin_destruct_candidate(
596596 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
597597 goal: Goal<'tcx, Self>,
598 ) -> Result<Candidate<'tcx>, NoSolution> {
598 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
599599 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
600600 return Err(NoSolution);
601601 }
......@@ -611,7 +611,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
611611 fn consider_builtin_transmute_candidate(
612612 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
613613 goal: Goal<'tcx, Self>,
614 ) -> Result<Candidate<'tcx>, NoSolution> {
614 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
615615 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
616616 return Err(NoSolution);
617617 }
......@@ -652,7 +652,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
652652 fn consider_structural_builtin_unsize_candidates(
653653 ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>,
654654 goal: Goal<'tcx, Self>,
655 ) -> Vec<Candidate<'tcx>> {
655 ) -> Vec<Candidate<TyCtxt<'tcx>>> {
656656 if goal.predicate.polarity != ty::PredicatePolarity::Positive {
657657 return vec![];
658658 }
......@@ -738,7 +738,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
738738 a_region: ty::Region<'tcx>,
739739 b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
740740 b_region: ty::Region<'tcx>,
741 ) -> Vec<Candidate<'tcx>> {
741 ) -> Vec<Candidate<TyCtxt<'tcx>>> {
742742 let tcx = self.interner();
743743 let Goal { predicate: (a_ty, _b_ty), .. } = goal;
744744
......@@ -784,7 +784,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
784784 goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
785785 b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
786786 b_region: ty::Region<'tcx>,
787 ) -> Result<Candidate<'tcx>, NoSolution> {
787 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
788788 let tcx = self.interner();
789789 let Goal { predicate: (a_ty, _), .. } = goal;
790790
......@@ -825,7 +825,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
825825 b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
826826 b_region: ty::Region<'tcx>,
827827 upcast_principal: Option<ty::PolyExistentialTraitRef<'tcx>>,
828 ) -> Result<Candidate<'tcx>, NoSolution> {
828 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
829829 let param_env = goal.param_env;
830830
831831 // We may upcast to auto traits that are either explicitly listed in
......@@ -928,7 +928,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
928928 goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
929929 a_elem_ty: Ty<'tcx>,
930930 b_elem_ty: Ty<'tcx>,
931 ) -> Result<Candidate<'tcx>, NoSolution> {
931 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
932932 self.eq(goal.param_env, a_elem_ty, b_elem_ty)?;
933933 self.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
934934 .enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
......@@ -953,7 +953,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
953953 def: ty::AdtDef<'tcx>,
954954 a_args: ty::GenericArgsRef<'tcx>,
955955 b_args: ty::GenericArgsRef<'tcx>,
956 ) -> Result<Candidate<'tcx>, NoSolution> {
956 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
957957 let tcx = self.interner();
958958 let Goal { predicate: (_a_ty, b_ty), .. } = goal;
959959
......@@ -1014,7 +1014,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
10141014 goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
10151015 a_tys: &'tcx ty::List<Ty<'tcx>>,
10161016 b_tys: &'tcx ty::List<Ty<'tcx>>,
1017 ) -> Result<Candidate<'tcx>, NoSolution> {
1017 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
10181018 let tcx = self.interner();
10191019 let Goal { predicate: (_a_ty, b_ty), .. } = goal;
10201020
......@@ -1049,7 +1049,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
10491049 fn disqualify_auto_trait_candidate_due_to_possible_impl(
10501050 &mut self,
10511051 goal: Goal<'tcx, TraitPredicate<'tcx>>,
1052 ) -> Option<Result<Candidate<'tcx>, NoSolution>> {
1052 ) -> Option<Result<Candidate<TyCtxt<'tcx>>, NoSolution>> {
10531053 let self_ty = goal.predicate.self_ty();
10541054 match *self_ty.kind() {
10551055 // Stall int and float vars until they are resolved to a concrete
......@@ -1154,7 +1154,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
11541154 &EvalCtxt<'_, InferCtxt<'tcx>>,
11551155 Ty<'tcx>,
11561156 ) -> Result<Vec<ty::Binder<'tcx, Ty<'tcx>>>, NoSolution>,
1157 ) -> Result<Candidate<'tcx>, NoSolution> {
1157 ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> {
11581158 self.probe_trait_candidate(source).enter(|ecx| {
11591159 ecx.add_goals(
11601160 GoalSource::ImplWhereBound,
compiler/rustc_trait_selection/src/traits/coherence.rs+2-2
......@@ -769,8 +769,8 @@ pub struct UncoveredTyParams<'tcx, T> {
769769/// add "non-blanket" impls without breaking negative reasoning in dependent
770770/// crates. This is the "rebalancing coherence" (RFC 1023) restriction.
771771///
772/// For that, we only a allow crate to perform negative reasoning on
773/// non-local-non-`#[fundamental]` only if there's a local key parameter as per (2).
772/// For that, we only allow a crate to perform negative reasoning on
773/// non-local-non-`#[fundamental]` if there's a local key parameter as per (2).
774774///
775775/// Because we never perform negative reasoning generically (coherence does
776776/// not involve type parameters), this can be interpreted as doing the full
compiler/rustc_type_ir/src/infcx.rs+2
......@@ -72,4 +72,6 @@ pub trait InferCtxtLike: Sized {
7272 fn resolve_vars_if_possible<T>(&self, value: T) -> T
7373 where
7474 T: TypeFoldable<Self::Interner>;
75
76 fn probe<T>(&self, probe: impl FnOnce() -> T) -> T;
7577}
compiler/stable_mir/src/mir/body.rs+10-17
......@@ -637,7 +637,7 @@ pub enum AggregateKind {
637637pub enum Operand {
638638 Copy(Place),
639639 Move(Place),
640 Constant(Constant),
640 Constant(ConstOperand),
641641}
642642
643643#[derive(Clone, Eq, PartialEq)]
......@@ -653,6 +653,13 @@ impl From<Local> for Place {
653653 }
654654}
655655
656#[derive(Clone, Debug, Eq, PartialEq)]
657pub struct ConstOperand {
658 pub span: Span,
659 pub user_ty: Option<UserTypeAnnotationIndex>,
660 pub const_: MirConst,
661}
662
656663/// Debug information pertaining to a user variable.
657664#[derive(Clone, Debug, Eq, PartialEq)]
658665pub struct VarDebugInfo {
......@@ -714,13 +721,6 @@ pub enum VarDebugInfoContents {
714721 Const(ConstOperand),
715722}
716723
717#[derive(Clone, Debug, Eq, PartialEq)]
718pub struct ConstOperand {
719 pub span: Span,
720 pub user_ty: Option<UserTypeAnnotationIndex>,
721 pub const_: MirConst,
722}
723
724724// In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This
725725// is so it can be used for both Places (for which the projection elements are of type
726726// ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements
......@@ -829,13 +829,6 @@ pub type FieldIdx = usize;
829829
830830type UserTypeAnnotationIndex = usize;
831831
832#[derive(Clone, Debug, Eq, PartialEq)]
833pub struct Constant {
834 pub span: Span,
835 pub user_ty: Option<UserTypeAnnotationIndex>,
836 pub literal: MirConst,
837}
838
839832/// The possible branch sites of a [TerminatorKind::SwitchInt].
840833#[derive(Clone, Debug, Eq, PartialEq)]
841834pub struct SwitchTargets {
......@@ -1001,9 +994,9 @@ impl Operand {
1001994 }
1002995}
1003996
1004impl Constant {
997impl ConstOperand {
1005998 pub fn ty(&self) -> Ty {
1006 self.literal.ty()
999 self.const_.ty()
10071000 }
10081001}
10091002
compiler/stable_mir/src/mir/pretty.rs+1-1
......@@ -310,7 +310,7 @@ fn pretty_operand(operand: &Operand) -> String {
310310 Operand::Move(mv) => {
311311 format!("move {:?}", mv)
312312 }
313 Operand::Constant(cnst) => pretty_mir_const(&cnst.literal),
313 Operand::Constant(cnst) => pretty_mir_const(&cnst.const_),
314314 }
315315}
316316
compiler/stable_mir/src/mir/visit.rs+6-6
......@@ -108,8 +108,8 @@ pub trait MirVisitor {
108108 self.super_ty(ty)
109109 }
110110
111 fn visit_constant(&mut self, constant: &Constant, location: Location) {
112 self.super_constant(constant, location)
111 fn visit_const_operand(&mut self, constant: &ConstOperand, location: Location) {
112 self.super_const_operand(constant, location)
113113 }
114114
115115 fn visit_mir_const(&mut self, constant: &MirConst, location: Location) {
......@@ -366,7 +366,7 @@ pub trait MirVisitor {
366366 self.visit_place(place, PlaceContext::NON_MUTATING, location)
367367 }
368368 Operand::Constant(constant) => {
369 self.visit_constant(constant, location);
369 self.visit_const_operand(constant, location);
370370 }
371371 }
372372 }
......@@ -380,10 +380,10 @@ pub trait MirVisitor {
380380 let _ = ty;
381381 }
382382
383 fn super_constant(&mut self, constant: &Constant, location: Location) {
384 let Constant { span, user_ty: _, literal } = constant;
383 fn super_const_operand(&mut self, constant: &ConstOperand, location: Location) {
384 let ConstOperand { span, user_ty: _, const_ } = constant;
385385 self.visit_span(span);
386 self.visit_mir_const(literal, location);
386 self.visit_mir_const(const_, location);
387387 }
388388
389389 fn super_mir_const(&mut self, constant: &MirConst, location: Location) {
library/std/src/sys/pal/windows/c/windows_sys.rs+66-417
......@@ -1,4 +1,4 @@
1// Bindings generated by `windows-bindgen` 0.56.0
1// Bindings generated by `windows-bindgen` 0.57.0
22
33#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
44#[link(name = "advapi32")]
......@@ -841,6 +841,7 @@ extern "system" {
841841pub const ABOVE_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 32768u32;
842842pub type ADDRESS_FAMILY = u16;
843843#[repr(C)]
844#[derive(Clone, Copy)]
844845pub struct ADDRINFOA {
845846 pub ai_flags: i32,
846847 pub ai_family: i32,
......@@ -851,18 +852,13 @@ pub struct ADDRINFOA {
851852 pub ai_addr: *mut SOCKADDR,
852853 pub ai_next: *mut ADDRINFOA,
853854}
854impl Copy for ADDRINFOA {}
855impl Clone for ADDRINFOA {
856 fn clone(&self) -> Self {
857 *self
858 }
859}
860855pub const AF_INET: ADDRESS_FAMILY = 2u16;
861856pub const AF_INET6: ADDRESS_FAMILY = 23u16;
862857pub const AF_UNIX: u16 = 1u16;
863858pub const AF_UNSPEC: ADDRESS_FAMILY = 0u16;
864859pub const ALL_PROCESSOR_GROUPS: u16 = 65535u16;
865860#[repr(C)]
861#[derive(Clone, Copy)]
866862pub union ARM64_NT_NEON128 {
867863 pub Anonymous: ARM64_NT_NEON128_0,
868864 pub D: [f64; 2],
......@@ -870,27 +866,17 @@ pub union ARM64_NT_NEON128 {
870866 pub H: [u16; 8],
871867 pub B: [u8; 16],
872868}
873impl Copy for ARM64_NT_NEON128 {}
874impl Clone for ARM64_NT_NEON128 {
875 fn clone(&self) -> Self {
876 *self
877 }
878}
879869#[repr(C)]
870#[derive(Clone, Copy)]
880871pub struct ARM64_NT_NEON128_0 {
881872 pub Low: u64,
882873 pub High: i64,
883874}
884impl Copy for ARM64_NT_NEON128_0 {}
885impl Clone for ARM64_NT_NEON128_0 {
886 fn clone(&self) -> Self {
887 *self
888 }
889}
890875pub const BELOW_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 16384u32;
891876pub type BOOL = i32;
892877pub type BOOLEAN = u8;
893878#[repr(C)]
879#[derive(Clone, Copy)]
894880pub struct BY_HANDLE_FILE_INFORMATION {
895881 pub dwFileAttributes: u32,
896882 pub ftCreationTime: FILETIME,
......@@ -903,41 +889,26 @@ pub struct BY_HANDLE_FILE_INFORMATION {
903889 pub nFileIndexHigh: u32,
904890 pub nFileIndexLow: u32,
905891}
906impl Copy for BY_HANDLE_FILE_INFORMATION {}
907impl Clone for BY_HANDLE_FILE_INFORMATION {
908 fn clone(&self) -> Self {
909 *self
910 }
911}
912892pub const CALLBACK_CHUNK_FINISHED: LPPROGRESS_ROUTINE_CALLBACK_REASON = 0u32;
913893pub const CALLBACK_STREAM_SWITCH: LPPROGRESS_ROUTINE_CALLBACK_REASON = 1u32;
914894pub type COMPARESTRING_RESULT = i32;
915895#[repr(C)]
896#[derive(Clone, Copy)]
916897pub struct CONDITION_VARIABLE {
917898 pub Ptr: *mut core::ffi::c_void,
918899}
919impl Copy for CONDITION_VARIABLE {}
920impl Clone for CONDITION_VARIABLE {
921 fn clone(&self) -> Self {
922 *self
923 }
924}
925900pub type CONSOLE_MODE = u32;
926901#[repr(C)]
902#[derive(Clone, Copy)]
927903pub struct CONSOLE_READCONSOLE_CONTROL {
928904 pub nLength: u32,
929905 pub nInitialChars: u32,
930906 pub dwCtrlWakeupMask: u32,
931907 pub dwControlKeyState: u32,
932908}
933impl Copy for CONSOLE_READCONSOLE_CONTROL {}
934impl Clone for CONSOLE_READCONSOLE_CONTROL {
935 fn clone(&self) -> Self {
936 *self
937 }
938}
939909#[repr(C)]
940910#[cfg(target_arch = "aarch64")]
911#[derive(Clone, Copy)]
941912pub struct CONTEXT {
942913 pub ContextFlags: CONTEXT_FLAGS,
943914 pub Cpsr: u32,
......@@ -952,30 +923,16 @@ pub struct CONTEXT {
952923 pub Wcr: [u32; 2],
953924 pub Wvr: [u64; 2],
954925}
955#[cfg(target_arch = "aarch64")]
956impl Copy for CONTEXT {}
957#[cfg(target_arch = "aarch64")]
958impl Clone for CONTEXT {
959 fn clone(&self) -> Self {
960 *self
961 }
962}
963926#[repr(C)]
964927#[cfg(target_arch = "aarch64")]
928#[derive(Clone, Copy)]
965929pub union CONTEXT_0 {
966930 pub Anonymous: CONTEXT_0_0,
967931 pub X: [u64; 31],
968932}
969#[cfg(target_arch = "aarch64")]
970impl Copy for CONTEXT_0 {}
971#[cfg(target_arch = "aarch64")]
972impl Clone for CONTEXT_0 {
973 fn clone(&self) -> Self {
974 *self
975 }
976}
977933#[repr(C)]
978934#[cfg(target_arch = "aarch64")]
935#[derive(Clone, Copy)]
979936pub struct CONTEXT_0_0 {
980937 pub X0: u64,
981938 pub X1: u64,
......@@ -1009,16 +966,9 @@ pub struct CONTEXT_0_0 {
1009966 pub Fp: u64,
1010967 pub Lr: u64,
1011968}
1012#[cfg(target_arch = "aarch64")]
1013impl Copy for CONTEXT_0_0 {}
1014#[cfg(target_arch = "aarch64")]
1015impl Clone for CONTEXT_0_0 {
1016 fn clone(&self) -> Self {
1017 *self
1018 }
1019}
1020969#[repr(C)]
1021970#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
971#[derive(Clone, Copy)]
1022972pub struct CONTEXT {
1023973 pub P1Home: u64,
1024974 pub P2Home: u64,
......@@ -1067,30 +1017,16 @@ pub struct CONTEXT {
10671017 pub LastExceptionToRip: u64,
10681018 pub LastExceptionFromRip: u64,
10691019}
1070#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1071impl Copy for CONTEXT {}
1072#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1073impl Clone for CONTEXT {
1074 fn clone(&self) -> Self {
1075 *self
1076 }
1077}
10781020#[repr(C)]
10791021#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1022#[derive(Clone, Copy)]
10801023pub union CONTEXT_0 {
10811024 pub FltSave: XSAVE_FORMAT,
10821025 pub Anonymous: CONTEXT_0_0,
10831026}
1084#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1085impl Copy for CONTEXT_0 {}
1086#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1087impl Clone for CONTEXT_0 {
1088 fn clone(&self) -> Self {
1089 *self
1090 }
1091}
10921027#[repr(C)]
10931028#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1029#[derive(Clone, Copy)]
10941030pub struct CONTEXT_0_0 {
10951031 pub Header: [M128A; 2],
10961032 pub Legacy: [M128A; 8],
......@@ -1111,16 +1047,9 @@ pub struct CONTEXT_0_0 {
11111047 pub Xmm14: M128A,
11121048 pub Xmm15: M128A,
11131049}
1114#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1115impl Copy for CONTEXT_0_0 {}
1116#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
1117impl Clone for CONTEXT_0_0 {
1118 fn clone(&self) -> Self {
1119 *self
1120 }
1121}
11221050#[repr(C)]
11231051#[cfg(target_arch = "x86")]
1052#[derive(Clone, Copy)]
11241053pub struct CONTEXT {
11251054 pub ContextFlags: CONTEXT_FLAGS,
11261055 pub Dr0: u32,
......@@ -1148,14 +1077,6 @@ pub struct CONTEXT {
11481077 pub SegSs: u32,
11491078 pub ExtendedRegisters: [u8; 512],
11501079}
1151#[cfg(target_arch = "x86")]
1152impl Copy for CONTEXT {}
1153#[cfg(target_arch = "x86")]
1154impl Clone for CONTEXT {
1155 fn clone(&self) -> Self {
1156 *self
1157 }
1158}
11591080pub type CONTEXT_FLAGS = u32;
11601081pub const CP_UTF8: u32 = 65001u32;
11611082pub const CREATE_ALWAYS: FILE_CREATION_DISPOSITION = 2u32;
......@@ -3068,6 +2989,7 @@ pub const ERROR_XML_PARSE_ERROR: WIN32_ERROR = 1465u32;
30682989pub type EXCEPTION_DISPOSITION = i32;
30692990pub const EXCEPTION_MAXIMUM_PARAMETERS: u32 = 15u32;
30702991#[repr(C)]
2992#[derive(Clone, Copy)]
30712993pub struct EXCEPTION_RECORD {
30722994 pub ExceptionCode: NTSTATUS,
30732995 pub ExceptionFlags: u32,
......@@ -3076,12 +2998,6 @@ pub struct EXCEPTION_RECORD {
30762998 pub NumberParameters: u32,
30772999 pub ExceptionInformation: [usize; 15],
30783000}
3079impl Copy for EXCEPTION_RECORD {}
3080impl Clone for EXCEPTION_RECORD {
3081 fn clone(&self) -> Self {
3082 *self
3083 }
3084}
30853001pub const EXCEPTION_STACK_OVERFLOW: NTSTATUS = 0xC00000FD_u32 as _;
30863002pub const EXTENDED_STARTUPINFO_PRESENT: PROCESS_CREATION_FLAGS = 524288u32;
30873003pub const E_NOTIMPL: HRESULT = 0x80004001_u32 as _;
......@@ -3095,40 +3011,25 @@ pub const FALSE: BOOL = 0i32;
30953011pub type FARPROC = Option<unsafe extern "system" fn() -> isize>;
30963012pub const FAST_FAIL_FATAL_APP_EXIT: u32 = 7u32;
30973013#[repr(C)]
3014#[derive(Clone, Copy)]
30983015pub struct FD_SET {
30993016 pub fd_count: u32,
31003017 pub fd_array: [SOCKET; 64],
31013018}
3102impl Copy for FD_SET {}
3103impl Clone for FD_SET {
3104 fn clone(&self) -> Self {
3105 *self
3106 }
3107}
31083019#[repr(C)]
3020#[derive(Clone, Copy)]
31093021pub struct FILETIME {
31103022 pub dwLowDateTime: u32,
31113023 pub dwHighDateTime: u32,
31123024}
3113impl Copy for FILETIME {}
3114impl Clone for FILETIME {
3115 fn clone(&self) -> Self {
3116 *self
3117 }
3118}
31193025pub type FILE_ACCESS_RIGHTS = u32;
31203026pub const FILE_ADD_FILE: FILE_ACCESS_RIGHTS = 2u32;
31213027pub const FILE_ADD_SUBDIRECTORY: FILE_ACCESS_RIGHTS = 4u32;
31223028#[repr(C)]
3029#[derive(Clone, Copy)]
31233030pub struct FILE_ALLOCATION_INFO {
31243031 pub AllocationSize: i64,
31253032}
3126impl Copy for FILE_ALLOCATION_INFO {}
3127impl Clone for FILE_ALLOCATION_INFO {
3128 fn clone(&self) -> Self {
3129 *self
3130 }
3131}
31323033pub const FILE_ALL_ACCESS: FILE_ACCESS_RIGHTS = 2032127u32;
31333034pub const FILE_APPEND_DATA: FILE_ACCESS_RIGHTS = 4u32;
31343035pub const FILE_ATTRIBUTE_ARCHIVE: FILE_FLAGS_AND_ATTRIBUTES = 32u32;
......@@ -3151,20 +3052,16 @@ pub const FILE_ATTRIBUTE_REPARSE_POINT: FILE_FLAGS_AND_ATTRIBUTES = 1024u32;
31513052pub const FILE_ATTRIBUTE_SPARSE_FILE: FILE_FLAGS_AND_ATTRIBUTES = 512u32;
31523053pub const FILE_ATTRIBUTE_SYSTEM: FILE_FLAGS_AND_ATTRIBUTES = 4u32;
31533054#[repr(C)]
3055#[derive(Clone, Copy)]
31543056pub struct FILE_ATTRIBUTE_TAG_INFO {
31553057 pub FileAttributes: u32,
31563058 pub ReparseTag: u32,
31573059}
3158impl Copy for FILE_ATTRIBUTE_TAG_INFO {}
3159impl Clone for FILE_ATTRIBUTE_TAG_INFO {
3160 fn clone(&self) -> Self {
3161 *self
3162 }
3163}
31643060pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32;
31653061pub const FILE_ATTRIBUTE_UNPINNED: FILE_FLAGS_AND_ATTRIBUTES = 1048576u32;
31663062pub const FILE_ATTRIBUTE_VIRTUAL: FILE_FLAGS_AND_ATTRIBUTES = 65536u32;
31673063#[repr(C)]
3064#[derive(Clone, Copy)]
31683065pub struct FILE_BASIC_INFO {
31693066 pub CreationTime: i64,
31703067 pub LastAccessTime: i64,
......@@ -3172,12 +3069,6 @@ pub struct FILE_BASIC_INFO {
31723069 pub ChangeTime: i64,
31733070 pub FileAttributes: u32,
31743071}
3175impl Copy for FILE_BASIC_INFO {}
3176impl Clone for FILE_BASIC_INFO {
3177 fn clone(&self) -> Self {
3178 *self
3179 }
3180}
31813072pub const FILE_BEGIN: SET_FILE_POINTER_MOVE_METHOD = 0u32;
31823073pub const FILE_COMPLETE_IF_OPLOCKED: NTCREATEFILE_CREATE_OPTIONS = 256u32;
31833074pub const FILE_CONTAINS_EXTENDED_CREATE_INFORMATION: NTCREATEFILE_CREATE_OPTIONS = 268435456u32;
......@@ -3197,37 +3088,22 @@ pub const FILE_DISPOSITION_FLAG_IGNORE_READONLY_ATTRIBUTE: FILE_DISPOSITION_INFO
31973088pub const FILE_DISPOSITION_FLAG_ON_CLOSE: FILE_DISPOSITION_INFO_EX_FLAGS = 8u32;
31983089pub const FILE_DISPOSITION_FLAG_POSIX_SEMANTICS: FILE_DISPOSITION_INFO_EX_FLAGS = 2u32;
31993090#[repr(C)]
3091#[derive(Clone, Copy)]
32003092pub struct FILE_DISPOSITION_INFO {
32013093 pub DeleteFile: BOOLEAN,
32023094}
3203impl Copy for FILE_DISPOSITION_INFO {}
3204impl Clone for FILE_DISPOSITION_INFO {
3205 fn clone(&self) -> Self {
3206 *self
3207 }
3208}
32093095#[repr(C)]
3096#[derive(Clone, Copy)]
32103097pub struct FILE_DISPOSITION_INFO_EX {
32113098 pub Flags: FILE_DISPOSITION_INFO_EX_FLAGS,
32123099}
3213impl Copy for FILE_DISPOSITION_INFO_EX {}
3214impl Clone for FILE_DISPOSITION_INFO_EX {
3215 fn clone(&self) -> Self {
3216 *self
3217 }
3218}
32193100pub type FILE_DISPOSITION_INFO_EX_FLAGS = u32;
32203101pub const FILE_END: SET_FILE_POINTER_MOVE_METHOD = 2u32;
32213102#[repr(C)]
3103#[derive(Clone, Copy)]
32223104pub struct FILE_END_OF_FILE_INFO {
32233105 pub EndOfFile: i64,
32243106}
3225impl Copy for FILE_END_OF_FILE_INFO {}
3226impl Clone for FILE_END_OF_FILE_INFO {
3227 fn clone(&self) -> Self {
3228 *self
3229 }
3230}
32313107pub const FILE_EXECUTE: FILE_ACCESS_RIGHTS = 32u32;
32323108pub type FILE_FLAGS_AND_ATTRIBUTES = u32;
32333109pub const FILE_FLAG_BACKUP_SEMANTICS: FILE_FLAGS_AND_ATTRIBUTES = 33554432u32;
......@@ -3246,6 +3122,7 @@ pub const FILE_GENERIC_EXECUTE: FILE_ACCESS_RIGHTS = 1179808u32;
32463122pub const FILE_GENERIC_READ: FILE_ACCESS_RIGHTS = 1179785u32;
32473123pub const FILE_GENERIC_WRITE: FILE_ACCESS_RIGHTS = 1179926u32;
32483124#[repr(C)]
3125#[derive(Clone, Copy)]
32493126pub struct FILE_ID_BOTH_DIR_INFO {
32503127 pub NextEntryOffset: u32,
32513128 pub FileIndex: u32,
......@@ -3263,23 +3140,12 @@ pub struct FILE_ID_BOTH_DIR_INFO {
32633140 pub FileId: i64,
32643141 pub FileName: [u16; 1],
32653142}
3266impl Copy for FILE_ID_BOTH_DIR_INFO {}
3267impl Clone for FILE_ID_BOTH_DIR_INFO {
3268 fn clone(&self) -> Self {
3269 *self
3270 }
3271}
32723143pub type FILE_INFO_BY_HANDLE_CLASS = i32;
32733144#[repr(C)]
3145#[derive(Clone, Copy)]
32743146pub struct FILE_IO_PRIORITY_HINT_INFO {
32753147 pub PriorityHint: PRIORITY_HINT,
32763148}
3277impl Copy for FILE_IO_PRIORITY_HINT_INFO {}
3278impl Clone for FILE_IO_PRIORITY_HINT_INFO {
3279 fn clone(&self) -> Self {
3280 *self
3281 }
3282}
32833149pub const FILE_LIST_DIRECTORY: FILE_ACCESS_RIGHTS = 1u32;
32843150pub const FILE_NAME_NORMALIZED: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32;
32853151pub const FILE_NAME_OPENED: GETFINALPATHNAMEBYHANDLE_FLAGS = 8u32;
......@@ -3310,6 +3176,7 @@ pub const FILE_SHARE_NONE: FILE_SHARE_MODE = 0u32;
33103176pub const FILE_SHARE_READ: FILE_SHARE_MODE = 1u32;
33113177pub const FILE_SHARE_WRITE: FILE_SHARE_MODE = 2u32;
33123178#[repr(C)]
3179#[derive(Clone, Copy)]
33133180pub struct FILE_STANDARD_INFO {
33143181 pub AllocationSize: i64,
33153182 pub EndOfFile: i64,
......@@ -3317,12 +3184,6 @@ pub struct FILE_STANDARD_INFO {
33173184 pub DeletePending: BOOLEAN,
33183185 pub Directory: BOOLEAN,
33193186}
3320impl Copy for FILE_STANDARD_INFO {}
3321impl Clone for FILE_STANDARD_INFO {
3322 fn clone(&self) -> Self {
3323 *self
3324 }
3325}
33263187pub const FILE_SUPERSEDE: NTCREATEFILE_CREATE_DISPOSITION = 0u32;
33273188pub const FILE_SYNCHRONOUS_IO_ALERT: NTCREATEFILE_CREATE_OPTIONS = 16u32;
33283189pub const FILE_SYNCHRONOUS_IO_NONALERT: NTCREATEFILE_CREATE_OPTIONS = 32u32;
......@@ -3340,6 +3201,7 @@ pub const FILE_WRITE_THROUGH: NTCREATEFILE_CREATE_OPTIONS = 2u32;
33403201pub const FIONBIO: i32 = -2147195266i32;
33413202#[repr(C)]
33423203#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
3204#[derive(Clone, Copy)]
33433205pub struct FLOATING_SAVE_AREA {
33443206 pub ControlWord: u32,
33453207 pub StatusWord: u32,
......@@ -3351,16 +3213,9 @@ pub struct FLOATING_SAVE_AREA {
33513213 pub RegisterArea: [u8; 80],
33523214 pub Cr0NpxState: u32,
33533215}
3354#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
3355impl Copy for FLOATING_SAVE_AREA {}
3356#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
3357impl Clone for FLOATING_SAVE_AREA {
3358 fn clone(&self) -> Self {
3359 *self
3360 }
3361}
33623216#[repr(C)]
33633217#[cfg(target_arch = "x86")]
3218#[derive(Clone, Copy)]
33643219pub struct FLOATING_SAVE_AREA {
33653220 pub ControlWord: u32,
33663221 pub StatusWord: u32,
......@@ -3372,14 +3227,6 @@ pub struct FLOATING_SAVE_AREA {
33723227 pub RegisterArea: [u8; 80],
33733228 pub Spare0: u32,
33743229}
3375#[cfg(target_arch = "x86")]
3376impl Copy for FLOATING_SAVE_AREA {}
3377#[cfg(target_arch = "x86")]
3378impl Clone for FLOATING_SAVE_AREA {
3379 fn clone(&self) -> Self {
3380 *self
3381 }
3382}
33833230pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: FORMAT_MESSAGE_OPTIONS = 256u32;
33843231pub const FORMAT_MESSAGE_ARGUMENT_ARRAY: FORMAT_MESSAGE_OPTIONS = 8192u32;
33853232pub const FORMAT_MESSAGE_FROM_HMODULE: FORMAT_MESSAGE_OPTIONS = 2048u32;
......@@ -3422,18 +3269,13 @@ pub const GENERIC_READ: GENERIC_ACCESS_RIGHTS = 2147483648u32;
34223269pub const GENERIC_WRITE: GENERIC_ACCESS_RIGHTS = 1073741824u32;
34233270pub type GETFINALPATHNAMEBYHANDLE_FLAGS = u32;
34243271#[repr(C)]
3272#[derive(Clone, Copy)]
34253273pub struct GUID {
34263274 pub data1: u32,
34273275 pub data2: u16,
34283276 pub data3: u16,
34293277 pub data4: [u8; 8],
34303278}
3431impl Copy for GUID {}
3432impl Clone for GUID {
3433 fn clone(&self) -> Self {
3434 *self
3435 }
3436}
34373279impl GUID {
34383280 pub const fn from_u128(uuid: u128) -> Self {
34393281 Self {
......@@ -3454,112 +3296,67 @@ pub type HMODULE = *mut core::ffi::c_void;
34543296pub type HRESULT = i32;
34553297pub const IDLE_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 64u32;
34563298#[repr(C)]
3299#[derive(Clone, Copy)]
34573300pub struct IN6_ADDR {
34583301 pub u: IN6_ADDR_0,
34593302}
3460impl Copy for IN6_ADDR {}
3461impl Clone for IN6_ADDR {
3462 fn clone(&self) -> Self {
3463 *self
3464 }
3465}
34663303#[repr(C)]
3304#[derive(Clone, Copy)]
34673305pub union IN6_ADDR_0 {
34683306 pub Byte: [u8; 16],
34693307 pub Word: [u16; 8],
34703308}
3471impl Copy for IN6_ADDR_0 {}
3472impl Clone for IN6_ADDR_0 {
3473 fn clone(&self) -> Self {
3474 *self
3475 }
3476}
34773309pub const INFINITE: u32 = 4294967295u32;
34783310pub const INHERIT_CALLER_PRIORITY: PROCESS_CREATION_FLAGS = 131072u32;
34793311pub const INHERIT_PARENT_AFFINITY: PROCESS_CREATION_FLAGS = 65536u32;
34803312#[repr(C)]
3313#[derive(Clone, Copy)]
34813314pub union INIT_ONCE {
34823315 pub Ptr: *mut core::ffi::c_void,
34833316}
3484impl Copy for INIT_ONCE {}
3485impl Clone for INIT_ONCE {
3486 fn clone(&self) -> Self {
3487 *self
3488 }
3489}
34903317pub const INIT_ONCE_INIT_FAILED: u32 = 4u32;
34913318pub const INVALID_FILE_ATTRIBUTES: u32 = 4294967295u32;
34923319pub const INVALID_SOCKET: SOCKET = -1i32 as _;
34933320#[repr(C)]
3321#[derive(Clone, Copy)]
34943322pub struct IN_ADDR {
34953323 pub S_un: IN_ADDR_0,
34963324}
3497impl Copy for IN_ADDR {}
3498impl Clone for IN_ADDR {
3499 fn clone(&self) -> Self {
3500 *self
3501 }
3502}
35033325#[repr(C)]
3326#[derive(Clone, Copy)]
35043327pub union IN_ADDR_0 {
35053328 pub S_un_b: IN_ADDR_0_0,
35063329 pub S_un_w: IN_ADDR_0_1,
35073330 pub S_addr: u32,
35083331}
3509impl Copy for IN_ADDR_0 {}
3510impl Clone for IN_ADDR_0 {
3511 fn clone(&self) -> Self {
3512 *self
3513 }
3514}
35153332#[repr(C)]
3333#[derive(Clone, Copy)]
35163334pub struct IN_ADDR_0_0 {
35173335 pub s_b1: u8,
35183336 pub s_b2: u8,
35193337 pub s_b3: u8,
35203338 pub s_b4: u8,
35213339}
3522impl Copy for IN_ADDR_0_0 {}
3523impl Clone for IN_ADDR_0_0 {
3524 fn clone(&self) -> Self {
3525 *self
3526 }
3527}
35283340#[repr(C)]
3341#[derive(Clone, Copy)]
35293342pub struct IN_ADDR_0_1 {
35303343 pub s_w1: u16,
35313344 pub s_w2: u16,
35323345}
3533impl Copy for IN_ADDR_0_1 {}
3534impl Clone for IN_ADDR_0_1 {
3535 fn clone(&self) -> Self {
3536 *self
3537 }
3538}
35393346pub const IO_REPARSE_TAG_MOUNT_POINT: u32 = 2684354563u32;
35403347pub const IO_REPARSE_TAG_SYMLINK: u32 = 2684354572u32;
35413348#[repr(C)]
3349#[derive(Clone, Copy)]
35423350pub struct IO_STATUS_BLOCK {
35433351 pub Anonymous: IO_STATUS_BLOCK_0,
35443352 pub Information: usize,
35453353}
3546impl Copy for IO_STATUS_BLOCK {}
3547impl Clone for IO_STATUS_BLOCK {
3548 fn clone(&self) -> Self {
3549 *self
3550 }
3551}
35523354#[repr(C)]
3355#[derive(Clone, Copy)]
35533356pub union IO_STATUS_BLOCK_0 {
35543357 pub Status: NTSTATUS,
35553358 pub Pointer: *mut core::ffi::c_void,
35563359}
3557impl Copy for IO_STATUS_BLOCK_0 {}
3558impl Clone for IO_STATUS_BLOCK_0 {
3559 fn clone(&self) -> Self {
3560 *self
3561 }
3562}
35633360pub type IPPROTO = i32;
35643361pub const IPPROTO_AH: IPPROTO = 51i32;
35653362pub const IPPROTO_CBT: IPPROTO = 7i32;
......@@ -3601,45 +3398,30 @@ pub const IPPROTO_UDP: IPPROTO = 17i32;
36013398pub const IPV6_ADD_MEMBERSHIP: i32 = 12i32;
36023399pub const IPV6_DROP_MEMBERSHIP: i32 = 13i32;
36033400#[repr(C)]
3401#[derive(Clone, Copy)]
36043402pub struct IPV6_MREQ {
36053403 pub ipv6mr_multiaddr: IN6_ADDR,
36063404 pub ipv6mr_interface: u32,
36073405}
3608impl Copy for IPV6_MREQ {}
3609impl Clone for IPV6_MREQ {
3610 fn clone(&self) -> Self {
3611 *self
3612 }
3613}
36143406pub const IPV6_MULTICAST_LOOP: i32 = 11i32;
36153407pub const IPV6_V6ONLY: i32 = 27i32;
36163408pub const IP_ADD_MEMBERSHIP: i32 = 12i32;
36173409pub const IP_DROP_MEMBERSHIP: i32 = 13i32;
36183410#[repr(C)]
3411#[derive(Clone, Copy)]
36193412pub struct IP_MREQ {
36203413 pub imr_multiaddr: IN_ADDR,
36213414 pub imr_interface: IN_ADDR,
36223415}
3623impl Copy for IP_MREQ {}
3624impl Clone for IP_MREQ {
3625 fn clone(&self) -> Self {
3626 *self
3627 }
3628}
36293416pub const IP_MULTICAST_LOOP: i32 = 11i32;
36303417pub const IP_MULTICAST_TTL: i32 = 10i32;
36313418pub const IP_TTL: i32 = 4i32;
36323419#[repr(C)]
3420#[derive(Clone, Copy)]
36333421pub struct LINGER {
36343422 pub l_onoff: u16,
36353423 pub l_linger: u16,
36363424}
3637impl Copy for LINGER {}
3638impl Clone for LINGER {
3639 fn clone(&self) -> Self {
3640 *self
3641 }
3642}
36433425pub type LPOVERLAPPED_COMPLETION_ROUTINE = Option<
36443426 unsafe extern "system" fn(
36453427 dwerrorcode: u32,
......@@ -3673,16 +3455,11 @@ pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = Option<
36733455 ),
36743456>;
36753457#[repr(C)]
3458#[derive(Clone, Copy)]
36763459pub struct M128A {
36773460 pub Low: u64,
36783461 pub High: i64,
36793462}
3680impl Copy for M128A {}
3681impl Clone for M128A {
3682 fn clone(&self) -> Self {
3683 *self
3684 }
3685}
36863463pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: u32 = 16384u32;
36873464pub const MAX_PATH: u32 = 260u32;
36883465pub const MB_COMPOSITE: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 2u32;
......@@ -3710,6 +3487,7 @@ pub type NTCREATEFILE_CREATE_DISPOSITION = u32;
37103487pub type NTCREATEFILE_CREATE_OPTIONS = u32;
37113488pub type NTSTATUS = i32;
37123489#[repr(C)]
3490#[derive(Clone, Copy)]
37133491pub struct OBJECT_ATTRIBUTES {
37143492 pub Length: u32,
37153493 pub RootDirectory: HANDLE,
......@@ -3718,50 +3496,29 @@ pub struct OBJECT_ATTRIBUTES {
37183496 pub SecurityDescriptor: *const core::ffi::c_void,
37193497 pub SecurityQualityOfService: *const core::ffi::c_void,
37203498}
3721impl Copy for OBJECT_ATTRIBUTES {}
3722impl Clone for OBJECT_ATTRIBUTES {
3723 fn clone(&self) -> Self {
3724 *self
3725 }
3726}
37273499pub const OBJ_DONT_REPARSE: i32 = 4096i32;
37283500pub const OPEN_ALWAYS: FILE_CREATION_DISPOSITION = 4u32;
37293501pub const OPEN_EXISTING: FILE_CREATION_DISPOSITION = 3u32;
37303502#[repr(C)]
3503#[derive(Clone, Copy)]
37313504pub struct OVERLAPPED {
37323505 pub Internal: usize,
37333506 pub InternalHigh: usize,
37343507 pub Anonymous: OVERLAPPED_0,
37353508 pub hEvent: HANDLE,
37363509}
3737impl Copy for OVERLAPPED {}
3738impl Clone for OVERLAPPED {
3739 fn clone(&self) -> Self {
3740 *self
3741 }
3742}
37433510#[repr(C)]
3511#[derive(Clone, Copy)]
37443512pub union OVERLAPPED_0 {
37453513 pub Anonymous: OVERLAPPED_0_0,
37463514 pub Pointer: *mut core::ffi::c_void,
37473515}
3748impl Copy for OVERLAPPED_0 {}
3749impl Clone for OVERLAPPED_0 {
3750 fn clone(&self) -> Self {
3751 *self
3752 }
3753}
37543516#[repr(C)]
3517#[derive(Clone, Copy)]
37553518pub struct OVERLAPPED_0_0 {
37563519 pub Offset: u32,
37573520 pub OffsetHigh: u32,
37583521}
3759impl Copy for OVERLAPPED_0_0 {}
3760impl Clone for OVERLAPPED_0_0 {
3761 fn clone(&self) -> Self {
3762 *self
3763 }
3764}
37653522pub type PCSTR = *const u8;
37663523pub type PCWSTR = *const u16;
37673524pub type PIO_APC_ROUTINE = Option<
......@@ -3788,18 +3545,13 @@ pub type PRIORITY_HINT = i32;
37883545pub type PROCESSOR_ARCHITECTURE = u16;
37893546pub type PROCESS_CREATION_FLAGS = u32;
37903547#[repr(C)]
3548#[derive(Clone, Copy)]
37913549pub struct PROCESS_INFORMATION {
37923550 pub hProcess: HANDLE,
37933551 pub hThread: HANDLE,
37943552 pub dwProcessId: u32,
37953553 pub dwThreadId: u32,
37963554}
3797impl Copy for PROCESS_INFORMATION {}
3798impl Clone for PROCESS_INFORMATION {
3799 fn clone(&self) -> Self {
3800 *self
3801 }
3802}
38033555pub const PROCESS_MODE_BACKGROUND_BEGIN: PROCESS_CREATION_FLAGS = 1048576u32;
38043556pub const PROCESS_MODE_BACKGROUND_END: PROCESS_CREATION_FLAGS = 2097152u32;
38053557pub const PROFILE_KERNEL: PROCESS_CREATION_FLAGS = 536870912u32;
......@@ -3822,17 +3574,12 @@ pub const SD_RECEIVE: WINSOCK_SHUTDOWN_HOW = 0i32;
38223574pub const SD_SEND: WINSOCK_SHUTDOWN_HOW = 1i32;
38233575pub const SECURITY_ANONYMOUS: FILE_FLAGS_AND_ATTRIBUTES = 0u32;
38243576#[repr(C)]
3577#[derive(Clone, Copy)]
38253578pub struct SECURITY_ATTRIBUTES {
38263579 pub nLength: u32,
38273580 pub lpSecurityDescriptor: *mut core::ffi::c_void,
38283581 pub bInheritHandle: BOOL,
38293582}
3830impl Copy for SECURITY_ATTRIBUTES {}
3831impl Clone for SECURITY_ATTRIBUTES {
3832 fn clone(&self) -> Self {
3833 *self
3834 }
3835}
38363583pub const SECURITY_CONTEXT_TRACKING: FILE_FLAGS_AND_ATTRIBUTES = 262144u32;
38373584pub const SECURITY_DELEGATION: FILE_FLAGS_AND_ATTRIBUTES = 196608u32;
38383585pub const SECURITY_EFFECTIVE_ONLY: FILE_FLAGS_AND_ATTRIBUTES = 524288u32;
......@@ -3843,27 +3590,17 @@ pub const SECURITY_VALID_SQOS_FLAGS: FILE_FLAGS_AND_ATTRIBUTES = 2031616u32;
38433590pub type SEND_RECV_FLAGS = i32;
38443591pub type SET_FILE_POINTER_MOVE_METHOD = u32;
38453592#[repr(C)]
3593#[derive(Clone, Copy)]
38463594pub struct SOCKADDR {
38473595 pub sa_family: ADDRESS_FAMILY,
38483596 pub sa_data: [i8; 14],
38493597}
3850impl Copy for SOCKADDR {}
3851impl Clone for SOCKADDR {
3852 fn clone(&self) -> Self {
3853 *self
3854 }
3855}
38563598#[repr(C)]
3599#[derive(Clone, Copy)]
38573600pub struct SOCKADDR_UN {
38583601 pub sun_family: ADDRESS_FAMILY,
38593602 pub sun_path: [i8; 108],
38603603}
3861impl Copy for SOCKADDR_UN {}
3862impl Clone for SOCKADDR_UN {
3863 fn clone(&self) -> Self {
3864 *self
3865 }
3866}
38673604pub type SOCKET = usize;
38683605pub const SOCKET_ERROR: i32 = -1i32;
38693606pub const SOCK_DGRAM: WINSOCK_SOCKET_TYPE = 2i32;
......@@ -3879,15 +3616,10 @@ pub const SO_RCVTIMEO: i32 = 4102i32;
38793616pub const SO_SNDTIMEO: i32 = 4101i32;
38803617pub const SPECIFIC_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 65535u32;
38813618#[repr(C)]
3619#[derive(Clone, Copy)]
38823620pub struct SRWLOCK {
38833621 pub Ptr: *mut core::ffi::c_void,
38843622}
3885impl Copy for SRWLOCK {}
3886impl Clone for SRWLOCK {
3887 fn clone(&self) -> Self {
3888 *self
3889 }
3890}
38913623pub const STACK_SIZE_PARAM_IS_A_RESERVATION: THREAD_CREATION_FLAGS = 65536u32;
38923624pub const STANDARD_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 2031616u32;
38933625pub const STANDARD_RIGHTS_EXECUTE: FILE_ACCESS_RIGHTS = 131072u32;
......@@ -3909,17 +3641,13 @@ pub const STARTF_USESHOWWINDOW: STARTUPINFOW_FLAGS = 1u32;
39093641pub const STARTF_USESIZE: STARTUPINFOW_FLAGS = 2u32;
39103642pub const STARTF_USESTDHANDLES: STARTUPINFOW_FLAGS = 256u32;
39113643#[repr(C)]
3644#[derive(Clone, Copy)]
39123645pub struct STARTUPINFOEXW {
39133646 pub StartupInfo: STARTUPINFOW,
39143647 pub lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST,
39153648}
3916impl Copy for STARTUPINFOEXW {}
3917impl Clone for STARTUPINFOEXW {
3918 fn clone(&self) -> Self {
3919 *self
3920 }
3921}
39223649#[repr(C)]
3650#[derive(Clone, Copy)]
39233651pub struct STARTUPINFOW {
39243652 pub cb: u32,
39253653 pub lpReserved: PWSTR,
......@@ -3940,12 +3668,6 @@ pub struct STARTUPINFOW {
39403668 pub hStdOutput: HANDLE,
39413669 pub hStdError: HANDLE,
39423670}
3943impl Copy for STARTUPINFOW {}
3944impl Clone for STARTUPINFOW {
3945 fn clone(&self) -> Self {
3946 *self
3947 }
3948}
39493671pub type STARTUPINFOW_FLAGS = u32;
39503672pub const STATUS_DELETE_PENDING: NTSTATUS = 0xC0000056_u32 as _;
39513673pub const STATUS_END_OF_FILE: NTSTATUS = 0xC0000011_u32 as _;
......@@ -3964,6 +3686,7 @@ pub const SYMLINK_FLAG_RELATIVE: u32 = 1u32;
39643686pub type SYNCHRONIZATION_ACCESS_RIGHTS = u32;
39653687pub const SYNCHRONIZE: FILE_ACCESS_RIGHTS = 1048576u32;
39663688#[repr(C)]
3689#[derive(Clone, Copy)]
39673690pub struct SYSTEM_INFO {
39683691 pub Anonymous: SYSTEM_INFO_0,
39693692 pub dwPageSize: u32,
......@@ -3976,34 +3699,18 @@ pub struct SYSTEM_INFO {
39763699 pub wProcessorLevel: u16,
39773700 pub wProcessorRevision: u16,
39783701}
3979impl Copy for SYSTEM_INFO {}
3980impl Clone for SYSTEM_INFO {
3981 fn clone(&self) -> Self {
3982 *self
3983 }
3984}
39853702#[repr(C)]
3703#[derive(Clone, Copy)]
39863704pub union SYSTEM_INFO_0 {
39873705 pub dwOemId: u32,
39883706 pub Anonymous: SYSTEM_INFO_0_0,
39893707}
3990impl Copy for SYSTEM_INFO_0 {}
3991impl Clone for SYSTEM_INFO_0 {
3992 fn clone(&self) -> Self {
3993 *self
3994 }
3995}
39963708#[repr(C)]
3709#[derive(Clone, Copy)]
39973710pub struct SYSTEM_INFO_0_0 {
39983711 pub wProcessorArchitecture: PROCESSOR_ARCHITECTURE,
39993712 pub wReserved: u16,
40003713}
4001impl Copy for SYSTEM_INFO_0_0 {}
4002impl Clone for SYSTEM_INFO_0_0 {
4003 fn clone(&self) -> Self {
4004 *self
4005 }
4006}
40073714pub const TCP_NODELAY: i32 = 1i32;
40083715pub const THREAD_CREATE_RUN_IMMEDIATELY: THREAD_CREATION_FLAGS = 0u32;
40093716pub const THREAD_CREATE_SUSPENDED: THREAD_CREATION_FLAGS = 4u32;
......@@ -4011,16 +3718,11 @@ pub type THREAD_CREATION_FLAGS = u32;
40113718pub const TIMER_ALL_ACCESS: SYNCHRONIZATION_ACCESS_RIGHTS = 2031619u32;
40123719pub const TIMER_MODIFY_STATE: SYNCHRONIZATION_ACCESS_RIGHTS = 2u32;
40133720#[repr(C)]
3721#[derive(Clone, Copy)]
40143722pub struct TIMEVAL {
40153723 pub tv_sec: i32,
40163724 pub tv_usec: i32,
40173725}
4018impl Copy for TIMEVAL {}
4019impl Clone for TIMEVAL {
4020 fn clone(&self) -> Self {
4021 *self
4022 }
4023}
40243726pub const TLS_OUT_OF_INDEXES: u32 = 4294967295u32;
40253727pub type TOKEN_ACCESS_MASK = u32;
40263728pub const TOKEN_ACCESS_PSEUDO_HANDLE: TOKEN_ACCESS_MASK = 24u32;
......@@ -4047,17 +3749,12 @@ pub const TOKEN_WRITE_OWNER: TOKEN_ACCESS_MASK = 524288u32;
40473749pub const TRUE: BOOL = 1i32;
40483750pub const TRUNCATE_EXISTING: FILE_CREATION_DISPOSITION = 5u32;
40493751#[repr(C)]
3752#[derive(Clone, Copy)]
40503753pub struct UNICODE_STRING {
40513754 pub Length: u16,
40523755 pub MaximumLength: u16,
40533756 pub Buffer: PWSTR,
40543757}
4055impl Copy for UNICODE_STRING {}
4056impl Clone for UNICODE_STRING {
4057 fn clone(&self) -> Self {
4058 *self
4059 }
4060}
40613758pub const VOLUME_NAME_DOS: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32;
40623759pub const VOLUME_NAME_GUID: GETFINALPATHNAMEBYHANDLE_FLAGS = 1u32;
40633760pub const VOLUME_NAME_NONE: GETFINALPATHNAMEBYHANDLE_FLAGS = 4u32;
......@@ -4071,6 +3768,7 @@ pub const WAIT_TIMEOUT: WAIT_EVENT = 258u32;
40713768pub const WC_ERR_INVALID_CHARS: u32 = 128u32;
40723769pub type WIN32_ERROR = u32;
40733770#[repr(C)]
3771#[derive(Clone, Copy)]
40743772pub struct WIN32_FIND_DATAW {
40753773 pub dwFileAttributes: u32,
40763774 pub ftCreationTime: FILETIME,
......@@ -4083,30 +3781,20 @@ pub struct WIN32_FIND_DATAW {
40833781 pub cFileName: [u16; 260],
40843782 pub cAlternateFileName: [u16; 14],
40853783}
4086impl Copy for WIN32_FIND_DATAW {}
4087impl Clone for WIN32_FIND_DATAW {
4088 fn clone(&self) -> Self {
4089 *self
4090 }
4091}
40923784pub type WINSOCK_SHUTDOWN_HOW = i32;
40933785pub type WINSOCK_SOCKET_TYPE = i32;
40943786pub const WRITE_DAC: FILE_ACCESS_RIGHTS = 262144u32;
40953787pub const WRITE_OWNER: FILE_ACCESS_RIGHTS = 524288u32;
40963788pub const WSABASEERR: WSA_ERROR = 10000i32;
40973789#[repr(C)]
3790#[derive(Clone, Copy)]
40983791pub struct WSABUF {
40993792 pub len: u32,
41003793 pub buf: PSTR,
41013794}
4102impl Copy for WSABUF {}
4103impl Clone for WSABUF {
4104 fn clone(&self) -> Self {
4105 *self
4106 }
4107}
41083795#[repr(C)]
41093796#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
3797#[derive(Clone, Copy)]
41103798pub struct WSADATA {
41113799 pub wVersion: u16,
41123800 pub wHighVersion: u16,
......@@ -4116,16 +3804,9 @@ pub struct WSADATA {
41163804 pub szDescription: [i8; 257],
41173805 pub szSystemStatus: [i8; 129],
41183806}
4119#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
4120impl Copy for WSADATA {}
4121#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
4122impl Clone for WSADATA {
4123 fn clone(&self) -> Self {
4124 *self
4125 }
4126}
41273807#[repr(C)]
41283808#[cfg(target_arch = "x86")]
3809#[derive(Clone, Copy)]
41293810pub struct WSADATA {
41303811 pub wVersion: u16,
41313812 pub wHighVersion: u16,
......@@ -4135,14 +3816,6 @@ pub struct WSADATA {
41353816 pub iMaxUdpDg: u16,
41363817 pub lpVendorInfo: PSTR,
41373818}
4138#[cfg(target_arch = "x86")]
4139impl Copy for WSADATA {}
4140#[cfg(target_arch = "x86")]
4141impl Clone for WSADATA {
4142 fn clone(&self) -> Self {
4143 *self
4144 }
4145}
41463819pub const WSAEACCES: WSA_ERROR = 10013i32;
41473820pub const WSAEADDRINUSE: WSA_ERROR = 10048i32;
41483821pub const WSAEADDRNOTAVAIL: WSA_ERROR = 10049i32;
......@@ -4198,17 +3871,13 @@ pub const WSANOTINITIALISED: WSA_ERROR = 10093i32;
41983871pub const WSANO_DATA: WSA_ERROR = 11004i32;
41993872pub const WSANO_RECOVERY: WSA_ERROR = 11003i32;
42003873#[repr(C)]
3874#[derive(Clone, Copy)]
42013875pub struct WSAPROTOCOLCHAIN {
42023876 pub ChainLen: i32,
42033877 pub ChainEntries: [u32; 7],
42043878}
4205impl Copy for WSAPROTOCOLCHAIN {}
4206impl Clone for WSAPROTOCOLCHAIN {
4207 fn clone(&self) -> Self {
4208 *self
4209 }
4210}
42113879#[repr(C)]
3880#[derive(Clone, Copy)]
42123881pub struct WSAPROTOCOL_INFOW {
42133882 pub dwServiceFlags1: u32,
42143883 pub dwServiceFlags2: u32,
......@@ -4231,12 +3900,6 @@ pub struct WSAPROTOCOL_INFOW {
42313900 pub dwProviderReserved: u32,
42323901 pub szProtocol: [u16; 256],
42333902}
4234impl Copy for WSAPROTOCOL_INFOW {}
4235impl Clone for WSAPROTOCOL_INFOW {
4236 fn clone(&self) -> Self {
4237 *self
4238 }
4239}
42403903pub const WSASERVICE_NOT_FOUND: WSA_ERROR = 10108i32;
42413904pub const WSASYSCALLFAILURE: WSA_ERROR = 10107i32;
42423905pub const WSASYSNOTREADY: WSA_ERROR = 10091i32;
......@@ -4287,6 +3950,7 @@ pub const WSA_WAIT_EVENT_0: WSA_ERROR = 0i32;
42873950pub const WSA_WAIT_IO_COMPLETION: WSA_ERROR = 192i32;
42883951#[repr(C)]
42893952#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
3953#[derive(Clone, Copy)]
42903954pub struct XSAVE_FORMAT {
42913955 pub ControlWord: u16,
42923956 pub StatusWord: u16,
......@@ -4305,16 +3969,9 @@ pub struct XSAVE_FORMAT {
43053969 pub XmmRegisters: [M128A; 16],
43063970 pub Reserved4: [u8; 96],
43073971}
4308#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
4309impl Copy for XSAVE_FORMAT {}
4310#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
4311impl Clone for XSAVE_FORMAT {
4312 fn clone(&self) -> Self {
4313 *self
4314 }
4315}
43163972#[repr(C)]
43173973#[cfg(target_arch = "x86")]
3974#[derive(Clone, Copy)]
43183975pub struct XSAVE_FORMAT {
43193976 pub ControlWord: u16,
43203977 pub StatusWord: u16,
......@@ -4333,12 +3990,4 @@ pub struct XSAVE_FORMAT {
43333990 pub XmmRegisters: [M128A; 8],
43343991 pub Reserved4: [u8; 224],
43353992}
4336#[cfg(target_arch = "x86")]
4337impl Copy for XSAVE_FORMAT {}
4338#[cfg(target_arch = "x86")]
4339impl Clone for XSAVE_FORMAT {
4340 fn clone(&self) -> Self {
4341 *self
4342 }
4343}
43443993// ignore-tidy-filelength
src/tools/generate-windows-sys/Cargo.toml+1-1
......@@ -4,4 +4,4 @@ version = "0.1.0"
44edition = "2021"
55
66[dependencies.windows-bindgen]
7version = "0.56.0"
7version = "0.57.0"
src/tools/tidy/src/allowed_run_make_makefiles.txt-2
......@@ -11,7 +11,6 @@ run-make/c-unwind-abi-catch-panic/Makefile
1111run-make/cat-and-grep-sanity-check/Makefile
1212run-make/cdylib-dylib-linkage/Makefile
1313run-make/cdylib-fewer-symbols/Makefile
14run-make/codegen-options-parsing/Makefile
1514run-make/comment-section/Makefile
1615run-make/compiler-lookup-paths-2/Makefile
1716run-make/compiler-lookup-paths/Makefile
......@@ -25,7 +24,6 @@ run-make/cross-lang-lto-upstream-rlibs/Makefile
2524run-make/cross-lang-lto/Makefile
2625run-make/debug-assertions/Makefile
2726run-make/debugger-visualizer-dep-info/Makefile
28run-make/dep-graph/Makefile
2927run-make/dep-info-doesnt-run-much/Makefile
3028run-make/dep-info-spaces/Makefile
3129run-make/dep-info/Makefile
src/tools/tidy/src/issues.txt-3
......@@ -2760,7 +2760,6 @@ ui/lint/issue-1866.rs
27602760ui/lint/issue-19102.rs
27612761ui/lint/issue-20343.rs
27622762ui/lint/issue-30302.rs
2763ui/lint/issue-31924-non-snake-ffi.rs
27642763ui/lint/issue-34798.rs
27652764ui/lint/issue-35075.rs
27662765ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs
......@@ -2769,7 +2768,6 @@ ui/lint/issue-54099-camel-case-underscore-types.rs
27692768ui/lint/issue-57410-1.rs
27702769ui/lint/issue-57410.rs
27712770ui/lint/issue-63364.rs
2772ui/lint/issue-66362-no-snake-case-warning-for-field-puns.rs
27732771ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
27742772ui/lint/issue-79546-fuel-ice.rs
27752773ui/lint/issue-79744.rs
......@@ -2777,7 +2775,6 @@ ui/lint/issue-80988.rs
27772775ui/lint/issue-81218.rs
27782776ui/lint/issue-83477.rs
27792777ui/lint/issue-87274-paren-parent.rs
2780ui/lint/issue-89469.rs
27812778ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs
27822779ui/lint/issue-97094.rs
27832780ui/lint/issue-99387.rs
tests/run-make/codegen-options-parsing/Makefile deleted-34
......@@ -1,34 +0,0 @@
1# This test intentionally feeds invalid inputs to codegen and checks if the error message outputs contain specific helpful indications.
2
3# ignore-cross-compile
4include ../tools.mk
5
6all:
7 #Option taking a number
8 $(RUSTC) -C codegen-units dummy.rs 2>&1 | \
9 $(CGREP) 'codegen option `codegen-units` requires a number'
10 $(RUSTC) -C codegen-units= dummy.rs 2>&1 | \
11 $(CGREP) 'incorrect value `` for codegen option `codegen-units` - a number was expected'
12 $(RUSTC) -C codegen-units=foo dummy.rs 2>&1 | \
13 $(CGREP) 'incorrect value `foo` for codegen option `codegen-units` - a number was expected'
14 $(RUSTC) -C codegen-units=1 dummy.rs
15 #Option taking a string
16 $(RUSTC) -C extra-filename dummy.rs 2>&1 | \
17 $(CGREP) 'codegen option `extra-filename` requires a string'
18 $(RUSTC) -C extra-filename= dummy.rs 2>&1
19 $(RUSTC) -C extra-filename=foo dummy.rs 2>&1
20 #Option taking no argument
21 $(RUSTC) -C lto= dummy.rs 2>&1 | \
22 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
23 $(RUSTC) -C lto=1 dummy.rs 2>&1 | \
24 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
25 $(RUSTC) -C lto=foo dummy.rs 2>&1 | \
26 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
27 $(RUSTC) -C lto dummy.rs
28
29 # Should not link dead code...
30 $(RUSTC) --print link-args dummy.rs 2>&1 | \
31 $(CGREP) -e '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'
32 # ... unless you specifically ask to keep it
33 $(RUSTC) --print link-args -C link-dead-code dummy.rs 2>&1 | \
34 $(CGREP) -ve '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'
tests/run-make/codegen-options-parsing/rmake.rs created+56
......@@ -0,0 +1,56 @@
1// This test intentionally feeds invalid inputs to codegen and checks if the error message outputs
2// contain specific helpful indications.
3
4//@ ignore-cross-compile
5
6use run_make_support::regex::Regex;
7use run_make_support::rustc;
8
9fn main() {
10 // Option taking a number.
11 rustc()
12 .input("dummy.rs")
13 .arg("-Ccodegen-units")
14 .run_fail()
15 .assert_stderr_contains("codegen option `codegen-units` requires a number");
16 rustc().input("dummy.rs").arg("-Ccodegen-units=").run_fail().assert_stderr_contains(
17 "incorrect value `` for codegen option `codegen-units` - a number was expected",
18 );
19 rustc().input("dummy.rs").arg("-Ccodegen-units=foo").run_fail().assert_stderr_contains(
20 "incorrect value `foo` for codegen option `codegen-units` - a number was expected",
21 );
22 rustc().input("dummy.rs").arg("-Ccodegen-units=1").run();
23
24 // Option taking a string.
25 rustc()
26 .input("dummy.rs")
27 .arg("-Cextra-filename")
28 .run_fail()
29 .assert_stderr_contains("codegen option `extra-filename` requires a string");
30 rustc().input("dummy.rs").arg("-Cextra-filename=").run();
31 rustc().input("dummy.rs").arg("-Cextra-filename=foo").run();
32
33 // Option taking no argument.
34 rustc().input("dummy.rs").arg("-Clto=").run_fail().assert_stderr_contains(
35 "codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, \
36 `fat`, or omitted",
37 );
38 rustc().input("dummy.rs").arg("-Clto=1").run_fail().assert_stderr_contains(
39 "codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, \
40 `fat`, or omitted",
41 );
42 rustc().input("dummy.rs").arg("-Clto=foo").run_fail().assert_stderr_contains(
43 "codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, \
44 `fat`, or omitted",
45 );
46 rustc().input("dummy.rs").arg("-Clto").run();
47
48 let regex = Regex::new("--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF").unwrap();
49 // Should not link dead code...
50 let stdout = rustc().input("dummy.rs").print("link-args").run().stdout_utf8();
51 assert!(regex.is_match(&stdout));
52 // ... unless you specifically ask to keep it
53 let stdout =
54 rustc().input("dummy.rs").print("link-args").arg("-Clink-dead-code").run().stdout_utf8();
55 assert!(!regex.is_match(&stdout));
56}
tests/run-make/dep-graph/Makefile deleted-12
......@@ -1,12 +0,0 @@
1include ../tools.mk
2
3# ignore-cross-compile
4
5# Just verify that we successfully run and produce dep graphs when requested.
6
7all:
8 RUST_DEP_GRAPH=$(TMPDIR)/dep-graph $(RUSTC) \
9 -Cincremental=$(TMPDIR)/incr \
10 -Zquery-dep-graph -Zdump-dep-graph foo.rs
11 test -f $(TMPDIR)/dep-graph.txt
12 test -f $(TMPDIR)/dep-graph.dot
tests/run-make/dep-graph/rmake.rs created+18
......@@ -0,0 +1,18 @@
1// Just verify that we successfully run and produce dep graphs when requested.
2
3//@ ignore-cross-compile
4
5use run_make_support::{path, rustc};
6
7fn main() {
8 rustc()
9 .input("foo.rs")
10 .incremental(path("incr"))
11 .arg("-Zquery-dep-graph")
12 .arg("-Zdump-dep-graph")
13 .env("RUST_DEP_GRAPH", path("dep-graph"))
14 .run();
15
16 assert!(path("dep-graph.txt").is_file());
17 assert!(path("dep-graph.dot").is_file());
18}
tests/ui-fulldeps/stable-mir/check_transform.rs+4-4
......@@ -21,7 +21,7 @@ extern crate stable_mir;
2121use rustc_smir::rustc_internal;
2222use stable_mir::mir::alloc::GlobalAlloc;
2323use stable_mir::mir::mono::Instance;
24use stable_mir::mir::{Body, Constant, Operand, Rvalue, StatementKind, TerminatorKind};
24use stable_mir::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind};
2525use stable_mir::ty::{ConstantKind, MirConst};
2626use stable_mir::{CrateDef, CrateItems, ItemKind};
2727use std::convert::TryFrom;
......@@ -72,7 +72,7 @@ fn check_msg(body: &Body, expected: &str) {
7272 .unwrap()
7373 }
7474 };
75 let ConstantKind::Allocated(alloc) = msg_const.literal.kind() else {
75 let ConstantKind::Allocated(alloc) = msg_const.const_.kind() else {
7676 unreachable!()
7777 };
7878 assert_eq!(alloc.provenance.ptrs.len(), 1);
......@@ -96,8 +96,8 @@ fn change_panic_msg(mut body: Body, new_msg: &str) -> Body {
9696 match &mut bb.terminator.kind {
9797 TerminatorKind::Call { args, .. } => {
9898 let new_const = MirConst::from_str(new_msg);
99 args[0] = Operand::Constant(Constant {
100 literal: new_const,
99 args[0] = Operand::Constant(ConstOperand {
100 const_: new_const,
101101 span: bb.terminator.span,
102102 user_ty: None,
103103 });
tests/ui/associated-types/defaults-unsound-62211-1.next.stderr+4-17
......@@ -31,18 +31,6 @@ help: consider further restricting `Self`
3131LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
3232 | +++++++++++++++++++++++++
3333
34error[E0271]: type mismatch resolving `<Self as Deref>::Target == str`
35 --> $DIR/defaults-unsound-62211-1.rs:24:96
36 |
37LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
38 | ^^^^ types differ
39 |
40note: required by a bound in `UncheckedCopy::Output`
41 --> $DIR/defaults-unsound-62211-1.rs:24:31
42 |
43LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
44 | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
45
4634error[E0277]: the trait bound `Self: Deref` is not satisfied
4735 --> $DIR/defaults-unsound-62211-1.rs:24:96
4836 |
......@@ -50,10 +38,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
5038 | ^^^^ the trait `Deref` is not implemented for `Self`
5139 |
5240note: required by a bound in `UncheckedCopy::Output`
53 --> $DIR/defaults-unsound-62211-1.rs:24:25
41 --> $DIR/defaults-unsound-62211-1.rs:24:31
5442 |
5543LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
56 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
44 | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
5745help: consider further restricting `Self`
5846 |
5947LL | trait UncheckedCopy: Sized + Deref {
......@@ -75,7 +63,6 @@ help: consider further restricting `Self`
7563LL | trait UncheckedCopy: Sized + Copy {
7664 | ++++++
7765
78error: aborting due to 5 previous errors
66error: aborting due to 4 previous errors
7967
80Some errors have detailed explanations: E0271, E0277.
81For more information about an error, try `rustc --explain E0271`.
68For more information about this error, try `rustc --explain E0277`.
tests/ui/associated-types/defaults-unsound-62211-1.rs-1
......@@ -26,7 +26,6 @@ trait UncheckedCopy: Sized {
2626 //~| ERROR the trait bound `Self: Deref` is not satisfied
2727 //~| ERROR cannot add-assign `&'static str` to `Self`
2828 //~| ERROR `Self` doesn't implement `std::fmt::Display`
29 //[next]~| ERROR type mismatch resolving `<Self as Deref>::Target == str`
3029
3130 // We said the Output type was Copy, so we can Copy it freely!
3231 fn unchecked_copy(other: &Self::Output) -> Self::Output {
tests/ui/associated-types/defaults-unsound-62211-2.next.stderr+4-17
......@@ -31,18 +31,6 @@ help: consider further restricting `Self`
3131LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
3232 | +++++++++++++++++++++++++
3333
34error[E0271]: type mismatch resolving `<Self as Deref>::Target == str`
35 --> $DIR/defaults-unsound-62211-2.rs:24:96
36 |
37LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
38 | ^^^^ types differ
39 |
40note: required by a bound in `UncheckedCopy::Output`
41 --> $DIR/defaults-unsound-62211-2.rs:24:31
42 |
43LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
44 | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
45
4634error[E0277]: the trait bound `Self: Deref` is not satisfied
4735 --> $DIR/defaults-unsound-62211-2.rs:24:96
4836 |
......@@ -50,10 +38,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
5038 | ^^^^ the trait `Deref` is not implemented for `Self`
5139 |
5240note: required by a bound in `UncheckedCopy::Output`
53 --> $DIR/defaults-unsound-62211-2.rs:24:25
41 --> $DIR/defaults-unsound-62211-2.rs:24:31
5442 |
5543LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
56 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
44 | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
5745help: consider further restricting `Self`
5846 |
5947LL | trait UncheckedCopy: Sized + Deref {
......@@ -75,7 +63,6 @@ help: consider further restricting `Self`
7563LL | trait UncheckedCopy: Sized + Copy {
7664 | ++++++
7765
78error: aborting due to 5 previous errors
66error: aborting due to 4 previous errors
7967
80Some errors have detailed explanations: E0271, E0277.
81For more information about an error, try `rustc --explain E0271`.
68For more information about this error, try `rustc --explain E0277`.
tests/ui/associated-types/defaults-unsound-62211-2.rs-1
......@@ -26,7 +26,6 @@ trait UncheckedCopy: Sized {
2626 //~| ERROR the trait bound `Self: Deref` is not satisfied
2727 //~| ERROR cannot add-assign `&'static str` to `Self`
2828 //~| ERROR `Self` doesn't implement `std::fmt::Display`
29 //[next]~| ERROR type mismatch resolving `<Self as Deref>::Target == str`
3029
3130 // We said the Output type was Copy, so we can Copy it freely!
3231 fn unchecked_copy(other: &Self::Output) -> Self::Output {
tests/ui/associated-types/issue-54108.next.stderr+4-17
......@@ -1,15 +1,3 @@
1error[E0271]: type mismatch resolving `<<T as SubEncoder>::ActualSize as Add>::Output == <T as SubEncoder>::ActualSize`
2 --> $DIR/issue-54108.rs:23:17
3 |
4LL | type Size = <Self as SubEncoder>::ActualSize;
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
6 |
7note: required by a bound in `Encoder::Size`
8 --> $DIR/issue-54108.rs:8:20
9 |
10LL | type Size: Add<Output = Self::Size>;
11 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
12
131error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
142 --> $DIR/issue-54108.rs:23:17
153 |
......@@ -18,16 +6,15 @@ LL | type Size = <Self as SubEncoder>::ActualSize;
186 |
197 = help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
208note: required by a bound in `Encoder::Size`
21 --> $DIR/issue-54108.rs:8:16
9 --> $DIR/issue-54108.rs:8:20
2210 |
2311LL | type Size: Add<Output = Self::Size>;
24 | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
12 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
2513help: consider further restricting the associated type
2614 |
2715LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
2816 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2917
30error: aborting due to 2 previous errors
18error: aborting due to 1 previous error
3119
32Some errors have detailed explanations: E0271, E0277.
33For more information about an error, try `rustc --explain E0271`.
20For more information about this error, try `rustc --explain E0277`.
tests/ui/associated-types/issue-54108.rs-1
......@@ -22,7 +22,6 @@ where
2222{
2323 type Size = <Self as SubEncoder>::ActualSize;
2424 //~^ ERROR: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
25 //[next]~| ERROR type mismatch resolving `<<T as SubEncoder>::ActualSize as Add>::Output == <T as SubEncoder>::ActualSize`
2625
2726 fn foo(&self) -> Self::Size {
2827 self.bar() + self.bar()
tests/ui/lint/issue-31924-non-snake-ffi.rs deleted-15
......@@ -1,15 +0,0 @@
1//@ check-pass
2
3#![deny(non_snake_case)]
4
5#[no_mangle]
6pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
7
8pub struct Foo;
9
10impl Foo {
11 #[no_mangle]
12 pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
13}
14
15fn main() {}
tests/ui/lint/issue-66362-no-snake-case-warning-for-field-puns.rs deleted-29
......@@ -1,29 +0,0 @@
1#![deny(non_snake_case)]
2#![allow(unused_variables)]
3#![allow(dead_code)]
4
5enum Foo {
6 Bad {
7 lowerCamelCaseName: bool,
8 //~^ ERROR structure field `lowerCamelCaseName` should have a snake case name
9 },
10 Good {
11 snake_case_name: bool,
12 },
13}
14
15fn main() {
16 let b = Foo::Bad { lowerCamelCaseName: true };
17
18 match b {
19 Foo::Bad { lowerCamelCaseName } => {}
20 Foo::Good { snake_case_name: lowerCamelCaseBinding } => { }
21 //~^ ERROR variable `lowerCamelCaseBinding` should have a snake case name
22 }
23
24 if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { }
25 //~^ ERROR variable `anotherLowerCamelCaseBinding` should have a snake case name
26
27 if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { }
28 //~^ ERROR variable `yetAnotherLowerCamelCaseBinding` should have a snake case name
29}
tests/ui/lint/issue-66362-no-snake-case-warning-for-field-puns.stderr deleted-32
......@@ -1,32 +0,0 @@
1error: structure field `lowerCamelCaseName` should have a snake case name
2 --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:7:9
3 |
4LL | lowerCamelCaseName: bool,
5 | ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_name`
6 |
7note: the lint level is defined here
8 --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: variable `lowerCamelCaseBinding` should have a snake case name
14 --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:20:38
15 |
16LL | Foo::Good { snake_case_name: lowerCamelCaseBinding } => { }
17 | ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_binding`
18
19error: variable `anotherLowerCamelCaseBinding` should have a snake case name
20 --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:24:41
21 |
22LL | if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { }
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `another_lower_camel_case_binding`
24
25error: variable `yetAnotherLowerCamelCaseBinding` should have a snake case name
26 --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:27:43
27 |
28LL | if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { }
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `yet_another_lower_camel_case_binding`
30
31error: aborting due to 4 previous errors
32
tests/ui/lint/issue-89469.rs deleted-20
......@@ -1,20 +0,0 @@
1// Regression test for #89469, where an extra non_snake_case warning was
2// reported for a shorthand field binding.
3
4//@ check-pass
5#![deny(non_snake_case)]
6
7#[allow(non_snake_case)]
8struct Entry {
9 A: u16,
10 a: u16
11}
12
13fn foo() -> Entry {todo!()}
14
15pub fn f() {
16 let Entry { A, a } = foo();
17 let _ = (A, a);
18}
19
20fn main() {}
tests/ui/lint/lint-non-snake-case-crate-bin.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ check-pass
3#![crate_name = "NonSnakeCase"]
4
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-bin2.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ compile-flags: --crate-name NonSnakeCase
3//@ check-pass
4
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-bin3.rs deleted-8
......@@ -1,8 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ check-pass
3#![crate_type = "bin"]
4#![crate_name = "NonSnakeCase"]
5
6#![deny(non_snake_case)]
7
8fn main() {}
tests/ui/lint/lint-non-snake-case-crate-cdylib.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "cdylib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-cdylib.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-crate-dylib.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "dylib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-dylib.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-crate-lib.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "lib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-lib.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-lib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-lib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-crate-proc-macro.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "proc-macro"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-crate-rlib.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "rlib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-rlib.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-rlib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-rlib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-crate-staticlib.rs deleted-7
......@@ -1,7 +0,0 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "staticlib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/lint-non-snake-case-crate-staticlib.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-staticlib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-staticlib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-functions.rs deleted-44
......@@ -1,44 +0,0 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4struct Foo;
5
6impl Foo {
7 fn Foo_Method() {}
8 //~^ ERROR method `Foo_Method` should have a snake case name
9
10 // Don't allow two underscores in a row
11 fn foo__method(&self) {}
12 //~^ ERROR method `foo__method` should have a snake case name
13
14 pub fn xyZ(&mut self) {}
15 //~^ ERROR method `xyZ` should have a snake case name
16
17 fn render_HTML() {}
18 //~^ ERROR method `render_HTML` should have a snake case name
19}
20
21trait X {
22 fn ABC();
23 //~^ ERROR trait method `ABC` should have a snake case name
24
25 fn a_b_C(&self) {}
26 //~^ ERROR trait method `a_b_C` should have a snake case name
27
28 fn something__else(&mut self);
29 //~^ ERROR trait method `something__else` should have a snake case name
30}
31
32impl X for Foo {
33 // These errors should be caught at the trait definition not the impl
34 fn ABC() {}
35 fn something__else(&mut self) {}
36}
37
38fn Cookie() {}
39//~^ ERROR function `Cookie` should have a snake case name
40
41pub fn bi_S_Cuit() {}
42//~^ ERROR function `bi_S_Cuit` should have a snake case name
43
44fn main() { }
tests/ui/lint/lint-non-snake-case-functions.stderr deleted-62
......@@ -1,62 +0,0 @@
1error: method `Foo_Method` should have a snake case name
2 --> $DIR/lint-non-snake-case-functions.rs:7:8
3 |
4LL | fn Foo_Method() {}
5 | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_method`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-functions.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: method `foo__method` should have a snake case name
14 --> $DIR/lint-non-snake-case-functions.rs:11:8
15 |
16LL | fn foo__method(&self) {}
17 | ^^^^^^^^^^^ help: convert the identifier to snake case: `foo_method`
18
19error: method `xyZ` should have a snake case name
20 --> $DIR/lint-non-snake-case-functions.rs:14:12
21 |
22LL | pub fn xyZ(&mut self) {}
23 | ^^^ help: convert the identifier to snake case: `xy_z`
24
25error: method `render_HTML` should have a snake case name
26 --> $DIR/lint-non-snake-case-functions.rs:17:8
27 |
28LL | fn render_HTML() {}
29 | ^^^^^^^^^^^ help: convert the identifier to snake case: `render_html`
30
31error: trait method `ABC` should have a snake case name
32 --> $DIR/lint-non-snake-case-functions.rs:22:8
33 |
34LL | fn ABC();
35 | ^^^ help: convert the identifier to snake case: `abc`
36
37error: trait method `a_b_C` should have a snake case name
38 --> $DIR/lint-non-snake-case-functions.rs:25:8
39 |
40LL | fn a_b_C(&self) {}
41 | ^^^^^ help: convert the identifier to snake case (notice the capitalization): `a_b_c`
42
43error: trait method `something__else` should have a snake case name
44 --> $DIR/lint-non-snake-case-functions.rs:28:8
45 |
46LL | fn something__else(&mut self);
47 | ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `something_else`
48
49error: function `Cookie` should have a snake case name
50 --> $DIR/lint-non-snake-case-functions.rs:38:4
51 |
52LL | fn Cookie() {}
53 | ^^^^^^ help: convert the identifier to snake case (notice the capitalization): `cookie`
54
55error: function `bi_S_Cuit` should have a snake case name
56 --> $DIR/lint-non-snake-case-functions.rs:41:8
57 |
58LL | pub fn bi_S_Cuit() {}
59 | ^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `bi_s_cuit`
60
61error: aborting due to 9 previous errors
62
tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs deleted-19
......@@ -1,19 +0,0 @@
1#![warn(unused)]
2#![allow(dead_code)]
3#![deny(non_snake_case)]
4
5mod Impl {}
6//~^ ERROR module `Impl` should have a snake case name
7
8fn While() {}
9//~^ ERROR function `While` should have a snake case name
10
11fn main() {
12 let Mod: usize = 0;
13 //~^ ERROR variable `Mod` should have a snake case name
14 //~^^ WARN unused variable: `Mod`
15
16 let Super: usize = 0;
17 //~^ ERROR variable `Super` should have a snake case name
18 //~^^ WARN unused variable: `Super`
19}
tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.stderr deleted-67
......@@ -1,67 +0,0 @@
1warning: unused variable: `Mod`
2 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
3 |
4LL | let Mod: usize = 0;
5 | ^^^ help: if this is intentional, prefix it with an underscore: `_Mod`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:1:9
9 |
10LL | #![warn(unused)]
11 | ^^^^^^
12 = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
13
14warning: unused variable: `Super`
15 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
16 |
17LL | let Super: usize = 0;
18 | ^^^^^ help: if this is intentional, prefix it with an underscore: `_Super`
19
20error: module `Impl` should have a snake case name
21 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:5:5
22 |
23LL | mod Impl {}
24 | ^^^^
25 |
26note: the lint level is defined here
27 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:3:9
28 |
29LL | #![deny(non_snake_case)]
30 | ^^^^^^^^^^^^^^
31help: rename the identifier or convert it to a snake case raw identifier
32 |
33LL | mod r#impl {}
34 | ~~~~~~
35
36error: function `While` should have a snake case name
37 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4
38 |
39LL | fn While() {}
40 | ^^^^^
41 |
42help: rename the identifier or convert it to a snake case raw identifier
43 |
44LL | fn r#while() {}
45 | ~~~~~~~
46
47error: variable `Mod` should have a snake case name
48 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
49 |
50LL | let Mod: usize = 0;
51 | ^^^
52 |
53help: rename the identifier or convert it to a snake case raw identifier
54 |
55LL | let r#mod: usize = 0;
56 | ~~~~~
57
58error: variable `Super` should have a snake case name
59 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
60 |
61LL | let Super: usize = 0;
62 | ^^^^^ help: rename the identifier
63 |
64 = note: `super` cannot be used as a raw identifier
65
66error: aborting due to 4 previous errors; 2 warnings emitted
67
tests/ui/lint/lint-non-snake-case-lifetimes.rs deleted-8
......@@ -1,8 +0,0 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name
5 _: &'FooBar ()
6) {}
7
8fn main() { }
tests/ui/lint/lint-non-snake-case-lifetimes.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: lifetime `'FooBar` should have a snake case name
2 --> $DIR/lint-non-snake-case-lifetimes.rs:4:6
3 |
4LL | fn f<'FooBar>(
5 | ^^^^^^^ help: convert the identifier to snake case: `'foo_bar`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-lifetimes.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-modules.rs deleted-10
......@@ -1,10 +0,0 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4mod FooBar { //~ ERROR module `FooBar` should have a snake case name
5 pub struct S;
6}
7
8fn f(_: FooBar::S) { }
9
10fn main() { }
tests/ui/lint/lint-non-snake-case-modules.stderr deleted-14
......@@ -1,14 +0,0 @@
1error: module `FooBar` should have a snake case name
2 --> $DIR/lint-non-snake-case-modules.rs:4:5
3 |
4LL | mod FooBar {
5 | ^^^^^^ help: convert the identifier to snake case: `foo_bar`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-modules.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/lint-non-snake-case-no-lowercase-equivalent.rs deleted-11
......@@ -1,11 +0,0 @@
1//@ check-pass
2
3#![allow(dead_code)]
4//@ pretty-expanded FIXME #23616
5
6#![deny(non_snake_case)]
7
8// This name is neither upper nor lower case
9fn 你好() {}
10
11fn main() {}
tests/ui/lint/lint-nonstandard-style-unicode-2.rs deleted-29
......@@ -1,29 +0,0 @@
1#![allow(dead_code)]
2
3#![forbid(non_snake_case)]
4
5// Some scripts (e.g., hiragana) don't have a concept of
6// upper/lowercase
7
8// 2. non_snake_case
9
10// Can only use non-uppercase letters.
11// So this works:
12
13fn 编程() {}
14
15// but this doesn't:
16
17fn Ц() {}
18//~^ ERROR function `Ц` should have a snake case name
19
20// besides this, you cannot use continuous underscores in the middle
21
22fn 分__隔() {}
23//~^ ERROR function `分__隔` should have a snake case name
24
25// but you can use them both at the beginning and at the end.
26
27fn _______不_连_续_的_存_在_______() {}
28
29fn main() {}
tests/ui/lint/lint-nonstandard-style-unicode-2.stderr deleted-20
......@@ -1,20 +0,0 @@
1error: function `Ц` should have a snake case name
2 --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4
3 |
4LL | fn Ц() {}
5 | ^ help: convert the identifier to snake case: `ц`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-nonstandard-style-unicode-2.rs:3:11
9 |
10LL | #![forbid(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: function `分__隔` should have a snake case name
14 --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4
15 |
16LL | fn 分__隔() {}
17 | ^^^^^^ help: convert the identifier to snake case: `分_隔`
18
19error: aborting due to 2 previous errors
20
tests/ui/lint/lint-uppercase-variables.rs deleted-41
......@@ -1,41 +0,0 @@
1#![warn(unused)]
2#![allow(dead_code)]
3#![deny(non_snake_case)]
4
5mod foo {
6 pub enum Foo { Foo }
7}
8
9struct Something {
10 X: usize //~ ERROR structure field `X` should have a snake case name
11}
12
13fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name
14 println!("{}", Xx);
15}
16
17fn main() {
18 let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name
19 println!("{}", Test);
20
21 match foo::Foo::Foo {
22 Foo => {}
23 //~^ ERROR variable `Foo` should have a snake case name
24 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
25 //~^^^ WARN unused variable: `Foo`
26 }
27
28 let Foo = foo::Foo::Foo;
29 //~^ ERROR variable `Foo` should have a snake case name
30 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
31 //~^^^ WARN unused variable: `Foo`
32
33 fn in_param(Foo: foo::Foo) {}
34 //~^ ERROR variable `Foo` should have a snake case name
35 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
36 //~^^^ WARN unused variable: `Foo`
37
38 test(1);
39
40 let _ = Something { X: 0 };
41}
tests/ui/lint/lint-uppercase-variables.stderr deleted-90
......@@ -1,90 +0,0 @@
1error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
2 --> $DIR/lint-uppercase-variables.rs:22:9
3 |
4LL | Foo => {}
5 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
6 |
7 = note: `#[deny(bindings_with_variant_name)]` on by default
8
9error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
10 --> $DIR/lint-uppercase-variables.rs:28:9
11 |
12LL | let Foo = foo::Foo::Foo;
13 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
14
15warning: unused variable: `Foo`
16 --> $DIR/lint-uppercase-variables.rs:22:9
17 |
18LL | Foo => {}
19 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
20 |
21note: the lint level is defined here
22 --> $DIR/lint-uppercase-variables.rs:1:9
23 |
24LL | #![warn(unused)]
25 | ^^^^^^
26 = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
27
28warning: unused variable: `Foo`
29 --> $DIR/lint-uppercase-variables.rs:28:9
30 |
31LL | let Foo = foo::Foo::Foo;
32 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
33
34error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
35 --> $DIR/lint-uppercase-variables.rs:33:17
36 |
37LL | fn in_param(Foo: foo::Foo) {}
38 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
39
40warning: unused variable: `Foo`
41 --> $DIR/lint-uppercase-variables.rs:33:17
42 |
43LL | fn in_param(Foo: foo::Foo) {}
44 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
45
46error: structure field `X` should have a snake case name
47 --> $DIR/lint-uppercase-variables.rs:10:5
48 |
49LL | X: usize
50 | ^ help: convert the identifier to snake case (notice the capitalization): `x`
51 |
52note: the lint level is defined here
53 --> $DIR/lint-uppercase-variables.rs:3:9
54 |
55LL | #![deny(non_snake_case)]
56 | ^^^^^^^^^^^^^^
57
58error: variable `Xx` should have a snake case name
59 --> $DIR/lint-uppercase-variables.rs:13:9
60 |
61LL | fn test(Xx: usize) {
62 | ^^ help: convert the identifier to snake case (notice the capitalization): `xx`
63
64error: variable `Test` should have a snake case name
65 --> $DIR/lint-uppercase-variables.rs:18:9
66 |
67LL | let Test: usize = 0;
68 | ^^^^ help: convert the identifier to snake case: `test`
69
70error: variable `Foo` should have a snake case name
71 --> $DIR/lint-uppercase-variables.rs:22:9
72 |
73LL | Foo => {}
74 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
75
76error: variable `Foo` should have a snake case name
77 --> $DIR/lint-uppercase-variables.rs:28:9
78 |
79LL | let Foo = foo::Foo::Foo;
80 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
81
82error: variable `Foo` should have a snake case name
83 --> $DIR/lint-uppercase-variables.rs:33:17
84 |
85LL | fn in_param(Foo: foo::Foo) {}
86 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
87
88error: aborting due to 9 previous errors; 3 warnings emitted
89
90For more information about this error, try `rustc --explain E0170`.
tests/ui/lint/non-snake-case/allow-snake-case-field-destructuring-issue-89469.rs created+20
......@@ -0,0 +1,20 @@
1// Regression test for #89469, where an extra non_snake_case warning was
2// reported for a shorthand field binding.
3
4//@ check-pass
5#![deny(non_snake_case)]
6
7#[allow(non_snake_case)]
8struct Entry {
9 A: u16,
10 a: u16
11}
12
13fn foo() -> Entry {todo!()}
14
15pub fn f() {
16 let Entry { A, a } = foo();
17 let _ = (A, a);
18}
19
20fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ check-pass
3#![crate_name = "NonSnakeCase"]
4
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin2.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ compile-flags: --crate-name NonSnakeCase
3//@ check-pass
4
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin3.rs created+8
......@@ -0,0 +1,8 @@
1//@ only-x86_64-unknown-linux-gnu
2//@ check-pass
3#![crate_type = "bin"]
4#![crate_name = "NonSnakeCase"]
5
6#![deny(non_snake_case)]
7
8fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "cdylib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "dylib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "lib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-lib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-lib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "proc-macro"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "rlib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-rlib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-rlib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.rs created+7
......@@ -0,0 +1,7 @@
1//@ only-x86_64-unknown-linux-gnu
2#![crate_type = "staticlib"]
3#![crate_name = "NonSnakeCase"]
4//~^ ERROR crate `NonSnakeCase` should have a snake case name
5#![deny(non_snake_case)]
6
7fn main() {}
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr created+14
......@@ -0,0 +1,14 @@
1error: crate `NonSnakeCase` should have a snake case name
2 --> $DIR/lint-non-snake-case-crate-staticlib.rs:3:18
3 |
4LL | #![crate_name = "NonSnakeCase"]
5 | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-crate-staticlib.rs:5:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-functions.rs created+44
......@@ -0,0 +1,44 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4struct Foo;
5
6impl Foo {
7 fn Foo_Method() {}
8 //~^ ERROR method `Foo_Method` should have a snake case name
9
10 // Don't allow two underscores in a row
11 fn foo__method(&self) {}
12 //~^ ERROR method `foo__method` should have a snake case name
13
14 pub fn xyZ(&mut self) {}
15 //~^ ERROR method `xyZ` should have a snake case name
16
17 fn render_HTML() {}
18 //~^ ERROR method `render_HTML` should have a snake case name
19}
20
21trait X {
22 fn ABC();
23 //~^ ERROR trait method `ABC` should have a snake case name
24
25 fn a_b_C(&self) {}
26 //~^ ERROR trait method `a_b_C` should have a snake case name
27
28 fn something__else(&mut self);
29 //~^ ERROR trait method `something__else` should have a snake case name
30}
31
32impl X for Foo {
33 // These errors should be caught at the trait definition not the impl
34 fn ABC() {}
35 fn something__else(&mut self) {}
36}
37
38fn Cookie() {}
39//~^ ERROR function `Cookie` should have a snake case name
40
41pub fn bi_S_Cuit() {}
42//~^ ERROR function `bi_S_Cuit` should have a snake case name
43
44fn main() { }
tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr created+62
......@@ -0,0 +1,62 @@
1error: method `Foo_Method` should have a snake case name
2 --> $DIR/lint-non-snake-case-functions.rs:7:8
3 |
4LL | fn Foo_Method() {}
5 | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_method`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-functions.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: method `foo__method` should have a snake case name
14 --> $DIR/lint-non-snake-case-functions.rs:11:8
15 |
16LL | fn foo__method(&self) {}
17 | ^^^^^^^^^^^ help: convert the identifier to snake case: `foo_method`
18
19error: method `xyZ` should have a snake case name
20 --> $DIR/lint-non-snake-case-functions.rs:14:12
21 |
22LL | pub fn xyZ(&mut self) {}
23 | ^^^ help: convert the identifier to snake case: `xy_z`
24
25error: method `render_HTML` should have a snake case name
26 --> $DIR/lint-non-snake-case-functions.rs:17:8
27 |
28LL | fn render_HTML() {}
29 | ^^^^^^^^^^^ help: convert the identifier to snake case: `render_html`
30
31error: trait method `ABC` should have a snake case name
32 --> $DIR/lint-non-snake-case-functions.rs:22:8
33 |
34LL | fn ABC();
35 | ^^^ help: convert the identifier to snake case: `abc`
36
37error: trait method `a_b_C` should have a snake case name
38 --> $DIR/lint-non-snake-case-functions.rs:25:8
39 |
40LL | fn a_b_C(&self) {}
41 | ^^^^^ help: convert the identifier to snake case (notice the capitalization): `a_b_c`
42
43error: trait method `something__else` should have a snake case name
44 --> $DIR/lint-non-snake-case-functions.rs:28:8
45 |
46LL | fn something__else(&mut self);
47 | ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `something_else`
48
49error: function `Cookie` should have a snake case name
50 --> $DIR/lint-non-snake-case-functions.rs:38:4
51 |
52LL | fn Cookie() {}
53 | ^^^^^^ help: convert the identifier to snake case (notice the capitalization): `cookie`
54
55error: function `bi_S_Cuit` should have a snake case name
56 --> $DIR/lint-non-snake-case-functions.rs:41:8
57 |
58LL | pub fn bi_S_Cuit() {}
59 | ^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `bi_s_cuit`
60
61error: aborting due to 9 previous errors
62
tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.rs created+19
......@@ -0,0 +1,19 @@
1#![warn(unused)]
2#![allow(dead_code)]
3#![deny(non_snake_case)]
4
5mod Impl {}
6//~^ ERROR module `Impl` should have a snake case name
7
8fn While() {}
9//~^ ERROR function `While` should have a snake case name
10
11fn main() {
12 let Mod: usize = 0;
13 //~^ ERROR variable `Mod` should have a snake case name
14 //~^^ WARN unused variable: `Mod`
15
16 let Super: usize = 0;
17 //~^ ERROR variable `Super` should have a snake case name
18 //~^^ WARN unused variable: `Super`
19}
tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr created+67
......@@ -0,0 +1,67 @@
1warning: unused variable: `Mod`
2 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
3 |
4LL | let Mod: usize = 0;
5 | ^^^ help: if this is intentional, prefix it with an underscore: `_Mod`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:1:9
9 |
10LL | #![warn(unused)]
11 | ^^^^^^
12 = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
13
14warning: unused variable: `Super`
15 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
16 |
17LL | let Super: usize = 0;
18 | ^^^^^ help: if this is intentional, prefix it with an underscore: `_Super`
19
20error: module `Impl` should have a snake case name
21 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:5:5
22 |
23LL | mod Impl {}
24 | ^^^^
25 |
26note: the lint level is defined here
27 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:3:9
28 |
29LL | #![deny(non_snake_case)]
30 | ^^^^^^^^^^^^^^
31help: rename the identifier or convert it to a snake case raw identifier
32 |
33LL | mod r#impl {}
34 | ~~~~~~
35
36error: function `While` should have a snake case name
37 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4
38 |
39LL | fn While() {}
40 | ^^^^^
41 |
42help: rename the identifier or convert it to a snake case raw identifier
43 |
44LL | fn r#while() {}
45 | ~~~~~~~
46
47error: variable `Mod` should have a snake case name
48 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
49 |
50LL | let Mod: usize = 0;
51 | ^^^
52 |
53help: rename the identifier or convert it to a snake case raw identifier
54 |
55LL | let r#mod: usize = 0;
56 | ~~~~~
57
58error: variable `Super` should have a snake case name
59 --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
60 |
61LL | let Super: usize = 0;
62 | ^^^^^ help: rename the identifier
63 |
64 = note: `super` cannot be used as a raw identifier
65
66error: aborting due to 4 previous errors; 2 warnings emitted
67
tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.rs created+8
......@@ -0,0 +1,8 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name
5 _: &'FooBar ()
6) {}
7
8fn main() { }
tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr created+14
......@@ -0,0 +1,14 @@
1error: lifetime `'FooBar` should have a snake case name
2 --> $DIR/lint-non-snake-case-lifetimes.rs:4:6
3 |
4LL | fn f<'FooBar>(
5 | ^^^^^^^ help: convert the identifier to snake case: `'foo_bar`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-lifetimes.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-modules.rs created+10
......@@ -0,0 +1,10 @@
1#![deny(non_snake_case)]
2#![allow(dead_code)]
3
4mod FooBar { //~ ERROR module `FooBar` should have a snake case name
5 pub struct S;
6}
7
8fn f(_: FooBar::S) { }
9
10fn main() { }
tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr created+14
......@@ -0,0 +1,14 @@
1error: module `FooBar` should have a snake case name
2 --> $DIR/lint-non-snake-case-modules.rs:4:5
3 |
4LL | mod FooBar {
5 | ^^^^^^ help: convert the identifier to snake case: `foo_bar`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-non-snake-case-modules.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: aborting due to 1 previous error
14
tests/ui/lint/non-snake-case/lint-non-snake-case-no-lowercase-equivalent.rs created+11
......@@ -0,0 +1,11 @@
1//@ check-pass
2
3#![allow(dead_code)]
4//@ pretty-expanded FIXME #23616
5
6#![deny(non_snake_case)]
7
8// This name is neither upper nor lower case
9fn 你好() {}
10
11fn main() {}
tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.rs created+29
......@@ -0,0 +1,29 @@
1#![allow(dead_code)]
2
3#![forbid(non_snake_case)]
4
5// Some scripts (e.g., hiragana) don't have a concept of
6// upper/lowercase
7
8// 2. non_snake_case
9
10// Can only use non-uppercase letters.
11// So this works:
12
13fn 编程() {}
14
15// but this doesn't:
16
17fn Ц() {}
18//~^ ERROR function `Ц` should have a snake case name
19
20// besides this, you cannot use continuous underscores in the middle
21
22fn 分__隔() {}
23//~^ ERROR function `分__隔` should have a snake case name
24
25// but you can use them both at the beginning and at the end.
26
27fn _______不_连_续_的_存_在_______() {}
28
29fn main() {}
tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr created+20
......@@ -0,0 +1,20 @@
1error: function `Ц` should have a snake case name
2 --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4
3 |
4LL | fn Ц() {}
5 | ^ help: convert the identifier to snake case: `ц`
6 |
7note: the lint level is defined here
8 --> $DIR/lint-nonstandard-style-unicode-2.rs:3:11
9 |
10LL | #![forbid(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: function `分__隔` should have a snake case name
14 --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4
15 |
16LL | fn 分__隔() {}
17 | ^^^^^^ help: convert the identifier to snake case: `分_隔`
18
19error: aborting due to 2 previous errors
20
tests/ui/lint/non-snake-case/lint-uppercase-variables.rs created+41
......@@ -0,0 +1,41 @@
1#![warn(unused)]
2#![allow(dead_code)]
3#![deny(non_snake_case)]
4
5mod foo {
6 pub enum Foo { Foo }
7}
8
9struct Something {
10 X: usize //~ ERROR structure field `X` should have a snake case name
11}
12
13fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name
14 println!("{}", Xx);
15}
16
17fn main() {
18 let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name
19 println!("{}", Test);
20
21 match foo::Foo::Foo {
22 Foo => {}
23 //~^ ERROR variable `Foo` should have a snake case name
24 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
25 //~^^^ WARN unused variable: `Foo`
26 }
27
28 let Foo = foo::Foo::Foo;
29 //~^ ERROR variable `Foo` should have a snake case name
30 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
31 //~^^^ WARN unused variable: `Foo`
32
33 fn in_param(Foo: foo::Foo) {}
34 //~^ ERROR variable `Foo` should have a snake case name
35 //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
36 //~^^^ WARN unused variable: `Foo`
37
38 test(1);
39
40 let _ = Something { X: 0 };
41}
tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr created+90
......@@ -0,0 +1,90 @@
1error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
2 --> $DIR/lint-uppercase-variables.rs:22:9
3 |
4LL | Foo => {}
5 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
6 |
7 = note: `#[deny(bindings_with_variant_name)]` on by default
8
9error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
10 --> $DIR/lint-uppercase-variables.rs:28:9
11 |
12LL | let Foo = foo::Foo::Foo;
13 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
14
15warning: unused variable: `Foo`
16 --> $DIR/lint-uppercase-variables.rs:22:9
17 |
18LL | Foo => {}
19 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
20 |
21note: the lint level is defined here
22 --> $DIR/lint-uppercase-variables.rs:1:9
23 |
24LL | #![warn(unused)]
25 | ^^^^^^
26 = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
27
28warning: unused variable: `Foo`
29 --> $DIR/lint-uppercase-variables.rs:28:9
30 |
31LL | let Foo = foo::Foo::Foo;
32 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
33
34error[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo`
35 --> $DIR/lint-uppercase-variables.rs:33:17
36 |
37LL | fn in_param(Foo: foo::Foo) {}
38 | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo`
39
40warning: unused variable: `Foo`
41 --> $DIR/lint-uppercase-variables.rs:33:17
42 |
43LL | fn in_param(Foo: foo::Foo) {}
44 | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
45
46error: structure field `X` should have a snake case name
47 --> $DIR/lint-uppercase-variables.rs:10:5
48 |
49LL | X: usize
50 | ^ help: convert the identifier to snake case (notice the capitalization): `x`
51 |
52note: the lint level is defined here
53 --> $DIR/lint-uppercase-variables.rs:3:9
54 |
55LL | #![deny(non_snake_case)]
56 | ^^^^^^^^^^^^^^
57
58error: variable `Xx` should have a snake case name
59 --> $DIR/lint-uppercase-variables.rs:13:9
60 |
61LL | fn test(Xx: usize) {
62 | ^^ help: convert the identifier to snake case (notice the capitalization): `xx`
63
64error: variable `Test` should have a snake case name
65 --> $DIR/lint-uppercase-variables.rs:18:9
66 |
67LL | let Test: usize = 0;
68 | ^^^^ help: convert the identifier to snake case: `test`
69
70error: variable `Foo` should have a snake case name
71 --> $DIR/lint-uppercase-variables.rs:22:9
72 |
73LL | Foo => {}
74 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
75
76error: variable `Foo` should have a snake case name
77 --> $DIR/lint-uppercase-variables.rs:28:9
78 |
79LL | let Foo = foo::Foo::Foo;
80 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
81
82error: variable `Foo` should have a snake case name
83 --> $DIR/lint-uppercase-variables.rs:33:17
84 |
85LL | fn in_param(Foo: foo::Foo) {}
86 | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
87
88error: aborting due to 9 previous errors; 3 warnings emitted
89
90For more information about this error, try `rustc --explain E0170`.
tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.rs created+29
......@@ -0,0 +1,29 @@
1#![deny(non_snake_case)]
2#![allow(unused_variables)]
3#![allow(dead_code)]
4
5enum Foo {
6 Bad {
7 lowerCamelCaseName: bool,
8 //~^ ERROR structure field `lowerCamelCaseName` should have a snake case name
9 },
10 Good {
11 snake_case_name: bool,
12 },
13}
14
15fn main() {
16 let b = Foo::Bad { lowerCamelCaseName: true };
17
18 match b {
19 Foo::Bad { lowerCamelCaseName } => {}
20 Foo::Good { snake_case_name: lowerCamelCaseBinding } => { }
21 //~^ ERROR variable `lowerCamelCaseBinding` should have a snake case name
22 }
23
24 if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { }
25 //~^ ERROR variable `anotherLowerCamelCaseBinding` should have a snake case name
26
27 if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { }
28 //~^ ERROR variable `yetAnotherLowerCamelCaseBinding` should have a snake case name
29}
tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.stderr created+32
......@@ -0,0 +1,32 @@
1error: structure field `lowerCamelCaseName` should have a snake case name
2 --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:7:9
3 |
4LL | lowerCamelCaseName: bool,
5 | ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_name`
6 |
7note: the lint level is defined here
8 --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:1:9
9 |
10LL | #![deny(non_snake_case)]
11 | ^^^^^^^^^^^^^^
12
13error: variable `lowerCamelCaseBinding` should have a snake case name
14 --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:20:38
15 |
16LL | Foo::Good { snake_case_name: lowerCamelCaseBinding } => { }
17 | ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_binding`
18
19error: variable `anotherLowerCamelCaseBinding` should have a snake case name
20 --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:24:41
21 |
22LL | if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { }
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `another_lower_camel_case_binding`
24
25error: variable `yetAnotherLowerCamelCaseBinding` should have a snake case name
26 --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:27:43
27 |
28LL | if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { }
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `yet_another_lower_camel_case_binding`
30
31error: aborting due to 4 previous errors
32
tests/ui/lint/non-snake-case/non-snake-ffi-issue-31924.rs created+15
......@@ -0,0 +1,15 @@
1//@ check-pass
2
3#![deny(non_snake_case)]
4
5#[no_mangle]
6pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
7
8pub struct Foo;
9
10impl Foo {
11 #[no_mangle]
12 pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
13}
14
15fn main() {}
tests/ui/traits/next-solver/coroutine.fail.stderr+2-45
......@@ -6,8 +6,6 @@ LL | needs_coroutine(
66LL | #[coroutine]
77LL | / || {
88LL | |
9LL | |
10LL | |
119LL | | yield ();
1210LL | | },
1311 | |_________^ the trait `Coroutine<A>` is not implemented for `{coroutine@$DIR/coroutine.rs:20:9: 20:11}`
......@@ -18,47 +16,6 @@ note: required by a bound in `needs_coroutine`
1816LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
1917 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `needs_coroutine`
2018
21error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Yield == B`
22 --> $DIR/coroutine.rs:20:9
23 |
24LL | needs_coroutine(
25 | --------------- required by a bound introduced by this call
26LL | #[coroutine]
27LL | / || {
28LL | |
29LL | |
30LL | |
31LL | | yield ();
32LL | | },
33 | |_________^ types differ
34 |
35note: required by a bound in `needs_coroutine`
36 --> $DIR/coroutine.rs:14:41
37 |
38LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
39 | ^^^^^^^^^ required by this bound in `needs_coroutine`
40
41error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Return == C`
42 --> $DIR/coroutine.rs:20:9
43 |
44LL | needs_coroutine(
45 | --------------- required by a bound introduced by this call
46LL | #[coroutine]
47LL | / || {
48LL | |
49LL | |
50LL | |
51LL | | yield ();
52LL | | },
53 | |_________^ types differ
54 |
55note: required by a bound in `needs_coroutine`
56 --> $DIR/coroutine.rs:14:52
57 |
58LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
59 | ^^^^^^^^^^ required by this bound in `needs_coroutine`
60
61error: aborting due to 3 previous errors
19error: aborting due to 1 previous error
6220
63Some errors have detailed explanations: E0271, E0277.
64For more information about an error, try `rustc --explain E0271`.
21For more information about this error, try `rustc --explain E0277`.
tests/ui/traits/next-solver/coroutine.rs-2
......@@ -19,8 +19,6 @@ fn main() {
1919 #[coroutine]
2020 || {
2121 //[fail]~^ ERROR Coroutine<A>` is not satisfied
22 //[fail]~| ERROR as Coroutine<A>>::Yield == B`
23 //[fail]~| ERROR as Coroutine<A>>::Return == C`
2422 yield ();
2523 },
2624 );
tests/ui/traits/next-solver/fn-trait.rs-4
......@@ -19,14 +19,10 @@ fn main() {
1919 require_fn(f as fn() -> i32);
2020 require_fn(f as unsafe fn() -> i32);
2121 //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32`
22 //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32`
2322 require_fn(g);
2423 //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}`
25 //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32`
2624 require_fn(g as extern "C" fn() -> i32);
2725 //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32`
28 //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32`
2926 require_fn(h);
3027 //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}`
31 //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32`
3228}
tests/ui/traits/next-solver/fn-trait.stderr+5-62
......@@ -15,22 +15,8 @@ note: required by a bound in `require_fn`
1515LL | fn require_fn(_: impl Fn() -> i32) {}
1616 | ^^^^^^^^^^^ required by this bound in `require_fn`
1717
18error[E0271]: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32`
19 --> $DIR/fn-trait.rs:20:16
20 |
21LL | require_fn(f as unsafe fn() -> i32);
22 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ types differ
23 | |
24 | required by a bound introduced by this call
25 |
26note: required by a bound in `require_fn`
27 --> $DIR/fn-trait.rs:3:31
28 |
29LL | fn require_fn(_: impl Fn() -> i32) {}
30 | ^^^ required by this bound in `require_fn`
31
3218error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}`
33 --> $DIR/fn-trait.rs:23:16
19 --> $DIR/fn-trait.rs:22:16
3420 |
3521LL | require_fn(g);
3622 | ---------- ^ expected an `Fn()` closure, found `extern "C" fn() -> i32 {g}`
......@@ -45,22 +31,8 @@ note: required by a bound in `require_fn`
4531LL | fn require_fn(_: impl Fn() -> i32) {}
4632 | ^^^^^^^^^^^ required by this bound in `require_fn`
4733
48error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32`
49 --> $DIR/fn-trait.rs:23:16
50 |
51LL | require_fn(g);
52 | ---------- ^ types differ
53 | |
54 | required by a bound introduced by this call
55 |
56note: required by a bound in `require_fn`
57 --> $DIR/fn-trait.rs:3:31
58 |
59LL | fn require_fn(_: impl Fn() -> i32) {}
60 | ^^^ required by this bound in `require_fn`
61
6234error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32`
63 --> $DIR/fn-trait.rs:26:16
35 --> $DIR/fn-trait.rs:24:16
6436 |
6537LL | require_fn(g as extern "C" fn() -> i32);
6638 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn()` closure, found `extern "C" fn() -> i32`
......@@ -75,22 +47,8 @@ note: required by a bound in `require_fn`
7547LL | fn require_fn(_: impl Fn() -> i32) {}
7648 | ^^^^^^^^^^^ required by this bound in `require_fn`
7749
78error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32`
79 --> $DIR/fn-trait.rs:26:16
80 |
81LL | require_fn(g as extern "C" fn() -> i32);
82 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
83 | |
84 | required by a bound introduced by this call
85 |
86note: required by a bound in `require_fn`
87 --> $DIR/fn-trait.rs:3:31
88 |
89LL | fn require_fn(_: impl Fn() -> i32) {}
90 | ^^^ required by this bound in `require_fn`
91
9250error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}`
93 --> $DIR/fn-trait.rs:29:16
51 --> $DIR/fn-trait.rs:26:16
9452 |
9553LL | require_fn(h);
9654 | ---------- ^ call the function in a closure: `|| unsafe { /* code */ }`
......@@ -106,21 +64,6 @@ note: required by a bound in `require_fn`
10664LL | fn require_fn(_: impl Fn() -> i32) {}
10765 | ^^^^^^^^^^^ required by this bound in `require_fn`
10866
109error[E0271]: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32`
110 --> $DIR/fn-trait.rs:29:16
111 |
112LL | require_fn(h);
113 | ---------- ^ types differ
114 | |
115 | required by a bound introduced by this call
116 |
117note: required by a bound in `require_fn`
118 --> $DIR/fn-trait.rs:3:31
119 |
120LL | fn require_fn(_: impl Fn() -> i32) {}
121 | ^^^ required by this bound in `require_fn`
122
123error: aborting due to 8 previous errors
67error: aborting due to 4 previous errors
12468
125Some errors have detailed explanations: E0271, E0277.
126For more information about an error, try `rustc --explain E0271`.
69For more information about this error, try `rustc --explain E0277`.