| author | bors <bors@rust-lang.org> 2024-06-15 18:52:57 UTC |
| committer | bors <bors@rust-lang.org> 2024-06-15 18:52:57 UTC |
| log | 3cf924b934322fd7b514600a7dc84fc517515346 |
| tree | 20e6f40a6193a78f8d8bdaf3da098a56e8aef206 |
| parent | 92af831290cf60434aa44ba7c6a5171ec48e98be |
| parent | f788ea47f9f600a3c12c345452f6d079f6eb530d |
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: rollup110 files changed, 1092 insertions(+), 1518 deletions(-)
Cargo.lock+4-4| ... | ... | @@ -6385,9 +6385,9 @@ dependencies = [ |
| 6385 | 6385 | |
| 6386 | 6386 | [[package]] |
| 6387 | 6387 | name = "windows-bindgen" |
| 6388 | version = "0.56.0" | |
| 6388 | version = "0.57.0" | |
| 6389 | 6389 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 6390 | checksum = "a28e3ea6330cf17fdcdce8bf08d0549ce93769dca9bedc6c39c36c8c0e17db46" | |
| 6390 | checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4" | |
| 6391 | 6391 | dependencies = [ |
| 6392 | 6392 | "proc-macro2", |
| 6393 | 6393 | "rayon", |
| ... | ... | @@ -6408,9 +6408,9 @@ dependencies = [ |
| 6408 | 6408 | |
| 6409 | 6409 | [[package]] |
| 6410 | 6410 | name = "windows-metadata" |
| 6411 | version = "0.56.0" | |
| 6411 | version = "0.57.0" | |
| 6412 | 6412 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 6413 | checksum = "3993f7827fff10c454e3a24847075598c7c08108304b8b07943c2c73d78f3b34" | |
| 6413 | checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc" | |
| 6414 | 6414 | |
| 6415 | 6415 | [[package]] |
| 6416 | 6416 | name = "windows-sys" |
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs+3-3| ... | ... | @@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { |
| 100 | 100 | move_site_vec.iter().map(|move_site| move_site.moi).collect(); |
| 101 | 101 | |
| 102 | 102 | if move_out_indices.is_empty() { |
| 103 | let root_place = PlaceRef { projection: &[], ..used_place }; | |
| 103 | let root_local = used_place.local; | |
| 104 | 104 | |
| 105 | if !self.uninitialized_error_reported.insert(root_place) { | |
| 105 | if !self.uninitialized_error_reported.insert(root_local) { | |
| 106 | 106 | debug!( |
| 107 | 107 | "report_use_of_moved_or_uninitialized place: error about {:?} suppressed", |
| 108 | root_place | |
| 108 | root_local | |
| 109 | 109 | ); |
| 110 | 110 | return; |
| 111 | 111 | } |
compiler/rustc_borrowck/src/lib.rs+1-1| ... | ... | @@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> { |
| 566 | 566 | fn_self_span_reported: FxIndexSet<Span>, |
| 567 | 567 | /// This field keeps track of errors reported in the checking of uninitialized variables, |
| 568 | 568 | /// so that we don't report seemingly duplicate errors. |
| 569 | uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>, | |
| 569 | uninitialized_error_reported: FxIndexSet<Local>, | |
| 570 | 570 | /// This field keeps track of all the local variables that are declared mut and are mutated. |
| 571 | 571 | /// Used for the warning issued by an unused mutable local variable. |
| 572 | 572 | 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> { |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | #[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) { | |
| 117 | 117 | let const_ = constant.const_; |
| 118 | 118 | constant.const_ = self.renumber_regions(const_, || RegionCtxt::Location(location)); |
| 119 | 119 | 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> { |
| 301 | 301 | self.sanitize_place(place, location, context); |
| 302 | 302 | } |
| 303 | 303 | |
| 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"); | |
| 306 | 306 | |
| 307 | self.super_constant(constant, location); | |
| 307 | self.super_const_operand(constant, location); | |
| 308 | 308 | let ty = self.sanitize_type(constant, constant.const_.ty()); |
| 309 | 309 | |
| 310 | 310 | 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> { |
| 471 | 471 | { |
| 472 | 472 | self.resolve_vars_if_possible(value) |
| 473 | 473 | } |
| 474 | ||
| 475 | fn probe<T>(&self, probe: impl FnOnce() -> T) -> T { | |
| 476 | self.probe(|_| probe()) | |
| 477 | } | |
| 474 | 478 | } |
| 475 | 479 | |
| 476 | 480 | /// 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 { |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | impl<'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) { | |
| 1291 | 1291 | let ConstOperand { span, user_ty, const_ } = constant; |
| 1292 | 1292 | if use_verbose(const_.ty(), true) { |
| 1293 | 1293 | self.push("mir::ConstOperand"); |
| ... | ... | @@ -1415,7 +1415,7 @@ pub fn write_allocations<'tcx>( |
| 1415 | 1415 | struct CollectAllocIds(BTreeSet<AllocId>); |
| 1416 | 1416 | |
| 1417 | 1417 | 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) { | |
| 1419 | 1419 | match c.const_ { |
| 1420 | 1420 | Const::Ty(_, _) | Const::Unevaluated(..) => {} |
| 1421 | 1421 | Const::Val(val, _) => { |
compiler/rustc_middle/src/mir/visit.rs+7-7| ... | ... | @@ -184,12 +184,12 @@ macro_rules! make_mir_visitor { |
| 184 | 184 | |
| 185 | 185 | /// This is called for every constant in the MIR body and every `required_consts` |
| 186 | 186 | /// (i.e., including consts that have been dead-code-eliminated). |
| 187 | fn visit_constant( | |
| 187 | fn visit_const_operand( | |
| 188 | 188 | &mut self, |
| 189 | 189 | constant: & $($mutability)? ConstOperand<'tcx>, |
| 190 | 190 | location: Location, |
| 191 | 191 | ) { |
| 192 | self.super_constant(constant, location); | |
| 192 | self.super_const_operand(constant, location); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | fn visit_ty_const( |
| ... | ... | @@ -597,7 +597,7 @@ macro_rules! make_mir_visitor { |
| 597 | 597 | } |
| 598 | 598 | InlineAsmOperand::Const { value } |
| 599 | 599 | | InlineAsmOperand::SymFn { value } => { |
| 600 | self.visit_constant(value, location); | |
| 600 | self.visit_const_operand(value, location); | |
| 601 | 601 | } |
| 602 | 602 | InlineAsmOperand::Out { place: None, .. } |
| 603 | 603 | | InlineAsmOperand::SymStatic { def_id: _ } |
| ... | ... | @@ -788,7 +788,7 @@ macro_rules! make_mir_visitor { |
| 788 | 788 | ); |
| 789 | 789 | } |
| 790 | 790 | Operand::Constant(constant) => { |
| 791 | self.visit_constant(constant, location); | |
| 791 | self.visit_const_operand(constant, location); | |
| 792 | 792 | } |
| 793 | 793 | } |
| 794 | 794 | } |
| ... | ... | @@ -867,7 +867,7 @@ macro_rules! make_mir_visitor { |
| 867 | 867 | } |
| 868 | 868 | } |
| 869 | 869 | match value { |
| 870 | VarDebugInfoContents::Const(c) => self.visit_constant(c, location), | |
| 870 | VarDebugInfoContents::Const(c) => self.visit_const_operand(c, location), | |
| 871 | 871 | VarDebugInfoContents::Place(place) => |
| 872 | 872 | self.visit_place( |
| 873 | 873 | place, |
| ... | ... | @@ -882,7 +882,7 @@ macro_rules! make_mir_visitor { |
| 882 | 882 | _scope: $(& $mutability)? SourceScope |
| 883 | 883 | ) {} |
| 884 | 884 | |
| 885 | fn super_constant( | |
| 885 | fn super_const_operand( | |
| 886 | 886 | &mut self, |
| 887 | 887 | constant: & $($mutability)? ConstOperand<'tcx>, |
| 888 | 888 | location: Location |
| ... | ... | @@ -1057,7 +1057,7 @@ macro_rules! super_body { |
| 1057 | 1057 | |
| 1058 | 1058 | for const_ in &$($mutability)? $body.required_consts { |
| 1059 | 1059 | let location = Location::START; |
| 1060 | $self.visit_constant(const_, location); | |
| 1060 | $self.visit_const_operand(const_, location); | |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
compiler/rustc_mir_transform/src/known_panics_lint.rs+3-3| ... | ... | @@ -706,9 +706,9 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> { |
| 706 | 706 | self.super_operand(operand, location); |
| 707 | 707 | } |
| 708 | 708 | |
| 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); | |
| 712 | 712 | self.eval_constant(constant); |
| 713 | 713 | } |
| 714 | 714 |
compiler/rustc_mir_transform/src/promote_consts.rs+1-1| ... | ... | @@ -956,7 +956,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> { |
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | 958 | |
| 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) { | |
| 960 | 960 | if constant.const_.is_required_const() { |
| 961 | 961 | self.promoted.required_consts.push(*constant); |
| 962 | 962 | } |
compiler/rustc_mir_transform/src/required_consts.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ impl<'a, 'tcx> RequiredConstsVisitor<'a, 'tcx> { |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | impl<'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) { | |
| 16 | 16 | if constant.const_.is_required_const() { |
| 17 | 17 | self.required_consts.push(*constant); |
| 18 | 18 | } |
compiler/rustc_mir_transform/src/reveal_all.rs+2-2| ... | ... | @@ -49,14 +49,14 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> { |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | #[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) { | |
| 53 | 53 | // We have to use `try_normalize_erasing_regions` here, since it's |
| 54 | 54 | // possible that we visit impossible-to-satisfy where clauses here, |
| 55 | 55 | // see #91745 |
| 56 | 56 | if let Ok(c) = self.tcx.try_normalize_erasing_regions(self.param_env, constant.const_) { |
| 57 | 57 | constant.const_ = c; |
| 58 | 58 | } |
| 59 | self.super_constant(constant, location); | |
| 59 | self.super_const_operand(constant, location); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | #[inline] |
compiler/rustc_monomorphize/src/collector.rs+1-1| ... | ... | @@ -799,7 +799,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> { |
| 799 | 799 | /// This does not walk the MIR of the constant as that is not needed for codegen, all we need is |
| 800 | 800 | /// to ensure that the constant evaluates successfully and walk the result. |
| 801 | 801 | #[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) { | |
| 803 | 803 | // No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`. |
| 804 | 804 | let Some(val) = self.eval_constant(constant) else { return }; |
| 805 | 805 | 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> { |
| 261 | 261 | self.super_local_decl(local, local_decl); |
| 262 | 262 | } |
| 263 | 263 | |
| 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) { | |
| 265 | 265 | match ct.const_ { |
| 266 | 266 | mir::Const::Ty(_, c) => { |
| 267 | 267 | c.visit_with(self); |
compiler/rustc_smir/src/rustc_smir/builder.rs+6-2| ... | ... | @@ -52,7 +52,11 @@ impl<'tcx> BodyBuilder<'tcx> { |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | impl<'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 | ) { | |
| 56 | 60 | let const_ = constant.const_; |
| 57 | 61 | let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) { |
| 58 | 62 | Ok(v) => v, |
| ... | ... | @@ -63,7 +67,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> { |
| 63 | 67 | }; |
| 64 | 68 | let ty = constant.ty(); |
| 65 | 69 | constant.const_ = mir::Const::Val(val, ty); |
| 66 | self.super_constant(constant, location); | |
| 70 | self.super_const_operand(constant, location); | |
| 67 | 71 | } |
| 68 | 72 | |
| 69 | 73 | 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> { |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | impl<'tcx> Stable<'tcx> for mir::ConstOperand<'tcx> { |
| 331 | type T = stable_mir::mir::Constant; | |
| 331 | type T = stable_mir::mir::ConstOperand; | |
| 332 | 332 | |
| 333 | 333 | fn stable(&self, tables: &mut Tables<'_>) -> Self::T { |
| 334 | stable_mir::mir::Constant { | |
| 334 | stable_mir::mir::ConstOperand { | |
| 335 | 335 | span: self.span.stable(tables), |
| 336 | 336 | user_ty: self.user_ty.map(|u| u.as_usize()).or(None), |
| 337 | literal: self.const_.stable(tables), | |
| 337 | const_: self.const_.stable(tables), | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | } |
compiler/rustc_trait_selection/src/solve/assembly/mod.rs+50-49| ... | ... | @@ -1,21 +1,21 @@ |
| 1 | 1 | //! Code shared by trait and projection goals for candidate assembly. |
| 2 | 2 | |
| 3 | use derivative::Derivative; | |
| 3 | 4 | use rustc_hir::def_id::DefId; |
| 4 | 5 | use rustc_hir::LangItem; |
| 5 | 6 | use rustc_infer::infer::InferCtxt; |
| 6 | 7 | use rustc_infer::traits::query::NoSolution; |
| 7 | 8 | use rustc_middle::bug; |
| 8 | 9 | use rustc_middle::traits::solve::inspect::ProbeKind; |
| 9 | use rustc_middle::traits::solve::{ | |
| 10 | CandidateSource, CanonicalResponse, Certainty, Goal, MaybeCause, QueryResult, | |
| 11 | }; | |
| 10 | use rustc_middle::traits::solve::{Certainty, Goal, MaybeCause, QueryResult}; | |
| 12 | 11 | use rustc_middle::traits::BuiltinImplSource; |
| 13 | 12 | use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams}; |
| 14 | 13 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 15 | 14 | use rustc_middle::ty::{fast_reject, TypeFoldable}; |
| 16 | 15 | use rustc_middle::ty::{TypeVisitableExt, Upcast}; |
| 17 | 16 | use rustc_span::{ErrorGuaranteed, DUMMY_SP}; |
| 18 | use std::fmt::Debug; | |
| 17 | use rustc_type_ir::solve::{CandidateSource, CanonicalResponse}; | |
| 18 | use rustc_type_ir::Interner; | |
| 19 | 19 | |
| 20 | 20 | use crate::solve::GoalSource; |
| 21 | 21 | use crate::solve::{EvalCtxt, SolverMode}; |
| ... | ... | @@ -26,10 +26,11 @@ pub(super) mod structural_traits; |
| 26 | 26 | /// |
| 27 | 27 | /// It consists of both the `source`, which describes how that goal would be proven, |
| 28 | 28 | /// and the `result` when using the given `source`. |
| 29 | #[derive(Debug, Clone)] | |
| 30 | pub(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 = ""))] | |
| 31 | pub(super) struct Candidate<I: Interner> { | |
| 32 | pub(super) source: CandidateSource<I>, | |
| 33 | pub(super) result: CanonicalResponse<I>, | |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 36 | /// Methods used to assemble candidates for either trait or projection goals. |
| ... | ... | @@ -50,22 +51,22 @@ pub(super) trait GoalKind<'tcx>: |
| 50 | 51 | /// [`EvalCtxt::evaluate_added_goals_and_make_canonical_response`]). |
| 51 | 52 | fn probe_and_match_goal_against_assumption( |
| 52 | 53 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 53 | source: CandidateSource<'tcx>, | |
| 54 | source: CandidateSource<TyCtxt<'tcx>>, | |
| 54 | 55 | goal: Goal<'tcx, Self>, |
| 55 | 56 | assumption: ty::Clause<'tcx>, |
| 56 | 57 | then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>, |
| 57 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 58 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 58 | 59 | |
| 59 | 60 | /// Consider a clause, which consists of a "assumption" and some "requirements", |
| 60 | 61 | /// to satisfy a goal. If the requirements hold, then attempt to satisfy our |
| 61 | 62 | /// goal by equating it with the assumption. |
| 62 | 63 | fn probe_and_consider_implied_clause( |
| 63 | 64 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 64 | parent_source: CandidateSource<'tcx>, | |
| 65 | parent_source: CandidateSource<TyCtxt<'tcx>>, | |
| 65 | 66 | goal: Goal<'tcx, Self>, |
| 66 | 67 | assumption: ty::Clause<'tcx>, |
| 67 | 68 | requirements: impl IntoIterator<Item = (GoalSource, Goal<'tcx, ty::Predicate<'tcx>>)>, |
| 68 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 69 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 69 | 70 | Self::probe_and_match_goal_against_assumption(ecx, parent_source, goal, assumption, |ecx| { |
| 70 | 71 | for (nested_source, goal) in requirements { |
| 71 | 72 | ecx.add_goal(nested_source, goal); |
| ... | ... | @@ -79,10 +80,10 @@ pub(super) trait GoalKind<'tcx>: |
| 79 | 80 | /// since they're not implied by the well-formedness of the object type. |
| 80 | 81 | fn probe_and_consider_object_bound_candidate( |
| 81 | 82 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 82 | source: CandidateSource<'tcx>, | |
| 83 | source: CandidateSource<TyCtxt<'tcx>>, | |
| 83 | 84 | goal: Goal<'tcx, Self>, |
| 84 | 85 | assumption: ty::Clause<'tcx>, |
| 85 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 86 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 86 | 87 | Self::probe_and_match_goal_against_assumption(ecx, source, goal, assumption, |ecx| { |
| 87 | 88 | let tcx = ecx.interner(); |
| 88 | 89 | let ty::Dynamic(bounds, _, _) = *goal.predicate.self_ty().kind() else { |
| ... | ... | @@ -105,7 +106,7 @@ pub(super) trait GoalKind<'tcx>: |
| 105 | 106 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 106 | 107 | goal: Goal<'tcx, Self>, |
| 107 | 108 | impl_def_id: DefId, |
| 108 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 109 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 109 | 110 | |
| 110 | 111 | /// If the predicate contained an error, we want to avoid emitting unnecessary trait |
| 111 | 112 | /// errors but still want to emit errors for other trait goals. We have some special |
| ... | ... | @@ -116,7 +117,7 @@ pub(super) trait GoalKind<'tcx>: |
| 116 | 117 | fn consider_error_guaranteed_candidate( |
| 117 | 118 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 118 | 119 | guar: ErrorGuaranteed, |
| 119 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 120 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 120 | 121 | |
| 121 | 122 | /// A type implements an `auto trait` if its components do as well. |
| 122 | 123 | /// |
| ... | ... | @@ -125,13 +126,13 @@ pub(super) trait GoalKind<'tcx>: |
| 125 | 126 | fn consider_auto_trait_candidate( |
| 126 | 127 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 127 | 128 | goal: Goal<'tcx, Self>, |
| 128 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 129 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 129 | 130 | |
| 130 | 131 | /// A trait alias holds if the RHS traits and `where` clauses hold. |
| 131 | 132 | fn consider_trait_alias_candidate( |
| 132 | 133 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 133 | 134 | goal: Goal<'tcx, Self>, |
| 134 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 135 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 135 | 136 | |
| 136 | 137 | /// A type is `Sized` if its tail component is `Sized`. |
| 137 | 138 | /// |
| ... | ... | @@ -140,7 +141,7 @@ pub(super) trait GoalKind<'tcx>: |
| 140 | 141 | fn consider_builtin_sized_candidate( |
| 141 | 142 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 142 | 143 | goal: Goal<'tcx, Self>, |
| 143 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 144 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 144 | 145 | |
| 145 | 146 | /// A type is `Copy` or `Clone` if its components are `Copy` or `Clone`. |
| 146 | 147 | /// |
| ... | ... | @@ -149,20 +150,20 @@ pub(super) trait GoalKind<'tcx>: |
| 149 | 150 | fn consider_builtin_copy_clone_candidate( |
| 150 | 151 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 151 | 152 | goal: Goal<'tcx, Self>, |
| 152 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 153 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 153 | 154 | |
| 154 | 155 | /// A type is `PointerLike` if we can compute its layout, and that layout |
| 155 | 156 | /// matches the layout of `usize`. |
| 156 | 157 | fn consider_builtin_pointer_like_candidate( |
| 157 | 158 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 158 | 159 | goal: Goal<'tcx, Self>, |
| 159 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 160 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 160 | 161 | |
| 161 | 162 | /// A type is a `FnPtr` if it is of `FnPtr` type. |
| 162 | 163 | fn consider_builtin_fn_ptr_trait_candidate( |
| 163 | 164 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 164 | 165 | goal: Goal<'tcx, Self>, |
| 165 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 166 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 166 | 167 | |
| 167 | 168 | /// A callable type (a closure, fn def, or fn ptr) is known to implement the `Fn<A>` |
| 168 | 169 | /// family of traits where `A` is given by the signature of the type. |
| ... | ... | @@ -170,7 +171,7 @@ pub(super) trait GoalKind<'tcx>: |
| 170 | 171 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 171 | 172 | goal: Goal<'tcx, Self>, |
| 172 | 173 | kind: ty::ClosureKind, |
| 173 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 174 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 174 | 175 | |
| 175 | 176 | /// An async closure is known to implement the `AsyncFn<A>` family of traits |
| 176 | 177 | /// where `A` is given by the signature of the type. |
| ... | ... | @@ -178,7 +179,7 @@ pub(super) trait GoalKind<'tcx>: |
| 178 | 179 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 179 | 180 | goal: Goal<'tcx, Self>, |
| 180 | 181 | kind: ty::ClosureKind, |
| 181 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 182 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 182 | 183 | |
| 183 | 184 | /// Compute the built-in logic of the `AsyncFnKindHelper` helper trait, which |
| 184 | 185 | /// is used internally to delay computation for async closures until after |
| ... | ... | @@ -186,13 +187,13 @@ pub(super) trait GoalKind<'tcx>: |
| 186 | 187 | fn consider_builtin_async_fn_kind_helper_candidate( |
| 187 | 188 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 188 | 189 | goal: Goal<'tcx, Self>, |
| 189 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 190 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 190 | 191 | |
| 191 | 192 | /// `Tuple` is implemented if the `Self` type is a tuple. |
| 192 | 193 | fn consider_builtin_tuple_candidate( |
| 193 | 194 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 194 | 195 | goal: Goal<'tcx, Self>, |
| 195 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 196 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 196 | 197 | |
| 197 | 198 | /// `Pointee` is always implemented. |
| 198 | 199 | /// |
| ... | ... | @@ -202,7 +203,7 @@ pub(super) trait GoalKind<'tcx>: |
| 202 | 203 | fn consider_builtin_pointee_candidate( |
| 203 | 204 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 204 | 205 | goal: Goal<'tcx, Self>, |
| 205 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 206 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 206 | 207 | |
| 207 | 208 | /// A coroutine (that comes from an `async` desugaring) is known to implement |
| 208 | 209 | /// `Future<Output = O>`, where `O` is given by the coroutine's return type |
| ... | ... | @@ -210,7 +211,7 @@ pub(super) trait GoalKind<'tcx>: |
| 210 | 211 | fn consider_builtin_future_candidate( |
| 211 | 212 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 212 | 213 | goal: Goal<'tcx, Self>, |
| 213 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 214 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 214 | 215 | |
| 215 | 216 | /// A coroutine (that comes from a `gen` desugaring) is known to implement |
| 216 | 217 | /// `Iterator<Item = O>`, where `O` is given by the generator's yield type |
| ... | ... | @@ -218,19 +219,19 @@ pub(super) trait GoalKind<'tcx>: |
| 218 | 219 | fn consider_builtin_iterator_candidate( |
| 219 | 220 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 220 | 221 | goal: Goal<'tcx, Self>, |
| 221 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 222 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 222 | 223 | |
| 223 | 224 | /// A coroutine (that comes from a `gen` desugaring) is known to implement |
| 224 | 225 | /// `FusedIterator` |
| 225 | 226 | fn consider_builtin_fused_iterator_candidate( |
| 226 | 227 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 227 | 228 | goal: Goal<'tcx, Self>, |
| 228 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 229 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 229 | 230 | |
| 230 | 231 | fn consider_builtin_async_iterator_candidate( |
| 231 | 232 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 232 | 233 | goal: Goal<'tcx, Self>, |
| 233 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 234 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 234 | 235 | |
| 235 | 236 | /// A coroutine (that doesn't come from an `async` or `gen` desugaring) is known to |
| 236 | 237 | /// implement `Coroutine<R, Yield = Y, Return = O>`, given the resume, yield, |
| ... | ... | @@ -238,27 +239,27 @@ pub(super) trait GoalKind<'tcx>: |
| 238 | 239 | fn consider_builtin_coroutine_candidate( |
| 239 | 240 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 240 | 241 | goal: Goal<'tcx, Self>, |
| 241 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 242 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 242 | 243 | |
| 243 | 244 | fn consider_builtin_discriminant_kind_candidate( |
| 244 | 245 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 245 | 246 | goal: Goal<'tcx, Self>, |
| 246 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 247 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 247 | 248 | |
| 248 | 249 | fn consider_builtin_async_destruct_candidate( |
| 249 | 250 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 250 | 251 | goal: Goal<'tcx, Self>, |
| 251 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 252 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 252 | 253 | |
| 253 | 254 | fn consider_builtin_destruct_candidate( |
| 254 | 255 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 255 | 256 | goal: Goal<'tcx, Self>, |
| 256 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 257 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 257 | 258 | |
| 258 | 259 | fn consider_builtin_transmute_candidate( |
| 259 | 260 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 260 | 261 | goal: Goal<'tcx, Self>, |
| 261 | ) -> Result<Candidate<'tcx>, NoSolution>; | |
| 262 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution>; | |
| 262 | 263 | |
| 263 | 264 | /// Consider (possibly several) candidates to upcast or unsize a type to another |
| 264 | 265 | /// type, excluding the coercion of a sized type into a `dyn Trait`. |
| ... | ... | @@ -270,14 +271,14 @@ pub(super) trait GoalKind<'tcx>: |
| 270 | 271 | fn consider_structural_builtin_unsize_candidates( |
| 271 | 272 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 272 | 273 | goal: Goal<'tcx, Self>, |
| 273 | ) -> Vec<Candidate<'tcx>>; | |
| 274 | ) -> Vec<Candidate<TyCtxt<'tcx>>>; | |
| 274 | 275 | } |
| 275 | 276 | |
| 276 | 277 | impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 277 | 278 | pub(super) fn assemble_and_evaluate_candidates<G: GoalKind<'tcx>>( |
| 278 | 279 | &mut self, |
| 279 | 280 | goal: Goal<'tcx, G>, |
| 280 | ) -> Vec<Candidate<'tcx>> { | |
| 281 | ) -> Vec<Candidate<TyCtxt<'tcx>>> { | |
| 281 | 282 | let Ok(normalized_self_ty) = |
| 282 | 283 | self.structurally_normalize_ty(goal.param_env, goal.predicate.self_ty()) |
| 283 | 284 | else { |
| ... | ... | @@ -324,7 +325,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 324 | 325 | pub(super) fn forced_ambiguity( |
| 325 | 326 | &mut self, |
| 326 | 327 | cause: MaybeCause, |
| 327 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 328 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 328 | 329 | // This may fail if `try_evaluate_added_goals` overflows because it |
| 329 | 330 | // fails to reach a fixpoint but ends up getting an error after |
| 330 | 331 | // running for some additional step. |
| ... | ... | @@ -340,7 +341,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 340 | 341 | fn assemble_non_blanket_impl_candidates<G: GoalKind<'tcx>>( |
| 341 | 342 | &mut self, |
| 342 | 343 | goal: Goal<'tcx, G>, |
| 343 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 344 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 344 | 345 | ) { |
| 345 | 346 | let tcx = self.interner(); |
| 346 | 347 | let self_ty = goal.predicate.self_ty(); |
| ... | ... | @@ -456,7 +457,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 456 | 457 | fn assemble_blanket_impl_candidates<G: GoalKind<'tcx>>( |
| 457 | 458 | &mut self, |
| 458 | 459 | goal: Goal<'tcx, G>, |
| 459 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 460 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 460 | 461 | ) { |
| 461 | 462 | let tcx = self.interner(); |
| 462 | 463 | let trait_impls = tcx.trait_impls_of(goal.predicate.trait_def_id(tcx)); |
| ... | ... | @@ -479,7 +480,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 479 | 480 | fn assemble_builtin_impl_candidates<G: GoalKind<'tcx>>( |
| 480 | 481 | &mut self, |
| 481 | 482 | goal: Goal<'tcx, G>, |
| 482 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 483 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 483 | 484 | ) { |
| 484 | 485 | let tcx = self.interner(); |
| 485 | 486 | let trait_def_id = goal.predicate.trait_def_id(tcx); |
| ... | ... | @@ -552,7 +553,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 552 | 553 | fn assemble_param_env_candidates<G: GoalKind<'tcx>>( |
| 553 | 554 | &mut self, |
| 554 | 555 | goal: Goal<'tcx, G>, |
| 555 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 556 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 556 | 557 | ) { |
| 557 | 558 | for (i, assumption) in goal.param_env.caller_bounds().iter().enumerate() { |
| 558 | 559 | candidates.extend(G::probe_and_consider_implied_clause( |
| ... | ... | @@ -569,7 +570,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 569 | 570 | fn assemble_alias_bound_candidates<G: GoalKind<'tcx>>( |
| 570 | 571 | &mut self, |
| 571 | 572 | goal: Goal<'tcx, G>, |
| 572 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 573 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 573 | 574 | ) { |
| 574 | 575 | let () = self.probe(|_| ProbeKind::NormalizedSelfTyAssembly).enter(|ecx| { |
| 575 | 576 | ecx.assemble_alias_bound_candidates_recur(goal.predicate.self_ty(), goal, candidates); |
| ... | ... | @@ -589,7 +590,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 589 | 590 | &mut self, |
| 590 | 591 | self_ty: Ty<'tcx>, |
| 591 | 592 | goal: Goal<'tcx, G>, |
| 592 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 593 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 593 | 594 | ) { |
| 594 | 595 | let (kind, alias_ty) = match *self_ty.kind() { |
| 595 | 596 | ty::Bool |
| ... | ... | @@ -673,7 +674,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 673 | 674 | fn assemble_object_bound_candidates<G: GoalKind<'tcx>>( |
| 674 | 675 | &mut self, |
| 675 | 676 | goal: Goal<'tcx, G>, |
| 676 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 677 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 677 | 678 | ) { |
| 678 | 679 | let tcx = self.interner(); |
| 679 | 680 | if !tcx.trait_def(goal.predicate.trait_def_id(tcx)).implement_via_object { |
| ... | ... | @@ -764,7 +765,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 764 | 765 | fn assemble_coherence_unknowable_candidates<G: GoalKind<'tcx>>( |
| 765 | 766 | &mut self, |
| 766 | 767 | goal: Goal<'tcx, G>, |
| 767 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 768 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 768 | 769 | ) { |
| 769 | 770 | let tcx = self.interner(); |
| 770 | 771 | |
| ... | ... | @@ -793,7 +794,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 793 | 794 | fn discard_impls_shadowed_by_env<G: GoalKind<'tcx>>( |
| 794 | 795 | &mut self, |
| 795 | 796 | goal: Goal<'tcx, G>, |
| 796 | candidates: &mut Vec<Candidate<'tcx>>, | |
| 797 | candidates: &mut Vec<Candidate<TyCtxt<'tcx>>>, | |
| 797 | 798 | ) { |
| 798 | 799 | let tcx = self.interner(); |
| 799 | 800 | let trait_goal: Goal<'tcx, ty::TraitPredicate<'tcx>> = |
| ... | ... | @@ -841,7 +842,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 841 | 842 | #[instrument(level = "debug", skip(self), ret)] |
| 842 | 843 | pub(super) fn merge_candidates( |
| 843 | 844 | &mut self, |
| 844 | candidates: Vec<Candidate<'tcx>>, | |
| 845 | candidates: Vec<Candidate<TyCtxt<'tcx>>>, | |
| 845 | 846 | ) -> QueryResult<'tcx> { |
| 846 | 847 | // First try merging all candidates. This is complete and fully sound. |
| 847 | 848 | 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 @@ |
| 1 | 1 | use crate::solve::assembly::Candidate; |
| 2 | 2 | |
| 3 | 3 | use super::EvalCtxt; |
| 4 | use rustc_infer::infer::InferCtxt; | |
| 5 | use rustc_infer::traits::BuiltinImplSource; | |
| 6 | use rustc_middle::traits::query::NoSolution; | |
| 7 | use rustc_middle::traits::solve::{inspect, CandidateSource, QueryResult}; | |
| 8 | use rustc_middle::ty::TyCtxt; | |
| 4 | use rustc_next_trait_solver::solve::{ | |
| 5 | inspect, BuiltinImplSource, CandidateSource, NoSolution, QueryResult, | |
| 6 | }; | |
| 7 | use rustc_type_ir::{InferCtxtLike, Interner}; | |
| 9 | 8 | use std::marker::PhantomData; |
| 10 | 9 | |
| 11 | pub(in crate::solve) struct ProbeCtxt<'me, 'a, 'tcx, F, T> { | |
| 12 | ecx: &'me mut EvalCtxt<'a, InferCtxt<'tcx>>, | |
| 10 | pub(in crate::solve) struct ProbeCtxt<'me, 'a, Infcx, I, F, T> | |
| 11 | where | |
| 12 | Infcx: InferCtxtLike<Interner = I>, | |
| 13 | I: Interner, | |
| 14 | { | |
| 15 | ecx: &'me mut EvalCtxt<'a, Infcx, I>, | |
| 13 | 16 | probe_kind: F, |
| 14 | 17 | _result: PhantomData<T>, |
| 15 | 18 | } |
| 16 | 19 | |
| 17 | impl<'tcx, F, T> ProbeCtxt<'_, '_, 'tcx, F, T> | |
| 20 | impl<Infcx, I, F, T> ProbeCtxt<'_, '_, Infcx, I, F, T> | |
| 18 | 21 | where |
| 19 | F: FnOnce(&T) -> inspect::ProbeKind<TyCtxt<'tcx>>, | |
| 22 | F: FnOnce(&T) -> inspect::ProbeKind<I>, | |
| 23 | Infcx: InferCtxtLike<Interner = I>, | |
| 24 | I: Interner, | |
| 20 | 25 | { |
| 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 { | |
| 25 | 27 | let ProbeCtxt { ecx: outer_ecx, probe_kind, _result } = self; |
| 26 | 28 | |
| 27 | 29 | let infcx = outer_ecx.infcx; |
| ... | ... | @@ -38,7 +40,7 @@ where |
| 38 | 40 | tainted: outer_ecx.tainted, |
| 39 | 41 | inspect: outer_ecx.inspect.take_and_enter_probe(), |
| 40 | 42 | }; |
| 41 | let r = nested_ecx.infcx.probe(|_| { | |
| 43 | let r = nested_ecx.infcx.probe(|| { | |
| 42 | 44 | let r = f(&mut nested_ecx); |
| 43 | 45 | nested_ecx.inspect.probe_final_state(infcx, max_input_universe); |
| 44 | 46 | r |
| ... | ... | @@ -52,30 +54,43 @@ where |
| 52 | 54 | } |
| 53 | 55 | } |
| 54 | 56 | |
| 55 | pub(in crate::solve) struct TraitProbeCtxt<'me, 'a, 'tcx, F> { | |
| 56 | cx: ProbeCtxt<'me, 'a, 'tcx, F, QueryResult<'tcx>>, | |
| 57 | source: CandidateSource<'tcx>, | |
| 57 | pub(in crate::solve) struct TraitProbeCtxt<'me, 'a, Infcx, I, F> | |
| 58 | where | |
| 59 | Infcx: InferCtxtLike<Interner = I>, | |
| 60 | I: Interner, | |
| 61 | { | |
| 62 | cx: ProbeCtxt<'me, 'a, Infcx, I, F, QueryResult<I>>, | |
| 63 | source: CandidateSource<I>, | |
| 58 | 64 | } |
| 59 | 65 | |
| 60 | impl<'tcx, F> TraitProbeCtxt<'_, '_, 'tcx, F> | |
| 66 | impl<Infcx, I, F> TraitProbeCtxt<'_, '_, Infcx, I, F> | |
| 61 | 67 | where |
| 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>, | |
| 63 | 71 | { |
| 64 | 72 | #[instrument(level = "debug", skip_all, fields(source = ?self.source))] |
| 65 | 73 | pub(in crate::solve) fn enter( |
| 66 | 74 | 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> { | |
| 69 | 77 | self.cx.enter(|ecx| f(ecx)).map(|result| Candidate { source: self.source, result }) |
| 70 | 78 | } |
| 71 | 79 | } |
| 72 | 80 | |
| 73 | impl<'a, 'tcx> EvalCtxt<'a, InferCtxt<'tcx>> { | |
| 81 | impl<'a, Infcx, I> EvalCtxt<'a, Infcx, I> | |
| 82 | where | |
| 83 | Infcx: InferCtxtLike<Interner = I>, | |
| 84 | I: Interner, | |
| 85 | { | |
| 74 | 86 | /// `probe_kind` is only called when proof tree building is enabled so it can be |
| 75 | 87 | /// 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> | |
| 77 | 92 | where |
| 78 | F: FnOnce(&T) -> inspect::ProbeKind<TyCtxt<'tcx>>, | |
| 93 | F: FnOnce(&T) -> inspect::ProbeKind<I>, | |
| 79 | 94 | { |
| 80 | 95 | ProbeCtxt { ecx: self, probe_kind, _result: PhantomData } |
| 81 | 96 | } |
| ... | ... | @@ -83,28 +98,20 @@ impl<'a, 'tcx> EvalCtxt<'a, InferCtxt<'tcx>> { |
| 83 | 98 | pub(in crate::solve) fn probe_builtin_trait_candidate( |
| 84 | 99 | &mut self, |
| 85 | 100 | 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 | { | |
| 92 | 103 | self.probe_trait_candidate(CandidateSource::BuiltinImpl(source)) |
| 93 | 104 | } |
| 94 | 105 | |
| 95 | 106 | pub(in crate::solve) fn probe_trait_candidate( |
| 96 | 107 | &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 | { | |
| 104 | 111 | TraitProbeCtxt { |
| 105 | 112 | cx: ProbeCtxt { |
| 106 | 113 | ecx: self, |
| 107 | probe_kind: move |result: &QueryResult<'tcx>| inspect::ProbeKind::TraitCandidate { | |
| 114 | probe_kind: move |result: &QueryResult<I>| inspect::ProbeKind::TraitCandidate { | |
| 108 | 115 | source, |
| 109 | 116 | result: *result, |
| 110 | 117 | }, |
compiler/rustc_trait_selection/src/solve/fulfill.rs+26| ... | ... | @@ -515,6 +515,32 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> { |
| 515 | 515 | self.with_derived_obligation(obligation, |this| nested_goal.visit_with(this))?; |
| 516 | 516 | } |
| 517 | 517 | |
| 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 | ||
| 518 | 544 | ControlFlow::Break(self.obligation.clone()) |
| 519 | 545 | } |
| 520 | 546 | } |
compiler/rustc_trait_selection/src/solve/inspect/analyse.rs+14-1| ... | ... | @@ -278,6 +278,10 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> { |
| 278 | 278 | self.source |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | pub fn depth(&self) -> usize { | |
| 282 | self.depth | |
| 283 | } | |
| 284 | ||
| 281 | 285 | fn candidates_recur( |
| 282 | 286 | &'a self, |
| 283 | 287 | candidates: &mut Vec<InspectCandidate<'a, 'tcx>>, |
| ... | ... | @@ -435,9 +439,18 @@ impl<'tcx> InferCtxt<'tcx> { |
| 435 | 439 | &self, |
| 436 | 440 | goal: Goal<'tcx, ty::Predicate<'tcx>>, |
| 437 | 441 | 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, | |
| 438 | 451 | ) -> V::Result { |
| 439 | 452 | let (_, proof_tree) = self.evaluate_root_goal(goal, GenerateProofTree::Yes); |
| 440 | 453 | 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)) | |
| 442 | 455 | } |
| 443 | 456 | } |
compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs+24-24| ... | ... | @@ -103,7 +103,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 103 | 103 | goal: Goal<'tcx, Self>, |
| 104 | 104 | assumption: ty::Clause<'tcx>, |
| 105 | 105 | then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>, |
| 106 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 106 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 107 | 107 | if let Some(projection_pred) = assumption.as_projection_clause() { |
| 108 | 108 | if projection_pred.projection_def_id() == goal.predicate.def_id() { |
| 109 | 109 | let tcx = ecx.interner(); |
| ... | ... | @@ -140,7 +140,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 140 | 140 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 141 | 141 | goal: Goal<'tcx, NormalizesTo<'tcx>>, |
| 142 | 142 | impl_def_id: DefId, |
| 143 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 143 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 144 | 144 | let tcx = ecx.interner(); |
| 145 | 145 | |
| 146 | 146 | let goal_trait_ref = goal.predicate.alias.trait_ref(tcx); |
| ... | ... | @@ -267,14 +267,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 267 | 267 | fn consider_error_guaranteed_candidate( |
| 268 | 268 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 269 | 269 | _guar: ErrorGuaranteed, |
| 270 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 270 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 271 | 271 | Err(NoSolution) |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | fn consider_auto_trait_candidate( |
| 275 | 275 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 276 | 276 | goal: Goal<'tcx, Self>, |
| 277 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 277 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 278 | 278 | ecx.interner().dcx().span_delayed_bug( |
| 279 | 279 | ecx.interner().def_span(goal.predicate.def_id()), |
| 280 | 280 | "associated types not allowed on auto traits", |
| ... | ... | @@ -285,35 +285,35 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 285 | 285 | fn consider_trait_alias_candidate( |
| 286 | 286 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 287 | 287 | goal: Goal<'tcx, Self>, |
| 288 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 288 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 289 | 289 | bug!("trait aliases do not have associated types: {:?}", goal); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | fn consider_builtin_sized_candidate( |
| 293 | 293 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 294 | 294 | goal: Goal<'tcx, Self>, |
| 295 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 295 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 296 | 296 | bug!("`Sized` does not have an associated type: {:?}", goal); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | fn consider_builtin_copy_clone_candidate( |
| 300 | 300 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 301 | 301 | goal: Goal<'tcx, Self>, |
| 302 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 302 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 303 | 303 | bug!("`Copy`/`Clone` does not have an associated type: {:?}", goal); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | fn consider_builtin_pointer_like_candidate( |
| 307 | 307 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 308 | 308 | goal: Goal<'tcx, Self>, |
| 309 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 309 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 310 | 310 | bug!("`PointerLike` does not have an associated type: {:?}", goal); |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | fn consider_builtin_fn_ptr_trait_candidate( |
| 314 | 314 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 315 | 315 | goal: Goal<'tcx, Self>, |
| 316 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 316 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 317 | 317 | bug!("`FnPtr` does not have an associated type: {:?}", goal); |
| 318 | 318 | } |
| 319 | 319 | |
| ... | ... | @@ -321,7 +321,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 321 | 321 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 322 | 322 | goal: Goal<'tcx, Self>, |
| 323 | 323 | goal_kind: ty::ClosureKind, |
| 324 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 324 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 325 | 325 | let tcx = ecx.interner(); |
| 326 | 326 | let tupled_inputs_and_output = |
| 327 | 327 | match structural_traits::extract_tupled_inputs_and_output_from_callable( |
| ... | ... | @@ -364,7 +364,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 364 | 364 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 365 | 365 | goal: Goal<'tcx, Self>, |
| 366 | 366 | goal_kind: ty::ClosureKind, |
| 367 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 367 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 368 | 368 | let tcx = ecx.interner(); |
| 369 | 369 | |
| 370 | 370 | let env_region = match goal_kind { |
| ... | ... | @@ -454,7 +454,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 454 | 454 | fn consider_builtin_async_fn_kind_helper_candidate( |
| 455 | 455 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 456 | 456 | goal: Goal<'tcx, Self>, |
| 457 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 457 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 458 | 458 | let [ |
| 459 | 459 | closure_fn_kind_ty, |
| 460 | 460 | goal_kind_ty, |
| ... | ... | @@ -501,14 +501,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 501 | 501 | fn consider_builtin_tuple_candidate( |
| 502 | 502 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 503 | 503 | goal: Goal<'tcx, Self>, |
| 504 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 504 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 505 | 505 | bug!("`Tuple` does not have an associated type: {:?}", goal); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | fn consider_builtin_pointee_candidate( |
| 509 | 509 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 510 | 510 | goal: Goal<'tcx, Self>, |
| 511 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 511 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 512 | 512 | let tcx = ecx.interner(); |
| 513 | 513 | let metadata_def_id = tcx.require_lang_item(LangItem::Metadata, None); |
| 514 | 514 | assert_eq!(metadata_def_id, goal.predicate.def_id()); |
| ... | ... | @@ -590,7 +590,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 590 | 590 | fn consider_builtin_future_candidate( |
| 591 | 591 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 592 | 592 | goal: Goal<'tcx, Self>, |
| 593 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 593 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 594 | 594 | let self_ty = goal.predicate.self_ty(); |
| 595 | 595 | let ty::Coroutine(def_id, args) = *self_ty.kind() else { |
| 596 | 596 | return Err(NoSolution); |
| ... | ... | @@ -626,7 +626,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 626 | 626 | fn consider_builtin_iterator_candidate( |
| 627 | 627 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 628 | 628 | goal: Goal<'tcx, Self>, |
| 629 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 629 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 630 | 630 | let self_ty = goal.predicate.self_ty(); |
| 631 | 631 | let ty::Coroutine(def_id, args) = *self_ty.kind() else { |
| 632 | 632 | return Err(NoSolution); |
| ... | ... | @@ -662,14 +662,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 662 | 662 | fn consider_builtin_fused_iterator_candidate( |
| 663 | 663 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 664 | 664 | goal: Goal<'tcx, Self>, |
| 665 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 665 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 666 | 666 | bug!("`FusedIterator` does not have an associated type: {:?}", goal); |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | fn consider_builtin_async_iterator_candidate( |
| 670 | 670 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 671 | 671 | goal: Goal<'tcx, Self>, |
| 672 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 672 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 673 | 673 | let self_ty = goal.predicate.self_ty(); |
| 674 | 674 | let ty::Coroutine(def_id, args) = *self_ty.kind() else { |
| 675 | 675 | return Err(NoSolution); |
| ... | ... | @@ -705,7 +705,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 705 | 705 | fn consider_builtin_coroutine_candidate( |
| 706 | 706 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 707 | 707 | goal: Goal<'tcx, Self>, |
| 708 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 708 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 709 | 709 | let self_ty = goal.predicate.self_ty(); |
| 710 | 710 | let ty::Coroutine(def_id, args) = *self_ty.kind() else { |
| 711 | 711 | return Err(NoSolution); |
| ... | ... | @@ -752,14 +752,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 752 | 752 | fn consider_structural_builtin_unsize_candidates( |
| 753 | 753 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 754 | 754 | goal: Goal<'tcx, Self>, |
| 755 | ) -> Vec<Candidate<'tcx>> { | |
| 755 | ) -> Vec<Candidate<TyCtxt<'tcx>>> { | |
| 756 | 756 | bug!("`Unsize` does not have an associated type: {:?}", goal); |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | fn consider_builtin_discriminant_kind_candidate( |
| 760 | 760 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 761 | 761 | goal: Goal<'tcx, Self>, |
| 762 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 762 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 763 | 763 | let self_ty = goal.predicate.self_ty(); |
| 764 | 764 | let discriminant_ty = match *self_ty.kind() { |
| 765 | 765 | ty::Bool |
| ... | ... | @@ -811,7 +811,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 811 | 811 | fn consider_builtin_async_destruct_candidate( |
| 812 | 812 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 813 | 813 | goal: Goal<'tcx, Self>, |
| 814 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 814 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 815 | 815 | let self_ty = goal.predicate.self_ty(); |
| 816 | 816 | let async_destructor_ty = match *self_ty.kind() { |
| 817 | 817 | ty::Bool |
| ... | ... | @@ -864,14 +864,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> { |
| 864 | 864 | fn consider_builtin_destruct_candidate( |
| 865 | 865 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 866 | 866 | goal: Goal<'tcx, Self>, |
| 867 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 867 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 868 | 868 | bug!("`Destruct` does not have an associated type: {:?}", goal); |
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | fn consider_builtin_transmute_candidate( |
| 872 | 872 | _ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 873 | 873 | goal: Goal<'tcx, Self>, |
| 874 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 874 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 875 | 875 | bug!("`BikeshedIntrinsicFrom` does not have an associated type: {:?}", goal) |
| 876 | 876 | } |
| 877 | 877 | } |
compiler/rustc_trait_selection/src/solve/trait_goals.rs+32-32| ... | ... | @@ -39,7 +39,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 39 | 39 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 40 | 40 | goal: Goal<'tcx, TraitPredicate<'tcx>>, |
| 41 | 41 | impl_def_id: DefId, |
| 42 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 42 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 43 | 43 | let tcx = ecx.interner(); |
| 44 | 44 | |
| 45 | 45 | let impl_trait_header = tcx.impl_trait_header(impl_def_id).unwrap(); |
| ... | ... | @@ -94,7 +94,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 94 | 94 | fn consider_error_guaranteed_candidate( |
| 95 | 95 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 96 | 96 | _guar: ErrorGuaranteed, |
| 97 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 97 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 98 | 98 | // FIXME: don't need to enter a probe here. |
| 99 | 99 | ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc) |
| 100 | 100 | .enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)) |
| ... | ... | @@ -106,7 +106,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 106 | 106 | goal: Goal<'tcx, Self>, |
| 107 | 107 | assumption: ty::Clause<'tcx>, |
| 108 | 108 | then: impl FnOnce(&mut EvalCtxt<'_, InferCtxt<'tcx>>) -> QueryResult<'tcx>, |
| 109 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 109 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 110 | 110 | if let Some(trait_clause) = assumption.as_trait_clause() { |
| 111 | 111 | if trait_clause.def_id() == goal.predicate.def_id() |
| 112 | 112 | && trait_clause.polarity() == goal.predicate.polarity |
| ... | ... | @@ -131,7 +131,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 131 | 131 | fn consider_auto_trait_candidate( |
| 132 | 132 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 133 | 133 | goal: Goal<'tcx, Self>, |
| 134 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 134 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 135 | 135 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 136 | 136 | return Err(NoSolution); |
| 137 | 137 | } |
| ... | ... | @@ -174,7 +174,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 174 | 174 | fn consider_trait_alias_candidate( |
| 175 | 175 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 176 | 176 | goal: Goal<'tcx, Self>, |
| 177 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 177 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 178 | 178 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 179 | 179 | return Err(NoSolution); |
| 180 | 180 | } |
| ... | ... | @@ -197,7 +197,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 197 | 197 | fn consider_builtin_sized_candidate( |
| 198 | 198 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 199 | 199 | goal: Goal<'tcx, Self>, |
| 200 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 200 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 201 | 201 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 202 | 202 | return Err(NoSolution); |
| 203 | 203 | } |
| ... | ... | @@ -212,7 +212,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 212 | 212 | fn consider_builtin_copy_clone_candidate( |
| 213 | 213 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 214 | 214 | goal: Goal<'tcx, Self>, |
| 215 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 215 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 216 | 216 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 217 | 217 | return Err(NoSolution); |
| 218 | 218 | } |
| ... | ... | @@ -227,7 +227,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 227 | 227 | fn consider_builtin_pointer_like_candidate( |
| 228 | 228 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 229 | 229 | goal: Goal<'tcx, Self>, |
| 230 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 230 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 231 | 231 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 232 | 232 | return Err(NoSolution); |
| 233 | 233 | } |
| ... | ... | @@ -257,7 +257,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 257 | 257 | fn consider_builtin_fn_ptr_trait_candidate( |
| 258 | 258 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 259 | 259 | goal: Goal<'tcx, Self>, |
| 260 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 260 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 261 | 261 | let self_ty = goal.predicate.self_ty(); |
| 262 | 262 | match goal.predicate.polarity { |
| 263 | 263 | // impl FnPtr for FnPtr {} |
| ... | ... | @@ -289,7 +289,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 289 | 289 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 290 | 290 | goal: Goal<'tcx, Self>, |
| 291 | 291 | goal_kind: ty::ClosureKind, |
| 292 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 292 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 293 | 293 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 294 | 294 | return Err(NoSolution); |
| 295 | 295 | } |
| ... | ... | @@ -330,7 +330,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 330 | 330 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 331 | 331 | goal: Goal<'tcx, Self>, |
| 332 | 332 | goal_kind: ty::ClosureKind, |
| 333 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 333 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 334 | 334 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 335 | 335 | return Err(NoSolution); |
| 336 | 336 | } |
| ... | ... | @@ -380,7 +380,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 380 | 380 | fn consider_builtin_async_fn_kind_helper_candidate( |
| 381 | 381 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 382 | 382 | goal: Goal<'tcx, Self>, |
| 383 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 383 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 384 | 384 | let [closure_fn_kind_ty, goal_kind_ty] = **goal.predicate.trait_ref.args else { |
| 385 | 385 | bug!(); |
| 386 | 386 | }; |
| ... | ... | @@ -407,7 +407,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 407 | 407 | fn consider_builtin_tuple_candidate( |
| 408 | 408 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 409 | 409 | goal: Goal<'tcx, Self>, |
| 410 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 410 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 411 | 411 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 412 | 412 | return Err(NoSolution); |
| 413 | 413 | } |
| ... | ... | @@ -423,7 +423,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 423 | 423 | fn consider_builtin_pointee_candidate( |
| 424 | 424 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 425 | 425 | goal: Goal<'tcx, Self>, |
| 426 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 426 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 427 | 427 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 428 | 428 | return Err(NoSolution); |
| 429 | 429 | } |
| ... | ... | @@ -435,7 +435,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 435 | 435 | fn consider_builtin_future_candidate( |
| 436 | 436 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 437 | 437 | goal: Goal<'tcx, Self>, |
| 438 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 438 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 439 | 439 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 440 | 440 | return Err(NoSolution); |
| 441 | 441 | } |
| ... | ... | @@ -461,7 +461,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 461 | 461 | fn consider_builtin_iterator_candidate( |
| 462 | 462 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 463 | 463 | goal: Goal<'tcx, Self>, |
| 464 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 464 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 465 | 465 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 466 | 466 | return Err(NoSolution); |
| 467 | 467 | } |
| ... | ... | @@ -487,7 +487,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 487 | 487 | fn consider_builtin_fused_iterator_candidate( |
| 488 | 488 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 489 | 489 | goal: Goal<'tcx, Self>, |
| 490 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 490 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 491 | 491 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 492 | 492 | return Err(NoSolution); |
| 493 | 493 | } |
| ... | ... | @@ -511,7 +511,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 511 | 511 | fn consider_builtin_async_iterator_candidate( |
| 512 | 512 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 513 | 513 | goal: Goal<'tcx, Self>, |
| 514 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 514 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 515 | 515 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 516 | 516 | return Err(NoSolution); |
| 517 | 517 | } |
| ... | ... | @@ -537,7 +537,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 537 | 537 | fn consider_builtin_coroutine_candidate( |
| 538 | 538 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 539 | 539 | goal: Goal<'tcx, Self>, |
| 540 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 540 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 541 | 541 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 542 | 542 | return Err(NoSolution); |
| 543 | 543 | } |
| ... | ... | @@ -569,7 +569,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 569 | 569 | fn consider_builtin_discriminant_kind_candidate( |
| 570 | 570 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 571 | 571 | goal: Goal<'tcx, Self>, |
| 572 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 572 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 573 | 573 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 574 | 574 | return Err(NoSolution); |
| 575 | 575 | } |
| ... | ... | @@ -582,7 +582,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 582 | 582 | fn consider_builtin_async_destruct_candidate( |
| 583 | 583 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 584 | 584 | goal: Goal<'tcx, Self>, |
| 585 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 585 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 586 | 586 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 587 | 587 | return Err(NoSolution); |
| 588 | 588 | } |
| ... | ... | @@ -595,7 +595,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 595 | 595 | fn consider_builtin_destruct_candidate( |
| 596 | 596 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 597 | 597 | goal: Goal<'tcx, Self>, |
| 598 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 598 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 599 | 599 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 600 | 600 | return Err(NoSolution); |
| 601 | 601 | } |
| ... | ... | @@ -611,7 +611,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 611 | 611 | fn consider_builtin_transmute_candidate( |
| 612 | 612 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 613 | 613 | goal: Goal<'tcx, Self>, |
| 614 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 614 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 615 | 615 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 616 | 616 | return Err(NoSolution); |
| 617 | 617 | } |
| ... | ... | @@ -652,7 +652,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { |
| 652 | 652 | fn consider_structural_builtin_unsize_candidates( |
| 653 | 653 | ecx: &mut EvalCtxt<'_, InferCtxt<'tcx>>, |
| 654 | 654 | goal: Goal<'tcx, Self>, |
| 655 | ) -> Vec<Candidate<'tcx>> { | |
| 655 | ) -> Vec<Candidate<TyCtxt<'tcx>>> { | |
| 656 | 656 | if goal.predicate.polarity != ty::PredicatePolarity::Positive { |
| 657 | 657 | return vec![]; |
| 658 | 658 | } |
| ... | ... | @@ -738,7 +738,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 738 | 738 | a_region: ty::Region<'tcx>, |
| 739 | 739 | b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>, |
| 740 | 740 | b_region: ty::Region<'tcx>, |
| 741 | ) -> Vec<Candidate<'tcx>> { | |
| 741 | ) -> Vec<Candidate<TyCtxt<'tcx>>> { | |
| 742 | 742 | let tcx = self.interner(); |
| 743 | 743 | let Goal { predicate: (a_ty, _b_ty), .. } = goal; |
| 744 | 744 | |
| ... | ... | @@ -784,7 +784,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 784 | 784 | goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>, |
| 785 | 785 | b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>, |
| 786 | 786 | b_region: ty::Region<'tcx>, |
| 787 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 787 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 788 | 788 | let tcx = self.interner(); |
| 789 | 789 | let Goal { predicate: (a_ty, _), .. } = goal; |
| 790 | 790 | |
| ... | ... | @@ -825,7 +825,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 825 | 825 | b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>, |
| 826 | 826 | b_region: ty::Region<'tcx>, |
| 827 | 827 | upcast_principal: Option<ty::PolyExistentialTraitRef<'tcx>>, |
| 828 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 828 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 829 | 829 | let param_env = goal.param_env; |
| 830 | 830 | |
| 831 | 831 | // We may upcast to auto traits that are either explicitly listed in |
| ... | ... | @@ -928,7 +928,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 928 | 928 | goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>, |
| 929 | 929 | a_elem_ty: Ty<'tcx>, |
| 930 | 930 | b_elem_ty: Ty<'tcx>, |
| 931 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 931 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 932 | 932 | self.eq(goal.param_env, a_elem_ty, b_elem_ty)?; |
| 933 | 933 | self.probe_builtin_trait_candidate(BuiltinImplSource::Misc) |
| 934 | 934 | .enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)) |
| ... | ... | @@ -953,7 +953,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 953 | 953 | def: ty::AdtDef<'tcx>, |
| 954 | 954 | a_args: ty::GenericArgsRef<'tcx>, |
| 955 | 955 | b_args: ty::GenericArgsRef<'tcx>, |
| 956 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 956 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 957 | 957 | let tcx = self.interner(); |
| 958 | 958 | let Goal { predicate: (_a_ty, b_ty), .. } = goal; |
| 959 | 959 | |
| ... | ... | @@ -1014,7 +1014,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 1014 | 1014 | goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>, |
| 1015 | 1015 | a_tys: &'tcx ty::List<Ty<'tcx>>, |
| 1016 | 1016 | b_tys: &'tcx ty::List<Ty<'tcx>>, |
| 1017 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 1017 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 1018 | 1018 | let tcx = self.interner(); |
| 1019 | 1019 | let Goal { predicate: (_a_ty, b_ty), .. } = goal; |
| 1020 | 1020 | |
| ... | ... | @@ -1049,7 +1049,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 1049 | 1049 | fn disqualify_auto_trait_candidate_due_to_possible_impl( |
| 1050 | 1050 | &mut self, |
| 1051 | 1051 | goal: Goal<'tcx, TraitPredicate<'tcx>>, |
| 1052 | ) -> Option<Result<Candidate<'tcx>, NoSolution>> { | |
| 1052 | ) -> Option<Result<Candidate<TyCtxt<'tcx>>, NoSolution>> { | |
| 1053 | 1053 | let self_ty = goal.predicate.self_ty(); |
| 1054 | 1054 | match *self_ty.kind() { |
| 1055 | 1055 | // Stall int and float vars until they are resolved to a concrete |
| ... | ... | @@ -1154,7 +1154,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> { |
| 1154 | 1154 | &EvalCtxt<'_, InferCtxt<'tcx>>, |
| 1155 | 1155 | Ty<'tcx>, |
| 1156 | 1156 | ) -> Result<Vec<ty::Binder<'tcx, Ty<'tcx>>>, NoSolution>, |
| 1157 | ) -> Result<Candidate<'tcx>, NoSolution> { | |
| 1157 | ) -> Result<Candidate<TyCtxt<'tcx>>, NoSolution> { | |
| 1158 | 1158 | self.probe_trait_candidate(source).enter(|ecx| { |
| 1159 | 1159 | ecx.add_goals( |
| 1160 | 1160 | GoalSource::ImplWhereBound, |
compiler/rustc_trait_selection/src/traits/coherence.rs+2-2| ... | ... | @@ -769,8 +769,8 @@ pub struct UncoveredTyParams<'tcx, T> { |
| 769 | 769 | /// add "non-blanket" impls without breaking negative reasoning in dependent |
| 770 | 770 | /// crates. This is the "rebalancing coherence" (RFC 1023) restriction. |
| 771 | 771 | /// |
| 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). | |
| 774 | 774 | /// |
| 775 | 775 | /// Because we never perform negative reasoning generically (coherence does |
| 776 | 776 | /// 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 { |
| 72 | 72 | fn resolve_vars_if_possible<T>(&self, value: T) -> T |
| 73 | 73 | where |
| 74 | 74 | T: TypeFoldable<Self::Interner>; |
| 75 | ||
| 76 | fn probe<T>(&self, probe: impl FnOnce() -> T) -> T; | |
| 75 | 77 | } |
compiler/stable_mir/src/mir/body.rs+10-17| ... | ... | @@ -637,7 +637,7 @@ pub enum AggregateKind { |
| 637 | 637 | pub enum Operand { |
| 638 | 638 | Copy(Place), |
| 639 | 639 | Move(Place), |
| 640 | Constant(Constant), | |
| 640 | Constant(ConstOperand), | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | #[derive(Clone, Eq, PartialEq)] |
| ... | ... | @@ -653,6 +653,13 @@ impl From<Local> for Place { |
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | #[derive(Clone, Debug, Eq, PartialEq)] | |
| 657 | pub struct ConstOperand { | |
| 658 | pub span: Span, | |
| 659 | pub user_ty: Option<UserTypeAnnotationIndex>, | |
| 660 | pub const_: MirConst, | |
| 661 | } | |
| 662 | ||
| 656 | 663 | /// Debug information pertaining to a user variable. |
| 657 | 664 | #[derive(Clone, Debug, Eq, PartialEq)] |
| 658 | 665 | pub struct VarDebugInfo { |
| ... | ... | @@ -714,13 +721,6 @@ pub enum VarDebugInfoContents { |
| 714 | 721 | Const(ConstOperand), |
| 715 | 722 | } |
| 716 | 723 | |
| 717 | #[derive(Clone, Debug, Eq, PartialEq)] | |
| 718 | pub struct ConstOperand { | |
| 719 | pub span: Span, | |
| 720 | pub user_ty: Option<UserTypeAnnotationIndex>, | |
| 721 | pub const_: MirConst, | |
| 722 | } | |
| 723 | ||
| 724 | 724 | // In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This |
| 725 | 725 | // is so it can be used for both Places (for which the projection elements are of type |
| 726 | 726 | // ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements |
| ... | ... | @@ -829,13 +829,6 @@ pub type FieldIdx = usize; |
| 829 | 829 | |
| 830 | 830 | type UserTypeAnnotationIndex = usize; |
| 831 | 831 | |
| 832 | #[derive(Clone, Debug, Eq, PartialEq)] | |
| 833 | pub struct Constant { | |
| 834 | pub span: Span, | |
| 835 | pub user_ty: Option<UserTypeAnnotationIndex>, | |
| 836 | pub literal: MirConst, | |
| 837 | } | |
| 838 | ||
| 839 | 832 | /// The possible branch sites of a [TerminatorKind::SwitchInt]. |
| 840 | 833 | #[derive(Clone, Debug, Eq, PartialEq)] |
| 841 | 834 | pub struct SwitchTargets { |
| ... | ... | @@ -1001,9 +994,9 @@ impl Operand { |
| 1001 | 994 | } |
| 1002 | 995 | } |
| 1003 | 996 | |
| 1004 | impl Constant { | |
| 997 | impl ConstOperand { | |
| 1005 | 998 | pub fn ty(&self) -> Ty { |
| 1006 | self.literal.ty() | |
| 999 | self.const_.ty() | |
| 1007 | 1000 | } |
| 1008 | 1001 | } |
| 1009 | 1002 |
compiler/stable_mir/src/mir/pretty.rs+1-1| ... | ... | @@ -310,7 +310,7 @@ fn pretty_operand(operand: &Operand) -> String { |
| 310 | 310 | Operand::Move(mv) => { |
| 311 | 311 | format!("move {:?}", mv) |
| 312 | 312 | } |
| 313 | Operand::Constant(cnst) => pretty_mir_const(&cnst.literal), | |
| 313 | Operand::Constant(cnst) => pretty_mir_const(&cnst.const_), | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 |
compiler/stable_mir/src/mir/visit.rs+6-6| ... | ... | @@ -108,8 +108,8 @@ pub trait MirVisitor { |
| 108 | 108 | self.super_ty(ty) |
| 109 | 109 | } |
| 110 | 110 | |
| 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) | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | fn visit_mir_const(&mut self, constant: &MirConst, location: Location) { |
| ... | ... | @@ -366,7 +366,7 @@ pub trait MirVisitor { |
| 366 | 366 | self.visit_place(place, PlaceContext::NON_MUTATING, location) |
| 367 | 367 | } |
| 368 | 368 | Operand::Constant(constant) => { |
| 369 | self.visit_constant(constant, location); | |
| 369 | self.visit_const_operand(constant, location); | |
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
| ... | ... | @@ -380,10 +380,10 @@ pub trait MirVisitor { |
| 380 | 380 | let _ = ty; |
| 381 | 381 | } |
| 382 | 382 | |
| 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; | |
| 385 | 385 | self.visit_span(span); |
| 386 | self.visit_mir_const(literal, location); | |
| 386 | self.visit_mir_const(const_, location); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | 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 | |
| 2 | 2 | |
| 3 | 3 | #![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)] |
| 4 | 4 | #[link(name = "advapi32")] |
| ... | ... | @@ -841,6 +841,7 @@ extern "system" { |
| 841 | 841 | pub const ABOVE_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 32768u32; |
| 842 | 842 | pub type ADDRESS_FAMILY = u16; |
| 843 | 843 | #[repr(C)] |
| 844 | #[derive(Clone, Copy)] | |
| 844 | 845 | pub struct ADDRINFOA { |
| 845 | 846 | pub ai_flags: i32, |
| 846 | 847 | pub ai_family: i32, |
| ... | ... | @@ -851,18 +852,13 @@ pub struct ADDRINFOA { |
| 851 | 852 | pub ai_addr: *mut SOCKADDR, |
| 852 | 853 | pub ai_next: *mut ADDRINFOA, |
| 853 | 854 | } |
| 854 | impl Copy for ADDRINFOA {} | |
| 855 | impl Clone for ADDRINFOA { | |
| 856 | fn clone(&self) -> Self { | |
| 857 | *self | |
| 858 | } | |
| 859 | } | |
| 860 | 855 | pub const AF_INET: ADDRESS_FAMILY = 2u16; |
| 861 | 856 | pub const AF_INET6: ADDRESS_FAMILY = 23u16; |
| 862 | 857 | pub const AF_UNIX: u16 = 1u16; |
| 863 | 858 | pub const AF_UNSPEC: ADDRESS_FAMILY = 0u16; |
| 864 | 859 | pub const ALL_PROCESSOR_GROUPS: u16 = 65535u16; |
| 865 | 860 | #[repr(C)] |
| 861 | #[derive(Clone, Copy)] | |
| 866 | 862 | pub union ARM64_NT_NEON128 { |
| 867 | 863 | pub Anonymous: ARM64_NT_NEON128_0, |
| 868 | 864 | pub D: [f64; 2], |
| ... | ... | @@ -870,27 +866,17 @@ pub union ARM64_NT_NEON128 { |
| 870 | 866 | pub H: [u16; 8], |
| 871 | 867 | pub B: [u8; 16], |
| 872 | 868 | } |
| 873 | impl Copy for ARM64_NT_NEON128 {} | |
| 874 | impl Clone for ARM64_NT_NEON128 { | |
| 875 | fn clone(&self) -> Self { | |
| 876 | *self | |
| 877 | } | |
| 878 | } | |
| 879 | 869 | #[repr(C)] |
| 870 | #[derive(Clone, Copy)] | |
| 880 | 871 | pub struct ARM64_NT_NEON128_0 { |
| 881 | 872 | pub Low: u64, |
| 882 | 873 | pub High: i64, |
| 883 | 874 | } |
| 884 | impl Copy for ARM64_NT_NEON128_0 {} | |
| 885 | impl Clone for ARM64_NT_NEON128_0 { | |
| 886 | fn clone(&self) -> Self { | |
| 887 | *self | |
| 888 | } | |
| 889 | } | |
| 890 | 875 | pub const BELOW_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 16384u32; |
| 891 | 876 | pub type BOOL = i32; |
| 892 | 877 | pub type BOOLEAN = u8; |
| 893 | 878 | #[repr(C)] |
| 879 | #[derive(Clone, Copy)] | |
| 894 | 880 | pub struct BY_HANDLE_FILE_INFORMATION { |
| 895 | 881 | pub dwFileAttributes: u32, |
| 896 | 882 | pub ftCreationTime: FILETIME, |
| ... | ... | @@ -903,41 +889,26 @@ pub struct BY_HANDLE_FILE_INFORMATION { |
| 903 | 889 | pub nFileIndexHigh: u32, |
| 904 | 890 | pub nFileIndexLow: u32, |
| 905 | 891 | } |
| 906 | impl Copy for BY_HANDLE_FILE_INFORMATION {} | |
| 907 | impl Clone for BY_HANDLE_FILE_INFORMATION { | |
| 908 | fn clone(&self) -> Self { | |
| 909 | *self | |
| 910 | } | |
| 911 | } | |
| 912 | 892 | pub const CALLBACK_CHUNK_FINISHED: LPPROGRESS_ROUTINE_CALLBACK_REASON = 0u32; |
| 913 | 893 | pub const CALLBACK_STREAM_SWITCH: LPPROGRESS_ROUTINE_CALLBACK_REASON = 1u32; |
| 914 | 894 | pub type COMPARESTRING_RESULT = i32; |
| 915 | 895 | #[repr(C)] |
| 896 | #[derive(Clone, Copy)] | |
| 916 | 897 | pub struct CONDITION_VARIABLE { |
| 917 | 898 | pub Ptr: *mut core::ffi::c_void, |
| 918 | 899 | } |
| 919 | impl Copy for CONDITION_VARIABLE {} | |
| 920 | impl Clone for CONDITION_VARIABLE { | |
| 921 | fn clone(&self) -> Self { | |
| 922 | *self | |
| 923 | } | |
| 924 | } | |
| 925 | 900 | pub type CONSOLE_MODE = u32; |
| 926 | 901 | #[repr(C)] |
| 902 | #[derive(Clone, Copy)] | |
| 927 | 903 | pub struct CONSOLE_READCONSOLE_CONTROL { |
| 928 | 904 | pub nLength: u32, |
| 929 | 905 | pub nInitialChars: u32, |
| 930 | 906 | pub dwCtrlWakeupMask: u32, |
| 931 | 907 | pub dwControlKeyState: u32, |
| 932 | 908 | } |
| 933 | impl Copy for CONSOLE_READCONSOLE_CONTROL {} | |
| 934 | impl Clone for CONSOLE_READCONSOLE_CONTROL { | |
| 935 | fn clone(&self) -> Self { | |
| 936 | *self | |
| 937 | } | |
| 938 | } | |
| 939 | 909 | #[repr(C)] |
| 940 | 910 | #[cfg(target_arch = "aarch64")] |
| 911 | #[derive(Clone, Copy)] | |
| 941 | 912 | pub struct CONTEXT { |
| 942 | 913 | pub ContextFlags: CONTEXT_FLAGS, |
| 943 | 914 | pub Cpsr: u32, |
| ... | ... | @@ -952,30 +923,16 @@ pub struct CONTEXT { |
| 952 | 923 | pub Wcr: [u32; 2], |
| 953 | 924 | pub Wvr: [u64; 2], |
| 954 | 925 | } |
| 955 | #[cfg(target_arch = "aarch64")] | |
| 956 | impl Copy for CONTEXT {} | |
| 957 | #[cfg(target_arch = "aarch64")] | |
| 958 | impl Clone for CONTEXT { | |
| 959 | fn clone(&self) -> Self { | |
| 960 | *self | |
| 961 | } | |
| 962 | } | |
| 963 | 926 | #[repr(C)] |
| 964 | 927 | #[cfg(target_arch = "aarch64")] |
| 928 | #[derive(Clone, Copy)] | |
| 965 | 929 | pub union CONTEXT_0 { |
| 966 | 930 | pub Anonymous: CONTEXT_0_0, |
| 967 | 931 | pub X: [u64; 31], |
| 968 | 932 | } |
| 969 | #[cfg(target_arch = "aarch64")] | |
| 970 | impl Copy for CONTEXT_0 {} | |
| 971 | #[cfg(target_arch = "aarch64")] | |
| 972 | impl Clone for CONTEXT_0 { | |
| 973 | fn clone(&self) -> Self { | |
| 974 | *self | |
| 975 | } | |
| 976 | } | |
| 977 | 933 | #[repr(C)] |
| 978 | 934 | #[cfg(target_arch = "aarch64")] |
| 935 | #[derive(Clone, Copy)] | |
| 979 | 936 | pub struct CONTEXT_0_0 { |
| 980 | 937 | pub X0: u64, |
| 981 | 938 | pub X1: u64, |
| ... | ... | @@ -1009,16 +966,9 @@ pub struct CONTEXT_0_0 { |
| 1009 | 966 | pub Fp: u64, |
| 1010 | 967 | pub Lr: u64, |
| 1011 | 968 | } |
| 1012 | #[cfg(target_arch = "aarch64")] | |
| 1013 | impl Copy for CONTEXT_0_0 {} | |
| 1014 | #[cfg(target_arch = "aarch64")] | |
| 1015 | impl Clone for CONTEXT_0_0 { | |
| 1016 | fn clone(&self) -> Self { | |
| 1017 | *self | |
| 1018 | } | |
| 1019 | } | |
| 1020 | 969 | #[repr(C)] |
| 1021 | 970 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] |
| 971 | #[derive(Clone, Copy)] | |
| 1022 | 972 | pub struct CONTEXT { |
| 1023 | 973 | pub P1Home: u64, |
| 1024 | 974 | pub P2Home: u64, |
| ... | ... | @@ -1067,30 +1017,16 @@ pub struct CONTEXT { |
| 1067 | 1017 | pub LastExceptionToRip: u64, |
| 1068 | 1018 | pub LastExceptionFromRip: u64, |
| 1069 | 1019 | } |
| 1070 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1071 | impl Copy for CONTEXT {} | |
| 1072 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1073 | impl Clone for CONTEXT { | |
| 1074 | fn clone(&self) -> Self { | |
| 1075 | *self | |
| 1076 | } | |
| 1077 | } | |
| 1078 | 1020 | #[repr(C)] |
| 1079 | 1021 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] |
| 1022 | #[derive(Clone, Copy)] | |
| 1080 | 1023 | pub union CONTEXT_0 { |
| 1081 | 1024 | pub FltSave: XSAVE_FORMAT, |
| 1082 | 1025 | pub Anonymous: CONTEXT_0_0, |
| 1083 | 1026 | } |
| 1084 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1085 | impl Copy for CONTEXT_0 {} | |
| 1086 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1087 | impl Clone for CONTEXT_0 { | |
| 1088 | fn clone(&self) -> Self { | |
| 1089 | *self | |
| 1090 | } | |
| 1091 | } | |
| 1092 | 1027 | #[repr(C)] |
| 1093 | 1028 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] |
| 1029 | #[derive(Clone, Copy)] | |
| 1094 | 1030 | pub struct CONTEXT_0_0 { |
| 1095 | 1031 | pub Header: [M128A; 2], |
| 1096 | 1032 | pub Legacy: [M128A; 8], |
| ... | ... | @@ -1111,16 +1047,9 @@ pub struct CONTEXT_0_0 { |
| 1111 | 1047 | pub Xmm14: M128A, |
| 1112 | 1048 | pub Xmm15: M128A, |
| 1113 | 1049 | } |
| 1114 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1115 | impl Copy for CONTEXT_0_0 {} | |
| 1116 | #[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 1117 | impl Clone for CONTEXT_0_0 { | |
| 1118 | fn clone(&self) -> Self { | |
| 1119 | *self | |
| 1120 | } | |
| 1121 | } | |
| 1122 | 1050 | #[repr(C)] |
| 1123 | 1051 | #[cfg(target_arch = "x86")] |
| 1052 | #[derive(Clone, Copy)] | |
| 1124 | 1053 | pub struct CONTEXT { |
| 1125 | 1054 | pub ContextFlags: CONTEXT_FLAGS, |
| 1126 | 1055 | pub Dr0: u32, |
| ... | ... | @@ -1148,14 +1077,6 @@ pub struct CONTEXT { |
| 1148 | 1077 | pub SegSs: u32, |
| 1149 | 1078 | pub ExtendedRegisters: [u8; 512], |
| 1150 | 1079 | } |
| 1151 | #[cfg(target_arch = "x86")] | |
| 1152 | impl Copy for CONTEXT {} | |
| 1153 | #[cfg(target_arch = "x86")] | |
| 1154 | impl Clone for CONTEXT { | |
| 1155 | fn clone(&self) -> Self { | |
| 1156 | *self | |
| 1157 | } | |
| 1158 | } | |
| 1159 | 1080 | pub type CONTEXT_FLAGS = u32; |
| 1160 | 1081 | pub const CP_UTF8: u32 = 65001u32; |
| 1161 | 1082 | pub const CREATE_ALWAYS: FILE_CREATION_DISPOSITION = 2u32; |
| ... | ... | @@ -3068,6 +2989,7 @@ pub const ERROR_XML_PARSE_ERROR: WIN32_ERROR = 1465u32; |
| 3068 | 2989 | pub type EXCEPTION_DISPOSITION = i32; |
| 3069 | 2990 | pub const EXCEPTION_MAXIMUM_PARAMETERS: u32 = 15u32; |
| 3070 | 2991 | #[repr(C)] |
| 2992 | #[derive(Clone, Copy)] | |
| 3071 | 2993 | pub struct EXCEPTION_RECORD { |
| 3072 | 2994 | pub ExceptionCode: NTSTATUS, |
| 3073 | 2995 | pub ExceptionFlags: u32, |
| ... | ... | @@ -3076,12 +2998,6 @@ pub struct EXCEPTION_RECORD { |
| 3076 | 2998 | pub NumberParameters: u32, |
| 3077 | 2999 | pub ExceptionInformation: [usize; 15], |
| 3078 | 3000 | } |
| 3079 | impl Copy for EXCEPTION_RECORD {} | |
| 3080 | impl Clone for EXCEPTION_RECORD { | |
| 3081 | fn clone(&self) -> Self { | |
| 3082 | *self | |
| 3083 | } | |
| 3084 | } | |
| 3085 | 3001 | pub const EXCEPTION_STACK_OVERFLOW: NTSTATUS = 0xC00000FD_u32 as _; |
| 3086 | 3002 | pub const EXTENDED_STARTUPINFO_PRESENT: PROCESS_CREATION_FLAGS = 524288u32; |
| 3087 | 3003 | pub const E_NOTIMPL: HRESULT = 0x80004001_u32 as _; |
| ... | ... | @@ -3095,40 +3011,25 @@ pub const FALSE: BOOL = 0i32; |
| 3095 | 3011 | pub type FARPROC = Option<unsafe extern "system" fn() -> isize>; |
| 3096 | 3012 | pub const FAST_FAIL_FATAL_APP_EXIT: u32 = 7u32; |
| 3097 | 3013 | #[repr(C)] |
| 3014 | #[derive(Clone, Copy)] | |
| 3098 | 3015 | pub struct FD_SET { |
| 3099 | 3016 | pub fd_count: u32, |
| 3100 | 3017 | pub fd_array: [SOCKET; 64], |
| 3101 | 3018 | } |
| 3102 | impl Copy for FD_SET {} | |
| 3103 | impl Clone for FD_SET { | |
| 3104 | fn clone(&self) -> Self { | |
| 3105 | *self | |
| 3106 | } | |
| 3107 | } | |
| 3108 | 3019 | #[repr(C)] |
| 3020 | #[derive(Clone, Copy)] | |
| 3109 | 3021 | pub struct FILETIME { |
| 3110 | 3022 | pub dwLowDateTime: u32, |
| 3111 | 3023 | pub dwHighDateTime: u32, |
| 3112 | 3024 | } |
| 3113 | impl Copy for FILETIME {} | |
| 3114 | impl Clone for FILETIME { | |
| 3115 | fn clone(&self) -> Self { | |
| 3116 | *self | |
| 3117 | } | |
| 3118 | } | |
| 3119 | 3025 | pub type FILE_ACCESS_RIGHTS = u32; |
| 3120 | 3026 | pub const FILE_ADD_FILE: FILE_ACCESS_RIGHTS = 2u32; |
| 3121 | 3027 | pub const FILE_ADD_SUBDIRECTORY: FILE_ACCESS_RIGHTS = 4u32; |
| 3122 | 3028 | #[repr(C)] |
| 3029 | #[derive(Clone, Copy)] | |
| 3123 | 3030 | pub struct FILE_ALLOCATION_INFO { |
| 3124 | 3031 | pub AllocationSize: i64, |
| 3125 | 3032 | } |
| 3126 | impl Copy for FILE_ALLOCATION_INFO {} | |
| 3127 | impl Clone for FILE_ALLOCATION_INFO { | |
| 3128 | fn clone(&self) -> Self { | |
| 3129 | *self | |
| 3130 | } | |
| 3131 | } | |
| 3132 | 3033 | pub const FILE_ALL_ACCESS: FILE_ACCESS_RIGHTS = 2032127u32; |
| 3133 | 3034 | pub const FILE_APPEND_DATA: FILE_ACCESS_RIGHTS = 4u32; |
| 3134 | 3035 | pub const FILE_ATTRIBUTE_ARCHIVE: FILE_FLAGS_AND_ATTRIBUTES = 32u32; |
| ... | ... | @@ -3151,20 +3052,16 @@ pub const FILE_ATTRIBUTE_REPARSE_POINT: FILE_FLAGS_AND_ATTRIBUTES = 1024u32; |
| 3151 | 3052 | pub const FILE_ATTRIBUTE_SPARSE_FILE: FILE_FLAGS_AND_ATTRIBUTES = 512u32; |
| 3152 | 3053 | pub const FILE_ATTRIBUTE_SYSTEM: FILE_FLAGS_AND_ATTRIBUTES = 4u32; |
| 3153 | 3054 | #[repr(C)] |
| 3055 | #[derive(Clone, Copy)] | |
| 3154 | 3056 | pub struct FILE_ATTRIBUTE_TAG_INFO { |
| 3155 | 3057 | pub FileAttributes: u32, |
| 3156 | 3058 | pub ReparseTag: u32, |
| 3157 | 3059 | } |
| 3158 | impl Copy for FILE_ATTRIBUTE_TAG_INFO {} | |
| 3159 | impl Clone for FILE_ATTRIBUTE_TAG_INFO { | |
| 3160 | fn clone(&self) -> Self { | |
| 3161 | *self | |
| 3162 | } | |
| 3163 | } | |
| 3164 | 3060 | pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32; |
| 3165 | 3061 | pub const FILE_ATTRIBUTE_UNPINNED: FILE_FLAGS_AND_ATTRIBUTES = 1048576u32; |
| 3166 | 3062 | pub const FILE_ATTRIBUTE_VIRTUAL: FILE_FLAGS_AND_ATTRIBUTES = 65536u32; |
| 3167 | 3063 | #[repr(C)] |
| 3064 | #[derive(Clone, Copy)] | |
| 3168 | 3065 | pub struct FILE_BASIC_INFO { |
| 3169 | 3066 | pub CreationTime: i64, |
| 3170 | 3067 | pub LastAccessTime: i64, |
| ... | ... | @@ -3172,12 +3069,6 @@ pub struct FILE_BASIC_INFO { |
| 3172 | 3069 | pub ChangeTime: i64, |
| 3173 | 3070 | pub FileAttributes: u32, |
| 3174 | 3071 | } |
| 3175 | impl Copy for FILE_BASIC_INFO {} | |
| 3176 | impl Clone for FILE_BASIC_INFO { | |
| 3177 | fn clone(&self) -> Self { | |
| 3178 | *self | |
| 3179 | } | |
| 3180 | } | |
| 3181 | 3072 | pub const FILE_BEGIN: SET_FILE_POINTER_MOVE_METHOD = 0u32; |
| 3182 | 3073 | pub const FILE_COMPLETE_IF_OPLOCKED: NTCREATEFILE_CREATE_OPTIONS = 256u32; |
| 3183 | 3074 | pub 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 |
| 3197 | 3088 | pub const FILE_DISPOSITION_FLAG_ON_CLOSE: FILE_DISPOSITION_INFO_EX_FLAGS = 8u32; |
| 3198 | 3089 | pub const FILE_DISPOSITION_FLAG_POSIX_SEMANTICS: FILE_DISPOSITION_INFO_EX_FLAGS = 2u32; |
| 3199 | 3090 | #[repr(C)] |
| 3091 | #[derive(Clone, Copy)] | |
| 3200 | 3092 | pub struct FILE_DISPOSITION_INFO { |
| 3201 | 3093 | pub DeleteFile: BOOLEAN, |
| 3202 | 3094 | } |
| 3203 | impl Copy for FILE_DISPOSITION_INFO {} | |
| 3204 | impl Clone for FILE_DISPOSITION_INFO { | |
| 3205 | fn clone(&self) -> Self { | |
| 3206 | *self | |
| 3207 | } | |
| 3208 | } | |
| 3209 | 3095 | #[repr(C)] |
| 3096 | #[derive(Clone, Copy)] | |
| 3210 | 3097 | pub struct FILE_DISPOSITION_INFO_EX { |
| 3211 | 3098 | pub Flags: FILE_DISPOSITION_INFO_EX_FLAGS, |
| 3212 | 3099 | } |
| 3213 | impl Copy for FILE_DISPOSITION_INFO_EX {} | |
| 3214 | impl Clone for FILE_DISPOSITION_INFO_EX { | |
| 3215 | fn clone(&self) -> Self { | |
| 3216 | *self | |
| 3217 | } | |
| 3218 | } | |
| 3219 | 3100 | pub type FILE_DISPOSITION_INFO_EX_FLAGS = u32; |
| 3220 | 3101 | pub const FILE_END: SET_FILE_POINTER_MOVE_METHOD = 2u32; |
| 3221 | 3102 | #[repr(C)] |
| 3103 | #[derive(Clone, Copy)] | |
| 3222 | 3104 | pub struct FILE_END_OF_FILE_INFO { |
| 3223 | 3105 | pub EndOfFile: i64, |
| 3224 | 3106 | } |
| 3225 | impl Copy for FILE_END_OF_FILE_INFO {} | |
| 3226 | impl Clone for FILE_END_OF_FILE_INFO { | |
| 3227 | fn clone(&self) -> Self { | |
| 3228 | *self | |
| 3229 | } | |
| 3230 | } | |
| 3231 | 3107 | pub const FILE_EXECUTE: FILE_ACCESS_RIGHTS = 32u32; |
| 3232 | 3108 | pub type FILE_FLAGS_AND_ATTRIBUTES = u32; |
| 3233 | 3109 | pub const FILE_FLAG_BACKUP_SEMANTICS: FILE_FLAGS_AND_ATTRIBUTES = 33554432u32; |
| ... | ... | @@ -3246,6 +3122,7 @@ pub const FILE_GENERIC_EXECUTE: FILE_ACCESS_RIGHTS = 1179808u32; |
| 3246 | 3122 | pub const FILE_GENERIC_READ: FILE_ACCESS_RIGHTS = 1179785u32; |
| 3247 | 3123 | pub const FILE_GENERIC_WRITE: FILE_ACCESS_RIGHTS = 1179926u32; |
| 3248 | 3124 | #[repr(C)] |
| 3125 | #[derive(Clone, Copy)] | |
| 3249 | 3126 | pub struct FILE_ID_BOTH_DIR_INFO { |
| 3250 | 3127 | pub NextEntryOffset: u32, |
| 3251 | 3128 | pub FileIndex: u32, |
| ... | ... | @@ -3263,23 +3140,12 @@ pub struct FILE_ID_BOTH_DIR_INFO { |
| 3263 | 3140 | pub FileId: i64, |
| 3264 | 3141 | pub FileName: [u16; 1], |
| 3265 | 3142 | } |
| 3266 | impl Copy for FILE_ID_BOTH_DIR_INFO {} | |
| 3267 | impl Clone for FILE_ID_BOTH_DIR_INFO { | |
| 3268 | fn clone(&self) -> Self { | |
| 3269 | *self | |
| 3270 | } | |
| 3271 | } | |
| 3272 | 3143 | pub type FILE_INFO_BY_HANDLE_CLASS = i32; |
| 3273 | 3144 | #[repr(C)] |
| 3145 | #[derive(Clone, Copy)] | |
| 3274 | 3146 | pub struct FILE_IO_PRIORITY_HINT_INFO { |
| 3275 | 3147 | pub PriorityHint: PRIORITY_HINT, |
| 3276 | 3148 | } |
| 3277 | impl Copy for FILE_IO_PRIORITY_HINT_INFO {} | |
| 3278 | impl Clone for FILE_IO_PRIORITY_HINT_INFO { | |
| 3279 | fn clone(&self) -> Self { | |
| 3280 | *self | |
| 3281 | } | |
| 3282 | } | |
| 3283 | 3149 | pub const FILE_LIST_DIRECTORY: FILE_ACCESS_RIGHTS = 1u32; |
| 3284 | 3150 | pub const FILE_NAME_NORMALIZED: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32; |
| 3285 | 3151 | pub const FILE_NAME_OPENED: GETFINALPATHNAMEBYHANDLE_FLAGS = 8u32; |
| ... | ... | @@ -3310,6 +3176,7 @@ pub const FILE_SHARE_NONE: FILE_SHARE_MODE = 0u32; |
| 3310 | 3176 | pub const FILE_SHARE_READ: FILE_SHARE_MODE = 1u32; |
| 3311 | 3177 | pub const FILE_SHARE_WRITE: FILE_SHARE_MODE = 2u32; |
| 3312 | 3178 | #[repr(C)] |
| 3179 | #[derive(Clone, Copy)] | |
| 3313 | 3180 | pub struct FILE_STANDARD_INFO { |
| 3314 | 3181 | pub AllocationSize: i64, |
| 3315 | 3182 | pub EndOfFile: i64, |
| ... | ... | @@ -3317,12 +3184,6 @@ pub struct FILE_STANDARD_INFO { |
| 3317 | 3184 | pub DeletePending: BOOLEAN, |
| 3318 | 3185 | pub Directory: BOOLEAN, |
| 3319 | 3186 | } |
| 3320 | impl Copy for FILE_STANDARD_INFO {} | |
| 3321 | impl Clone for FILE_STANDARD_INFO { | |
| 3322 | fn clone(&self) -> Self { | |
| 3323 | *self | |
| 3324 | } | |
| 3325 | } | |
| 3326 | 3187 | pub const FILE_SUPERSEDE: NTCREATEFILE_CREATE_DISPOSITION = 0u32; |
| 3327 | 3188 | pub const FILE_SYNCHRONOUS_IO_ALERT: NTCREATEFILE_CREATE_OPTIONS = 16u32; |
| 3328 | 3189 | pub const FILE_SYNCHRONOUS_IO_NONALERT: NTCREATEFILE_CREATE_OPTIONS = 32u32; |
| ... | ... | @@ -3340,6 +3201,7 @@ pub const FILE_WRITE_THROUGH: NTCREATEFILE_CREATE_OPTIONS = 2u32; |
| 3340 | 3201 | pub const FIONBIO: i32 = -2147195266i32; |
| 3341 | 3202 | #[repr(C)] |
| 3342 | 3203 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] |
| 3204 | #[derive(Clone, Copy)] | |
| 3343 | 3205 | pub struct FLOATING_SAVE_AREA { |
| 3344 | 3206 | pub ControlWord: u32, |
| 3345 | 3207 | pub StatusWord: u32, |
| ... | ... | @@ -3351,16 +3213,9 @@ pub struct FLOATING_SAVE_AREA { |
| 3351 | 3213 | pub RegisterArea: [u8; 80], |
| 3352 | 3214 | pub Cr0NpxState: u32, |
| 3353 | 3215 | } |
| 3354 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 3355 | impl Copy for FLOATING_SAVE_AREA {} | |
| 3356 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 3357 | impl Clone for FLOATING_SAVE_AREA { | |
| 3358 | fn clone(&self) -> Self { | |
| 3359 | *self | |
| 3360 | } | |
| 3361 | } | |
| 3362 | 3216 | #[repr(C)] |
| 3363 | 3217 | #[cfg(target_arch = "x86")] |
| 3218 | #[derive(Clone, Copy)] | |
| 3364 | 3219 | pub struct FLOATING_SAVE_AREA { |
| 3365 | 3220 | pub ControlWord: u32, |
| 3366 | 3221 | pub StatusWord: u32, |
| ... | ... | @@ -3372,14 +3227,6 @@ pub struct FLOATING_SAVE_AREA { |
| 3372 | 3227 | pub RegisterArea: [u8; 80], |
| 3373 | 3228 | pub Spare0: u32, |
| 3374 | 3229 | } |
| 3375 | #[cfg(target_arch = "x86")] | |
| 3376 | impl Copy for FLOATING_SAVE_AREA {} | |
| 3377 | #[cfg(target_arch = "x86")] | |
| 3378 | impl Clone for FLOATING_SAVE_AREA { | |
| 3379 | fn clone(&self) -> Self { | |
| 3380 | *self | |
| 3381 | } | |
| 3382 | } | |
| 3383 | 3230 | pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: FORMAT_MESSAGE_OPTIONS = 256u32; |
| 3384 | 3231 | pub const FORMAT_MESSAGE_ARGUMENT_ARRAY: FORMAT_MESSAGE_OPTIONS = 8192u32; |
| 3385 | 3232 | pub const FORMAT_MESSAGE_FROM_HMODULE: FORMAT_MESSAGE_OPTIONS = 2048u32; |
| ... | ... | @@ -3422,18 +3269,13 @@ pub const GENERIC_READ: GENERIC_ACCESS_RIGHTS = 2147483648u32; |
| 3422 | 3269 | pub const GENERIC_WRITE: GENERIC_ACCESS_RIGHTS = 1073741824u32; |
| 3423 | 3270 | pub type GETFINALPATHNAMEBYHANDLE_FLAGS = u32; |
| 3424 | 3271 | #[repr(C)] |
| 3272 | #[derive(Clone, Copy)] | |
| 3425 | 3273 | pub struct GUID { |
| 3426 | 3274 | pub data1: u32, |
| 3427 | 3275 | pub data2: u16, |
| 3428 | 3276 | pub data3: u16, |
| 3429 | 3277 | pub data4: [u8; 8], |
| 3430 | 3278 | } |
| 3431 | impl Copy for GUID {} | |
| 3432 | impl Clone for GUID { | |
| 3433 | fn clone(&self) -> Self { | |
| 3434 | *self | |
| 3435 | } | |
| 3436 | } | |
| 3437 | 3279 | impl GUID { |
| 3438 | 3280 | pub const fn from_u128(uuid: u128) -> Self { |
| 3439 | 3281 | Self { |
| ... | ... | @@ -3454,112 +3296,67 @@ pub type HMODULE = *mut core::ffi::c_void; |
| 3454 | 3296 | pub type HRESULT = i32; |
| 3455 | 3297 | pub const IDLE_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 64u32; |
| 3456 | 3298 | #[repr(C)] |
| 3299 | #[derive(Clone, Copy)] | |
| 3457 | 3300 | pub struct IN6_ADDR { |
| 3458 | 3301 | pub u: IN6_ADDR_0, |
| 3459 | 3302 | } |
| 3460 | impl Copy for IN6_ADDR {} | |
| 3461 | impl Clone for IN6_ADDR { | |
| 3462 | fn clone(&self) -> Self { | |
| 3463 | *self | |
| 3464 | } | |
| 3465 | } | |
| 3466 | 3303 | #[repr(C)] |
| 3304 | #[derive(Clone, Copy)] | |
| 3467 | 3305 | pub union IN6_ADDR_0 { |
| 3468 | 3306 | pub Byte: [u8; 16], |
| 3469 | 3307 | pub Word: [u16; 8], |
| 3470 | 3308 | } |
| 3471 | impl Copy for IN6_ADDR_0 {} | |
| 3472 | impl Clone for IN6_ADDR_0 { | |
| 3473 | fn clone(&self) -> Self { | |
| 3474 | *self | |
| 3475 | } | |
| 3476 | } | |
| 3477 | 3309 | pub const INFINITE: u32 = 4294967295u32; |
| 3478 | 3310 | pub const INHERIT_CALLER_PRIORITY: PROCESS_CREATION_FLAGS = 131072u32; |
| 3479 | 3311 | pub const INHERIT_PARENT_AFFINITY: PROCESS_CREATION_FLAGS = 65536u32; |
| 3480 | 3312 | #[repr(C)] |
| 3313 | #[derive(Clone, Copy)] | |
| 3481 | 3314 | pub union INIT_ONCE { |
| 3482 | 3315 | pub Ptr: *mut core::ffi::c_void, |
| 3483 | 3316 | } |
| 3484 | impl Copy for INIT_ONCE {} | |
| 3485 | impl Clone for INIT_ONCE { | |
| 3486 | fn clone(&self) -> Self { | |
| 3487 | *self | |
| 3488 | } | |
| 3489 | } | |
| 3490 | 3317 | pub const INIT_ONCE_INIT_FAILED: u32 = 4u32; |
| 3491 | 3318 | pub const INVALID_FILE_ATTRIBUTES: u32 = 4294967295u32; |
| 3492 | 3319 | pub const INVALID_SOCKET: SOCKET = -1i32 as _; |
| 3493 | 3320 | #[repr(C)] |
| 3321 | #[derive(Clone, Copy)] | |
| 3494 | 3322 | pub struct IN_ADDR { |
| 3495 | 3323 | pub S_un: IN_ADDR_0, |
| 3496 | 3324 | } |
| 3497 | impl Copy for IN_ADDR {} | |
| 3498 | impl Clone for IN_ADDR { | |
| 3499 | fn clone(&self) -> Self { | |
| 3500 | *self | |
| 3501 | } | |
| 3502 | } | |
| 3503 | 3325 | #[repr(C)] |
| 3326 | #[derive(Clone, Copy)] | |
| 3504 | 3327 | pub union IN_ADDR_0 { |
| 3505 | 3328 | pub S_un_b: IN_ADDR_0_0, |
| 3506 | 3329 | pub S_un_w: IN_ADDR_0_1, |
| 3507 | 3330 | pub S_addr: u32, |
| 3508 | 3331 | } |
| 3509 | impl Copy for IN_ADDR_0 {} | |
| 3510 | impl Clone for IN_ADDR_0 { | |
| 3511 | fn clone(&self) -> Self { | |
| 3512 | *self | |
| 3513 | } | |
| 3514 | } | |
| 3515 | 3332 | #[repr(C)] |
| 3333 | #[derive(Clone, Copy)] | |
| 3516 | 3334 | pub struct IN_ADDR_0_0 { |
| 3517 | 3335 | pub s_b1: u8, |
| 3518 | 3336 | pub s_b2: u8, |
| 3519 | 3337 | pub s_b3: u8, |
| 3520 | 3338 | pub s_b4: u8, |
| 3521 | 3339 | } |
| 3522 | impl Copy for IN_ADDR_0_0 {} | |
| 3523 | impl Clone for IN_ADDR_0_0 { | |
| 3524 | fn clone(&self) -> Self { | |
| 3525 | *self | |
| 3526 | } | |
| 3527 | } | |
| 3528 | 3340 | #[repr(C)] |
| 3341 | #[derive(Clone, Copy)] | |
| 3529 | 3342 | pub struct IN_ADDR_0_1 { |
| 3530 | 3343 | pub s_w1: u16, |
| 3531 | 3344 | pub s_w2: u16, |
| 3532 | 3345 | } |
| 3533 | impl Copy for IN_ADDR_0_1 {} | |
| 3534 | impl Clone for IN_ADDR_0_1 { | |
| 3535 | fn clone(&self) -> Self { | |
| 3536 | *self | |
| 3537 | } | |
| 3538 | } | |
| 3539 | 3346 | pub const IO_REPARSE_TAG_MOUNT_POINT: u32 = 2684354563u32; |
| 3540 | 3347 | pub const IO_REPARSE_TAG_SYMLINK: u32 = 2684354572u32; |
| 3541 | 3348 | #[repr(C)] |
| 3349 | #[derive(Clone, Copy)] | |
| 3542 | 3350 | pub struct IO_STATUS_BLOCK { |
| 3543 | 3351 | pub Anonymous: IO_STATUS_BLOCK_0, |
| 3544 | 3352 | pub Information: usize, |
| 3545 | 3353 | } |
| 3546 | impl Copy for IO_STATUS_BLOCK {} | |
| 3547 | impl Clone for IO_STATUS_BLOCK { | |
| 3548 | fn clone(&self) -> Self { | |
| 3549 | *self | |
| 3550 | } | |
| 3551 | } | |
| 3552 | 3354 | #[repr(C)] |
| 3355 | #[derive(Clone, Copy)] | |
| 3553 | 3356 | pub union IO_STATUS_BLOCK_0 { |
| 3554 | 3357 | pub Status: NTSTATUS, |
| 3555 | 3358 | pub Pointer: *mut core::ffi::c_void, |
| 3556 | 3359 | } |
| 3557 | impl Copy for IO_STATUS_BLOCK_0 {} | |
| 3558 | impl Clone for IO_STATUS_BLOCK_0 { | |
| 3559 | fn clone(&self) -> Self { | |
| 3560 | *self | |
| 3561 | } | |
| 3562 | } | |
| 3563 | 3360 | pub type IPPROTO = i32; |
| 3564 | 3361 | pub const IPPROTO_AH: IPPROTO = 51i32; |
| 3565 | 3362 | pub const IPPROTO_CBT: IPPROTO = 7i32; |
| ... | ... | @@ -3601,45 +3398,30 @@ pub const IPPROTO_UDP: IPPROTO = 17i32; |
| 3601 | 3398 | pub const IPV6_ADD_MEMBERSHIP: i32 = 12i32; |
| 3602 | 3399 | pub const IPV6_DROP_MEMBERSHIP: i32 = 13i32; |
| 3603 | 3400 | #[repr(C)] |
| 3401 | #[derive(Clone, Copy)] | |
| 3604 | 3402 | pub struct IPV6_MREQ { |
| 3605 | 3403 | pub ipv6mr_multiaddr: IN6_ADDR, |
| 3606 | 3404 | pub ipv6mr_interface: u32, |
| 3607 | 3405 | } |
| 3608 | impl Copy for IPV6_MREQ {} | |
| 3609 | impl Clone for IPV6_MREQ { | |
| 3610 | fn clone(&self) -> Self { | |
| 3611 | *self | |
| 3612 | } | |
| 3613 | } | |
| 3614 | 3406 | pub const IPV6_MULTICAST_LOOP: i32 = 11i32; |
| 3615 | 3407 | pub const IPV6_V6ONLY: i32 = 27i32; |
| 3616 | 3408 | pub const IP_ADD_MEMBERSHIP: i32 = 12i32; |
| 3617 | 3409 | pub const IP_DROP_MEMBERSHIP: i32 = 13i32; |
| 3618 | 3410 | #[repr(C)] |
| 3411 | #[derive(Clone, Copy)] | |
| 3619 | 3412 | pub struct IP_MREQ { |
| 3620 | 3413 | pub imr_multiaddr: IN_ADDR, |
| 3621 | 3414 | pub imr_interface: IN_ADDR, |
| 3622 | 3415 | } |
| 3623 | impl Copy for IP_MREQ {} | |
| 3624 | impl Clone for IP_MREQ { | |
| 3625 | fn clone(&self) -> Self { | |
| 3626 | *self | |
| 3627 | } | |
| 3628 | } | |
| 3629 | 3416 | pub const IP_MULTICAST_LOOP: i32 = 11i32; |
| 3630 | 3417 | pub const IP_MULTICAST_TTL: i32 = 10i32; |
| 3631 | 3418 | pub const IP_TTL: i32 = 4i32; |
| 3632 | 3419 | #[repr(C)] |
| 3420 | #[derive(Clone, Copy)] | |
| 3633 | 3421 | pub struct LINGER { |
| 3634 | 3422 | pub l_onoff: u16, |
| 3635 | 3423 | pub l_linger: u16, |
| 3636 | 3424 | } |
| 3637 | impl Copy for LINGER {} | |
| 3638 | impl Clone for LINGER { | |
| 3639 | fn clone(&self) -> Self { | |
| 3640 | *self | |
| 3641 | } | |
| 3642 | } | |
| 3643 | 3425 | pub type LPOVERLAPPED_COMPLETION_ROUTINE = Option< |
| 3644 | 3426 | unsafe extern "system" fn( |
| 3645 | 3427 | dwerrorcode: u32, |
| ... | ... | @@ -3673,16 +3455,11 @@ pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = Option< |
| 3673 | 3455 | ), |
| 3674 | 3456 | >; |
| 3675 | 3457 | #[repr(C)] |
| 3458 | #[derive(Clone, Copy)] | |
| 3676 | 3459 | pub struct M128A { |
| 3677 | 3460 | pub Low: u64, |
| 3678 | 3461 | pub High: i64, |
| 3679 | 3462 | } |
| 3680 | impl Copy for M128A {} | |
| 3681 | impl Clone for M128A { | |
| 3682 | fn clone(&self) -> Self { | |
| 3683 | *self | |
| 3684 | } | |
| 3685 | } | |
| 3686 | 3463 | pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: u32 = 16384u32; |
| 3687 | 3464 | pub const MAX_PATH: u32 = 260u32; |
| 3688 | 3465 | pub const MB_COMPOSITE: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 2u32; |
| ... | ... | @@ -3710,6 +3487,7 @@ pub type NTCREATEFILE_CREATE_DISPOSITION = u32; |
| 3710 | 3487 | pub type NTCREATEFILE_CREATE_OPTIONS = u32; |
| 3711 | 3488 | pub type NTSTATUS = i32; |
| 3712 | 3489 | #[repr(C)] |
| 3490 | #[derive(Clone, Copy)] | |
| 3713 | 3491 | pub struct OBJECT_ATTRIBUTES { |
| 3714 | 3492 | pub Length: u32, |
| 3715 | 3493 | pub RootDirectory: HANDLE, |
| ... | ... | @@ -3718,50 +3496,29 @@ pub struct OBJECT_ATTRIBUTES { |
| 3718 | 3496 | pub SecurityDescriptor: *const core::ffi::c_void, |
| 3719 | 3497 | pub SecurityQualityOfService: *const core::ffi::c_void, |
| 3720 | 3498 | } |
| 3721 | impl Copy for OBJECT_ATTRIBUTES {} | |
| 3722 | impl Clone for OBJECT_ATTRIBUTES { | |
| 3723 | fn clone(&self) -> Self { | |
| 3724 | *self | |
| 3725 | } | |
| 3726 | } | |
| 3727 | 3499 | pub const OBJ_DONT_REPARSE: i32 = 4096i32; |
| 3728 | 3500 | pub const OPEN_ALWAYS: FILE_CREATION_DISPOSITION = 4u32; |
| 3729 | 3501 | pub const OPEN_EXISTING: FILE_CREATION_DISPOSITION = 3u32; |
| 3730 | 3502 | #[repr(C)] |
| 3503 | #[derive(Clone, Copy)] | |
| 3731 | 3504 | pub struct OVERLAPPED { |
| 3732 | 3505 | pub Internal: usize, |
| 3733 | 3506 | pub InternalHigh: usize, |
| 3734 | 3507 | pub Anonymous: OVERLAPPED_0, |
| 3735 | 3508 | pub hEvent: HANDLE, |
| 3736 | 3509 | } |
| 3737 | impl Copy for OVERLAPPED {} | |
| 3738 | impl Clone for OVERLAPPED { | |
| 3739 | fn clone(&self) -> Self { | |
| 3740 | *self | |
| 3741 | } | |
| 3742 | } | |
| 3743 | 3510 | #[repr(C)] |
| 3511 | #[derive(Clone, Copy)] | |
| 3744 | 3512 | pub union OVERLAPPED_0 { |
| 3745 | 3513 | pub Anonymous: OVERLAPPED_0_0, |
| 3746 | 3514 | pub Pointer: *mut core::ffi::c_void, |
| 3747 | 3515 | } |
| 3748 | impl Copy for OVERLAPPED_0 {} | |
| 3749 | impl Clone for OVERLAPPED_0 { | |
| 3750 | fn clone(&self) -> Self { | |
| 3751 | *self | |
| 3752 | } | |
| 3753 | } | |
| 3754 | 3516 | #[repr(C)] |
| 3517 | #[derive(Clone, Copy)] | |
| 3755 | 3518 | pub struct OVERLAPPED_0_0 { |
| 3756 | 3519 | pub Offset: u32, |
| 3757 | 3520 | pub OffsetHigh: u32, |
| 3758 | 3521 | } |
| 3759 | impl Copy for OVERLAPPED_0_0 {} | |
| 3760 | impl Clone for OVERLAPPED_0_0 { | |
| 3761 | fn clone(&self) -> Self { | |
| 3762 | *self | |
| 3763 | } | |
| 3764 | } | |
| 3765 | 3522 | pub type PCSTR = *const u8; |
| 3766 | 3523 | pub type PCWSTR = *const u16; |
| 3767 | 3524 | pub type PIO_APC_ROUTINE = Option< |
| ... | ... | @@ -3788,18 +3545,13 @@ pub type PRIORITY_HINT = i32; |
| 3788 | 3545 | pub type PROCESSOR_ARCHITECTURE = u16; |
| 3789 | 3546 | pub type PROCESS_CREATION_FLAGS = u32; |
| 3790 | 3547 | #[repr(C)] |
| 3548 | #[derive(Clone, Copy)] | |
| 3791 | 3549 | pub struct PROCESS_INFORMATION { |
| 3792 | 3550 | pub hProcess: HANDLE, |
| 3793 | 3551 | pub hThread: HANDLE, |
| 3794 | 3552 | pub dwProcessId: u32, |
| 3795 | 3553 | pub dwThreadId: u32, |
| 3796 | 3554 | } |
| 3797 | impl Copy for PROCESS_INFORMATION {} | |
| 3798 | impl Clone for PROCESS_INFORMATION { | |
| 3799 | fn clone(&self) -> Self { | |
| 3800 | *self | |
| 3801 | } | |
| 3802 | } | |
| 3803 | 3555 | pub const PROCESS_MODE_BACKGROUND_BEGIN: PROCESS_CREATION_FLAGS = 1048576u32; |
| 3804 | 3556 | pub const PROCESS_MODE_BACKGROUND_END: PROCESS_CREATION_FLAGS = 2097152u32; |
| 3805 | 3557 | pub const PROFILE_KERNEL: PROCESS_CREATION_FLAGS = 536870912u32; |
| ... | ... | @@ -3822,17 +3574,12 @@ pub const SD_RECEIVE: WINSOCK_SHUTDOWN_HOW = 0i32; |
| 3822 | 3574 | pub const SD_SEND: WINSOCK_SHUTDOWN_HOW = 1i32; |
| 3823 | 3575 | pub const SECURITY_ANONYMOUS: FILE_FLAGS_AND_ATTRIBUTES = 0u32; |
| 3824 | 3576 | #[repr(C)] |
| 3577 | #[derive(Clone, Copy)] | |
| 3825 | 3578 | pub struct SECURITY_ATTRIBUTES { |
| 3826 | 3579 | pub nLength: u32, |
| 3827 | 3580 | pub lpSecurityDescriptor: *mut core::ffi::c_void, |
| 3828 | 3581 | pub bInheritHandle: BOOL, |
| 3829 | 3582 | } |
| 3830 | impl Copy for SECURITY_ATTRIBUTES {} | |
| 3831 | impl Clone for SECURITY_ATTRIBUTES { | |
| 3832 | fn clone(&self) -> Self { | |
| 3833 | *self | |
| 3834 | } | |
| 3835 | } | |
| 3836 | 3583 | pub const SECURITY_CONTEXT_TRACKING: FILE_FLAGS_AND_ATTRIBUTES = 262144u32; |
| 3837 | 3584 | pub const SECURITY_DELEGATION: FILE_FLAGS_AND_ATTRIBUTES = 196608u32; |
| 3838 | 3585 | pub const SECURITY_EFFECTIVE_ONLY: FILE_FLAGS_AND_ATTRIBUTES = 524288u32; |
| ... | ... | @@ -3843,27 +3590,17 @@ pub const SECURITY_VALID_SQOS_FLAGS: FILE_FLAGS_AND_ATTRIBUTES = 2031616u32; |
| 3843 | 3590 | pub type SEND_RECV_FLAGS = i32; |
| 3844 | 3591 | pub type SET_FILE_POINTER_MOVE_METHOD = u32; |
| 3845 | 3592 | #[repr(C)] |
| 3593 | #[derive(Clone, Copy)] | |
| 3846 | 3594 | pub struct SOCKADDR { |
| 3847 | 3595 | pub sa_family: ADDRESS_FAMILY, |
| 3848 | 3596 | pub sa_data: [i8; 14], |
| 3849 | 3597 | } |
| 3850 | impl Copy for SOCKADDR {} | |
| 3851 | impl Clone for SOCKADDR { | |
| 3852 | fn clone(&self) -> Self { | |
| 3853 | *self | |
| 3854 | } | |
| 3855 | } | |
| 3856 | 3598 | #[repr(C)] |
| 3599 | #[derive(Clone, Copy)] | |
| 3857 | 3600 | pub struct SOCKADDR_UN { |
| 3858 | 3601 | pub sun_family: ADDRESS_FAMILY, |
| 3859 | 3602 | pub sun_path: [i8; 108], |
| 3860 | 3603 | } |
| 3861 | impl Copy for SOCKADDR_UN {} | |
| 3862 | impl Clone for SOCKADDR_UN { | |
| 3863 | fn clone(&self) -> Self { | |
| 3864 | *self | |
| 3865 | } | |
| 3866 | } | |
| 3867 | 3604 | pub type SOCKET = usize; |
| 3868 | 3605 | pub const SOCKET_ERROR: i32 = -1i32; |
| 3869 | 3606 | pub const SOCK_DGRAM: WINSOCK_SOCKET_TYPE = 2i32; |
| ... | ... | @@ -3879,15 +3616,10 @@ pub const SO_RCVTIMEO: i32 = 4102i32; |
| 3879 | 3616 | pub const SO_SNDTIMEO: i32 = 4101i32; |
| 3880 | 3617 | pub const SPECIFIC_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 65535u32; |
| 3881 | 3618 | #[repr(C)] |
| 3619 | #[derive(Clone, Copy)] | |
| 3882 | 3620 | pub struct SRWLOCK { |
| 3883 | 3621 | pub Ptr: *mut core::ffi::c_void, |
| 3884 | 3622 | } |
| 3885 | impl Copy for SRWLOCK {} | |
| 3886 | impl Clone for SRWLOCK { | |
| 3887 | fn clone(&self) -> Self { | |
| 3888 | *self | |
| 3889 | } | |
| 3890 | } | |
| 3891 | 3623 | pub const STACK_SIZE_PARAM_IS_A_RESERVATION: THREAD_CREATION_FLAGS = 65536u32; |
| 3892 | 3624 | pub const STANDARD_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 2031616u32; |
| 3893 | 3625 | pub const STANDARD_RIGHTS_EXECUTE: FILE_ACCESS_RIGHTS = 131072u32; |
| ... | ... | @@ -3909,17 +3641,13 @@ pub const STARTF_USESHOWWINDOW: STARTUPINFOW_FLAGS = 1u32; |
| 3909 | 3641 | pub const STARTF_USESIZE: STARTUPINFOW_FLAGS = 2u32; |
| 3910 | 3642 | pub const STARTF_USESTDHANDLES: STARTUPINFOW_FLAGS = 256u32; |
| 3911 | 3643 | #[repr(C)] |
| 3644 | #[derive(Clone, Copy)] | |
| 3912 | 3645 | pub struct STARTUPINFOEXW { |
| 3913 | 3646 | pub StartupInfo: STARTUPINFOW, |
| 3914 | 3647 | pub lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, |
| 3915 | 3648 | } |
| 3916 | impl Copy for STARTUPINFOEXW {} | |
| 3917 | impl Clone for STARTUPINFOEXW { | |
| 3918 | fn clone(&self) -> Self { | |
| 3919 | *self | |
| 3920 | } | |
| 3921 | } | |
| 3922 | 3649 | #[repr(C)] |
| 3650 | #[derive(Clone, Copy)] | |
| 3923 | 3651 | pub struct STARTUPINFOW { |
| 3924 | 3652 | pub cb: u32, |
| 3925 | 3653 | pub lpReserved: PWSTR, |
| ... | ... | @@ -3940,12 +3668,6 @@ pub struct STARTUPINFOW { |
| 3940 | 3668 | pub hStdOutput: HANDLE, |
| 3941 | 3669 | pub hStdError: HANDLE, |
| 3942 | 3670 | } |
| 3943 | impl Copy for STARTUPINFOW {} | |
| 3944 | impl Clone for STARTUPINFOW { | |
| 3945 | fn clone(&self) -> Self { | |
| 3946 | *self | |
| 3947 | } | |
| 3948 | } | |
| 3949 | 3671 | pub type STARTUPINFOW_FLAGS = u32; |
| 3950 | 3672 | pub const STATUS_DELETE_PENDING: NTSTATUS = 0xC0000056_u32 as _; |
| 3951 | 3673 | pub const STATUS_END_OF_FILE: NTSTATUS = 0xC0000011_u32 as _; |
| ... | ... | @@ -3964,6 +3686,7 @@ pub const SYMLINK_FLAG_RELATIVE: u32 = 1u32; |
| 3964 | 3686 | pub type SYNCHRONIZATION_ACCESS_RIGHTS = u32; |
| 3965 | 3687 | pub const SYNCHRONIZE: FILE_ACCESS_RIGHTS = 1048576u32; |
| 3966 | 3688 | #[repr(C)] |
| 3689 | #[derive(Clone, Copy)] | |
| 3967 | 3690 | pub struct SYSTEM_INFO { |
| 3968 | 3691 | pub Anonymous: SYSTEM_INFO_0, |
| 3969 | 3692 | pub dwPageSize: u32, |
| ... | ... | @@ -3976,34 +3699,18 @@ pub struct SYSTEM_INFO { |
| 3976 | 3699 | pub wProcessorLevel: u16, |
| 3977 | 3700 | pub wProcessorRevision: u16, |
| 3978 | 3701 | } |
| 3979 | impl Copy for SYSTEM_INFO {} | |
| 3980 | impl Clone for SYSTEM_INFO { | |
| 3981 | fn clone(&self) -> Self { | |
| 3982 | *self | |
| 3983 | } | |
| 3984 | } | |
| 3985 | 3702 | #[repr(C)] |
| 3703 | #[derive(Clone, Copy)] | |
| 3986 | 3704 | pub union SYSTEM_INFO_0 { |
| 3987 | 3705 | pub dwOemId: u32, |
| 3988 | 3706 | pub Anonymous: SYSTEM_INFO_0_0, |
| 3989 | 3707 | } |
| 3990 | impl Copy for SYSTEM_INFO_0 {} | |
| 3991 | impl Clone for SYSTEM_INFO_0 { | |
| 3992 | fn clone(&self) -> Self { | |
| 3993 | *self | |
| 3994 | } | |
| 3995 | } | |
| 3996 | 3708 | #[repr(C)] |
| 3709 | #[derive(Clone, Copy)] | |
| 3997 | 3710 | pub struct SYSTEM_INFO_0_0 { |
| 3998 | 3711 | pub wProcessorArchitecture: PROCESSOR_ARCHITECTURE, |
| 3999 | 3712 | pub wReserved: u16, |
| 4000 | 3713 | } |
| 4001 | impl Copy for SYSTEM_INFO_0_0 {} | |
| 4002 | impl Clone for SYSTEM_INFO_0_0 { | |
| 4003 | fn clone(&self) -> Self { | |
| 4004 | *self | |
| 4005 | } | |
| 4006 | } | |
| 4007 | 3714 | pub const TCP_NODELAY: i32 = 1i32; |
| 4008 | 3715 | pub const THREAD_CREATE_RUN_IMMEDIATELY: THREAD_CREATION_FLAGS = 0u32; |
| 4009 | 3716 | pub const THREAD_CREATE_SUSPENDED: THREAD_CREATION_FLAGS = 4u32; |
| ... | ... | @@ -4011,16 +3718,11 @@ pub type THREAD_CREATION_FLAGS = u32; |
| 4011 | 3718 | pub const TIMER_ALL_ACCESS: SYNCHRONIZATION_ACCESS_RIGHTS = 2031619u32; |
| 4012 | 3719 | pub const TIMER_MODIFY_STATE: SYNCHRONIZATION_ACCESS_RIGHTS = 2u32; |
| 4013 | 3720 | #[repr(C)] |
| 3721 | #[derive(Clone, Copy)] | |
| 4014 | 3722 | pub struct TIMEVAL { |
| 4015 | 3723 | pub tv_sec: i32, |
| 4016 | 3724 | pub tv_usec: i32, |
| 4017 | 3725 | } |
| 4018 | impl Copy for TIMEVAL {} | |
| 4019 | impl Clone for TIMEVAL { | |
| 4020 | fn clone(&self) -> Self { | |
| 4021 | *self | |
| 4022 | } | |
| 4023 | } | |
| 4024 | 3726 | pub const TLS_OUT_OF_INDEXES: u32 = 4294967295u32; |
| 4025 | 3727 | pub type TOKEN_ACCESS_MASK = u32; |
| 4026 | 3728 | pub const TOKEN_ACCESS_PSEUDO_HANDLE: TOKEN_ACCESS_MASK = 24u32; |
| ... | ... | @@ -4047,17 +3749,12 @@ pub const TOKEN_WRITE_OWNER: TOKEN_ACCESS_MASK = 524288u32; |
| 4047 | 3749 | pub const TRUE: BOOL = 1i32; |
| 4048 | 3750 | pub const TRUNCATE_EXISTING: FILE_CREATION_DISPOSITION = 5u32; |
| 4049 | 3751 | #[repr(C)] |
| 3752 | #[derive(Clone, Copy)] | |
| 4050 | 3753 | pub struct UNICODE_STRING { |
| 4051 | 3754 | pub Length: u16, |
| 4052 | 3755 | pub MaximumLength: u16, |
| 4053 | 3756 | pub Buffer: PWSTR, |
| 4054 | 3757 | } |
| 4055 | impl Copy for UNICODE_STRING {} | |
| 4056 | impl Clone for UNICODE_STRING { | |
| 4057 | fn clone(&self) -> Self { | |
| 4058 | *self | |
| 4059 | } | |
| 4060 | } | |
| 4061 | 3758 | pub const VOLUME_NAME_DOS: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32; |
| 4062 | 3759 | pub const VOLUME_NAME_GUID: GETFINALPATHNAMEBYHANDLE_FLAGS = 1u32; |
| 4063 | 3760 | pub const VOLUME_NAME_NONE: GETFINALPATHNAMEBYHANDLE_FLAGS = 4u32; |
| ... | ... | @@ -4071,6 +3768,7 @@ pub const WAIT_TIMEOUT: WAIT_EVENT = 258u32; |
| 4071 | 3768 | pub const WC_ERR_INVALID_CHARS: u32 = 128u32; |
| 4072 | 3769 | pub type WIN32_ERROR = u32; |
| 4073 | 3770 | #[repr(C)] |
| 3771 | #[derive(Clone, Copy)] | |
| 4074 | 3772 | pub struct WIN32_FIND_DATAW { |
| 4075 | 3773 | pub dwFileAttributes: u32, |
| 4076 | 3774 | pub ftCreationTime: FILETIME, |
| ... | ... | @@ -4083,30 +3781,20 @@ pub struct WIN32_FIND_DATAW { |
| 4083 | 3781 | pub cFileName: [u16; 260], |
| 4084 | 3782 | pub cAlternateFileName: [u16; 14], |
| 4085 | 3783 | } |
| 4086 | impl Copy for WIN32_FIND_DATAW {} | |
| 4087 | impl Clone for WIN32_FIND_DATAW { | |
| 4088 | fn clone(&self) -> Self { | |
| 4089 | *self | |
| 4090 | } | |
| 4091 | } | |
| 4092 | 3784 | pub type WINSOCK_SHUTDOWN_HOW = i32; |
| 4093 | 3785 | pub type WINSOCK_SOCKET_TYPE = i32; |
| 4094 | 3786 | pub const WRITE_DAC: FILE_ACCESS_RIGHTS = 262144u32; |
| 4095 | 3787 | pub const WRITE_OWNER: FILE_ACCESS_RIGHTS = 524288u32; |
| 4096 | 3788 | pub const WSABASEERR: WSA_ERROR = 10000i32; |
| 4097 | 3789 | #[repr(C)] |
| 3790 | #[derive(Clone, Copy)] | |
| 4098 | 3791 | pub struct WSABUF { |
| 4099 | 3792 | pub len: u32, |
| 4100 | 3793 | pub buf: PSTR, |
| 4101 | 3794 | } |
| 4102 | impl Copy for WSABUF {} | |
| 4103 | impl Clone for WSABUF { | |
| 4104 | fn clone(&self) -> Self { | |
| 4105 | *self | |
| 4106 | } | |
| 4107 | } | |
| 4108 | 3795 | #[repr(C)] |
| 4109 | 3796 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] |
| 3797 | #[derive(Clone, Copy)] | |
| 4110 | 3798 | pub struct WSADATA { |
| 4111 | 3799 | pub wVersion: u16, |
| 4112 | 3800 | pub wHighVersion: u16, |
| ... | ... | @@ -4116,16 +3804,9 @@ pub struct WSADATA { |
| 4116 | 3804 | pub szDescription: [i8; 257], |
| 4117 | 3805 | pub szSystemStatus: [i8; 129], |
| 4118 | 3806 | } |
| 4119 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 4120 | impl Copy for WSADATA {} | |
| 4121 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 4122 | impl Clone for WSADATA { | |
| 4123 | fn clone(&self) -> Self { | |
| 4124 | *self | |
| 4125 | } | |
| 4126 | } | |
| 4127 | 3807 | #[repr(C)] |
| 4128 | 3808 | #[cfg(target_arch = "x86")] |
| 3809 | #[derive(Clone, Copy)] | |
| 4129 | 3810 | pub struct WSADATA { |
| 4130 | 3811 | pub wVersion: u16, |
| 4131 | 3812 | pub wHighVersion: u16, |
| ... | ... | @@ -4135,14 +3816,6 @@ pub struct WSADATA { |
| 4135 | 3816 | pub iMaxUdpDg: u16, |
| 4136 | 3817 | pub lpVendorInfo: PSTR, |
| 4137 | 3818 | } |
| 4138 | #[cfg(target_arch = "x86")] | |
| 4139 | impl Copy for WSADATA {} | |
| 4140 | #[cfg(target_arch = "x86")] | |
| 4141 | impl Clone for WSADATA { | |
| 4142 | fn clone(&self) -> Self { | |
| 4143 | *self | |
| 4144 | } | |
| 4145 | } | |
| 4146 | 3819 | pub const WSAEACCES: WSA_ERROR = 10013i32; |
| 4147 | 3820 | pub const WSAEADDRINUSE: WSA_ERROR = 10048i32; |
| 4148 | 3821 | pub const WSAEADDRNOTAVAIL: WSA_ERROR = 10049i32; |
| ... | ... | @@ -4198,17 +3871,13 @@ pub const WSANOTINITIALISED: WSA_ERROR = 10093i32; |
| 4198 | 3871 | pub const WSANO_DATA: WSA_ERROR = 11004i32; |
| 4199 | 3872 | pub const WSANO_RECOVERY: WSA_ERROR = 11003i32; |
| 4200 | 3873 | #[repr(C)] |
| 3874 | #[derive(Clone, Copy)] | |
| 4201 | 3875 | pub struct WSAPROTOCOLCHAIN { |
| 4202 | 3876 | pub ChainLen: i32, |
| 4203 | 3877 | pub ChainEntries: [u32; 7], |
| 4204 | 3878 | } |
| 4205 | impl Copy for WSAPROTOCOLCHAIN {} | |
| 4206 | impl Clone for WSAPROTOCOLCHAIN { | |
| 4207 | fn clone(&self) -> Self { | |
| 4208 | *self | |
| 4209 | } | |
| 4210 | } | |
| 4211 | 3879 | #[repr(C)] |
| 3880 | #[derive(Clone, Copy)] | |
| 4212 | 3881 | pub struct WSAPROTOCOL_INFOW { |
| 4213 | 3882 | pub dwServiceFlags1: u32, |
| 4214 | 3883 | pub dwServiceFlags2: u32, |
| ... | ... | @@ -4231,12 +3900,6 @@ pub struct WSAPROTOCOL_INFOW { |
| 4231 | 3900 | pub dwProviderReserved: u32, |
| 4232 | 3901 | pub szProtocol: [u16; 256], |
| 4233 | 3902 | } |
| 4234 | impl Copy for WSAPROTOCOL_INFOW {} | |
| 4235 | impl Clone for WSAPROTOCOL_INFOW { | |
| 4236 | fn clone(&self) -> Self { | |
| 4237 | *self | |
| 4238 | } | |
| 4239 | } | |
| 4240 | 3903 | pub const WSASERVICE_NOT_FOUND: WSA_ERROR = 10108i32; |
| 4241 | 3904 | pub const WSASYSCALLFAILURE: WSA_ERROR = 10107i32; |
| 4242 | 3905 | pub const WSASYSNOTREADY: WSA_ERROR = 10091i32; |
| ... | ... | @@ -4287,6 +3950,7 @@ pub const WSA_WAIT_EVENT_0: WSA_ERROR = 0i32; |
| 4287 | 3950 | pub const WSA_WAIT_IO_COMPLETION: WSA_ERROR = 192i32; |
| 4288 | 3951 | #[repr(C)] |
| 4289 | 3952 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] |
| 3953 | #[derive(Clone, Copy)] | |
| 4290 | 3954 | pub struct XSAVE_FORMAT { |
| 4291 | 3955 | pub ControlWord: u16, |
| 4292 | 3956 | pub StatusWord: u16, |
| ... | ... | @@ -4305,16 +3969,9 @@ pub struct XSAVE_FORMAT { |
| 4305 | 3969 | pub XmmRegisters: [M128A; 16], |
| 4306 | 3970 | pub Reserved4: [u8; 96], |
| 4307 | 3971 | } |
| 4308 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 4309 | impl Copy for XSAVE_FORMAT {} | |
| 4310 | #[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))] | |
| 4311 | impl Clone for XSAVE_FORMAT { | |
| 4312 | fn clone(&self) -> Self { | |
| 4313 | *self | |
| 4314 | } | |
| 4315 | } | |
| 4316 | 3972 | #[repr(C)] |
| 4317 | 3973 | #[cfg(target_arch = "x86")] |
| 3974 | #[derive(Clone, Copy)] | |
| 4318 | 3975 | pub struct XSAVE_FORMAT { |
| 4319 | 3976 | pub ControlWord: u16, |
| 4320 | 3977 | pub StatusWord: u16, |
| ... | ... | @@ -4333,12 +3990,4 @@ pub struct XSAVE_FORMAT { |
| 4333 | 3990 | pub XmmRegisters: [M128A; 8], |
| 4334 | 3991 | pub Reserved4: [u8; 224], |
| 4335 | 3992 | } |
| 4336 | #[cfg(target_arch = "x86")] | |
| 4337 | impl Copy for XSAVE_FORMAT {} | |
| 4338 | #[cfg(target_arch = "x86")] | |
| 4339 | impl Clone for XSAVE_FORMAT { | |
| 4340 | fn clone(&self) -> Self { | |
| 4341 | *self | |
| 4342 | } | |
| 4343 | } | |
| 4344 | 3993 | // ignore-tidy-filelength |
src/tools/generate-windows-sys/Cargo.toml+1-1| ... | ... | @@ -4,4 +4,4 @@ version = "0.1.0" |
| 4 | 4 | edition = "2021" |
| 5 | 5 | |
| 6 | 6 | [dependencies.windows-bindgen] |
| 7 | version = "0.56.0" | |
| 7 | version = "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 |
| 11 | 11 | run-make/cat-and-grep-sanity-check/Makefile |
| 12 | 12 | run-make/cdylib-dylib-linkage/Makefile |
| 13 | 13 | run-make/cdylib-fewer-symbols/Makefile |
| 14 | run-make/codegen-options-parsing/Makefile | |
| 15 | 14 | run-make/comment-section/Makefile |
| 16 | 15 | run-make/compiler-lookup-paths-2/Makefile |
| 17 | 16 | run-make/compiler-lookup-paths/Makefile |
| ... | ... | @@ -25,7 +24,6 @@ run-make/cross-lang-lto-upstream-rlibs/Makefile |
| 25 | 24 | run-make/cross-lang-lto/Makefile |
| 26 | 25 | run-make/debug-assertions/Makefile |
| 27 | 26 | run-make/debugger-visualizer-dep-info/Makefile |
| 28 | run-make/dep-graph/Makefile | |
| 29 | 27 | run-make/dep-info-doesnt-run-much/Makefile |
| 30 | 28 | run-make/dep-info-spaces/Makefile |
| 31 | 29 | run-make/dep-info/Makefile |
src/tools/tidy/src/issues.txt-3| ... | ... | @@ -2760,7 +2760,6 @@ ui/lint/issue-1866.rs |
| 2760 | 2760 | ui/lint/issue-19102.rs |
| 2761 | 2761 | ui/lint/issue-20343.rs |
| 2762 | 2762 | ui/lint/issue-30302.rs |
| 2763 | ui/lint/issue-31924-non-snake-ffi.rs | |
| 2764 | 2763 | ui/lint/issue-34798.rs |
| 2765 | 2764 | ui/lint/issue-35075.rs |
| 2766 | 2765 | ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs |
| ... | ... | @@ -2769,7 +2768,6 @@ ui/lint/issue-54099-camel-case-underscore-types.rs |
| 2769 | 2768 | ui/lint/issue-57410-1.rs |
| 2770 | 2769 | ui/lint/issue-57410.rs |
| 2771 | 2770 | ui/lint/issue-63364.rs |
| 2772 | ui/lint/issue-66362-no-snake-case-warning-for-field-puns.rs | |
| 2773 | 2771 | ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs |
| 2774 | 2772 | ui/lint/issue-79546-fuel-ice.rs |
| 2775 | 2773 | ui/lint/issue-79744.rs |
| ... | ... | @@ -2777,7 +2775,6 @@ ui/lint/issue-80988.rs |
| 2777 | 2775 | ui/lint/issue-81218.rs |
| 2778 | 2776 | ui/lint/issue-83477.rs |
| 2779 | 2777 | ui/lint/issue-87274-paren-parent.rs |
| 2780 | ui/lint/issue-89469.rs | |
| 2781 | 2778 | ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs |
| 2782 | 2779 | ui/lint/issue-97094.rs |
| 2783 | 2780 | ui/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 | |
| 4 | include ../tools.mk | |
| 5 | ||
| 6 | all: | |
| 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 | ||
| 6 | use run_make_support::regex::Regex; | |
| 7 | use run_make_support::rustc; | |
| 8 | ||
| 9 | fn 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 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | # ignore-cross-compile | |
| 4 | ||
| 5 | # Just verify that we successfully run and produce dep graphs when requested. | |
| 6 | ||
| 7 | all: | |
| 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 | ||
| 5 | use run_make_support::{path, rustc}; | |
| 6 | ||
| 7 | fn 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; |
| 21 | 21 | use rustc_smir::rustc_internal; |
| 22 | 22 | use stable_mir::mir::alloc::GlobalAlloc; |
| 23 | 23 | use stable_mir::mir::mono::Instance; |
| 24 | use stable_mir::mir::{Body, Constant, Operand, Rvalue, StatementKind, TerminatorKind}; | |
| 24 | use stable_mir::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind}; | |
| 25 | 25 | use stable_mir::ty::{ConstantKind, MirConst}; |
| 26 | 26 | use stable_mir::{CrateDef, CrateItems, ItemKind}; |
| 27 | 27 | use std::convert::TryFrom; |
| ... | ... | @@ -72,7 +72,7 @@ fn check_msg(body: &Body, expected: &str) { |
| 72 | 72 | .unwrap() |
| 73 | 73 | } |
| 74 | 74 | }; |
| 75 | let ConstantKind::Allocated(alloc) = msg_const.literal.kind() else { | |
| 75 | let ConstantKind::Allocated(alloc) = msg_const.const_.kind() else { | |
| 76 | 76 | unreachable!() |
| 77 | 77 | }; |
| 78 | 78 | assert_eq!(alloc.provenance.ptrs.len(), 1); |
| ... | ... | @@ -96,8 +96,8 @@ fn change_panic_msg(mut body: Body, new_msg: &str) -> Body { |
| 96 | 96 | match &mut bb.terminator.kind { |
| 97 | 97 | TerminatorKind::Call { args, .. } => { |
| 98 | 98 | 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, | |
| 101 | 101 | span: bb.terminator.span, |
| 102 | 102 | user_ty: None, |
| 103 | 103 | }); |
tests/ui/associated-types/defaults-unsound-62211-1.next.stderr+4-17| ... | ... | @@ -31,18 +31,6 @@ help: consider further restricting `Self` |
| 31 | 31 | LL | trait UncheckedCopy: Sized + AddAssign<&'static str> { |
| 32 | 32 | | +++++++++++++++++++++++++ |
| 33 | 33 | |
| 34 | error[E0271]: type mismatch resolving `<Self as Deref>::Target == str` | |
| 35 | --> $DIR/defaults-unsound-62211-1.rs:24:96 | |
| 36 | | | |
| 37 | LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | |
| 38 | | ^^^^ types differ | |
| 39 | | | |
| 40 | note: required by a bound in `UncheckedCopy::Output` | |
| 41 | --> $DIR/defaults-unsound-62211-1.rs:24:31 | |
| 42 | | | |
| 43 | LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | |
| 44 | | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | |
| 45 | ||
| 46 | 34 | error[E0277]: the trait bound `Self: Deref` is not satisfied |
| 47 | 35 | --> $DIR/defaults-unsound-62211-1.rs:24:96 |
| 48 | 36 | | |
| ... | ... | @@ -50,10 +38,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro |
| 50 | 38 | | ^^^^ the trait `Deref` is not implemented for `Self` |
| 51 | 39 | | |
| 52 | 40 | note: 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 | |
| 54 | 42 | | |
| 55 | 43 | LL | 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` | |
| 57 | 45 | help: consider further restricting `Self` |
| 58 | 46 | | |
| 59 | 47 | LL | trait UncheckedCopy: Sized + Deref { |
| ... | ... | @@ -75,7 +63,6 @@ help: consider further restricting `Self` |
| 75 | 63 | LL | trait UncheckedCopy: Sized + Copy { |
| 76 | 64 | | ++++++ |
| 77 | 65 | |
| 78 | error: aborting due to 5 previous errors | |
| 66 | error: aborting due to 4 previous errors | |
| 79 | 67 | |
| 80 | Some errors have detailed explanations: E0271, E0277. | |
| 81 | For more information about an error, try `rustc --explain E0271`. | |
| 68 | For 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 { |
| 26 | 26 | //~| ERROR the trait bound `Self: Deref` is not satisfied |
| 27 | 27 | //~| ERROR cannot add-assign `&'static str` to `Self` |
| 28 | 28 | //~| ERROR `Self` doesn't implement `std::fmt::Display` |
| 29 | //[next]~| ERROR type mismatch resolving `<Self as Deref>::Target == str` | |
| 30 | 29 | |
| 31 | 30 | // We said the Output type was Copy, so we can Copy it freely! |
| 32 | 31 | 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` |
| 31 | 31 | LL | trait UncheckedCopy: Sized + AddAssign<&'static str> { |
| 32 | 32 | | +++++++++++++++++++++++++ |
| 33 | 33 | |
| 34 | error[E0271]: type mismatch resolving `<Self as Deref>::Target == str` | |
| 35 | --> $DIR/defaults-unsound-62211-2.rs:24:96 | |
| 36 | | | |
| 37 | LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | |
| 38 | | ^^^^ types differ | |
| 39 | | | |
| 40 | note: required by a bound in `UncheckedCopy::Output` | |
| 41 | --> $DIR/defaults-unsound-62211-2.rs:24:31 | |
| 42 | | | |
| 43 | LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | |
| 44 | | ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | |
| 45 | ||
| 46 | 34 | error[E0277]: the trait bound `Self: Deref` is not satisfied |
| 47 | 35 | --> $DIR/defaults-unsound-62211-2.rs:24:96 |
| 48 | 36 | | |
| ... | ... | @@ -50,10 +38,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro |
| 50 | 38 | | ^^^^ the trait `Deref` is not implemented for `Self` |
| 51 | 39 | | |
| 52 | 40 | note: 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 | |
| 54 | 42 | | |
| 55 | 43 | LL | 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` | |
| 57 | 45 | help: consider further restricting `Self` |
| 58 | 46 | | |
| 59 | 47 | LL | trait UncheckedCopy: Sized + Deref { |
| ... | ... | @@ -75,7 +63,6 @@ help: consider further restricting `Self` |
| 75 | 63 | LL | trait UncheckedCopy: Sized + Copy { |
| 76 | 64 | | ++++++ |
| 77 | 65 | |
| 78 | error: aborting due to 5 previous errors | |
| 66 | error: aborting due to 4 previous errors | |
| 79 | 67 | |
| 80 | Some errors have detailed explanations: E0271, E0277. | |
| 81 | For more information about an error, try `rustc --explain E0271`. | |
| 68 | For 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 { |
| 26 | 26 | //~| ERROR the trait bound `Self: Deref` is not satisfied |
| 27 | 27 | //~| ERROR cannot add-assign `&'static str` to `Self` |
| 28 | 28 | //~| ERROR `Self` doesn't implement `std::fmt::Display` |
| 29 | //[next]~| ERROR type mismatch resolving `<Self as Deref>::Target == str` | |
| 30 | 29 | |
| 31 | 30 | // We said the Output type was Copy, so we can Copy it freely! |
| 32 | 31 | fn unchecked_copy(other: &Self::Output) -> Self::Output { |
tests/ui/associated-types/issue-54108.next.stderr+4-17| ... | ... | @@ -1,15 +1,3 @@ |
| 1 | error[E0271]: type mismatch resolving `<<T as SubEncoder>::ActualSize as Add>::Output == <T as SubEncoder>::ActualSize` | |
| 2 | --> $DIR/issue-54108.rs:23:17 | |
| 3 | | | |
| 4 | LL | type Size = <Self as SubEncoder>::ActualSize; | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ | |
| 6 | | | |
| 7 | note: required by a bound in `Encoder::Size` | |
| 8 | --> $DIR/issue-54108.rs:8:20 | |
| 9 | | | |
| 10 | LL | type Size: Add<Output = Self::Size>; | |
| 11 | | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` | |
| 12 | ||
| 13 | 1 | error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize` |
| 14 | 2 | --> $DIR/issue-54108.rs:23:17 |
| 15 | 3 | | |
| ... | ... | @@ -18,16 +6,15 @@ LL | type Size = <Self as SubEncoder>::ActualSize; |
| 18 | 6 | | |
| 19 | 7 | = help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize` |
| 20 | 8 | note: required by a bound in `Encoder::Size` |
| 21 | --> $DIR/issue-54108.rs:8:16 | |
| 9 | --> $DIR/issue-54108.rs:8:20 | |
| 22 | 10 | | |
| 23 | 11 | LL | type Size: Add<Output = Self::Size>; |
| 24 | | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` | |
| 12 | | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` | |
| 25 | 13 | help: consider further restricting the associated type |
| 26 | 14 | | |
| 27 | 15 | LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add |
| 28 | 16 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 29 | 17 | |
| 30 | error: aborting due to 2 previous errors | |
| 18 | error: aborting due to 1 previous error | |
| 31 | 19 | |
| 32 | Some errors have detailed explanations: E0271, E0277. | |
| 33 | For more information about an error, try `rustc --explain E0271`. | |
| 20 | For more information about this error, try `rustc --explain E0277`. |
tests/ui/associated-types/issue-54108.rs-1| ... | ... | @@ -22,7 +22,6 @@ where |
| 22 | 22 | { |
| 23 | 23 | type Size = <Self as SubEncoder>::ActualSize; |
| 24 | 24 | //~^ 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` | |
| 26 | 25 | |
| 27 | 26 | fn foo(&self) -> Self::Size { |
| 28 | 27 | 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] | |
| 6 | pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK | |
| 7 | ||
| 8 | pub struct Foo; | |
| 9 | ||
| 10 | impl Foo { | |
| 11 | #[no_mangle] | |
| 12 | pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK | |
| 13 | } | |
| 14 | ||
| 15 | fn 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 | ||
| 5 | enum 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 | ||
| 15 | fn 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 @@ |
| 1 | error: structure field `lowerCamelCaseName` should have a snake case name | |
| 2 | --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:7:9 | |
| 3 | | | |
| 4 | LL | lowerCamelCaseName: bool, | |
| 5 | | ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_name` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: variable `lowerCamelCaseBinding` should have a snake case name | |
| 14 | --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:20:38 | |
| 15 | | | |
| 16 | LL | Foo::Good { snake_case_name: lowerCamelCaseBinding } => { } | |
| 17 | | ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_binding` | |
| 18 | ||
| 19 | error: variable `anotherLowerCamelCaseBinding` should have a snake case name | |
| 20 | --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:24:41 | |
| 21 | | | |
| 22 | LL | if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { } | |
| 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `another_lower_camel_case_binding` | |
| 24 | ||
| 25 | error: variable `yetAnotherLowerCamelCaseBinding` should have a snake case name | |
| 26 | --> $DIR/issue-66362-no-snake-case-warning-for-field-puns.rs:27:43 | |
| 27 | | | |
| 28 | LL | if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { } | |
| 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `yet_another_lower_camel_case_binding` | |
| 30 | ||
| 31 | error: 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)] | |
| 8 | struct Entry { | |
| 9 | A: u16, | |
| 10 | a: u16 | |
| 11 | } | |
| 12 | ||
| 13 | fn foo() -> Entry {todo!()} | |
| 14 | ||
| 15 | pub fn f() { | |
| 16 | let Entry { A, a } = foo(); | |
| 17 | let _ = (A, a); | |
| 18 | } | |
| 19 | ||
| 20 | fn 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 | ||
| 7 | fn 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 | ||
| 7 | fn 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 | ||
| 8 | fn 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-cdylib.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-dylib.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-lib.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-lib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-lib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-rlib.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-rlib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-rlib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/lint-non-snake-case-crate-staticlib.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-staticlib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-staticlib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 4 | struct Foo; | |
| 5 | ||
| 6 | impl 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 | ||
| 21 | trait 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 | ||
| 32 | impl 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 | ||
| 38 | fn Cookie() {} | |
| 39 | //~^ ERROR function `Cookie` should have a snake case name | |
| 40 | ||
| 41 | pub fn bi_S_Cuit() {} | |
| 42 | //~^ ERROR function `bi_S_Cuit` should have a snake case name | |
| 43 | ||
| 44 | fn main() { } |
tests/ui/lint/lint-non-snake-case-functions.stderr deleted-62| ... | ... | @@ -1,62 +0,0 @@ |
| 1 | error: method `Foo_Method` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-functions.rs:7:8 | |
| 3 | | | |
| 4 | LL | fn Foo_Method() {} | |
| 5 | | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-functions.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: method `foo__method` should have a snake case name | |
| 14 | --> $DIR/lint-non-snake-case-functions.rs:11:8 | |
| 15 | | | |
| 16 | LL | fn foo__method(&self) {} | |
| 17 | | ^^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` | |
| 18 | ||
| 19 | error: method `xyZ` should have a snake case name | |
| 20 | --> $DIR/lint-non-snake-case-functions.rs:14:12 | |
| 21 | | | |
| 22 | LL | pub fn xyZ(&mut self) {} | |
| 23 | | ^^^ help: convert the identifier to snake case: `xy_z` | |
| 24 | ||
| 25 | error: method `render_HTML` should have a snake case name | |
| 26 | --> $DIR/lint-non-snake-case-functions.rs:17:8 | |
| 27 | | | |
| 28 | LL | fn render_HTML() {} | |
| 29 | | ^^^^^^^^^^^ help: convert the identifier to snake case: `render_html` | |
| 30 | ||
| 31 | error: trait method `ABC` should have a snake case name | |
| 32 | --> $DIR/lint-non-snake-case-functions.rs:22:8 | |
| 33 | | | |
| 34 | LL | fn ABC(); | |
| 35 | | ^^^ help: convert the identifier to snake case: `abc` | |
| 36 | ||
| 37 | error: trait method `a_b_C` should have a snake case name | |
| 38 | --> $DIR/lint-non-snake-case-functions.rs:25:8 | |
| 39 | | | |
| 40 | LL | fn a_b_C(&self) {} | |
| 41 | | ^^^^^ help: convert the identifier to snake case (notice the capitalization): `a_b_c` | |
| 42 | ||
| 43 | error: trait method `something__else` should have a snake case name | |
| 44 | --> $DIR/lint-non-snake-case-functions.rs:28:8 | |
| 45 | | | |
| 46 | LL | fn something__else(&mut self); | |
| 47 | | ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `something_else` | |
| 48 | ||
| 49 | error: function `Cookie` should have a snake case name | |
| 50 | --> $DIR/lint-non-snake-case-functions.rs:38:4 | |
| 51 | | | |
| 52 | LL | fn Cookie() {} | |
| 53 | | ^^^^^^ help: convert the identifier to snake case (notice the capitalization): `cookie` | |
| 54 | ||
| 55 | error: function `bi_S_Cuit` should have a snake case name | |
| 56 | --> $DIR/lint-non-snake-case-functions.rs:41:8 | |
| 57 | | | |
| 58 | LL | pub fn bi_S_Cuit() {} | |
| 59 | | ^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `bi_s_cuit` | |
| 60 | ||
| 61 | error: 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 | ||
| 5 | mod Impl {} | |
| 6 | //~^ ERROR module `Impl` should have a snake case name | |
| 7 | ||
| 8 | fn While() {} | |
| 9 | //~^ ERROR function `While` should have a snake case name | |
| 10 | ||
| 11 | fn 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 @@ |
| 1 | warning: unused variable: `Mod` | |
| 2 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | |
| 3 | | | |
| 4 | LL | let Mod: usize = 0; | |
| 5 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Mod` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![warn(unused)] | |
| 11 | | ^^^^^^ | |
| 12 | = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | |
| 13 | ||
| 14 | warning: unused variable: `Super` | |
| 15 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | |
| 16 | | | |
| 17 | LL | let Super: usize = 0; | |
| 18 | | ^^^^^ help: if this is intentional, prefix it with an underscore: `_Super` | |
| 19 | ||
| 20 | error: module `Impl` should have a snake case name | |
| 21 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:5:5 | |
| 22 | | | |
| 23 | LL | mod Impl {} | |
| 24 | | ^^^^ | |
| 25 | | | |
| 26 | note: the lint level is defined here | |
| 27 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:3:9 | |
| 28 | | | |
| 29 | LL | #![deny(non_snake_case)] | |
| 30 | | ^^^^^^^^^^^^^^ | |
| 31 | help: rename the identifier or convert it to a snake case raw identifier | |
| 32 | | | |
| 33 | LL | mod r#impl {} | |
| 34 | | ~~~~~~ | |
| 35 | ||
| 36 | error: function `While` should have a snake case name | |
| 37 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4 | |
| 38 | | | |
| 39 | LL | fn While() {} | |
| 40 | | ^^^^^ | |
| 41 | | | |
| 42 | help: rename the identifier or convert it to a snake case raw identifier | |
| 43 | | | |
| 44 | LL | fn r#while() {} | |
| 45 | | ~~~~~~~ | |
| 46 | ||
| 47 | error: variable `Mod` should have a snake case name | |
| 48 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | |
| 49 | | | |
| 50 | LL | let Mod: usize = 0; | |
| 51 | | ^^^ | |
| 52 | | | |
| 53 | help: rename the identifier or convert it to a snake case raw identifier | |
| 54 | | | |
| 55 | LL | let r#mod: usize = 0; | |
| 56 | | ~~~~~ | |
| 57 | ||
| 58 | error: variable `Super` should have a snake case name | |
| 59 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | |
| 60 | | | |
| 61 | LL | let Super: usize = 0; | |
| 62 | | ^^^^^ help: rename the identifier | |
| 63 | | | |
| 64 | = note: `super` cannot be used as a raw identifier | |
| 65 | ||
| 66 | error: 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 | ||
| 4 | fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name | |
| 5 | _: &'FooBar () | |
| 6 | ) {} | |
| 7 | ||
| 8 | fn main() { } |
tests/ui/lint/lint-non-snake-case-lifetimes.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: lifetime `'FooBar` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-lifetimes.rs:4:6 | |
| 3 | | | |
| 4 | LL | fn f<'FooBar>( | |
| 5 | | ^^^^^^^ help: convert the identifier to snake case: `'foo_bar` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-lifetimes.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 4 | mod FooBar { //~ ERROR module `FooBar` should have a snake case name | |
| 5 | pub struct S; | |
| 6 | } | |
| 7 | ||
| 8 | fn f(_: FooBar::S) { } | |
| 9 | ||
| 10 | fn main() { } |
tests/ui/lint/lint-non-snake-case-modules.stderr deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | error: module `FooBar` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-modules.rs:4:5 | |
| 3 | | | |
| 4 | LL | mod FooBar { | |
| 5 | | ^^^^^^ help: convert the identifier to snake case: `foo_bar` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-modules.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | |
| 9 | fn 你好() {} | |
| 10 | ||
| 11 | fn 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 | ||
| 13 | fn 编程() {} | |
| 14 | ||
| 15 | // but this doesn't: | |
| 16 | ||
| 17 | fn Ц() {} | |
| 18 | //~^ ERROR function `Ц` should have a snake case name | |
| 19 | ||
| 20 | // besides this, you cannot use continuous underscores in the middle | |
| 21 | ||
| 22 | fn 分__隔() {} | |
| 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 | ||
| 27 | fn _______不_连_续_的_存_在_______() {} | |
| 28 | ||
| 29 | fn main() {} |
tests/ui/lint/lint-nonstandard-style-unicode-2.stderr deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | error: function `Ц` should have a snake case name | |
| 2 | --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4 | |
| 3 | | | |
| 4 | LL | fn Ц() {} | |
| 5 | | ^ help: convert the identifier to snake case: `ц` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-nonstandard-style-unicode-2.rs:3:11 | |
| 9 | | | |
| 10 | LL | #![forbid(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: function `分__隔` should have a snake case name | |
| 14 | --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4 | |
| 15 | | | |
| 16 | LL | fn 分__隔() {} | |
| 17 | | ^^^^^^ help: convert the identifier to snake case: `分_隔` | |
| 18 | ||
| 19 | error: 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 | ||
| 5 | mod foo { | |
| 6 | pub enum Foo { Foo } | |
| 7 | } | |
| 8 | ||
| 9 | struct Something { | |
| 10 | X: usize //~ ERROR structure field `X` should have a snake case name | |
| 11 | } | |
| 12 | ||
| 13 | fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name | |
| 14 | println!("{}", Xx); | |
| 15 | } | |
| 16 | ||
| 17 | fn 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 @@ |
| 1 | error[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 | | | |
| 4 | LL | 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 | ||
| 9 | error[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 | | | |
| 12 | LL | let Foo = foo::Foo::Foo; | |
| 13 | | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo` | |
| 14 | ||
| 15 | warning: unused variable: `Foo` | |
| 16 | --> $DIR/lint-uppercase-variables.rs:22:9 | |
| 17 | | | |
| 18 | LL | Foo => {} | |
| 19 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 20 | | | |
| 21 | note: the lint level is defined here | |
| 22 | --> $DIR/lint-uppercase-variables.rs:1:9 | |
| 23 | | | |
| 24 | LL | #![warn(unused)] | |
| 25 | | ^^^^^^ | |
| 26 | = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | |
| 27 | ||
| 28 | warning: unused variable: `Foo` | |
| 29 | --> $DIR/lint-uppercase-variables.rs:28:9 | |
| 30 | | | |
| 31 | LL | let Foo = foo::Foo::Foo; | |
| 32 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 33 | ||
| 34 | error[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 | | | |
| 37 | LL | fn in_param(Foo: foo::Foo) {} | |
| 38 | | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo` | |
| 39 | ||
| 40 | warning: unused variable: `Foo` | |
| 41 | --> $DIR/lint-uppercase-variables.rs:33:17 | |
| 42 | | | |
| 43 | LL | fn in_param(Foo: foo::Foo) {} | |
| 44 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 45 | ||
| 46 | error: structure field `X` should have a snake case name | |
| 47 | --> $DIR/lint-uppercase-variables.rs:10:5 | |
| 48 | | | |
| 49 | LL | X: usize | |
| 50 | | ^ help: convert the identifier to snake case (notice the capitalization): `x` | |
| 51 | | | |
| 52 | note: the lint level is defined here | |
| 53 | --> $DIR/lint-uppercase-variables.rs:3:9 | |
| 54 | | | |
| 55 | LL | #![deny(non_snake_case)] | |
| 56 | | ^^^^^^^^^^^^^^ | |
| 57 | ||
| 58 | error: variable `Xx` should have a snake case name | |
| 59 | --> $DIR/lint-uppercase-variables.rs:13:9 | |
| 60 | | | |
| 61 | LL | fn test(Xx: usize) { | |
| 62 | | ^^ help: convert the identifier to snake case (notice the capitalization): `xx` | |
| 63 | ||
| 64 | error: variable `Test` should have a snake case name | |
| 65 | --> $DIR/lint-uppercase-variables.rs:18:9 | |
| 66 | | | |
| 67 | LL | let Test: usize = 0; | |
| 68 | | ^^^^ help: convert the identifier to snake case: `test` | |
| 69 | ||
| 70 | error: variable `Foo` should have a snake case name | |
| 71 | --> $DIR/lint-uppercase-variables.rs:22:9 | |
| 72 | | | |
| 73 | LL | Foo => {} | |
| 74 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 75 | ||
| 76 | error: variable `Foo` should have a snake case name | |
| 77 | --> $DIR/lint-uppercase-variables.rs:28:9 | |
| 78 | | | |
| 79 | LL | let Foo = foo::Foo::Foo; | |
| 80 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 81 | ||
| 82 | error: variable `Foo` should have a snake case name | |
| 83 | --> $DIR/lint-uppercase-variables.rs:33:17 | |
| 84 | | | |
| 85 | LL | fn in_param(Foo: foo::Foo) {} | |
| 86 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 87 | ||
| 88 | error: aborting due to 9 previous errors; 3 warnings emitted | |
| 89 | ||
| 90 | For 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)] | |
| 8 | struct Entry { | |
| 9 | A: u16, | |
| 10 | a: u16 | |
| 11 | } | |
| 12 | ||
| 13 | fn foo() -> Entry {todo!()} | |
| 14 | ||
| 15 | pub fn f() { | |
| 16 | let Entry { A, a } = foo(); | |
| 17 | let _ = (A, a); | |
| 18 | } | |
| 19 | ||
| 20 | fn 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 | ||
| 7 | fn 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 | ||
| 7 | fn 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 | ||
| 8 | fn 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-lib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-lib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-rlib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-rlib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 7 | fn main() {} |
tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: crate `NonSnakeCase` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-crate-staticlib.rs:3:18 | |
| 3 | | | |
| 4 | LL | #![crate_name = "NonSnakeCase"] | |
| 5 | | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-crate-staticlib.rs:5:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 4 | struct Foo; | |
| 5 | ||
| 6 | impl 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 | ||
| 21 | trait 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 | ||
| 32 | impl 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 | ||
| 38 | fn Cookie() {} | |
| 39 | //~^ ERROR function `Cookie` should have a snake case name | |
| 40 | ||
| 41 | pub fn bi_S_Cuit() {} | |
| 42 | //~^ ERROR function `bi_S_Cuit` should have a snake case name | |
| 43 | ||
| 44 | fn main() { } |
tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | error: method `Foo_Method` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-functions.rs:7:8 | |
| 3 | | | |
| 4 | LL | fn Foo_Method() {} | |
| 5 | | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-functions.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: method `foo__method` should have a snake case name | |
| 14 | --> $DIR/lint-non-snake-case-functions.rs:11:8 | |
| 15 | | | |
| 16 | LL | fn foo__method(&self) {} | |
| 17 | | ^^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` | |
| 18 | ||
| 19 | error: method `xyZ` should have a snake case name | |
| 20 | --> $DIR/lint-non-snake-case-functions.rs:14:12 | |
| 21 | | | |
| 22 | LL | pub fn xyZ(&mut self) {} | |
| 23 | | ^^^ help: convert the identifier to snake case: `xy_z` | |
| 24 | ||
| 25 | error: method `render_HTML` should have a snake case name | |
| 26 | --> $DIR/lint-non-snake-case-functions.rs:17:8 | |
| 27 | | | |
| 28 | LL | fn render_HTML() {} | |
| 29 | | ^^^^^^^^^^^ help: convert the identifier to snake case: `render_html` | |
| 30 | ||
| 31 | error: trait method `ABC` should have a snake case name | |
| 32 | --> $DIR/lint-non-snake-case-functions.rs:22:8 | |
| 33 | | | |
| 34 | LL | fn ABC(); | |
| 35 | | ^^^ help: convert the identifier to snake case: `abc` | |
| 36 | ||
| 37 | error: trait method `a_b_C` should have a snake case name | |
| 38 | --> $DIR/lint-non-snake-case-functions.rs:25:8 | |
| 39 | | | |
| 40 | LL | fn a_b_C(&self) {} | |
| 41 | | ^^^^^ help: convert the identifier to snake case (notice the capitalization): `a_b_c` | |
| 42 | ||
| 43 | error: trait method `something__else` should have a snake case name | |
| 44 | --> $DIR/lint-non-snake-case-functions.rs:28:8 | |
| 45 | | | |
| 46 | LL | fn something__else(&mut self); | |
| 47 | | ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `something_else` | |
| 48 | ||
| 49 | error: function `Cookie` should have a snake case name | |
| 50 | --> $DIR/lint-non-snake-case-functions.rs:38:4 | |
| 51 | | | |
| 52 | LL | fn Cookie() {} | |
| 53 | | ^^^^^^ help: convert the identifier to snake case (notice the capitalization): `cookie` | |
| 54 | ||
| 55 | error: function `bi_S_Cuit` should have a snake case name | |
| 56 | --> $DIR/lint-non-snake-case-functions.rs:41:8 | |
| 57 | | | |
| 58 | LL | pub fn bi_S_Cuit() {} | |
| 59 | | ^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `bi_s_cuit` | |
| 60 | ||
| 61 | error: 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 | ||
| 5 | mod Impl {} | |
| 6 | //~^ ERROR module `Impl` should have a snake case name | |
| 7 | ||
| 8 | fn While() {} | |
| 9 | //~^ ERROR function `While` should have a snake case name | |
| 10 | ||
| 11 | fn 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 @@ |
| 1 | warning: unused variable: `Mod` | |
| 2 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | |
| 3 | | | |
| 4 | LL | let Mod: usize = 0; | |
| 5 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Mod` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![warn(unused)] | |
| 11 | | ^^^^^^ | |
| 12 | = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | |
| 13 | ||
| 14 | warning: unused variable: `Super` | |
| 15 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | |
| 16 | | | |
| 17 | LL | let Super: usize = 0; | |
| 18 | | ^^^^^ help: if this is intentional, prefix it with an underscore: `_Super` | |
| 19 | ||
| 20 | error: module `Impl` should have a snake case name | |
| 21 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:5:5 | |
| 22 | | | |
| 23 | LL | mod Impl {} | |
| 24 | | ^^^^ | |
| 25 | | | |
| 26 | note: the lint level is defined here | |
| 27 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:3:9 | |
| 28 | | | |
| 29 | LL | #![deny(non_snake_case)] | |
| 30 | | ^^^^^^^^^^^^^^ | |
| 31 | help: rename the identifier or convert it to a snake case raw identifier | |
| 32 | | | |
| 33 | LL | mod r#impl {} | |
| 34 | | ~~~~~~ | |
| 35 | ||
| 36 | error: function `While` should have a snake case name | |
| 37 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4 | |
| 38 | | | |
| 39 | LL | fn While() {} | |
| 40 | | ^^^^^ | |
| 41 | | | |
| 42 | help: rename the identifier or convert it to a snake case raw identifier | |
| 43 | | | |
| 44 | LL | fn r#while() {} | |
| 45 | | ~~~~~~~ | |
| 46 | ||
| 47 | error: variable `Mod` should have a snake case name | |
| 48 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 | |
| 49 | | | |
| 50 | LL | let Mod: usize = 0; | |
| 51 | | ^^^ | |
| 52 | | | |
| 53 | help: rename the identifier or convert it to a snake case raw identifier | |
| 54 | | | |
| 55 | LL | let r#mod: usize = 0; | |
| 56 | | ~~~~~ | |
| 57 | ||
| 58 | error: variable `Super` should have a snake case name | |
| 59 | --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | |
| 60 | | | |
| 61 | LL | let Super: usize = 0; | |
| 62 | | ^^^^^ help: rename the identifier | |
| 63 | | | |
| 64 | = note: `super` cannot be used as a raw identifier | |
| 65 | ||
| 66 | error: 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 | ||
| 4 | fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name | |
| 5 | _: &'FooBar () | |
| 6 | ) {} | |
| 7 | ||
| 8 | fn main() { } |
tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: lifetime `'FooBar` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-lifetimes.rs:4:6 | |
| 3 | | | |
| 4 | LL | fn f<'FooBar>( | |
| 5 | | ^^^^^^^ help: convert the identifier to snake case: `'foo_bar` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-lifetimes.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | ||
| 4 | mod FooBar { //~ ERROR module `FooBar` should have a snake case name | |
| 5 | pub struct S; | |
| 6 | } | |
| 7 | ||
| 8 | fn f(_: FooBar::S) { } | |
| 9 | ||
| 10 | fn main() { } |
tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error: module `FooBar` should have a snake case name | |
| 2 | --> $DIR/lint-non-snake-case-modules.rs:4:5 | |
| 3 | | | |
| 4 | LL | mod FooBar { | |
| 5 | | ^^^^^^ help: convert the identifier to snake case: `foo_bar` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-non-snake-case-modules.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: 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 | |
| 9 | fn 你好() {} | |
| 10 | ||
| 11 | fn 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 | ||
| 13 | fn 编程() {} | |
| 14 | ||
| 15 | // but this doesn't: | |
| 16 | ||
| 17 | fn Ц() {} | |
| 18 | //~^ ERROR function `Ц` should have a snake case name | |
| 19 | ||
| 20 | // besides this, you cannot use continuous underscores in the middle | |
| 21 | ||
| 22 | fn 分__隔() {} | |
| 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 | ||
| 27 | fn _______不_连_续_的_存_在_______() {} | |
| 28 | ||
| 29 | fn main() {} |
tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | error: function `Ц` should have a snake case name | |
| 2 | --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4 | |
| 3 | | | |
| 4 | LL | fn Ц() {} | |
| 5 | | ^ help: convert the identifier to snake case: `ц` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/lint-nonstandard-style-unicode-2.rs:3:11 | |
| 9 | | | |
| 10 | LL | #![forbid(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: function `分__隔` should have a snake case name | |
| 14 | --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4 | |
| 15 | | | |
| 16 | LL | fn 分__隔() {} | |
| 17 | | ^^^^^^ help: convert the identifier to snake case: `分_隔` | |
| 18 | ||
| 19 | error: 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 | ||
| 5 | mod foo { | |
| 6 | pub enum Foo { Foo } | |
| 7 | } | |
| 8 | ||
| 9 | struct Something { | |
| 10 | X: usize //~ ERROR structure field `X` should have a snake case name | |
| 11 | } | |
| 12 | ||
| 13 | fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name | |
| 14 | println!("{}", Xx); | |
| 15 | } | |
| 16 | ||
| 17 | fn 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 @@ |
| 1 | error[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 | | | |
| 4 | LL | 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 | ||
| 9 | error[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 | | | |
| 12 | LL | let Foo = foo::Foo::Foo; | |
| 13 | | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo` | |
| 14 | ||
| 15 | warning: unused variable: `Foo` | |
| 16 | --> $DIR/lint-uppercase-variables.rs:22:9 | |
| 17 | | | |
| 18 | LL | Foo => {} | |
| 19 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 20 | | | |
| 21 | note: the lint level is defined here | |
| 22 | --> $DIR/lint-uppercase-variables.rs:1:9 | |
| 23 | | | |
| 24 | LL | #![warn(unused)] | |
| 25 | | ^^^^^^ | |
| 26 | = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | |
| 27 | ||
| 28 | warning: unused variable: `Foo` | |
| 29 | --> $DIR/lint-uppercase-variables.rs:28:9 | |
| 30 | | | |
| 31 | LL | let Foo = foo::Foo::Foo; | |
| 32 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 33 | ||
| 34 | error[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 | | | |
| 37 | LL | fn in_param(Foo: foo::Foo) {} | |
| 38 | | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo` | |
| 39 | ||
| 40 | warning: unused variable: `Foo` | |
| 41 | --> $DIR/lint-uppercase-variables.rs:33:17 | |
| 42 | | | |
| 43 | LL | fn in_param(Foo: foo::Foo) {} | |
| 44 | | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | |
| 45 | ||
| 46 | error: structure field `X` should have a snake case name | |
| 47 | --> $DIR/lint-uppercase-variables.rs:10:5 | |
| 48 | | | |
| 49 | LL | X: usize | |
| 50 | | ^ help: convert the identifier to snake case (notice the capitalization): `x` | |
| 51 | | | |
| 52 | note: the lint level is defined here | |
| 53 | --> $DIR/lint-uppercase-variables.rs:3:9 | |
| 54 | | | |
| 55 | LL | #![deny(non_snake_case)] | |
| 56 | | ^^^^^^^^^^^^^^ | |
| 57 | ||
| 58 | error: variable `Xx` should have a snake case name | |
| 59 | --> $DIR/lint-uppercase-variables.rs:13:9 | |
| 60 | | | |
| 61 | LL | fn test(Xx: usize) { | |
| 62 | | ^^ help: convert the identifier to snake case (notice the capitalization): `xx` | |
| 63 | ||
| 64 | error: variable `Test` should have a snake case name | |
| 65 | --> $DIR/lint-uppercase-variables.rs:18:9 | |
| 66 | | | |
| 67 | LL | let Test: usize = 0; | |
| 68 | | ^^^^ help: convert the identifier to snake case: `test` | |
| 69 | ||
| 70 | error: variable `Foo` should have a snake case name | |
| 71 | --> $DIR/lint-uppercase-variables.rs:22:9 | |
| 72 | | | |
| 73 | LL | Foo => {} | |
| 74 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 75 | ||
| 76 | error: variable `Foo` should have a snake case name | |
| 77 | --> $DIR/lint-uppercase-variables.rs:28:9 | |
| 78 | | | |
| 79 | LL | let Foo = foo::Foo::Foo; | |
| 80 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 81 | ||
| 82 | error: variable `Foo` should have a snake case name | |
| 83 | --> $DIR/lint-uppercase-variables.rs:33:17 | |
| 84 | | | |
| 85 | LL | fn in_param(Foo: foo::Foo) {} | |
| 86 | | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` | |
| 87 | ||
| 88 | error: aborting due to 9 previous errors; 3 warnings emitted | |
| 89 | ||
| 90 | For 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 | ||
| 5 | enum 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 | ||
| 15 | fn 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 @@ |
| 1 | error: structure field `lowerCamelCaseName` should have a snake case name | |
| 2 | --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:7:9 | |
| 3 | | | |
| 4 | LL | lowerCamelCaseName: bool, | |
| 5 | | ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_name` | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(non_snake_case)] | |
| 11 | | ^^^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: variable `lowerCamelCaseBinding` should have a snake case name | |
| 14 | --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:20:38 | |
| 15 | | | |
| 16 | LL | Foo::Good { snake_case_name: lowerCamelCaseBinding } => { } | |
| 17 | | ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_binding` | |
| 18 | ||
| 19 | error: variable `anotherLowerCamelCaseBinding` should have a snake case name | |
| 20 | --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:24:41 | |
| 21 | | | |
| 22 | LL | if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { } | |
| 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `another_lower_camel_case_binding` | |
| 24 | ||
| 25 | error: variable `yetAnotherLowerCamelCaseBinding` should have a snake case name | |
| 26 | --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:27:43 | |
| 27 | | | |
| 28 | LL | if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { } | |
| 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `yet_another_lower_camel_case_binding` | |
| 30 | ||
| 31 | error: 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] | |
| 6 | pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK | |
| 7 | ||
| 8 | pub struct Foo; | |
| 9 | ||
| 10 | impl Foo { | |
| 11 | #[no_mangle] | |
| 12 | pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK | |
| 13 | } | |
| 14 | ||
| 15 | fn main() {} |
tests/ui/traits/next-solver/coroutine.fail.stderr+2-45| ... | ... | @@ -6,8 +6,6 @@ LL | needs_coroutine( |
| 6 | 6 | LL | #[coroutine] |
| 7 | 7 | LL | / || { |
| 8 | 8 | LL | | |
| 9 | LL | | | |
| 10 | LL | | | |
| 11 | 9 | LL | | yield (); |
| 12 | 10 | LL | | }, |
| 13 | 11 | | |_________^ 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` |
| 18 | 16 | LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {} |
| 19 | 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `needs_coroutine` |
| 20 | 18 | |
| 21 | error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Yield == B` | |
| 22 | --> $DIR/coroutine.rs:20:9 | |
| 23 | | | |
| 24 | LL | needs_coroutine( | |
| 25 | | --------------- required by a bound introduced by this call | |
| 26 | LL | #[coroutine] | |
| 27 | LL | / || { | |
| 28 | LL | | | |
| 29 | LL | | | |
| 30 | LL | | | |
| 31 | LL | | yield (); | |
| 32 | LL | | }, | |
| 33 | | |_________^ types differ | |
| 34 | | | |
| 35 | note: required by a bound in `needs_coroutine` | |
| 36 | --> $DIR/coroutine.rs:14:41 | |
| 37 | | | |
| 38 | LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {} | |
| 39 | | ^^^^^^^^^ required by this bound in `needs_coroutine` | |
| 40 | ||
| 41 | error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Return == C` | |
| 42 | --> $DIR/coroutine.rs:20:9 | |
| 43 | | | |
| 44 | LL | needs_coroutine( | |
| 45 | | --------------- required by a bound introduced by this call | |
| 46 | LL | #[coroutine] | |
| 47 | LL | / || { | |
| 48 | LL | | | |
| 49 | LL | | | |
| 50 | LL | | | |
| 51 | LL | | yield (); | |
| 52 | LL | | }, | |
| 53 | | |_________^ types differ | |
| 54 | | | |
| 55 | note: required by a bound in `needs_coroutine` | |
| 56 | --> $DIR/coroutine.rs:14:52 | |
| 57 | | | |
| 58 | LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {} | |
| 59 | | ^^^^^^^^^^ required by this bound in `needs_coroutine` | |
| 60 | ||
| 61 | error: aborting due to 3 previous errors | |
| 19 | error: aborting due to 1 previous error | |
| 62 | 20 | |
| 63 | Some errors have detailed explanations: E0271, E0277. | |
| 64 | For more information about an error, try `rustc --explain E0271`. | |
| 21 | For more information about this error, try `rustc --explain E0277`. |
tests/ui/traits/next-solver/coroutine.rs-2| ... | ... | @@ -19,8 +19,6 @@ fn main() { |
| 19 | 19 | #[coroutine] |
| 20 | 20 | || { |
| 21 | 21 | //[fail]~^ ERROR Coroutine<A>` is not satisfied |
| 22 | //[fail]~| ERROR as Coroutine<A>>::Yield == B` | |
| 23 | //[fail]~| ERROR as Coroutine<A>>::Return == C` | |
| 24 | 22 | yield (); |
| 25 | 23 | }, |
| 26 | 24 | ); |
tests/ui/traits/next-solver/fn-trait.rs-4| ... | ... | @@ -19,14 +19,10 @@ fn main() { |
| 19 | 19 | require_fn(f as fn() -> i32); |
| 20 | 20 | require_fn(f as unsafe fn() -> i32); |
| 21 | 21 | //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32` |
| 22 | //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32` | |
| 23 | 22 | require_fn(g); |
| 24 | 23 | //~^ 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` | |
| 26 | 24 | require_fn(g as extern "C" fn() -> i32); |
| 27 | 25 | //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32` |
| 28 | //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32` | |
| 29 | 26 | require_fn(h); |
| 30 | 27 | //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` |
| 31 | //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32` | |
| 32 | 28 | } |
tests/ui/traits/next-solver/fn-trait.stderr+5-62| ... | ... | @@ -15,22 +15,8 @@ note: required by a bound in `require_fn` |
| 15 | 15 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 16 | 16 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 17 | 17 | |
| 18 | error[E0271]: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32` | |
| 19 | --> $DIR/fn-trait.rs:20:16 | |
| 20 | | | |
| 21 | LL | require_fn(f as unsafe fn() -> i32); | |
| 22 | | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ types differ | |
| 23 | | | | |
| 24 | | required by a bound introduced by this call | |
| 25 | | | |
| 26 | note: required by a bound in `require_fn` | |
| 27 | --> $DIR/fn-trait.rs:3:31 | |
| 28 | | | |
| 29 | LL | fn require_fn(_: impl Fn() -> i32) {} | |
| 30 | | ^^^ required by this bound in `require_fn` | |
| 31 | ||
| 32 | 18 | error[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 | |
| 34 | 20 | | |
| 35 | 21 | LL | require_fn(g); |
| 36 | 22 | | ---------- ^ expected an `Fn()` closure, found `extern "C" fn() -> i32 {g}` |
| ... | ... | @@ -45,22 +31,8 @@ note: required by a bound in `require_fn` |
| 45 | 31 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 46 | 32 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 47 | 33 | |
| 48 | error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32` | |
| 49 | --> $DIR/fn-trait.rs:23:16 | |
| 50 | | | |
| 51 | LL | require_fn(g); | |
| 52 | | ---------- ^ types differ | |
| 53 | | | | |
| 54 | | required by a bound introduced by this call | |
| 55 | | | |
| 56 | note: required by a bound in `require_fn` | |
| 57 | --> $DIR/fn-trait.rs:3:31 | |
| 58 | | | |
| 59 | LL | fn require_fn(_: impl Fn() -> i32) {} | |
| 60 | | ^^^ required by this bound in `require_fn` | |
| 61 | ||
| 62 | 34 | error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32` |
| 63 | --> $DIR/fn-trait.rs:26:16 | |
| 35 | --> $DIR/fn-trait.rs:24:16 | |
| 64 | 36 | | |
| 65 | 37 | LL | require_fn(g as extern "C" fn() -> i32); |
| 66 | 38 | | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn()` closure, found `extern "C" fn() -> i32` |
| ... | ... | @@ -75,22 +47,8 @@ note: required by a bound in `require_fn` |
| 75 | 47 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 76 | 48 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 77 | 49 | |
| 78 | error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32` | |
| 79 | --> $DIR/fn-trait.rs:26:16 | |
| 80 | | | |
| 81 | LL | require_fn(g as extern "C" fn() -> i32); | |
| 82 | | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ | |
| 83 | | | | |
| 84 | | required by a bound introduced by this call | |
| 85 | | | |
| 86 | note: required by a bound in `require_fn` | |
| 87 | --> $DIR/fn-trait.rs:3:31 | |
| 88 | | | |
| 89 | LL | fn require_fn(_: impl Fn() -> i32) {} | |
| 90 | | ^^^ required by this bound in `require_fn` | |
| 91 | ||
| 92 | 50 | error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` |
| 93 | --> $DIR/fn-trait.rs:29:16 | |
| 51 | --> $DIR/fn-trait.rs:26:16 | |
| 94 | 52 | | |
| 95 | 53 | LL | require_fn(h); |
| 96 | 54 | | ---------- ^ call the function in a closure: `|| unsafe { /* code */ }` |
| ... | ... | @@ -106,21 +64,6 @@ note: required by a bound in `require_fn` |
| 106 | 64 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 107 | 65 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 108 | 66 | |
| 109 | error[E0271]: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32` | |
| 110 | --> $DIR/fn-trait.rs:29:16 | |
| 111 | | | |
| 112 | LL | require_fn(h); | |
| 113 | | ---------- ^ types differ | |
| 114 | | | | |
| 115 | | required by a bound introduced by this call | |
| 116 | | | |
| 117 | note: required by a bound in `require_fn` | |
| 118 | --> $DIR/fn-trait.rs:3:31 | |
| 119 | | | |
| 120 | LL | fn require_fn(_: impl Fn() -> i32) {} | |
| 121 | | ^^^ required by this bound in `require_fn` | |
| 122 | ||
| 123 | error: aborting due to 8 previous errors | |
| 67 | error: aborting due to 4 previous errors | |
| 124 | 68 | |
| 125 | Some errors have detailed explanations: E0271, E0277. | |
| 126 | For more information about an error, try `rustc --explain E0271`. | |
| 69 | For more information about this error, try `rustc --explain E0277`. |