Rollup merge of #111021 - c410-f3r:dqewdas, r=petrochenkov
Move some tests
r? ``@petrochenkov``
diff --git a/Cargo.lock b/Cargo.lock
index 6d77c2b..6539bd3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1444,6 +1444,13 @@
]
[[package]]
+name = "generate-windows-sys"
+version = "0.1.0"
+dependencies = [
+ "windows-bindgen",
+]
+
+[[package]]
name = "generic-array"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3353,6 +3360,7 @@
"rustc_middle",
"rustc_mir_build",
"rustc_mir_dataflow",
+ "rustc_mir_transform",
"rustc_monomorphize",
"rustc_parse",
"rustc_passes",
@@ -3861,8 +3869,10 @@
"rustc_const_eval",
"rustc_data_structures",
"rustc_errors",
+ "rustc_fluent_macro",
"rustc_hir",
"rustc_index",
+ "rustc_macros",
"rustc_middle",
"rustc_mir_dataflow",
"rustc_serialize",
@@ -5507,6 +5517,22 @@
]
[[package]]
+name = "windows-bindgen"
+version = "0.49.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6935fb09b84ee57929ae92518b475f5dfdfbeb87c5334756acc28ee8e202b60"
+dependencies = [
+ "windows-metadata",
+ "windows-tokens",
+]
+
+[[package]]
+name = "windows-metadata"
+version = "0.49.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f5bca94a32bf1e6a376522b6601275a3b611ee885ec0f1b6a05f17e8cfd3385"
+
+[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5570,6 +5596,12 @@
]
[[package]]
+name = "windows-tokens"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b34c9a3b28cb41db7385546f7f9a8179348dffc89923dde66857b1ba5312f6b4"
+
+[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 7aaa34a..53331e2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,6 +39,7 @@
"src/tools/collect-license-metadata",
"src/tools/generate-copyright",
"src/tools/suggest-tests",
+ "src/tools/generate-windows-sys",
]
exclude = [
diff --git a/compiler/rustc_ast_lowering/src/format.rs b/compiler/rustc_ast_lowering/src/format.rs
index 9b29533..afcf8b1 100644
--- a/compiler/rustc_ast_lowering/src/format.rs
+++ b/compiler/rustc_ast_lowering/src/format.rs
@@ -446,7 +446,30 @@ fn expand_format_args<'hir>(
&& argmap.iter().enumerate().all(|(i, (&(j, _), _))| i == j)
&& arguments.iter().skip(1).all(|arg| !may_contain_yield_point(&arg.expr));
- let args = if use_simple_array {
+ let args = if arguments.is_empty() {
+ // Generate:
+ // &<core::fmt::Argument>::none()
+ //
+ // Note:
+ // `none()` just returns `[]`. We use `none()` rather than `[]` to limit the lifetime.
+ //
+ // This makes sure that this still fails to compile, even when the argument is inlined:
+ //
+ // ```
+ // let f = format_args!("{}", "a");
+ // println!("{f}"); // error E0716
+ // ```
+ //
+ // Cases where keeping the object around is allowed, such as `format_args!("a")`,
+ // are handled above by the `allow_const` case.
+ let none_fn = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
+ macsp,
+ hir::LangItem::FormatArgument,
+ sym::none,
+ ));
+ let none = ctx.expr_call(macsp, none_fn, &[]);
+ ctx.expr(macsp, hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Not, none))
+ } else if use_simple_array {
// Generate:
// &[
// <core::fmt::Argument>::new_display(&arg0),
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs
index b960671..3d5056d 100644
--- a/compiler/rustc_ast_passes/src/feature_gate.rs
+++ b/compiler/rustc_ast_passes/src/feature_gate.rs
@@ -603,6 +603,7 @@ macro_rules! gate_all {
gate_all!(yeet_expr, "`do yeet` expression is experimental");
gate_all!(dyn_star, "`dyn*` trait objects are experimental");
gate_all!(const_closures, "const closures are experimental");
+ gate_all!(builtin_syntax, "`builtin #` syntax is unstable");
if !visitor.features.negative_bounds {
for &span in spans.get(&sym::negative_bounds).iter().copied().flatten() {
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index b74c59b..87c32ff 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -556,8 +556,7 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
self.pclose();
}
ast::ExprKind::OffsetOf(container, fields) => {
- // FIXME: This should have its own syntax, distinct from a macro invocation.
- self.word("offset_of!");
+ self.word("builtin # offset_of");
self.popen();
self.rbox(0, Inconsistent);
self.print_type(container);
diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
index 7558247..6286033 100644
--- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
@@ -1,4 +1,4 @@
-use rustc_errors::{Applicability, Diagnostic};
+use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed};
use rustc_hir as hir;
use rustc_hir::intravisit::Visitor;
use rustc_hir::Node;
@@ -478,179 +478,6 @@ pub(crate) fn report_mutability_error(
match self.local_names[local] {
Some(name) if !local_decl.from_compiler_desugaring() => {
- let label = match *local_decl.local_info() {
- LocalInfo::User(mir::BindingForm::ImplicitSelf(_)) => {
- let (span, suggestion) =
- suggest_ampmut_self(self.infcx.tcx, local_decl);
- Some((true, span, suggestion))
- }
-
- LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
- binding_mode: ty::BindingMode::BindByValue(_),
- opt_ty_info,
- ..
- })) => {
- // check if the RHS is from desugaring
- let opt_assignment_rhs_span =
- self.body.find_assignments(local).first().map(|&location| {
- if let Some(mir::Statement {
- source_info: _,
- kind:
- mir::StatementKind::Assign(box (
- _,
- mir::Rvalue::Use(mir::Operand::Copy(place)),
- )),
- }) = self.body[location.block]
- .statements
- .get(location.statement_index)
- {
- self.body.local_decls[place.local].source_info.span
- } else {
- self.body.source_info(location).span
- }
- });
- match opt_assignment_rhs_span.and_then(|s| s.desugaring_kind()) {
- // on for loops, RHS points to the iterator part
- Some(DesugaringKind::ForLoop) => {
- self.suggest_similar_mut_method_for_for_loop(&mut err);
- err.span_label(opt_assignment_rhs_span.unwrap(), format!(
- "this iterator yields `{pointer_sigil}` {pointer_desc}s",
- ));
- None
- }
- // don't create labels for compiler-generated spans
- Some(_) => None,
- None => {
- let label = if name != kw::SelfLower {
- suggest_ampmut(
- self.infcx.tcx,
- local_decl,
- opt_assignment_rhs_span,
- opt_ty_info,
- )
- } else {
- match local_decl.local_info() {
- LocalInfo::User(mir::BindingForm::Var(
- mir::VarBindingForm {
- opt_ty_info: None, ..
- },
- )) => {
- let (span, sugg) = suggest_ampmut_self(
- self.infcx.tcx,
- local_decl,
- );
- (true, span, sugg)
- }
- // explicit self (eg `self: &'a Self`)
- _ => suggest_ampmut(
- self.infcx.tcx,
- local_decl,
- opt_assignment_rhs_span,
- opt_ty_info,
- ),
- }
- };
- Some(label)
- }
- }
- }
-
- LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
- binding_mode: ty::BindingMode::BindByReference(_),
- ..
- })) => {
- let pattern_span = local_decl.source_info.span;
- suggest_ref_mut(self.infcx.tcx, pattern_span)
- .map(|replacement| (true, pattern_span, replacement))
- }
-
- _ => unreachable!(),
- };
-
- match label {
- Some((true, err_help_span, suggested_code)) => {
- let (is_trait_sig, local_trait) = self.is_error_in_trait(local);
- if !is_trait_sig {
- err.span_suggestion_verbose(
- err_help_span,
- format!(
- "consider changing this to be a mutable {pointer_desc}"
- ),
- suggested_code,
- Applicability::MachineApplicable,
- );
- } else if let Some(x) = local_trait {
- err.span_suggestion_verbose(
- x,
- format!(
- "consider changing that to be a mutable {pointer_desc}"
- ),
- suggested_code,
- Applicability::MachineApplicable,
- );
- }
- }
- Some((false, err_label_span, message)) => {
- struct BindingFinder {
- span: Span,
- hir_id: Option<hir::HirId>,
- }
-
- impl<'tcx> Visitor<'tcx> for BindingFinder {
- fn visit_stmt(&mut self, s: &'tcx hir::Stmt<'tcx>) {
- if let hir::StmtKind::Local(local) = s.kind {
- if local.pat.span == self.span {
- self.hir_id = Some(local.hir_id);
- }
- }
- hir::intravisit::walk_stmt(self, s);
- }
- }
- let hir_map = self.infcx.tcx.hir();
- let def_id = self.body.source.def_id();
- let hir_id = hir_map.local_def_id_to_hir_id(def_id.expect_local());
- let node = hir_map.find(hir_id);
- let hir_id = if let Some(hir::Node::Item(item)) = node
- && let hir::ItemKind::Fn(.., body_id) = item.kind
- {
- let body = hir_map.body(body_id);
- let mut v = BindingFinder {
- span: err_label_span,
- hir_id: None,
- };
- v.visit_body(body);
- v.hir_id
- } else {
- None
- };
- if let Some(hir_id) = hir_id
- && let Some(hir::Node::Local(local)) = hir_map.find(hir_id)
- {
- let (changing, span, sugg) = match local.ty {
- Some(ty) => ("changing", ty.span, message),
- None => (
- "specifying",
- local.pat.span.shrink_to_hi(),
- format!(": {message}"),
- ),
- };
- err.span_suggestion_verbose(
- span,
- format!("consider {changing} this binding's type"),
- sugg,
- Applicability::HasPlaceholders,
- );
- } else {
- err.span_label(
- err_label_span,
- format!(
- "consider changing this binding's type to be: `{message}`"
- ),
- );
- }
- }
- None => {}
- }
err.span_label(
span,
format!(
@@ -658,6 +485,8 @@ fn visit_stmt(&mut self, s: &'tcx hir::Stmt<'tcx>) {
so the data it refers to cannot be {acted_on}",
),
);
+
+ self.suggest_make_local_mut(&mut err, local, name);
}
_ => {
err.span_label(
@@ -1131,6 +960,184 @@ fn expected_fn_found_fn_mut_call(&self, err: &mut Diagnostic, sp: Span, act: &st
}
}
}
+
+ fn suggest_make_local_mut(
+ &self,
+ err: &mut DiagnosticBuilder<'_, ErrorGuaranteed>,
+ local: Local,
+ name: Symbol,
+ ) {
+ let local_decl = &self.body.local_decls[local];
+
+ let (pointer_sigil, pointer_desc) =
+ if local_decl.ty.is_ref() { ("&", "reference") } else { ("*const", "pointer") };
+
+ let (is_trait_sig, local_trait) = self.is_error_in_trait(local);
+ if is_trait_sig && local_trait.is_none() {
+ return;
+ }
+
+ let decl_span = match local_trait {
+ Some(span) => span,
+ None => local_decl.source_info.span,
+ };
+
+ let label = match *local_decl.local_info() {
+ LocalInfo::User(mir::BindingForm::ImplicitSelf(_)) => {
+ let suggestion = suggest_ampmut_self(self.infcx.tcx, decl_span);
+ Some((true, decl_span, suggestion))
+ }
+
+ LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
+ binding_mode: ty::BindingMode::BindByValue(_),
+ opt_ty_info,
+ ..
+ })) => {
+ // check if the RHS is from desugaring
+ let opt_assignment_rhs_span =
+ self.body.find_assignments(local).first().map(|&location| {
+ if let Some(mir::Statement {
+ source_info: _,
+ kind:
+ mir::StatementKind::Assign(box (
+ _,
+ mir::Rvalue::Use(mir::Operand::Copy(place)),
+ )),
+ }) = self.body[location.block].statements.get(location.statement_index)
+ {
+ self.body.local_decls[place.local].source_info.span
+ } else {
+ self.body.source_info(location).span
+ }
+ });
+ match opt_assignment_rhs_span.and_then(|s| s.desugaring_kind()) {
+ // on for loops, RHS points to the iterator part
+ Some(DesugaringKind::ForLoop) => {
+ self.suggest_similar_mut_method_for_for_loop(err);
+ err.span_label(
+ opt_assignment_rhs_span.unwrap(),
+ format!("this iterator yields `{pointer_sigil}` {pointer_desc}s",),
+ );
+ None
+ }
+ // don't create labels for compiler-generated spans
+ Some(_) => None,
+ None => {
+ let label = if name != kw::SelfLower {
+ suggest_ampmut(
+ self.infcx.tcx,
+ local_decl.ty,
+ decl_span,
+ opt_assignment_rhs_span,
+ opt_ty_info,
+ )
+ } else {
+ match local_decl.local_info() {
+ LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
+ opt_ty_info: None,
+ ..
+ })) => {
+ let sugg = suggest_ampmut_self(self.infcx.tcx, decl_span);
+ (true, decl_span, sugg)
+ }
+ // explicit self (eg `self: &'a Self`)
+ _ => suggest_ampmut(
+ self.infcx.tcx,
+ local_decl.ty,
+ decl_span,
+ opt_assignment_rhs_span,
+ opt_ty_info,
+ ),
+ }
+ };
+ Some(label)
+ }
+ }
+ }
+
+ LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
+ binding_mode: ty::BindingMode::BindByReference(_),
+ ..
+ })) => {
+ let pattern_span: Span = local_decl.source_info.span;
+ suggest_ref_mut(self.infcx.tcx, pattern_span)
+ .map(|span| (true, span, "mut ".to_owned()))
+ }
+
+ _ => unreachable!(),
+ };
+
+ match label {
+ Some((true, err_help_span, suggested_code)) => {
+ err.span_suggestion_verbose(
+ err_help_span,
+ format!("consider changing this to be a mutable {pointer_desc}"),
+ suggested_code,
+ Applicability::MachineApplicable,
+ );
+ }
+ Some((false, err_label_span, message)) => {
+ struct BindingFinder {
+ span: Span,
+ hir_id: Option<hir::HirId>,
+ }
+
+ impl<'tcx> Visitor<'tcx> for BindingFinder {
+ fn visit_stmt(&mut self, s: &'tcx hir::Stmt<'tcx>) {
+ if let hir::StmtKind::Local(local) = s.kind {
+ if local.pat.span == self.span {
+ self.hir_id = Some(local.hir_id);
+ }
+ }
+ hir::intravisit::walk_stmt(self, s);
+ }
+ }
+ let hir_map = self.infcx.tcx.hir();
+ let def_id = self.body.source.def_id();
+ let hir_id = hir_map.local_def_id_to_hir_id(def_id.expect_local());
+ let node = hir_map.find(hir_id);
+ let hir_id = if let Some(hir::Node::Item(item)) = node
+ && let hir::ItemKind::Fn(.., body_id) = item.kind
+ {
+ let body = hir_map.body(body_id);
+ let mut v = BindingFinder {
+ span: err_label_span,
+ hir_id: None,
+ };
+ v.visit_body(body);
+ v.hir_id
+ } else {
+ None
+ };
+ if let Some(hir_id) = hir_id
+ && let Some(hir::Node::Local(local)) = hir_map.find(hir_id)
+ {
+ let (changing, span, sugg) = match local.ty {
+ Some(ty) => ("changing", ty.span, message),
+ None => (
+ "specifying",
+ local.pat.span.shrink_to_hi(),
+ format!(": {message}"),
+ ),
+ };
+ err.span_suggestion_verbose(
+ span,
+ format!("consider {changing} this binding's type"),
+ sugg,
+ Applicability::HasPlaceholders,
+ );
+ } else {
+ err.span_label(
+ err_label_span,
+ format!(
+ "consider changing this binding's type to be: `{message}`"
+ ),
+ );
+ }
+ }
+ None => {}
+ }
+ }
}
pub fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option<Symbol>) -> bool {
@@ -1160,25 +1167,18 @@ pub fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option<
}
}
-fn suggest_ampmut_self<'tcx>(
- tcx: TyCtxt<'tcx>,
- local_decl: &mir::LocalDecl<'tcx>,
-) -> (Span, String) {
- let sp = local_decl.source_info.span;
- (
- sp,
- match tcx.sess.source_map().span_to_snippet(sp) {
- Ok(snippet) => {
- let lt_pos = snippet.find('\'');
- if let Some(lt_pos) = lt_pos {
- format!("&{}mut self", &snippet[lt_pos..snippet.len() - 4])
- } else {
- "&mut self".to_string()
- }
+fn suggest_ampmut_self<'tcx>(tcx: TyCtxt<'tcx>, span: Span) -> String {
+ match tcx.sess.source_map().span_to_snippet(span) {
+ Ok(snippet) => {
+ let lt_pos = snippet.find('\'');
+ if let Some(lt_pos) = lt_pos {
+ format!("&{}mut self", &snippet[lt_pos..snippet.len() - 4])
+ } else {
+ "&mut self".to_string()
}
- _ => "&mut self".to_string(),
- },
- )
+ }
+ _ => "&mut self".to_string(),
+ }
}
// When we want to suggest a user change a local variable to be a `&mut`, there
@@ -1198,72 +1198,89 @@ fn suggest_ampmut_self<'tcx>(
// by trying (3.), then (2.) and finally falling back on (1.).
fn suggest_ampmut<'tcx>(
tcx: TyCtxt<'tcx>,
- local_decl: &mir::LocalDecl<'tcx>,
+ decl_ty: Ty<'tcx>,
+ decl_span: Span,
opt_assignment_rhs_span: Option<Span>,
opt_ty_info: Option<Span>,
) -> (bool, Span, String) {
+ // if there is a RHS and it starts with a `&` from it, then check if it is
+ // mutable, and if not, put suggest putting `mut ` to make it mutable.
+ // we don't have to worry about lifetime annotations here because they are
+ // not valid when taking a reference. For example, the following is not valid Rust:
+ //
+ // let x: &i32 = &'a 5;
+ // ^^ lifetime annotation not allowed
+ //
if let Some(assignment_rhs_span) = opt_assignment_rhs_span
&& let Ok(src) = tcx.sess.source_map().span_to_snippet(assignment_rhs_span)
+ && let Some(stripped) = src.strip_prefix('&')
{
- let is_mutbl = |ty: &str| -> bool {
- if let Some(rest) = ty.strip_prefix("mut") {
- match rest.chars().next() {
- // e.g. `&mut x`
- Some(c) if c.is_whitespace() => true,
- // e.g. `&mut(x)`
- Some('(') => true,
- // e.g. `&mut{x}`
- Some('{') => true,
- // e.g. `&mutablevar`
- _ => false,
- }
- } else {
- false
+ let is_mut = if let Some(rest) = stripped.trim_start().strip_prefix("mut") {
+ match rest.chars().next() {
+ // e.g. `&mut x`
+ Some(c) if c.is_whitespace() => true,
+ // e.g. `&mut(x)`
+ Some('(') => true,
+ // e.g. `&mut{x}`
+ Some('{') => true,
+ // e.g. `&mutablevar`
+ _ => false,
}
+ } else {
+ false
};
- if let (true, Some(ws_pos)) = (src.starts_with("&'"), src.find(char::is_whitespace)) {
- let lt_name = &src[1..ws_pos];
- let ty = src[ws_pos..].trim_start();
- if !is_mutbl(ty) {
- return (true, assignment_rhs_span, format!("&{lt_name} mut {ty}"));
- }
- } else if let Some(stripped) = src.strip_prefix('&') {
- let stripped = stripped.trim_start();
- if !is_mutbl(stripped) {
- return (true, assignment_rhs_span, format!("&mut {stripped}"));
- }
+ // if the reference is already mutable then there is nothing we can do
+ // here.
+ if !is_mut {
+ let span = assignment_rhs_span;
+ // shrink the span to just after the `&` in `&variable`
+ let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo();
+
+ // FIXME(Ezrashaw): returning is bad because we still might want to
+ // update the annotated type, see #106857.
+ return (true, span, "mut ".to_owned());
}
}
- let (suggestibility, highlight_span) = match opt_ty_info {
+ let (binding_exists, span) = match opt_ty_info {
// if this is a variable binding with an explicit type,
- // try to highlight that for the suggestion.
+ // then we will suggest changing it to be mutable.
+ // this is `Applicability::MachineApplicable`.
Some(ty_span) => (true, ty_span),
- // otherwise, just highlight the span associated with
- // the (MIR) LocalDecl.
- None => (false, local_decl.source_info.span),
+ // otherwise, we'll suggest *adding* an annotated type, we'll suggest
+ // the RHS's type for that.
+ // this is `Applicability::HasPlaceholders`.
+ None => (false, decl_span),
};
- if let Ok(src) = tcx.sess.source_map().span_to_snippet(highlight_span)
- && let (true, Some(ws_pos)) = (src.starts_with("&'"), src.find(char::is_whitespace))
+ // if the binding already exists and is a reference with a explicit
+ // lifetime, then we can suggest adding ` mut`. this is special-cased from
+ // the path without a explicit lifetime.
+ if let Ok(src) = tcx.sess.source_map().span_to_snippet(span)
+ && src.starts_with("&'")
+ // note that `& 'a T` is invalid so this is correct.
+ && let Some(ws_pos) = src.find(char::is_whitespace)
{
- let lt_name = &src[1..ws_pos];
- let ty = &src[ws_pos..];
- return (true, highlight_span, format!("&{lt_name} mut{ty}"));
- }
+ let span = span.with_lo(span.lo() + BytePos(ws_pos as u32)).shrink_to_lo();
+ (true, span, " mut".to_owned())
+ // if there is already a binding, we modify it to be `mut`
+ } else if binding_exists {
+ // shrink the span to just after the `&` in `&variable`
+ let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo();
+ (true, span, "mut ".to_owned())
+ } else {
+ // otherwise, suggest that the user annotates the binding; we provide the
+ // type of the local.
+ let ty_mut = decl_ty.builtin_deref(true).unwrap();
+ assert_eq!(ty_mut.mutbl, hir::Mutability::Not);
- let ty_mut = local_decl.ty.builtin_deref(true).unwrap();
- assert_eq!(ty_mut.mutbl, hir::Mutability::Not);
- (
- suggestibility,
- highlight_span,
- if local_decl.ty.is_ref() {
- format!("&mut {}", ty_mut.ty)
- } else {
- format!("*mut {}", ty_mut.ty)
- },
- )
+ (
+ false,
+ span,
+ format!("{}mut {}", if decl_ty.is_ref() {"&"} else {"*"}, ty_mut.ty)
+ )
+ }
}
fn is_closure_or_generator(ty: Ty<'_>) -> bool {
@@ -1300,11 +1317,13 @@ fn get_mut_span_in_struct_field<'tcx>(
}
/// If possible, suggest replacing `ref` with `ref mut`.
-fn suggest_ref_mut(tcx: TyCtxt<'_>, binding_span: Span) -> Option<String> {
- let hi_src = tcx.sess.source_map().span_to_snippet(binding_span).ok()?;
- if hi_src.starts_with("ref") && hi_src["ref".len()..].starts_with(rustc_lexer::is_whitespace) {
- let replacement = format!("ref mut{}", &hi_src["ref".len()..]);
- Some(replacement)
+fn suggest_ref_mut(tcx: TyCtxt<'_>, span: Span) -> Option<Span> {
+ let pattern_str = tcx.sess.source_map().span_to_snippet(span).ok()?;
+ if pattern_str.starts_with("ref")
+ && pattern_str["ref".len()..].starts_with(rustc_lexer::is_whitespace)
+ {
+ let span = span.with_lo(span.lo() + BytePos(4)).shrink_to_lo();
+ Some(span)
} else {
None
}
diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl
index 0d7cf7c..3b458b1 100644
--- a/compiler/rustc_builtin_macros/messages.ftl
+++ b/compiler/rustc_builtin_macros/messages.ftl
@@ -150,10 +150,6 @@
*[more] arguments
} in format string, but {$desc}
-builtin_macros_offset_of_expected_field = expected field
-
-builtin_macros_offset_of_expected_two_args = expected 2 arguments
-
builtin_macros_test_case_non_item = `#[test_case]` attribute is only allowed on items
builtin_macros_test_bad_fn = {$kind} functions cannot be used for tests
diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs
index c7da61d..4e5edb4 100644
--- a/compiler/rustc_builtin_macros/src/lib.rs
+++ b/compiler/rustc_builtin_macros/src/lib.rs
@@ -44,7 +44,6 @@
mod format_foreign;
mod global_allocator;
mod log_syntax;
-mod offset_of;
mod source_util;
mod test;
mod trace_macros;
@@ -92,7 +91,6 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
line: source_util::expand_line,
log_syntax: log_syntax::expand_log_syntax,
module_path: source_util::expand_mod,
- offset_of: offset_of::expand_offset_of,
option_env: env::expand_option_env,
core_panic: edition_panic::expand_panic,
std_panic: edition_panic::expand_panic,
diff --git a/compiler/rustc_builtin_macros/src/offset_of.rs b/compiler/rustc_builtin_macros/src/offset_of.rs
deleted file mode 100644
index 0ef3e00..0000000
--- a/compiler/rustc_builtin_macros/src/offset_of.rs
+++ /dev/null
@@ -1,99 +0,0 @@
-use rustc_ast as ast;
-use rustc_ast::ptr::P;
-use rustc_ast::token;
-use rustc_ast::tokenstream::TokenStream;
-use rustc_errors::PResult;
-use rustc_expand::base::{self, *};
-use rustc_macros::Diagnostic;
-use rustc_parse::parser::Parser;
-use rustc_span::{symbol::Ident, Span};
-
-#[derive(Diagnostic)]
-#[diag(builtin_macros_offset_of_expected_field)]
-struct ExpectedField {
- #[primary_span]
- span: Span,
-}
-
-#[derive(Diagnostic)]
-#[diag(builtin_macros_offset_of_expected_two_args)]
-struct ExpectedTwoArgs {
- #[primary_span]
- span: Span,
-}
-
-fn parse_field<'a>(cx: &ExtCtxt<'a>, p: &mut Parser<'a>) -> PResult<'a, Ident> {
- let token = p.token.uninterpolate();
- let field = match token.kind {
- token::Ident(name, _) => Ident::new(name, token.span),
- token::Literal(token::Lit { kind: token::Integer, symbol, suffix: None }) => {
- Ident::new(symbol, token.span)
- }
- _ => return Err(cx.create_err(ExpectedField { span: p.token.span })),
- };
-
- p.bump();
-
- Ok(field)
-}
-
-fn parse_args<'a>(
- cx: &mut ExtCtxt<'a>,
- sp: Span,
- tts: TokenStream,
-) -> PResult<'a, (P<ast::Ty>, P<[Ident]>)> {
- let mut p = cx.new_parser_from_tts(tts);
-
- let container = p.parse_ty()?;
-
- p.expect(&token::Comma)?;
-
- if p.eat(&token::Eof) {
- return Err(cx.create_err(ExpectedTwoArgs { span: sp }));
- }
-
- let mut fields = Vec::new();
-
- loop {
- let field = parse_field(cx, &mut p)?;
- fields.push(field);
-
- if p.eat(&token::Dot) {
- continue;
- }
-
- p.eat(&token::Comma);
-
- if !p.eat(&token::Eof) {
- return Err(cx.create_err(ExpectedTwoArgs { span: sp }));
- }
-
- break;
- }
-
- Ok((container, fields.into()))
-}
-
-pub fn expand_offset_of<'cx>(
- cx: &'cx mut ExtCtxt<'_>,
- sp: Span,
- tts: TokenStream,
-) -> Box<dyn base::MacResult + 'cx> {
- match parse_args(cx, sp, tts) {
- Ok((container, fields)) => {
- let expr = P(ast::Expr {
- id: ast::DUMMY_NODE_ID,
- kind: ast::ExprKind::OffsetOf(container, fields),
- span: sp,
- attrs: ast::AttrVec::new(),
- tokens: None,
- });
-
- MacEager::expr(expr)
- }
- Err(mut err) => {
- err.emit();
- DummyResult::any(sp)
- }
- }
-}
diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs
index a66ddb6..869344c 100644
--- a/compiler/rustc_codegen_gcc/src/builder.rs
+++ b/compiler/rustc_codegen_gcc/src/builder.rs
@@ -1227,6 +1227,11 @@ fn cleanup_landing_pad(&mut self, _pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RVal
(value1, value2)
}
+ fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RValue<'gcc>) {
+ // TODO(antoyo): generate the correct landing pad
+ self.cleanup_landing_pad(pers_fn)
+ }
+
#[cfg(feature="master")]
fn resume(&mut self, exn0: RValue<'gcc>, _exn1: RValue<'gcc>) {
let exn_type = exn0.get_type();
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 2fd6db8..4d0bcd5 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -985,13 +985,20 @@ fn set_personality_fn(&mut self, personality: &'ll Value) {
fn cleanup_landing_pad(&mut self, pers_fn: &'ll Value) -> (&'ll Value, &'ll Value) {
let ty = self.type_struct(&[self.type_i8p(), self.type_i32()], false);
- let landing_pad = self.landing_pad(ty, pers_fn, 1 /* FIXME should this be 0? */);
+ let landing_pad = self.landing_pad(ty, pers_fn, 0);
unsafe {
llvm::LLVMSetCleanup(landing_pad, llvm::True);
}
(self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
}
+ fn filter_landing_pad(&mut self, pers_fn: &'ll Value) -> (&'ll Value, &'ll Value) {
+ let ty = self.type_struct(&[self.type_i8p(), self.type_i32()], false);
+ let landing_pad = self.landing_pad(ty, pers_fn, 1);
+ self.add_clause(landing_pad, self.const_array(self.type_i8p(), &[]));
+ (self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
+ }
+
fn resume(&mut self, exn0: &'ll Value, exn1: &'ll Value) {
let ty = self.type_struct(&[self.type_i8p(), self.type_i32()], false);
let mut exn = self.const_poison(ty);
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs
index d5d8437..8968133 100644
--- a/compiler/rustc_codegen_ssa/src/back/metadata.rs
+++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs
@@ -12,6 +12,7 @@
use snap::write::FrameEncoder;
+use object::elf::NT_GNU_PROPERTY_TYPE_0;
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::owned_slice::try_slice_owned;
use rustc_data_structures::sync::MetadataRef;
@@ -93,6 +94,54 @@ pub(super) fn search_for_section<'a>(
.map_err(|e| format!("failed to read {} section in '{}': {}", section, path.display(), e))
}
+fn add_gnu_property_note(
+ file: &mut write::Object<'static>,
+ architecture: Architecture,
+ binary_format: BinaryFormat,
+ endianness: Endianness,
+) {
+ // check bti protection
+ if binary_format != BinaryFormat::Elf
+ || !matches!(architecture, Architecture::X86_64 | Architecture::Aarch64)
+ {
+ return;
+ }
+
+ let section = file.add_section(
+ file.segment_name(StandardSegment::Data).to_vec(),
+ b".note.gnu.property".to_vec(),
+ SectionKind::Note,
+ );
+ let mut data: Vec<u8> = Vec::new();
+ let n_namsz: u32 = 4; // Size of the n_name field
+ let n_descsz: u32 = 16; // Size of the n_desc field
+ let n_type: u32 = NT_GNU_PROPERTY_TYPE_0; // Type of note descriptor
+ let header_values = [n_namsz, n_descsz, n_type];
+ header_values.iter().for_each(|v| {
+ data.extend_from_slice(&match endianness {
+ Endianness::Little => v.to_le_bytes(),
+ Endianness::Big => v.to_be_bytes(),
+ })
+ });
+ data.extend_from_slice(b"GNU\0"); // Owner of the program property note
+ let pr_type: u32 = match architecture {
+ Architecture::X86_64 => 0xc0000002,
+ Architecture::Aarch64 => 0xc0000000,
+ _ => unreachable!(),
+ };
+ let pr_datasz: u32 = 4; //size of the pr_data field
+ let pr_data: u32 = 3; //program property descriptor
+ let pr_padding: u32 = 0;
+ let property_values = [pr_type, pr_datasz, pr_data, pr_padding];
+ property_values.iter().for_each(|v| {
+ data.extend_from_slice(&match endianness {
+ Endianness::Little => v.to_le_bytes(),
+ Endianness::Big => v.to_be_bytes(),
+ })
+ });
+ file.append_section_data(section, &data, 8);
+}
+
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {
let endianness = match sess.target.options.endian {
Endian::Little => Endianness::Little,
@@ -205,6 +254,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
_ => elf::ELFOSABI_NONE,
};
let abi_version = 0;
+ add_gnu_property_note(&mut file, architecture, binary_format, endianness);
file.flags = FileFlags::Elf { os_abi, abi_version, e_flags };
Some(file)
}
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index c1613a9..a832999 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -1600,7 +1600,7 @@ fn terminate_block(&mut self) -> Bx::BasicBlock {
bx = Bx::build(self.cx, llbb);
let llpersonality = self.cx.eh_personality();
- bx.cleanup_landing_pad(llpersonality);
+ bx.filter_landing_pad(llpersonality);
funclet = None;
}
diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs
index 57de7e9..853c693 100644
--- a/compiler/rustc_codegen_ssa/src/traits/builder.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs
@@ -274,6 +274,7 @@ fn select(
// These are used by everyone except msvc
fn cleanup_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value);
+ fn filter_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value);
fn resume(&mut self, exn0: Self::Value, exn1: Self::Value);
// These are used only by msvc
diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs
index 048401f..311a42a 100644
--- a/compiler/rustc_data_structures/src/owned_slice.rs
+++ b/compiler/rustc_data_structures/src/owned_slice.rs
@@ -109,9 +109,11 @@ fn borrow(&self) -> &[u8] {
}
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box<dyn Send + Sync>)`, which is `Send`
+#[cfg(parallel_compiler)]
unsafe impl Send for OwnedSlice {}
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box<dyn Send + Sync>)`, which is `Sync`
+#[cfg(parallel_compiler)]
unsafe impl Sync for OwnedSlice {}
#[cfg(test)]
diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml
index cc4c5a0..d7d97fc 100644
--- a/compiler/rustc_driver_impl/Cargo.toml
+++ b/compiler/rustc_driver_impl/Cargo.toml
@@ -51,6 +51,7 @@
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
+rustc_mir_transform = { path = "../rustc_mir_transform" }
[target.'cfg(unix)'.dependencies]
libc = "0.2"
@@ -64,5 +65,8 @@
[features]
llvm = ['rustc_interface/llvm']
max_level_info = ['rustc_log/max_level_info']
-rustc_use_parallel_compiler = ['rustc_data_structures/rustc_use_parallel_compiler', 'rustc_interface/rustc_use_parallel_compiler',
- 'rustc_middle/rustc_use_parallel_compiler']
+rustc_use_parallel_compiler = [
+ 'rustc_data_structures/rustc_use_parallel_compiler',
+ 'rustc_interface/rustc_use_parallel_compiler',
+ 'rustc_middle/rustc_use_parallel_compiler'
+]
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 446e291..9b16f24 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -99,6 +99,7 @@
rustc_middle::DEFAULT_LOCALE_RESOURCE,
rustc_mir_build::DEFAULT_LOCALE_RESOURCE,
rustc_mir_dataflow::DEFAULT_LOCALE_RESOURCE,
+ rustc_mir_transform::DEFAULT_LOCALE_RESOURCE,
rustc_monomorphize::DEFAULT_LOCALE_RESOURCE,
rustc_parse::DEFAULT_LOCALE_RESOURCE,
rustc_passes::DEFAULT_LOCALE_RESOURCE,
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index ef528d8..db97d96 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -571,6 +571,14 @@ pub fn into_diagnostic(mut self) -> Option<(Diagnostic, &'a Handler)> {
Some((diagnostic, handler))
}
+ /// Retrieves the [`Handler`] if available
+ pub fn handler(&self) -> Option<&Handler> {
+ match self.inner.state {
+ DiagnosticBuilderState::Emittable(handler) => Some(handler),
+ DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation => None,
+ }
+ }
+
/// Buffers the diagnostic for later emission,
/// unless handler has disabled such buffering.
pub fn buffer(self, buffered_diagnostics: &mut Vec<Diagnostic>) {
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index 27d30c3..f461544 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -313,6 +313,8 @@ pub fn set(&self, features: &mut Features, span: Span) {
(active, async_closure, "1.37.0", Some(62290), None),
/// Allows async functions to be declared, implemented, and used in traits.
(active, async_fn_in_trait, "1.66.0", Some(91611), None),
+ /// Allows builtin # foo() syntax
+ (active, builtin_syntax, "CURRENT_RUSTC_VERSION", Some(110680), None),
/// Allows `c"foo"` literals.
(active, c_str_literals, "CURRENT_RUSTC_VERSION", Some(105723), None),
/// Treat `extern "C"` function as nounwind.
diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl
index 3b42b0f..5e5c984 100644
--- a/compiler/rustc_hir_analysis/messages.ftl
+++ b/compiler/rustc_hir_analysis/messages.ftl
@@ -279,6 +279,9 @@
hir_analysis_closure_implicit_hrtb = implicit types in closure signatures are forbidden when `for<...>` is present
.label = `for<...>` is here
+hir_analysis_empty_specialization = specialization impl does not specialize any associated items
+ .note = impl is a specialization of this impl
+
hir_analysis_const_specialize = cannot specialize on const impl with non-const impl
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs
index 5ee0cf9..6ac1df6 100644
--- a/compiler/rustc_hir_analysis/src/astconv/mod.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs
@@ -2419,6 +2419,10 @@ fn lookup_inherent_assoc_ty(
return Ok(None);
}
+ //
+ // Select applicable inherent associated type candidates modulo regions.
+ //
+
// In contexts that have no inference context, just make a new one.
// We do need a local variable to store it, though.
let infcx_;
@@ -2431,7 +2435,9 @@ fn lookup_inherent_assoc_ty(
}
};
- let param_env = tcx.param_env(block.owner.to_def_id());
+ // FIXME(inherent_associated_types): Acquiring the ParamEnv this early leads to cycle errors
+ // when inside of an ADT (#108491) or where clause.
+ let param_env = tcx.param_env(block.owner);
let cause = ObligationCause::misc(span, block.owner.def_id);
let mut fulfillment_errors = Vec::new();
@@ -2439,6 +2445,8 @@ fn lookup_inherent_assoc_ty(
let universe = infcx.create_next_universe();
// Regions are not considered during selection.
+ // FIXME(non_lifetime_binders): Here we are "truncating" or "flattening" the universes
+ // of type and const binders. Is that correct in the selection phase? See also #109505.
let self_ty = tcx.replace_escaping_bound_vars_uncached(
self_ty,
FnMutDelegate {
@@ -2454,41 +2462,40 @@ fn lookup_inherent_assoc_ty(
candidates
.iter()
- .filter_map(|&(impl_, (assoc_item, def_scope))| {
+ .copied()
+ .filter(|&(impl_, _)| {
infcx.probe(|_| {
let ocx = ObligationCtxt::new_in_snapshot(&infcx);
- let impl_ty = tcx.type_of(impl_);
let impl_substs = infcx.fresh_item_substs(impl_);
- let impl_ty = impl_ty.subst(tcx, impl_substs);
+ let impl_ty = tcx.type_of(impl_).subst(tcx, impl_substs);
let impl_ty = ocx.normalize(&cause, param_env, impl_ty);
- // Check that the Self-types can be related.
- // FIXME(fmease): Should we use `eq` here?
- ocx.sup(&ObligationCause::dummy(), param_env, impl_ty, self_ty).ok()?;
+ // Check that the self types can be related.
+ // FIXME(inherent_associated_types): Should we use `eq` here? Method probing uses
+ // `sup` for this situtation, too. What for? To constrain inference variables?
+ if ocx.sup(&ObligationCause::dummy(), param_env, impl_ty, self_ty).is_err()
+ {
+ return false;
+ }
// Check whether the impl imposes obligations we have to worry about.
- let impl_bounds = tcx.predicates_of(impl_);
- let impl_bounds = impl_bounds.instantiate(tcx, impl_substs);
-
+ let impl_bounds = tcx.predicates_of(impl_).instantiate(tcx, impl_substs);
let impl_bounds = ocx.normalize(&cause, param_env, impl_bounds);
-
let impl_obligations = traits::predicates_for_generics(
|_, _| cause.clone(),
param_env,
impl_bounds,
);
-
ocx.register_obligations(impl_obligations);
let mut errors = ocx.select_where_possible();
if !errors.is_empty() {
fulfillment_errors.append(&mut errors);
- return None;
+ return false;
}
- // FIXME(fmease): Unsolved vars can escape this InferCtxt snapshot.
- Some((assoc_item, def_scope, infcx.resolve_vars_if_possible(impl_substs)))
+ true
})
})
.collect()
@@ -2497,24 +2504,26 @@ fn lookup_inherent_assoc_ty(
if applicable_candidates.len() > 1 {
return Err(self.complain_about_ambiguous_inherent_assoc_type(
name,
- applicable_candidates.into_iter().map(|(candidate, ..)| candidate).collect(),
+ applicable_candidates.into_iter().map(|(_, (candidate, _))| candidate).collect(),
span,
));
}
- if let Some((assoc_item, def_scope, impl_substs)) = applicable_candidates.pop() {
+ if let Some((impl_, (assoc_item, def_scope))) = applicable_candidates.pop() {
self.check_assoc_ty(assoc_item, name, def_scope, block, span);
- // FIXME(inherent_associated_types): To fully *confirm* the *probed* candidate, we still
- // need to relate the Self-type with fresh item substs & register region obligations for
- // regionck to prove/disprove.
+ // FIXME(fmease): Currently creating throwaway `parent_substs` to please
+ // `create_substs_for_associated_item`. Modify the latter instead (or sth. similar) to
+ // not require the parent substs logic.
+ let parent_substs = InternalSubsts::identity_for_item(tcx, impl_);
+ let substs =
+ self.create_substs_for_associated_item(span, assoc_item, segment, parent_substs);
+ let substs = tcx.mk_substs_from_iter(
+ std::iter::once(ty::GenericArg::from(self_ty))
+ .chain(substs.into_iter().skip(parent_substs.len())),
+ );
- let item_substs =
- self.create_substs_for_associated_item(span, assoc_item, segment, impl_substs);
-
- // FIXME(fmease, #106722): Check if the bounds on the parameters of the
- // associated type hold, if any.
- let ty = tcx.type_of(assoc_item).subst(tcx, item_substs);
+ let ty = tcx.mk_alias(ty::Inherent, tcx.mk_alias_ty(assoc_item, substs));
return Ok(Some((ty, assoc_item)));
}
diff --git a/compiler/rustc_hir_analysis/src/coherence/orphan.rs b/compiler/rustc_hir_analysis/src/coherence/orphan.rs
index 5ce8a83..272177d 100644
--- a/compiler/rustc_hir_analysis/src/coherence/orphan.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/orphan.rs
@@ -210,6 +210,19 @@ enum NonlocalImpl {
NonlocalImpl::DisallowOther,
),
+ // ```
+ // struct S<T>(T);
+ // impl<T: ?Sized> S<T> {
+ // type This = T;
+ // }
+ // impl<T: ?Sized> AutoTrait for S<T>::This {}
+ // ```
+ // FIXME(inherent_associated_types): The example code above currently leads to a cycle
+ ty::Alias(AliasKind::Inherent, _) => (
+ LocalImpl::Disallow { problematic_kind: "associated type" },
+ NonlocalImpl::DisallowOther,
+ ),
+
// type Opaque = impl Trait;
// impl AutoTrait for Opaque {}
ty::Alias(AliasKind::Opaque, _) => (
diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
index 821567c..5c7f7f1 100644
--- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
+++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
@@ -1948,7 +1948,7 @@ fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<!> {
ty::Param(param_ty) => {
self.arg_is_constrained[param_ty.index as usize] = true;
}
- ty::Alias(ty::Projection, _) => return ControlFlow::Continue(()),
+ ty::Alias(ty::Projection | ty::Inherent, _) => return ControlFlow::Continue(()),
_ => (),
}
t.super_visit_with(self)
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs
index c20fbfd..8df0166 100644
--- a/compiler/rustc_hir_analysis/src/collect/type_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs
@@ -127,7 +127,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
// the def_id that this query was called with. We filter to only type and const args here
// as a precaution for if it's ever allowed to elide lifetimes in GAT's. It currently isn't
// but it can't hurt to be safe ^^
- if let ty::Alias(ty::Projection, projection) = ty.kind() {
+ if let ty::Alias(ty::Projection | ty::Inherent, projection) = ty.kind() {
let generics = tcx.generics_of(projection.def_id);
let arg_index = segment
diff --git a/compiler/rustc_hir_analysis/src/constrained_generic_params.rs b/compiler/rustc_hir_analysis/src/constrained_generic_params.rs
index e18b0f0..9200c2a 100644
--- a/compiler/rustc_hir_analysis/src/constrained_generic_params.rs
+++ b/compiler/rustc_hir_analysis/src/constrained_generic_params.rs
@@ -59,7 +59,7 @@ struct ParameterCollector {
impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ParameterCollector {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
match *t.kind() {
- ty::Alias(ty::Projection, ..) if !self.include_nonconstraining => {
+ ty::Alias(ty::Projection | ty::Inherent, ..) if !self.include_nonconstraining => {
// projections are not injective
return ControlFlow::Continue(());
}
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 379a885..6e7eb4f 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -815,6 +815,15 @@ pub(crate) struct ClosureImplicitHrtb {
}
#[derive(Diagnostic)]
+#[diag(hir_analysis_empty_specialization)]
+pub(crate) struct EmptySpecialization {
+ #[primary_span]
+ pub span: Span,
+ #[note]
+ pub base_impl_span: Span,
+}
+
+#[derive(Diagnostic)]
#[diag(hir_analysis_const_specialize)]
pub(crate) struct ConstSpecialize {
#[primary_span]
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
index 5cca2da..e84da25 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
@@ -80,7 +80,7 @@
use rustc_span::Span;
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _;
-use rustc_trait_selection::traits::{self, translate_substs, wf, ObligationCtxt};
+use rustc_trait_selection::traits::{self, translate_substs_with_cause, wf, ObligationCtxt};
pub(super) fn check_min_specialization(tcx: TyCtxt<'_>, impl_def_id: LocalDefId) {
if let Some(node) = parent_specialization_node(tcx, impl_def_id) {
@@ -100,12 +100,19 @@ fn parent_specialization_node(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId) -> Opti
// Implementing a normal trait isn't a specialization.
return None;
}
+ if trait_def.is_marker {
+ // Overlapping marker implementations are not really specializations.
+ return None;
+ }
Some(impl2_node)
}
/// Check that `impl1` is a sound specialization
#[instrument(level = "debug", skip(tcx))]
fn check_always_applicable(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node: Node) {
+ let span = tcx.def_span(impl1_def_id);
+ check_has_items(tcx, impl1_def_id, impl2_node, span);
+
if let Some((impl1_substs, impl2_substs)) = get_impl_substs(tcx, impl1_def_id, impl2_node) {
let impl2_def_id = impl2_node.def_id();
debug!(?impl2_def_id, ?impl2_substs);
@@ -116,7 +123,6 @@ fn check_always_applicable(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node
unconstrained_parent_impl_substs(tcx, impl2_def_id, impl2_substs)
};
- let span = tcx.def_span(impl1_def_id);
check_constness(tcx, impl1_def_id, impl2_node, span);
check_static_lifetimes(tcx, &parent_substs, span);
check_duplicate_params(tcx, impl1_substs, &parent_substs, span);
@@ -124,6 +130,13 @@ fn check_always_applicable(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node
}
}
+fn check_has_items(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node: Node, span: Span) {
+ if let Node::Impl(impl2_id) = impl2_node && tcx.associated_item_def_ids(impl1_def_id).is_empty() {
+ let base_impl_span = tcx.def_span(impl2_id);
+ tcx.sess.emit_err(errors::EmptySpecialization { span, base_impl_span });
+ }
+}
+
/// Check that the specializing impl `impl1` is at least as const as the base
/// impl `impl2`
fn check_constness(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node: Node, span: Span) {
@@ -167,8 +180,21 @@ fn get_impl_substs(
ocx.assumed_wf_types(param_env, tcx.def_span(impl1_def_id), impl1_def_id);
let impl1_substs = InternalSubsts::identity_for_item(tcx, impl1_def_id);
- let impl2_substs =
- translate_substs(infcx, param_env, impl1_def_id.to_def_id(), impl1_substs, impl2_node);
+ let impl1_span = tcx.def_span(impl1_def_id);
+ let impl2_substs = translate_substs_with_cause(
+ infcx,
+ param_env,
+ impl1_def_id.to_def_id(),
+ impl1_substs,
+ impl2_node,
+ |_, span| {
+ traits::ObligationCause::new(
+ impl1_span,
+ impl1_def_id,
+ traits::ObligationCauseCode::BindingObligation(impl2_node.def_id(), span),
+ )
+ },
+ );
let errors = ocx.select_all_or_error();
if !errors.is_empty() {
diff --git a/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs b/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs
index d53c429..0cd2fc1 100644
--- a/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs
+++ b/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs
@@ -210,6 +210,9 @@ fn insert_required_predicates_to_be_wf<'tcx>(
);
}
+ // FIXME(inherent_associated_types): Handle this case properly.
+ ty::Alias(ty::Inherent, _) => {}
+
_ => {}
}
}
diff --git a/compiler/rustc_hir_typeck/src/demand.rs b/compiler/rustc_hir_typeck/src/demand.rs
index 9d59cdc..2defca5 100644
--- a/compiler/rustc_hir_typeck/src/demand.rs
+++ b/compiler/rustc_hir_typeck/src/demand.rs
@@ -86,9 +86,9 @@ pub fn emit_coerce_suggestions(
self.emit_type_mismatch_suggestions(err, expr, expr_ty, expected, expected_ty_expr, error);
self.note_type_is_not_clone(err, expected, expr_ty, expr);
self.note_internal_mutation_in_method(err, expr, Some(expected), expr_ty);
- self.check_for_range_as_method_call(err, expr, expr_ty, expected);
- self.check_for_binding_assigned_block_without_tail_expression(err, expr, expr_ty, expected);
- self.check_wrong_return_type_due_to_generic_arg(err, expr, expr_ty);
+ self.suggest_method_call_on_range_literal(err, expr, expr_ty, expected);
+ self.suggest_return_binding_for_missing_tail_expr(err, expr, expr_ty, expected);
+ self.note_wrong_return_ty_due_to_generic_arg(err, expr, expr_ty);
}
/// Requires that the two types unify, and prints an error message if
@@ -1087,7 +1087,7 @@ fn has_only_self_parameter(&self, method: &AssocItem) -> bool {
/// ```ignore (illustrative)
/// opt.map(|param| { takes_ref(param) });
/// ```
- fn can_use_as_ref(&self, expr: &hir::Expr<'_>) -> Option<(Span, &'static str, String)> {
+ fn can_use_as_ref(&self, expr: &hir::Expr<'_>) -> Option<(Vec<(Span, String)>, &'static str)> {
let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = expr.kind else {
return None;
};
@@ -1133,12 +1133,13 @@ fn can_use_as_ref(&self, expr: &hir::Expr<'_>) -> Option<(Span, &'static str, St
}
_ => false,
};
- match (is_as_ref_able, self.sess().source_map().span_to_snippet(method_path.ident.span)) {
- (true, Ok(src)) => {
- let suggestion = format!("as_ref().{}", src);
- Some((method_path.ident.span, "consider using `as_ref` instead", suggestion))
- }
- _ => None,
+ if is_as_ref_able {
+ Some((
+ vec![(method_path.ident.span.shrink_to_lo(), "as_ref().".to_string())],
+ "consider using `as_ref` instead",
+ ))
+ } else {
+ None
}
}
@@ -1217,14 +1218,13 @@ pub(crate) fn is_else_if_block(&self, expr: &hir::Expr<'_>) -> bool {
/// In addition of this check, it also checks between references mutability state. If the
/// expected is mutable but the provided isn't, maybe we could just say "Hey, try with
/// `&mut`!".
- pub fn check_ref(
+ pub fn suggest_deref_or_ref(
&self,
expr: &hir::Expr<'tcx>,
checked_ty: Ty<'tcx>,
expected: Ty<'tcx>,
) -> Option<(
- Span,
- String,
+ Vec<(Span, String)>,
String,
Applicability,
bool, /* verbose */
@@ -1254,30 +1254,28 @@ pub fn check_ref(
&& let Ok(src) = sm.span_to_snippet(sp)
&& replace_prefix(&src, "b\"", "\"").is_some()
{
- let pos = sp.lo() + BytePos(1);
- return Some((
- sp.with_hi(pos),
- "consider removing the leading `b`".to_string(),
- String::new(),
- Applicability::MachineApplicable,
- true,
- false,
- ));
- }
- }
+ let pos = sp.lo() + BytePos(1);
+ return Some((
+ vec![(sp.with_hi(pos), String::new())],
+ "consider removing the leading `b`".to_string(),
+ Applicability::MachineApplicable,
+ true,
+ false,
+ ));
+ }
+ }
(&ty::Array(arr, _) | &ty::Slice(arr), &ty::Str) if arr == self.tcx.types.u8 => {
if let hir::ExprKind::Lit(_) = expr.kind
&& let Ok(src) = sm.span_to_snippet(sp)
&& replace_prefix(&src, "\"", "b\"").is_some()
{
- return Some((
- sp.shrink_to_lo(),
- "consider adding a leading `b`".to_string(),
- "b".to_string(),
- Applicability::MachineApplicable,
- true,
- false,
- ));
+ return Some((
+ vec![(sp.shrink_to_lo(), "b".to_string())],
+ "consider adding a leading `b`".to_string(),
+ Applicability::MachineApplicable,
+ true,
+ false,
+ ));
}
}
_ => {}
@@ -1320,66 +1318,73 @@ pub fn check_ref(
}
if let hir::ExprKind::Unary(hir::UnOp::Deref, ref inner) = expr.kind
- && let Some(1) = self.deref_steps(expected, checked_ty) {
+ && let Some(1) = self.deref_steps(expected, checked_ty)
+ {
// We have `*&T`, check if what was expected was `&T`.
// If so, we may want to suggest removing a `*`.
sugg_sp = sugg_sp.with_hi(inner.span.lo());
return Some((
- sugg_sp,
+ vec![(sugg_sp, String::new())],
"consider removing deref here".to_string(),
- "".to_string(),
Applicability::MachineApplicable,
true,
false,
));
}
- if let Ok(src) = sm.span_to_snippet(sugg_sp) {
- let needs_parens = match expr.kind {
- // parenthesize if needed (Issue #46756)
- hir::ExprKind::Cast(_, _) | hir::ExprKind::Binary(_, _, _) => true,
- // parenthesize borrows of range literals (Issue #54505)
- _ if is_range_literal(expr) => true,
- _ => false,
- };
+ let needs_parens = match expr.kind {
+ // parenthesize if needed (Issue #46756)
+ hir::ExprKind::Cast(_, _) | hir::ExprKind::Binary(_, _, _) => true,
+ // parenthesize borrows of range literals (Issue #54505)
+ _ if is_range_literal(expr) => true,
+ _ => false,
+ };
- if let Some(sugg) = self.can_use_as_ref(expr) {
- return Some((
- sugg.0,
- sugg.1.to_string(),
- sugg.2,
- Applicability::MachineApplicable,
- false,
- false,
- ));
- }
-
- let prefix = match self.maybe_get_struct_pattern_shorthand_field(expr) {
- Some(ident) => format!("{ident}: "),
- None => String::new(),
- };
-
- if let Some(hir::Node::Expr(hir::Expr {
- kind: hir::ExprKind::Assign(..),
- ..
- })) = self.tcx.hir().find_parent(expr.hir_id)
- {
- if mutability.is_mut() {
- // Suppressing this diagnostic, we'll properly print it in `check_expr_assign`
- return None;
- }
- }
-
- let sugg_expr = if needs_parens { format!("({src})") } else { src };
+ if let Some((sugg, msg)) = self.can_use_as_ref(expr) {
return Some((
- sp,
- format!("consider {}borrowing here", mutability.mutably_str()),
- format!("{prefix}{}{sugg_expr}", mutability.ref_prefix_str()),
+ sugg,
+ msg.to_string(),
Applicability::MachineApplicable,
- false,
+ true,
false,
));
}
+
+ let prefix = match self.maybe_get_struct_pattern_shorthand_field(expr) {
+ Some(ident) => format!("{ident}: "),
+ None => String::new(),
+ };
+
+ if let Some(hir::Node::Expr(hir::Expr {
+ kind: hir::ExprKind::Assign(..),
+ ..
+ })) = self.tcx.hir().find_parent(expr.hir_id)
+ {
+ if mutability.is_mut() {
+ // Suppressing this diagnostic, we'll properly print it in `check_expr_assign`
+ return None;
+ }
+ }
+
+ let sugg = mutability.ref_prefix_str();
+ let (sugg, verbose) = if needs_parens {
+ (
+ vec![
+ (sp.shrink_to_lo(), format!("{prefix}{sugg}(")),
+ (sp.shrink_to_hi(), ")".to_string()),
+ ],
+ false,
+ )
+ } else {
+ (vec![(sp.shrink_to_lo(), format!("{prefix}{sugg}"))], true)
+ };
+ return Some((
+ sugg,
+ format!("consider {}borrowing here", mutability.mutably_str()),
+ Applicability::MachineApplicable,
+ verbose,
+ false,
+ ));
}
}
(
@@ -1401,23 +1406,19 @@ pub fn check_ref(
&& sm.is_span_accessible(call_span)
{
return Some((
- sp.with_hi(call_span.lo()),
+ vec![(sp.with_hi(call_span.lo()), String::new())],
"consider removing the borrow".to_string(),
- String::new(),
Applicability::MachineApplicable,
true,
- true
+ true,
));
}
return None;
}
- if sp.contains(expr.span)
- && sm.is_span_accessible(expr.span)
- {
+ if sp.contains(expr.span) && sm.is_span_accessible(expr.span) {
return Some((
- sp.with_hi(expr.span.lo()),
+ vec![(sp.with_hi(expr.span.lo()), String::new())],
"consider removing the borrow".to_string(),
- String::new(),
Applicability::MachineApplicable,
true,
true,
@@ -1441,23 +1442,30 @@ pub fn check_ref(
let suggestion = replace_prefix(&src, old_prefix, &new_prefix).map(|_| {
// skip `&` or `&mut ` if both mutabilities are mutable
- let lo = sp.lo() + BytePos(min(old_prefix.len(), mutbl_b.ref_prefix_str().len()) as _);
+ let lo = sp.lo()
+ + BytePos(min(old_prefix.len(), mutbl_b.ref_prefix_str().len()) as _);
// skip `&` or `&mut `
let hi = sp.lo() + BytePos(old_prefix.len() as _);
let sp = sp.with_lo(lo).with_hi(hi);
(
sp,
- format!("{}{derefs}", if mutbl_a != mutbl_b { mutbl_b.prefix_str() } else { "" }),
- if mutbl_b <= mutbl_a { Applicability::MachineApplicable } else { Applicability::MaybeIncorrect }
+ format!(
+ "{}{derefs}",
+ if mutbl_a != mutbl_b { mutbl_b.prefix_str() } else { "" }
+ ),
+ if mutbl_b <= mutbl_a {
+ Applicability::MachineApplicable
+ } else {
+ Applicability::MaybeIncorrect
+ },
)
});
if let Some((span, src, applicability)) = suggestion {
return Some((
- span,
+ vec![(span, src)],
"consider dereferencing".to_string(),
- src,
applicability,
true,
false,
@@ -1486,9 +1494,8 @@ pub fn check_ref(
// If we've reached our target type with just removing `&`, then just print now.
if steps == 0 && !remove.trim().is_empty() {
return Some((
- prefix_span,
+ vec![(prefix_span, String::new())],
format!("consider removing the `{}`", remove.trim()),
- String::new(),
// Do not remove `&&` to get to bool, because it might be something like
// { a } && b, which we have a separate fixup suggestion that is more
// likely correct...
@@ -1554,9 +1561,8 @@ pub fn check_ref(
}
return Some((
- span,
+ vec![(span, suggestion)],
message,
- suggestion,
Applicability::MachineApplicable,
true,
false,
@@ -1569,7 +1575,7 @@ pub fn check_ref(
None
}
- pub fn check_for_cast(
+ pub fn suggest_cast(
&self,
err: &mut Diagnostic,
expr: &hir::Expr<'_>,
@@ -1936,7 +1942,7 @@ pub fn check_for_cast(
}
/// Identify when the user has written `foo..bar()` instead of `foo.bar()`.
- pub fn check_for_range_as_method_call(
+ pub fn suggest_method_call_on_range_literal(
&self,
err: &mut Diagnostic,
expr: &hir::Expr<'tcx>,
@@ -2005,7 +2011,7 @@ pub fn check_for_range_as_method_call(
/// Identify when the type error is because `()` is found in a binding that was assigned a
/// block without a tail expression.
- fn check_for_binding_assigned_block_without_tail_expression(
+ fn suggest_return_binding_for_missing_tail_expr(
&self,
err: &mut Diagnostic,
expr: &hir::Expr<'_>,
@@ -2047,7 +2053,7 @@ fn check_for_binding_assigned_block_without_tail_expression(
}
}
- fn check_wrong_return_type_due_to_generic_arg(
+ fn note_wrong_return_ty_due_to_generic_arg(
&self,
err: &mut Diagnostic,
expr: &hir::Expr<'_>,
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
index 70ce45e..05e5d85 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
@@ -843,7 +843,7 @@ fn find_param_in_ty<'tcx>(
return true;
}
if let ty::GenericArgKind::Type(ty) = arg.unpack()
- && let ty::Alias(ty::Projection, ..) = ty.kind()
+ && let ty::Alias(ty::Projection | ty::Inherent, ..) = ty.kind()
{
// This logic may seem a bit strange, but typically when
// we have a projection type in a function signature, the
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
index 73a7bbe..67f45f9 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
@@ -300,7 +300,7 @@ fn probe_adt(&self, span: Span, ty: Ty<'tcx>) -> Option<ty::AdtDef<'tcx>> {
match ty.kind() {
ty::Adt(adt_def, _) => Some(*adt_def),
// FIXME(#104767): Should we handle bound regions here?
- ty::Alias(ty::Projection, _) if !ty.has_escaping_bound_vars() => {
+ ty::Alias(ty::Projection | ty::Inherent, _) if !ty.has_escaping_bound_vars() => {
self.normalize(span, ty).ty_adt_def()
}
_ => None,
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
index 2867fcc..c4add4d 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
@@ -275,13 +275,13 @@ pub fn suggest_deref_ref_or_into(
expected_ty_expr: Option<&'tcx hir::Expr<'tcx>>,
) -> bool {
let expr = expr.peel_blocks();
- if let Some((sp, msg, suggestion, applicability, verbose, annotation)) =
- self.check_ref(expr, found, expected)
+ if let Some((suggestion, msg, applicability, verbose, annotation)) =
+ self.suggest_deref_or_ref(expr, found, expected)
{
if verbose {
- err.span_suggestion_verbose(sp, msg, suggestion, applicability);
+ err.multipart_suggestion_verbose(msg, suggestion, applicability);
} else {
- err.span_suggestion(sp, msg, suggestion, applicability);
+ err.multipart_suggestion(msg, suggestion, applicability);
}
if annotation {
let suggest_annotation = match expr.peel_drop_temps().kind {
@@ -343,7 +343,7 @@ pub fn suggest_deref_ref_or_into(
err.span_label(sp, format!("{descr} `{name}` defined here"));
}
return true;
- } else if self.check_for_cast(err, expr, found, expected, expected_ty_expr) {
+ } else if self.suggest_cast(err, expr, found, expected, expected_ty_expr) {
return true;
} else {
let methods = self.get_conversion_methods(expr.span, expected, found, expr.hir_id);
diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs
index 30f0978..486c217 100644
--- a/compiler/rustc_hir_typeck/src/method/suggest.rs
+++ b/compiler/rustc_hir_typeck/src/method/suggest.rs
@@ -1045,7 +1045,7 @@ trait bound{s}",
);
}
- self.check_for_inner_self(&mut err, source, rcvr_ty, item_name);
+ self.suggest_unwrapping_inner_self(&mut err, source, rcvr_ty, item_name);
bound_spans.sort();
bound_spans.dedup();
@@ -1132,7 +1132,7 @@ trait bound{s}",
}
}
- self.check_for_deref_method(&mut err, source, rcvr_ty, item_name, expected);
+ self.note_derefed_ty_has_method(&mut err, source, rcvr_ty, item_name, expected);
return Some(err);
}
@@ -1805,7 +1805,7 @@ fn suggest_calling_method_on_field(
}
}
- fn check_for_inner_self(
+ fn suggest_unwrapping_inner_self(
&self,
err: &mut Diagnostic,
source: SelfSource<'tcx>,
@@ -2175,7 +2175,7 @@ pub fn suggest_derive(
}
}
- fn check_for_deref_method(
+ fn note_derefed_ty_has_method(
&self,
err: &mut Diagnostic,
self_source: SelfSource<'tcx>,
@@ -2211,7 +2211,7 @@ fn check_for_deref_method(
| ty::Float(_)
| ty::Adt(_, _)
| ty::Str
- | ty::Alias(ty::Projection, _)
+ | ty::Alias(ty::Projection | ty::Inherent, _)
| ty::Param(_) => format!("{deref_ty}"),
// we need to test something like <&[_]>::len or <(&[u32])>::len
// and Vec::function();
diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs
index 2a51439..08eec07 100644
--- a/compiler/rustc_infer/src/infer/combine.rs
+++ b/compiler/rustc_infer/src/infer/combine.rs
@@ -127,7 +127,8 @@ pub fn super_combine_tys<R>(
bug!()
}
- (_, ty::Alias(AliasKind::Projection, _)) | (ty::Alias(AliasKind::Projection, _), _)
+ (_, ty::Alias(AliasKind::Projection | AliasKind::Inherent, _))
+ | (ty::Alias(AliasKind::Projection | AliasKind::Inherent, _), _)
if self.tcx.trait_solver_next() =>
{
relation.register_type_relate_obligation(a, b);
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index 98da5ba..ce70f39 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -2354,7 +2354,9 @@ pub fn construct_generic_bound_failure(
let labeled_user_string = match bound_kind {
GenericKind::Param(ref p) => format!("the parameter type `{}`", p),
GenericKind::Alias(ref p) => match p.kind(self.tcx) {
- ty::AliasKind::Projection => format!("the associated type `{}`", p),
+ ty::AliasKind::Projection | ty::AliasKind::Inherent => {
+ format!("the associated type `{}`", p)
+ }
ty::AliasKind::Opaque => format!("the opaque type `{}`", p),
},
};
diff --git a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
index a311635..064811b 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
@@ -71,9 +71,10 @@ pub fn note_and_explain_type_err(
#traits-as-parameters",
);
}
- (ty::Alias(ty::Projection, _), ty::Alias(ty::Projection, _)) => {
+ (ty::Alias(ty::Projection | ty::Inherent, _), ty::Alias(ty::Projection | ty::Inherent, _)) => {
diag.note("an associated type was expected, but a different one was found");
}
+ // FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
(ty::Param(p), ty::Alias(ty::Projection, proj)) | (ty::Alias(ty::Projection, proj), ty::Param(p))
if !tcx.is_impl_trait_in_trait(proj.def_id) =>
{
@@ -222,7 +223,7 @@ fn foo(&self, x: T) -> T { x }
diag.span_label(p_span, "this type parameter");
}
}
- (ty::Alias(ty::Projection, proj_ty), _) if !tcx.is_impl_trait_in_trait(proj_ty.def_id) => {
+ (ty::Alias(ty::Projection | ty::Inherent, proj_ty), _) if !tcx.is_impl_trait_in_trait(proj_ty.def_id) => {
self.expected_projection(
diag,
proj_ty,
@@ -231,7 +232,7 @@ fn foo(&self, x: T) -> T { x }
cause.code(),
);
}
- (_, ty::Alias(ty::Projection, proj_ty)) if !tcx.is_impl_trait_in_trait(proj_ty.def_id) => {
+ (_, ty::Alias(ty::Projection | ty::Inherent, proj_ty)) if !tcx.is_impl_trait_in_trait(proj_ty.def_id) => {
let msg = format!(
"consider constraining the associated type `{}` to `{}`",
values.found, values.expected,
diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs
index 3343959..362b22b 100644
--- a/compiler/rustc_infer/src/infer/opaque_types.rs
+++ b/compiler/rustc_infer/src/infer/opaque_types.rs
@@ -549,6 +549,7 @@ fn register_hidden_type(
// We can't normalize associated types from `rustc_infer`,
// but we can eagerly register inference variables for them.
// FIXME(RPITIT): Don't replace RPITITs with inference vars.
+ // FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
ty::Alias(ty::Projection, projection_ty)
if !projection_ty.has_escaping_bound_vars()
&& !tcx.is_impl_trait_in_trait(projection_ty.def_id) =>
@@ -569,6 +570,7 @@ fn register_hidden_type(
hidden_ty
}
// FIXME(RPITIT): This can go away when we move to associated types
+ // FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
ty::Alias(
ty::Projection,
ty::AliasTy { def_id: def_id2, substs: substs2, .. },
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 0b7a704..3025cce 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -62,6 +62,7 @@
use rustc_middle::ty::layout::{LayoutError, LayoutOf};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::subst::GenericArgKind;
+use rustc_middle::ty::TypeVisitableExt;
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, VariantDef};
use rustc_session::config::ExpectedValues;
use rustc_session::lint::{BuiltinLintDiagnostics, FutureIncompatibilityReason};
@@ -1442,6 +1443,10 @@ fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
// Bounds are respected for `type X = impl Trait`
return;
}
+ if cx.tcx.type_of(item.owner_id).skip_binder().has_inherent_projections() {
+ // Bounds are respected for `type X = … Type::Inherent …`
+ return;
+ }
// There must not be a where clause
if type_alias_generics.predicates.is_empty() {
return;
@@ -1561,7 +1566,6 @@ fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
- use rustc_middle::ty::visit::TypeVisitableExt;
use rustc_middle::ty::Clause;
use rustc_middle::ty::PredicateKind::*;
@@ -2898,6 +2902,7 @@ fn structurally_same_type_impl<'tcx>(
| (Generator(..), Generator(..))
| (GeneratorWitness(..), GeneratorWitness(..))
| (Alias(ty::Projection, ..), Alias(ty::Projection, ..))
+ | (Alias(ty::Inherent, ..), Alias(ty::Inherent, ..))
| (Alias(ty::Opaque, ..), Alias(ty::Opaque, ..)) => false,
// These definitely should have been caught above.
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs
index a6ba742..125b4dc 100644
--- a/compiler/rustc_lint/src/types.rs
+++ b/compiler/rustc_lint/src/types.rs
@@ -1119,14 +1119,14 @@ fn check_type_for_ffi(&self, cache: &mut FxHashSet<Ty<'tcx>>, ty: Ty<'tcx>) -> F
// `extern "C" fn` functions can have type parameters, which may or may not be FFI-safe,
// so they are currently ignored for the purposes of this lint.
- ty::Param(..) | ty::Alias(ty::Projection, ..)
+ ty::Param(..) | ty::Alias(ty::Projection | ty::Inherent, ..)
if matches!(self.mode, CItemKind::Definition) =>
{
FfiSafe
}
ty::Param(..)
- | ty::Alias(ty::Projection, ..)
+ | ty::Alias(ty::Projection | ty::Inherent, ..)
| ty::Infer(..)
| ty::Bound(..)
| ty::Error(_)
diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs
index 427c82c..cd6e368 100644
--- a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs
+++ b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs
@@ -9,7 +9,7 @@
FieldInnerTy, FieldMap, HasFieldMap, SetOnce, SpannedOption, SubdiagnosticKind,
};
use proc_macro2::{Ident, Span, TokenStream};
-use quote::{format_ident, quote};
+use quote::{format_ident, quote, quote_spanned};
use syn::Token;
use syn::{parse_quote, spanned::Spanned, Attribute, Meta, Path, Type};
use synstructure::{BindingInfo, Structure, VariantInfo};
@@ -251,7 +251,8 @@ fn generate_field_code(&mut self, binding_info: &BindingInfo<'_>) -> TokenStream
let diag = &self.parent.diag;
let field = binding_info.ast();
- let field_binding = &binding_info.binding;
+ let mut field_binding = binding_info.binding.clone();
+ field_binding.set_span(field.ty.span());
let ident = field.ident.as_ref().unwrap();
let ident = format_ident!("{}", ident); // strip `r#` prefix, if present
@@ -284,9 +285,9 @@ fn generate_field_attrs_code(&mut self, binding_info: &BindingInfo<'_>) -> Token
name == "primary_span" && matches!(inner_ty, FieldInnerTy::Vec(_));
let (binding, needs_destructure) = if needs_clone {
// `primary_span` can accept a `Vec<Span>` so don't destructure that.
- (quote! { #field_binding.clone() }, false)
+ (quote_spanned! {inner_ty.span()=> #field_binding.clone() }, false)
} else {
- (quote! { #field_binding }, true)
+ (quote_spanned! {inner_ty.span()=> #field_binding }, true)
};
let generated_code = self
diff --git a/compiler/rustc_macros/src/diagnostics/mod.rs b/compiler/rustc_macros/src/diagnostics/mod.rs
index bd84681..a536eb3 100644
--- a/compiler/rustc_macros/src/diagnostics/mod.rs
+++ b/compiler/rustc_macros/src/diagnostics/mod.rs
@@ -140,7 +140,7 @@ pub fn lint_diagnostic_derive(s: Structure<'_>) -> TokenStream {
/// ```fluent
/// parser_expected_identifier = expected identifier
///
-/// parser_expected_identifier-found = expected identifier, found {$found}
+/// parser_expected_identifier_found = expected identifier, found {$found}
///
/// parser_raw_identifier = escape `{$ident}` to use it as an identifier
/// ```
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
index 62d49c1..374ba1a 100644
--- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
@@ -4,17 +4,16 @@
invalid_attr, span_err, throw_invalid_attr, throw_span_err, DiagnosticDeriveError,
};
use crate::diagnostics::utils::{
- build_field_mapping, is_doc_comment, new_code_ident,
- report_error_if_not_applied_to_applicability, report_error_if_not_applied_to_span, FieldInfo,
- FieldInnerTy, FieldMap, HasFieldMap, SetOnce, SpannedOption, SubdiagnosticKind,
+ build_field_mapping, build_suggestion_code, is_doc_comment, new_code_ident,
+ report_error_if_not_applied_to_applicability, report_error_if_not_applied_to_span,
+ should_generate_set_arg, AllowMultipleAlternatives, FieldInfo, FieldInnerTy, FieldMap,
+ HasFieldMap, SetOnce, SpannedOption, SubdiagnosticKind,
};
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use syn::{spanned::Spanned, Attribute, Meta, MetaList, Path};
use synstructure::{BindingInfo, Structure, VariantInfo};
-use super::utils::{build_suggestion_code, AllowMultipleAlternatives};
-
/// The central struct for constructing the `add_to_diagnostic` method from an annotated struct.
pub(crate) struct SubdiagnosticDeriveBuilder {
diag: syn::Ident,
@@ -210,19 +209,20 @@ fn identify_kind(&mut self) -> Result<Vec<(SubdiagnosticKind, Path)>, Diagnostic
}
/// Generates the code for a field with no attributes.
- fn generate_field_set_arg(&mut self, binding: &BindingInfo<'_>) -> TokenStream {
- let ast = binding.ast();
- assert_eq!(ast.attrs.len(), 0, "field with attribute used as diagnostic arg");
-
+ fn generate_field_set_arg(&mut self, binding_info: &BindingInfo<'_>) -> TokenStream {
let diag = &self.parent.diag;
- let ident = ast.ident.as_ref().unwrap();
- // strip `r#` prefix, if present
- let ident = format_ident!("{}", ident);
+
+ let field = binding_info.ast();
+ let mut field_binding = binding_info.binding.clone();
+ field_binding.set_span(field.ty.span());
+
+ let ident = field.ident.as_ref().unwrap();
+ let ident = format_ident!("{}", ident); // strip `r#` prefix, if present
quote! {
#diag.set_arg(
stringify!(#ident),
- #binding
+ #field_binding
);
}
}
@@ -399,7 +399,8 @@ fn generate_field_code_inner_list(
clone_suggestion_code: bool,
) -> Result<TokenStream, DiagnosticDeriveError> {
let span = attr.span().unwrap();
- let ident = &list.path.segments.last().unwrap().ident;
+ let mut ident = list.path.segments.last().unwrap().ident.clone();
+ ident.set_span(info.ty.span());
let name = ident.to_string();
let name = name.as_str();
@@ -498,7 +499,7 @@ pub fn into_tokens(&mut self) -> Result<TokenStream, DiagnosticDeriveError> {
.variant
.bindings()
.iter()
- .filter(|binding| !binding.ast().attrs.is_empty())
+ .filter(|binding| !should_generate_set_arg(binding.ast()))
.map(|binding| self.generate_field_attr_code(binding, kind_stats))
.collect();
@@ -580,7 +581,7 @@ pub fn into_tokens(&mut self) -> Result<TokenStream, DiagnosticDeriveError> {
.variant
.bindings()
.iter()
- .filter(|binding| binding.ast().attrs.is_empty())
+ .filter(|binding| should_generate_set_arg(binding.ast()))
.map(|binding| self.generate_field_set_arg(binding))
.collect();
diff --git a/compiler/rustc_macros/src/diagnostics/utils.rs b/compiler/rustc_macros/src/diagnostics/utils.rs
index b9b09c6..e243498 100644
--- a/compiler/rustc_macros/src/diagnostics/utils.rs
+++ b/compiler/rustc_macros/src/diagnostics/utils.rs
@@ -207,6 +207,12 @@ pub(crate) fn with(&self, binding: impl ToTokens, inner: impl ToTokens) -> Token
FieldInnerTy::Plain(..) => quote! { #inner },
}
}
+
+ pub fn span(&self) -> proc_macro2::Span {
+ match self {
+ FieldInnerTy::Option(ty) | FieldInnerTy::Vec(ty) | FieldInnerTy::Plain(ty) => ty.span(),
+ }
+ }
}
/// Field information passed to the builder. Deliberately omits attrs to discourage the
@@ -851,7 +857,8 @@ fn span(&self) -> Option<proc_macro2::Span> {
/// Returns `true` if `field` should generate a `set_arg` call rather than any other diagnostic
/// call (like `span_label`).
pub(super) fn should_generate_set_arg(field: &Field) -> bool {
- field.attrs.is_empty()
+ // Perhaps this should be an exhaustive list...
+ field.attrs.iter().all(|attr| is_doc_comment(attr))
}
pub(super) fn is_doc_comment(attr: &Attribute) -> bool {
diff --git a/compiler/rustc_middle/src/middle/privacy.rs b/compiler/rustc_middle/src/middle/privacy.rs
index aeb6a16..967fed6 100644
--- a/compiler/rustc_middle/src/middle/privacy.rs
+++ b/compiler/rustc_middle/src/middle/privacy.rs
@@ -64,7 +64,7 @@ pub fn is_public_at_level(&self, level: Level) -> bool {
self.at_level(level).is_public()
}
- pub const fn from_vis(vis: Visibility) -> EffectiveVisibility {
+ pub fn from_vis(vis: Visibility) -> EffectiveVisibility {
EffectiveVisibility {
direct: vis,
reexported: vis,
@@ -72,18 +72,6 @@ pub const fn from_vis(vis: Visibility) -> EffectiveVisibility {
reachable_through_impl_trait: vis,
}
}
-
- #[must_use]
- pub fn min(mut self, lhs: EffectiveVisibility, tcx: TyCtxt<'_>) -> Self {
- for l in Level::all_levels() {
- let rhs_vis = self.at_level_mut(l);
- let lhs_vis = *lhs.at_level(l);
- if rhs_vis.is_at_least(lhs_vis, tcx) {
- *rhs_vis = lhs_vis;
- };
- }
- self
- }
}
/// Holds a map of effective visibilities for reachable HIR nodes.
@@ -149,6 +137,24 @@ pub fn update_eff_vis(
};
}
+ pub fn set_public_at_level(
+ &mut self,
+ id: LocalDefId,
+ lazy_private_vis: impl FnOnce() -> Visibility,
+ level: Level,
+ ) {
+ let mut effective_vis = self
+ .effective_vis(id)
+ .copied()
+ .unwrap_or_else(|| EffectiveVisibility::from_vis(lazy_private_vis()));
+ for l in Level::all_levels() {
+ if l <= level {
+ *effective_vis.at_level_mut(l) = Visibility::Public;
+ }
+ }
+ self.map.insert(id, effective_vis);
+ }
+
pub fn check_invariants(&self, tcx: TyCtxt<'_>, early: bool) {
if !cfg!(debug_assertions) {
return;
@@ -213,7 +219,7 @@ pub fn effective_vis_or_private(
pub fn update(
&mut self,
id: Id,
- nominal_vis: Option<Visibility>,
+ nominal_vis: Visibility,
lazy_private_vis: impl FnOnce() -> Visibility,
inherited_effective_vis: EffectiveVisibility,
level: Level,
@@ -237,11 +243,12 @@ pub fn update(
if !(inherited_effective_vis_at_prev_level == inherited_effective_vis_at_level
&& level != l)
{
- calculated_effective_vis = if let Some(nominal_vis) = nominal_vis && !nominal_vis.is_at_least(inherited_effective_vis_at_level, tcx) {
- nominal_vis
- } else {
- inherited_effective_vis_at_level
- }
+ calculated_effective_vis =
+ if nominal_vis.is_at_least(inherited_effective_vis_at_level, tcx) {
+ inherited_effective_vis_at_level
+ } else {
+ nominal_vis
+ };
}
// effective visibility can't be decreased at next update call for the
// same id
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 858a3d2..f284118 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -2728,8 +2728,6 @@ pub struct UserTypeProjection {
pub projs: Vec<ProjectionKind>,
}
-impl Copy for ProjectionKind {}
-
impl UserTypeProjection {
pub(crate) fn index(mut self) -> Self {
self.projs.push(ProjectionElem::Index(()));
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index b425c76..d5b185e 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1821,6 +1821,16 @@
desc { "normalizing `{}`", goal.value.value }
}
+ /// Do not call this query directly: invoke `normalize` instead.
+ query normalize_inherent_projection_ty(
+ goal: CanonicalProjectionGoal<'tcx>
+ ) -> Result<
+ &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
+ NoSolution,
+ > {
+ desc { "normalizing `{}`", goal.value.value }
+ }
+
/// Do not call this query directly: invoke `try_normalize_erasing_regions` instead.
query try_normalize_generic_arg_after_erasing_regions(
goal: ParamEnvAnd<'tcx, GenericArg<'tcx>>
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index c255057..8aea2d8 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -1848,7 +1848,17 @@ pub(crate) fn check_and_mk_substs(
let substs = substs.into_iter().map(Into::into);
#[cfg(debug_assertions)]
{
- let n = self.generics_of(_def_id).count();
+ let generics = self.generics_of(_def_id);
+
+ let n = if let DefKind::AssocTy = self.def_kind(_def_id)
+ && let DefKind::Impl { of_trait: false } = self.def_kind(self.parent(_def_id))
+ {
+ // If this is an inherent projection.
+
+ generics.params.len() + 1
+ } else {
+ generics.count()
+ };
assert_eq!(
(n, Some(n)),
substs.size_hint(),
@@ -2009,7 +2019,7 @@ pub fn mk_alias(self, kind: ty::AliasKind, alias_ty: ty::AliasTy<'tcx>) -> Ty<'t
debug_assert_matches!(
(kind, self.def_kind(alias_ty.def_id)),
(ty::Opaque, DefKind::OpaqueTy)
- | (ty::Projection, DefKind::AssocTy)
+ | (ty::Projection | ty::Inherent, DefKind::AssocTy)
| (ty::Opaque | ty::Projection, DefKind::ImplTraitPlaceholder)
);
self.mk_ty_from_kind(Alias(kind, alias_ty))
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs
index 1be61e1..49ab9b7 100644
--- a/compiler/rustc_middle/src/ty/error.rs
+++ b/compiler/rustc_middle/src/ty/error.rs
@@ -265,7 +265,7 @@ pub fn sort_string(self, tcx: TyCtxt<'tcx>) -> Cow<'static, str> {
ty::Infer(ty::FreshTy(_)) => "fresh type".into(),
ty::Infer(ty::FreshIntTy(_)) => "fresh integral type".into(),
ty::Infer(ty::FreshFloatTy(_)) => "fresh floating-point type".into(),
- ty::Alias(ty::Projection, _) => "associated type".into(),
+ ty::Alias(ty::Projection | ty::Inherent, _) => "associated type".into(),
ty::Param(p) => format!("type parameter `{p}`").into(),
ty::Alias(ty::Opaque, ..) => if tcx.ty_is_opaque_future(self) { "future".into() } else { "opaque type".into() },
ty::Error(_) => "type error".into(),
@@ -312,7 +312,7 @@ pub fn prefix_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
ty::Tuple(..) => "tuple".into(),
ty::Placeholder(..) => "higher-ranked type".into(),
ty::Bound(..) => "bound type variable".into(),
- ty::Alias(ty::Projection, _) => "associated type".into(),
+ ty::Alias(ty::Projection | ty::Inherent, _) => "associated type".into(),
ty::Param(_) => "type parameter".into(),
ty::Alias(ty::Opaque, ..) => "opaque type".into(),
}
diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs
index 68002bf..d64875a 100644
--- a/compiler/rustc_middle/src/ty/flags.rs
+++ b/compiler/rustc_middle/src/ty/flags.rs
@@ -176,14 +176,14 @@ fn add_kind(&mut self, kind: &ty::TyKind<'_>) {
self.add_substs(substs);
}
- &ty::Alias(ty::Projection, data) => {
- self.add_flags(TypeFlags::HAS_TY_PROJECTION);
- self.add_alias_ty(data);
- }
+ &ty::Alias(kind, data) => {
+ self.add_flags(match kind {
+ ty::Projection => TypeFlags::HAS_TY_PROJECTION,
+ ty::Inherent => TypeFlags::HAS_TY_INHERENT,
+ ty::Opaque => TypeFlags::HAS_TY_OPAQUE,
+ });
- &ty::Alias(ty::Opaque, ty::AliasTy { substs, .. }) => {
- self.add_flags(TypeFlags::HAS_TY_OPAQUE);
- self.add_substs(substs);
+ self.add_alias_ty(data);
}
&ty::Dynamic(obj, r, _) => {
diff --git a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs
index 92a0400..9e67200 100644
--- a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs
+++ b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs
@@ -113,6 +113,12 @@ pub fn inhabited_predicate(self, tcx: TyCtxt<'tcx>) -> InhabitedPredicate<'tcx>
}
Never => InhabitedPredicate::False,
Param(_) | Alias(ty::Projection, _) => InhabitedPredicate::GenericType(self),
+ // FIXME(inherent_associated_types): Most likely we can just map to `GenericType` like above.
+ // However it's unclear if the substs passed to `InhabitedPredicate::subst` are of the correct
+ // format, i.e. don't contain parent substs. If you hit this case, please verify this beforehand.
+ Alias(ty::Inherent, _) => {
+ bug!("unimplemented: inhabitedness checking for inherent projections")
+ }
Tuple(tys) if tys.is_empty() => InhabitedPredicate::True,
// use a query for more complex cases
Adt(..) | Array(..) | Tuple(_) => tcx.inhabited_predicate_type(self),
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
index f2a2e67..47cf48f 100644
--- a/compiler/rustc_middle/src/ty/layout.rs
+++ b/compiler/rustc_middle/src/ty/layout.rs
@@ -324,7 +324,7 @@ pub fn compute(
let non_zero = !ty.is_unsafe_ptr();
let tail = tcx.struct_tail_erasing_lifetimes(pointee, param_env);
match tail.kind() {
- ty::Param(_) | ty::Alias(ty::Projection, _) => {
+ ty::Param(_) | ty::Alias(ty::Projection | ty::Inherent, _) => {
debug_assert!(tail.has_non_region_param());
Ok(SizeSkeleton::Pointer { non_zero, tail: tcx.erase_regions(tail) })
}
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 88b084b..f882f54 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -1004,7 +1004,7 @@ pub fn to_projection_term(&self, tcx: TyCtxt<'tcx>) -> Option<AliasTy<'tcx>> {
match self.unpack() {
TermKind::Ty(ty) => match ty.kind() {
ty::Alias(kind, alias_ty) => match kind {
- AliasKind::Projection => Some(*alias_ty),
+ AliasKind::Projection | AliasKind::Inherent => Some(*alias_ty),
AliasKind::Opaque => None,
},
_ => None,
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index b7e780b..926172f 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -729,7 +729,7 @@ fn pretty_print_type(mut self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>
ty::Foreign(def_id) => {
p!(print_def_path(def_id, &[]));
}
- ty::Alias(ty::Projection, ref data) => {
+ ty::Alias(ty::Projection | ty::Inherent, ref data) => {
if !(self.should_print_verbose() || NO_QUERIES.with(|q| q.get()))
&& self.tcx().is_impl_trait_in_trait(data.def_id)
{
diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs
index 7f28ed6..da43475 100644
--- a/compiler/rustc_middle/src/ty/relate.rs
+++ b/compiler/rustc_middle/src/ty/relate.rs
@@ -550,6 +550,11 @@ pub fn super_relate_tys<'tcx, R: TypeRelation<'tcx>>(
Ok(tcx.mk_projection(projection_ty.def_id, projection_ty.substs))
}
+ (&ty::Alias(ty::Inherent, a_data), &ty::Alias(ty::Inherent, b_data)) => {
+ let alias_ty = relation.relate(a_data, b_data)?;
+ Ok(tcx.mk_alias(ty::Inherent, tcx.mk_alias_ty(alias_ty.def_id, alias_ty.substs)))
+ }
+
(
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, substs: a_substs, .. }),
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, substs: b_substs, .. }),
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index 646384e..8d0737e 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1190,9 +1190,9 @@ fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
/// Represents the projection of an associated type.
///
-/// For a projection, this would be `<Ty as Trait<...>>::N`.
-///
-/// For an opaque type, there is no explicit syntax.
+/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
+/// * For an inherent projection, this would be `Ty::N<...>`.
+/// * For an opaque type, there is no explicit syntax.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable)]
#[derive(HashStable, TypeFoldable, TypeVisitable, Lift)]
pub struct AliasTy<'tcx> {
@@ -1201,12 +1201,16 @@ pub struct AliasTy<'tcx> {
/// For a projection, these are the substitutions for the trait and the
/// GAT substitutions, if there are any.
///
+ /// For an inherent projection, they consist of the self type and the GAT substitutions,
+ /// if there are any.
+ ///
/// For RPIT the substitutions are for the generics of the function,
/// while for TAIT it is used for the generic parameters of the alias.
pub substs: SubstsRef<'tcx>,
- /// The `DefId` of the `TraitItem` for the associated type `N` if this is a projection,
- /// or the `OpaqueType` item if this is an opaque.
+ /// The `DefId` of the `TraitItem` or `ImplItem` for the associated type `N` depending on whether
+ /// this is a projection or an inherent projection or the `DefId` of the `OpaqueType` item if
+ /// this is an opaque.
///
/// During codegen, `tcx.type_of(def_id)` can be used to get the type of the
/// underlying type if the type is an opaque.
@@ -1224,6 +1228,7 @@ pub struct AliasTy<'tcx> {
impl<'tcx> AliasTy<'tcx> {
pub fn kind(self, tcx: TyCtxt<'tcx>) -> ty::AliasKind {
match tcx.def_kind(self.def_id) {
+ DefKind::AssocTy if let DefKind::Impl { of_trait: false } = tcx.def_kind(tcx.parent(self.def_id)) => ty::Inherent,
DefKind::AssocTy | DefKind::ImplTraitPlaceholder => ty::Projection,
DefKind::OpaqueTy => ty::Opaque,
kind => bug!("unexpected DefKind in AliasTy: {kind:?}"),
@@ -1237,6 +1242,17 @@ pub fn to_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
/// The following methods work only with associated type projections.
impl<'tcx> AliasTy<'tcx> {
+ pub fn self_ty(self) -> Ty<'tcx> {
+ self.substs.type_at(0)
+ }
+
+ pub fn with_self_ty(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
+ tcx.mk_alias_ty(self.def_id, [self_ty.into()].into_iter().chain(self.substs.iter().skip(1)))
+ }
+}
+
+/// The following methods work only with trait associated type projections.
+impl<'tcx> AliasTy<'tcx> {
pub fn trait_def_id(self, tcx: TyCtxt<'tcx>) -> DefId {
match tcx.def_kind(self.def_id) {
DefKind::AssocTy | DefKind::AssocConst => tcx.parent(self.def_id),
@@ -1274,13 +1290,28 @@ pub fn trait_ref(self, tcx: TyCtxt<'tcx>) -> ty::TraitRef<'tcx> {
let def_id = self.trait_def_id(tcx);
ty::TraitRef::new(tcx, def_id, self.substs.truncate_to(tcx, tcx.generics_of(def_id)))
}
+}
- pub fn self_ty(self) -> Ty<'tcx> {
- self.substs.type_at(0)
- }
+/// The following methods work only with inherent associated type projections.
+impl<'tcx> AliasTy<'tcx> {
+ /// Transform the substitutions to have the given `impl` substs as the base and the GAT substs on top of that.
+ ///
+ /// Does the following transformation:
+ ///
+ /// ```text
+ /// [Self, P_0...P_m] -> [I_0...I_n, P_0...P_m]
+ ///
+ /// I_i impl subst
+ /// P_j GAT subst
+ /// ```
+ pub fn rebase_substs_onto_impl(
+ self,
+ impl_substs: ty::SubstsRef<'tcx>,
+ tcx: TyCtxt<'tcx>,
+ ) -> ty::SubstsRef<'tcx> {
+ debug_assert_eq!(self.kind(tcx), ty::Inherent);
- pub fn with_self_ty(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
- tcx.mk_alias_ty(self.def_id, [self_ty.into()].into_iter().chain(self.substs.iter().skip(1)))
+ tcx.mk_substs_from_iter(impl_substs.into_iter().chain(self.substs.into_iter().skip(1)))
}
}
diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs
index 5eaa58d..520bb55 100644
--- a/compiler/rustc_middle/src/ty/visit.rs
+++ b/compiler/rustc_middle/src/ty/visit.rs
@@ -49,6 +49,9 @@ fn has_type_flags(&self, flags: TypeFlags) -> bool {
fn has_projections(&self) -> bool {
self.has_type_flags(TypeFlags::HAS_PROJECTION)
}
+ fn has_inherent_projections(&self) -> bool {
+ self.has_type_flags(TypeFlags::HAS_TY_INHERENT)
+ }
fn has_opaque_types(&self) -> bool {
self.has_type_flags(TypeFlags::HAS_TY_OPAQUE)
}
diff --git a/compiler/rustc_mir_transform/Cargo.toml b/compiler/rustc_mir_transform/Cargo.toml
index 9625366..eca5f98 100644
--- a/compiler/rustc_mir_transform/Cargo.toml
+++ b/compiler/rustc_mir_transform/Cargo.toml
@@ -24,6 +24,8 @@
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_span = { path = "../rustc_span" }
+rustc_fluent_macro = { path = "../rustc_fluent_macro" }
+rustc_macros = { path = "../rustc_macros" }
[dev-dependencies]
coverage_test_macros = { path = "src/coverage/test_macros" }
diff --git a/compiler/rustc_mir_transform/messages.ftl b/compiler/rustc_mir_transform/messages.ftl
new file mode 100644
index 0000000..8c85cb5f
--- /dev/null
+++ b/compiler/rustc_mir_transform/messages.ftl
@@ -0,0 +1,66 @@
+mir_transform_const_modify = attempting to modify a `const` item
+ .note = each usage of a `const` item creates a new temporary; the original `const` item will not be modified
+
+mir_transform_const_mut_borrow = taking a mutable reference to a `const` item
+ .note = each usage of a `const` item creates a new temporary
+ .note2 = the mutable reference will refer to this temporary, not the original `const` item
+ .note3 = mutable reference created due to call to this method
+
+mir_transform_const_defined_here = `const` item defined here
+
+mir_transform_unaligned_packed_ref = reference to packed field is unaligned
+ .note = packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ .note_ub = creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ .help = copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+mir_transform_unused_unsafe = unnecessary `unsafe` block
+ .label = because it's nested under this `unsafe` block
+
+mir_transform_requires_unsafe = {$details} is unsafe and requires unsafe {$op_in_unsafe_fn_allowed ->
+ [true] function or block
+ *[false] block
+ }
+ .not_inherited = items do not inherit unsafety from separate enclosing items
+
+mir_transform_call_to_unsafe_label = call to unsafe function
+mir_transform_call_to_unsafe_note = consult the function's documentation for information on how to avoid undefined behavior
+mir_transform_use_of_asm_label = use of inline assembly
+mir_transform_use_of_asm_note = inline assembly is entirely unchecked and can cause undefined behavior
+mir_transform_initializing_valid_range_label = initializing type with `rustc_layout_scalar_valid_range` attr
+mir_transform_initializing_valid_range_note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior
+mir_transform_const_ptr2int_label = cast of pointer to int
+mir_transform_const_ptr2int_note = casting pointers to integers in constants
+mir_transform_use_of_static_mut_label = use of mutable static
+mir_transform_use_of_static_mut_note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+mir_transform_use_of_extern_static_label = use of extern static
+mir_transform_use_of_extern_static_note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
+mir_transform_deref_ptr_label = dereference of raw pointer
+mir_transform_deref_ptr_note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
+mir_transform_union_access_label = access to union field
+mir_transform_union_access_note = the field may not be properly initialized: using uninitialized data will cause undefined behavior
+mir_transform_mutation_layout_constrained_label = mutation of layout constrained field
+mir_transform_mutation_layout_constrained_note = mutating layout constrained fields cannot statically be checked for valid values
+mir_transform_mutation_layout_constrained_borrow_label = borrow of layout constrained field with interior mutability
+mir_transform_mutation_layout_constrained_borrow_note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
+mir_transform_target_feature_call_label = call to function with `#[target_feature]`
+mir_transform_target_feature_call_note = can only be called if the required target features are available
+
+mir_transform_unsafe_op_in_unsafe_fn = {$details} is unsafe and requires unsafe block (error E0133)
+
+mir_transform_arithmetic_overflow = this arithmetic operation will overflow
+mir_transform_operation_will_panic = this operation will panic at runtime
+
+mir_transform_ffi_unwind_call = call to {$foreign ->
+ [true] foreign function
+ *[false] function pointer
+ } with FFI-unwind ABI
+
+mir_transform_fn_item_ref = taking a reference to a function item does not give a function pointer
+ .suggestion = cast `{$ident}` to obtain a function pointer
+
+mir_transform_must_not_suspend = {$pre}`{$def_path}`{$post} held across a suspend point, but should not be
+ .label = the value is held across this suspend point
+ .note = {$reason}
+ .help = consider using a block (`{"{ ... }"}`) to shrink the value's scope, ending before the suspend point
+
+mir_transform_simd_shuffle_last_const = last argument of `simd_shuffle` is required to be a `const` item
diff --git a/compiler/rustc_mir_transform/src/check_const_item_mutation.rs b/compiler/rustc_mir_transform/src/check_const_item_mutation.rs
index 57b24c9..b791507 100644
--- a/compiler/rustc_mir_transform/src/check_const_item_mutation.rs
+++ b/compiler/rustc_mir_transform/src/check_const_item_mutation.rs
@@ -1,11 +1,12 @@
-use rustc_errors::{DiagnosticBuilder, DiagnosticMessage};
+use rustc_hir::HirId;
use rustc_middle::mir::visit::Visitor;
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;
use rustc_session::lint::builtin::CONST_ITEM_MUTATION;
use rustc_span::def_id::DefId;
+use rustc_span::Span;
-use crate::MirLint;
+use crate::{errors, MirLint};
pub struct CheckConstItemMutation;
@@ -58,16 +59,14 @@ fn is_const_item_without_destructor(&self, local: Local) -> Option<DefId> {
}
}
- fn lint_const_item_usage(
+ /// If we should lint on this usage, return the [`HirId`], source [`Span`]
+ /// and [`Span`] of the const item to use in the lint.
+ fn should_lint_const_item_usage(
&self,
place: &Place<'tcx>,
const_item: DefId,
location: Location,
- msg: impl Into<DiagnosticMessage>,
- decorate: impl for<'a, 'b> FnOnce(
- &'a mut DiagnosticBuilder<'b, ()>,
- ) -> &'a mut DiagnosticBuilder<'b, ()>,
- ) {
+ ) -> Option<(HirId, Span, Span)> {
// Don't lint on borrowing/assigning when a dereference is involved.
// If we 'leave' the temporary via a dereference, we must
// be modifying something else
@@ -83,16 +82,9 @@ fn lint_const_item_usage(
.assert_crate_local()
.lint_root;
- self.tcx.struct_span_lint_hir(
- CONST_ITEM_MUTATION,
- lint_root,
- source_info.span,
- msg,
- |lint| {
- decorate(lint)
- .span_note(self.tcx.def_span(const_item), "`const` item defined here")
- },
- );
+ Some((lint_root, source_info.span, self.tcx.def_span(const_item)))
+ } else {
+ None
}
}
}
@@ -104,10 +96,14 @@ fn visit_statement(&mut self, stmt: &Statement<'tcx>, loc: Location) {
// Assigning directly to a constant (e.g. `FOO = true;`) is a hard error,
// so emitting a lint would be redundant.
if !lhs.projection.is_empty() {
- if let Some(def_id) = self.is_const_item_without_destructor(lhs.local) {
- self.lint_const_item_usage(&lhs, def_id, loc, "attempting to modify a `const` item",|lint| {
- lint.note("each usage of a `const` item creates a new temporary; the original `const` item will not be modified")
- })
+ if let Some(def_id) = self.is_const_item_without_destructor(lhs.local)
+ && let Some((lint_root, span, item)) = self.should_lint_const_item_usage(&lhs, def_id, loc) {
+ self.tcx.emit_spanned_lint(
+ CONST_ITEM_MUTATION,
+ lint_root,
+ span,
+ errors::ConstMutate::Modify { konst: item }
+ );
}
}
// We are looking for MIR of the form:
@@ -143,17 +139,22 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, loc: Location) {
});
let lint_loc =
if method_did.is_some() { self.body.terminator_loc(loc.block) } else { loc };
- self.lint_const_item_usage(place, def_id, lint_loc, "taking a mutable reference to a `const` item", |lint| {
- lint
- .note("each usage of a `const` item creates a new temporary")
- .note("the mutable reference will refer to this temporary, not the original `const` item");
- if let Some((method_did, _substs)) = method_did {
- lint.span_note(self.tcx.def_span(method_did), "mutable reference created due to call to this method");
- }
-
- lint
- });
+ let method_call = if let Some((method_did, _)) = method_did {
+ Some(self.tcx.def_span(method_did))
+ } else {
+ None
+ };
+ if let Some((lint_root, span, item)) =
+ self.should_lint_const_item_usage(place, def_id, lint_loc)
+ {
+ self.tcx.emit_spanned_lint(
+ CONST_ITEM_MUTATION,
+ lint_root,
+ span,
+ errors::ConstMutate::MutBorrow { method_call, konst: item },
+ );
+ }
}
}
self.super_rvalue(rvalue, loc);
diff --git a/compiler/rustc_mir_transform/src/check_packed_ref.rs b/compiler/rustc_mir_transform/src/check_packed_ref.rs
index b9bc89f..2e6cf60 100644
--- a/compiler/rustc_mir_transform/src/check_packed_ref.rs
+++ b/compiler/rustc_mir_transform/src/check_packed_ref.rs
@@ -1,10 +1,9 @@
-use rustc_errors::struct_span_err;
use rustc_middle::mir::visit::{PlaceContext, Visitor};
use rustc_middle::mir::*;
use rustc_middle::ty::{self, TyCtxt};
-use crate::util;
use crate::MirLint;
+use crate::{errors, util};
pub struct CheckPackedRef;
@@ -49,25 +48,7 @@ fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location:
// shouldn't do.
span_bug!(self.source_info.span, "builtin derive created an unaligned reference");
} else {
- struct_span_err!(
- self.tcx.sess,
- self.source_info.span,
- E0793,
- "reference to packed field is unaligned"
- )
- .note(
- "packed structs are only aligned by one byte, and many modern architectures \
- penalize unaligned field accesses"
- )
- .note(
- "creating a misaligned reference is undefined behavior (even if that \
- reference is never dereferenced)",
- ).help(
- "copy the field contents to a local variable, or replace the \
- reference with a raw pointer and use `read_unaligned`/`write_unaligned` \
- (loads and stores via `*p` must be properly aligned even when using raw pointers)"
- )
- .emit();
+ self.tcx.sess.emit_err(errors::UnalignedPackedRef { span: self.source_info.span });
}
}
}
diff --git a/compiler/rustc_mir_transform/src/check_unsafety.rs b/compiler/rustc_mir_transform/src/check_unsafety.rs
index ce6d865..bdb4f20 100644
--- a/compiler/rustc_mir_transform/src/check_unsafety.rs
+++ b/compiler/rustc_mir_transform/src/check_unsafety.rs
@@ -1,5 +1,4 @@
use rustc_data_structures::unord::{UnordItems, UnordSet};
-use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId};
@@ -15,6 +14,8 @@
use std::ops::Bound;
+use crate::errors;
+
pub struct UnsafetyChecker<'a, 'tcx> {
body: &'a Body<'tcx>,
body_did: LocalDefId,
@@ -509,21 +510,12 @@ fn unsafety_check_result(tcx: TyCtxt<'_>, def: LocalDefId) -> &UnsafetyCheckResu
fn report_unused_unsafe(tcx: TyCtxt<'_>, kind: UnusedUnsafe, id: HirId) {
let span = tcx.sess.source_map().guess_head_span(tcx.hir().span(id));
- let msg = "unnecessary `unsafe` block";
- tcx.struct_span_lint_hir(UNUSED_UNSAFE, id, span, msg, |lint| {
- lint.span_label(span, msg);
- match kind {
- UnusedUnsafe::Unused => {}
- UnusedUnsafe::InUnsafeBlock(id) => {
- lint.span_label(
- tcx.sess.source_map().guess_head_span(tcx.hir().span(id)),
- "because it's nested under this `unsafe` block",
- );
- }
- }
-
- lint
- });
+ let nested_parent = if let UnusedUnsafe::InUnsafeBlock(id) = kind {
+ Some(tcx.sess.source_map().guess_head_span(tcx.hir().span(id)))
+ } else {
+ None
+ };
+ tcx.emit_spanned_lint(UNUSED_UNSAFE, id, span, errors::UnusedUnsafe { span, nested_parent });
}
pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) {
@@ -537,26 +529,11 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) {
let UnsafetyCheckResult { violations, unused_unsafes, .. } = tcx.unsafety_check_result(def_id);
for &UnsafetyViolation { source_info, lint_root, kind, details } in violations.iter() {
- let (description, note) = details.description_and_note();
+ let details = errors::RequiresUnsafeDetail { violation: details, span: source_info.span };
match kind {
UnsafetyViolationKind::General => {
- // once
- let unsafe_fn_msg = if unsafe_op_in_unsafe_fn_allowed(tcx, lint_root) {
- " function or"
- } else {
- ""
- };
-
- let mut err = struct_span_err!(
- tcx.sess,
- source_info.span,
- E0133,
- "{} is unsafe and requires unsafe{} block",
- description,
- unsafe_fn_msg,
- );
- err.span_label(source_info.span, description).note(note);
+ let op_in_unsafe_fn_allowed = unsafe_op_in_unsafe_fn_allowed(tcx, lint_root);
let note_non_inherited = tcx.hir().parent_iter(lint_root).find(|(id, node)| {
if let Node::Expr(block) = node
&& let ExprKind::Block(block, _) = block.kind
@@ -572,22 +549,23 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) {
false
}
});
- if let Some((id, _)) = note_non_inherited {
- let span = tcx.hir().span(id);
- err.span_label(
- tcx.sess.source_map().guess_head_span(span),
- "items do not inherit unsafety from separate enclosing items",
- );
- }
-
- err.emit();
+ let enclosing = if let Some((id, _)) = note_non_inherited {
+ Some(tcx.sess.source_map().guess_head_span(tcx.hir().span(id)))
+ } else {
+ None
+ };
+ tcx.sess.emit_err(errors::RequiresUnsafe {
+ span: source_info.span,
+ enclosing,
+ details,
+ op_in_unsafe_fn_allowed,
+ });
}
- UnsafetyViolationKind::UnsafeFn => tcx.struct_span_lint_hir(
+ UnsafetyViolationKind::UnsafeFn => tcx.emit_spanned_lint(
UNSAFE_OP_IN_UNSAFE_FN,
lint_root,
source_info.span,
- format!("{} is unsafe and requires unsafe block (error E0133)", description,),
- |lint| lint.span_label(source_info.span, description).note(note),
+ errors::UnsafeOpInUnsafeFn { details },
),
}
}
diff --git a/compiler/rustc_mir_transform/src/const_prop_lint.rs b/compiler/rustc_mir_transform/src/const_prop_lint.rs
index a4049d0..adb09c5 100644
--- a/compiler/rustc_mir_transform/src/const_prop_lint.rs
+++ b/compiler/rustc_mir_transform/src/const_prop_lint.rs
@@ -1,6 +1,8 @@
//! Propagates constants for early reporting of statically known
//! assertion failures
+use std::fmt::Debug;
+
use either::Left;
use rustc_const_eval::interpret::Immediate;
@@ -17,7 +19,6 @@
use rustc_middle::ty::{
self, ConstInt, Instance, ParamEnv, ScalarInt, Ty, TyCtxt, TypeVisitableExt,
};
-use rustc_session::lint;
use rustc_span::Span;
use rustc_target::abi::{HasDataLayout, Size, TargetDataLayout};
use rustc_trait_selection::traits;
@@ -25,6 +26,7 @@
use crate::const_prop::CanConstProp;
use crate::const_prop::ConstPropMachine;
use crate::const_prop::ConstPropMode;
+use crate::errors::AssertLint;
use crate::MirLint;
/// The maximum number of bytes that we'll allocate space for a local or the return value.
@@ -311,18 +313,9 @@ fn eval_operand(&mut self, op: &Operand<'tcx>, location: Location) -> Option<OpT
}
}
- fn report_assert_as_lint(
- &self,
- lint: &'static lint::Lint,
- location: Location,
- message: &'static str,
- panic: AssertKind<impl std::fmt::Debug>,
- ) {
- let source_info = self.body().source_info(location);
+ fn report_assert_as_lint(&self, source_info: &SourceInfo, lint: AssertLint<impl Debug>) {
if let Some(lint_root) = self.lint_root(*source_info) {
- self.tcx.struct_span_lint_hir(lint, lint_root, source_info.span, message, |lint| {
- lint.span_label(source_info.span, format!("{:?}", panic))
- });
+ self.tcx.emit_spanned_lint(lint.lint(), lint_root, source_info.span, lint);
}
}
@@ -335,11 +328,13 @@ fn check_unary_op(&mut self, op: UnOp, arg: &Operand<'tcx>, location: Location)
// `AssertKind` only has an `OverflowNeg` variant, so make sure that is
// appropriate to use.
assert_eq!(op, UnOp::Neg, "Neg is the only UnOp that can overflow");
+ let source_info = self.body().source_info(location);
self.report_assert_as_lint(
- lint::builtin::ARITHMETIC_OVERFLOW,
- location,
- "this arithmetic operation will overflow",
- AssertKind::OverflowNeg(val.to_const_int()),
+ source_info,
+ AssertLint::ArithmeticOverflow(
+ source_info.span,
+ AssertKind::OverflowNeg(val.to_const_int()),
+ ),
);
return None;
}
@@ -370,23 +365,23 @@ fn check_binary_op(
let r_bits = r.to_scalar().to_bits(right_size).ok();
if r_bits.map_or(false, |b| b >= left_size.bits() as u128) {
debug!("check_binary_op: reporting assert for {:?}", location);
+ let source_info = self.body().source_info(location);
+ let panic = AssertKind::Overflow(
+ op,
+ match l {
+ Some(l) => l.to_const_int(),
+ // Invent a dummy value, the diagnostic ignores it anyway
+ None => ConstInt::new(
+ ScalarInt::try_from_uint(1_u8, left_size).unwrap(),
+ left_ty.is_signed(),
+ left_ty.is_ptr_sized_integral(),
+ ),
+ },
+ r.to_const_int(),
+ );
self.report_assert_as_lint(
- lint::builtin::ARITHMETIC_OVERFLOW,
- location,
- "this arithmetic operation will overflow",
- AssertKind::Overflow(
- op,
- match l {
- Some(l) => l.to_const_int(),
- // Invent a dummy value, the diagnostic ignores it anyway
- None => ConstInt::new(
- ScalarInt::try_from_uint(1_u8, left_size).unwrap(),
- left_ty.is_signed(),
- left_ty.is_ptr_sized_integral(),
- ),
- },
- r.to_const_int(),
- ),
+ source_info,
+ AssertLint::ArithmeticOverflow(source_info.span, panic),
);
return None;
}
@@ -398,11 +393,13 @@ fn check_binary_op(
let (_res, overflow, _ty) = this.ecx.overflowing_binary_op(op, &l, &r)?;
Ok(overflow)
})? {
+ let source_info = self.body().source_info(location);
self.report_assert_as_lint(
- lint::builtin::ARITHMETIC_OVERFLOW,
- location,
- "this arithmetic operation will overflow",
- AssertKind::Overflow(op, l.to_const_int(), r.to_const_int()),
+ source_info,
+ AssertLint::ArithmeticOverflow(
+ source_info.span,
+ AssertKind::Overflow(op, l.to_const_int(), r.to_const_int()),
+ ),
);
return None;
}
@@ -543,11 +540,10 @@ fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// Need proper const propagator for these.
_ => return None,
};
+ let source_info = self.body().source_info(location);
self.report_assert_as_lint(
- lint::builtin::UNCONDITIONAL_PANIC,
- location,
- "this operation will panic at runtime",
- msg,
+ source_info,
+ AssertLint::UnconditionalPanic(source_info.span, msg),
);
}
diff --git a/compiler/rustc_mir_transform/src/errors.rs b/compiler/rustc_mir_transform/src/errors.rs
new file mode 100644
index 0000000..602e40d
--- /dev/null
+++ b/compiler/rustc_mir_transform/src/errors.rs
@@ -0,0 +1,245 @@
+use rustc_errors::{
+ DecorateLint, DiagnosticBuilder, DiagnosticMessage, EmissionGuarantee, Handler, IntoDiagnostic,
+};
+use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
+use rustc_middle::mir::{AssertKind, UnsafetyViolationDetails};
+use rustc_session::lint::{self, Lint};
+use rustc_span::Span;
+
+#[derive(LintDiagnostic)]
+pub(crate) enum ConstMutate {
+ #[diag(mir_transform_const_modify)]
+ #[note]
+ Modify {
+ #[note(mir_transform_const_defined_here)]
+ konst: Span,
+ },
+ #[diag(mir_transform_const_mut_borrow)]
+ #[note]
+ #[note(mir_transform_note2)]
+ MutBorrow {
+ #[note(mir_transform_note3)]
+ method_call: Option<Span>,
+ #[note(mir_transform_const_defined_here)]
+ konst: Span,
+ },
+}
+
+#[derive(Diagnostic)]
+#[diag(mir_transform_unaligned_packed_ref, code = "E0793")]
+#[note]
+#[note(mir_transform_note_ub)]
+#[help]
+pub(crate) struct UnalignedPackedRef {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(LintDiagnostic)]
+#[diag(mir_transform_unused_unsafe)]
+pub(crate) struct UnusedUnsafe {
+ #[label(mir_transform_unused_unsafe)]
+ pub span: Span,
+ #[label]
+ pub nested_parent: Option<Span>,
+}
+
+pub(crate) struct RequiresUnsafe {
+ pub span: Span,
+ pub details: RequiresUnsafeDetail,
+ pub enclosing: Option<Span>,
+ pub op_in_unsafe_fn_allowed: bool,
+}
+
+// The primary message for this diagnostic should be '{$label} is unsafe and...',
+// so we need to eagerly translate the label here, which isn't supported by the derive API
+// We could also exhaustively list out the primary messages for all unsafe violations,
+// but this would result in a lot of duplication.
+impl<'sess, G: EmissionGuarantee> IntoDiagnostic<'sess, G> for RequiresUnsafe {
+ #[track_caller]
+ fn into_diagnostic(self, handler: &'sess Handler) -> DiagnosticBuilder<'sess, G> {
+ let mut diag =
+ handler.struct_diagnostic(crate::fluent_generated::mir_transform_requires_unsafe);
+ diag.code(rustc_errors::DiagnosticId::Error("E0133".to_string()));
+ diag.set_span(self.span);
+ diag.span_label(self.span, self.details.label());
+ diag.note(self.details.note());
+ let desc = handler.eagerly_translate_to_string(self.details.label(), [].into_iter());
+ diag.set_arg("details", desc);
+ diag.set_arg("op_in_unsafe_fn_allowed", self.op_in_unsafe_fn_allowed);
+ if let Some(sp) = self.enclosing {
+ diag.span_label(sp, crate::fluent_generated::mir_transform_not_inherited);
+ }
+ diag
+ }
+}
+
+#[derive(Copy, Clone)]
+pub(crate) struct RequiresUnsafeDetail {
+ pub span: Span,
+ pub violation: UnsafetyViolationDetails,
+}
+
+impl RequiresUnsafeDetail {
+ fn note(self) -> DiagnosticMessage {
+ use UnsafetyViolationDetails::*;
+ match self.violation {
+ CallToUnsafeFunction => crate::fluent_generated::mir_transform_call_to_unsafe_note,
+ UseOfInlineAssembly => crate::fluent_generated::mir_transform_use_of_asm_note,
+ InitializingTypeWith => {
+ crate::fluent_generated::mir_transform_initializing_valid_range_note
+ }
+ CastOfPointerToInt => crate::fluent_generated::mir_transform_const_ptr2int_note,
+ UseOfMutableStatic => crate::fluent_generated::mir_transform_use_of_static_mut_note,
+ UseOfExternStatic => crate::fluent_generated::mir_transform_use_of_extern_static_note,
+ DerefOfRawPointer => crate::fluent_generated::mir_transform_deref_ptr_note,
+ AccessToUnionField => crate::fluent_generated::mir_transform_union_access_note,
+ MutationOfLayoutConstrainedField => {
+ crate::fluent_generated::mir_transform_mutation_layout_constrained_note
+ }
+ BorrowOfLayoutConstrainedField => {
+ crate::fluent_generated::mir_transform_mutation_layout_constrained_borrow_note
+ }
+ CallToFunctionWith => crate::fluent_generated::mir_transform_target_feature_call_note,
+ }
+ }
+
+ fn label(self) -> DiagnosticMessage {
+ use UnsafetyViolationDetails::*;
+ match self.violation {
+ CallToUnsafeFunction => crate::fluent_generated::mir_transform_call_to_unsafe_label,
+ UseOfInlineAssembly => crate::fluent_generated::mir_transform_use_of_asm_label,
+ InitializingTypeWith => {
+ crate::fluent_generated::mir_transform_initializing_valid_range_label
+ }
+ CastOfPointerToInt => crate::fluent_generated::mir_transform_const_ptr2int_label,
+ UseOfMutableStatic => crate::fluent_generated::mir_transform_use_of_static_mut_label,
+ UseOfExternStatic => crate::fluent_generated::mir_transform_use_of_extern_static_label,
+ DerefOfRawPointer => crate::fluent_generated::mir_transform_deref_ptr_label,
+ AccessToUnionField => crate::fluent_generated::mir_transform_union_access_label,
+ MutationOfLayoutConstrainedField => {
+ crate::fluent_generated::mir_transform_mutation_layout_constrained_label
+ }
+ BorrowOfLayoutConstrainedField => {
+ crate::fluent_generated::mir_transform_mutation_layout_constrained_borrow_label
+ }
+ CallToFunctionWith => crate::fluent_generated::mir_transform_target_feature_call_label,
+ }
+ }
+}
+
+pub(crate) struct UnsafeOpInUnsafeFn {
+ pub details: RequiresUnsafeDetail,
+}
+
+impl<'a> DecorateLint<'a, ()> for UnsafeOpInUnsafeFn {
+ #[track_caller]
+ fn decorate_lint<'b>(
+ self,
+ diag: &'b mut DiagnosticBuilder<'a, ()>,
+ ) -> &'b mut DiagnosticBuilder<'a, ()> {
+ let desc = diag
+ .handler()
+ .expect("lint should not yet be emitted")
+ .eagerly_translate_to_string(self.details.label(), [].into_iter());
+ diag.set_arg("details", desc);
+ diag.span_label(self.details.span, self.details.label());
+ diag.note(self.details.note());
+ diag
+ }
+
+ fn msg(&self) -> DiagnosticMessage {
+ crate::fluent_generated::mir_transform_unsafe_op_in_unsafe_fn
+ }
+}
+
+pub(crate) enum AssertLint<P> {
+ ArithmeticOverflow(Span, AssertKind<P>),
+ UnconditionalPanic(Span, AssertKind<P>),
+}
+
+impl<'a, P: std::fmt::Debug> DecorateLint<'a, ()> for AssertLint<P> {
+ fn decorate_lint<'b>(
+ self,
+ diag: &'b mut DiagnosticBuilder<'a, ()>,
+ ) -> &'b mut DiagnosticBuilder<'a, ()> {
+ diag.span_label(self.span(), format!("{:?}", self.panic()));
+ diag
+ }
+
+ fn msg(&self) -> DiagnosticMessage {
+ match self {
+ AssertLint::ArithmeticOverflow(..) => {
+ crate::fluent_generated::mir_transform_arithmetic_overflow
+ }
+ AssertLint::UnconditionalPanic(..) => {
+ crate::fluent_generated::mir_transform_operation_will_panic
+ }
+ }
+ }
+}
+
+impl<P> AssertLint<P> {
+ pub fn lint(&self) -> &'static Lint {
+ match self {
+ AssertLint::ArithmeticOverflow(..) => lint::builtin::ARITHMETIC_OVERFLOW,
+ AssertLint::UnconditionalPanic(..) => lint::builtin::UNCONDITIONAL_PANIC,
+ }
+ }
+ pub fn span(&self) -> Span {
+ match self {
+ AssertLint::ArithmeticOverflow(sp, _) | AssertLint::UnconditionalPanic(sp, _) => *sp,
+ }
+ }
+ pub fn panic(&self) -> &AssertKind<P> {
+ match self {
+ AssertLint::ArithmeticOverflow(_, p) | AssertLint::UnconditionalPanic(_, p) => p,
+ }
+ }
+}
+
+#[derive(LintDiagnostic)]
+#[diag(mir_transform_ffi_unwind_call)]
+pub(crate) struct FfiUnwindCall {
+ #[label(mir_transform_ffi_unwind_call)]
+ pub span: Span,
+ pub foreign: bool,
+}
+
+#[derive(LintDiagnostic)]
+#[diag(mir_transform_fn_item_ref)]
+pub(crate) struct FnItemRef {
+ #[suggestion(code = "{sugg}", applicability = "unspecified")]
+ pub span: Span,
+ pub sugg: String,
+ pub ident: String,
+}
+
+#[derive(LintDiagnostic)]
+#[diag(mir_transform_must_not_suspend)]
+pub(crate) struct MustNotSupend<'a> {
+ #[label]
+ pub yield_sp: Span,
+ #[subdiagnostic]
+ pub reason: Option<MustNotSuspendReason>,
+ #[help]
+ pub src_sp: Span,
+ pub pre: &'a str,
+ pub def_path: String,
+ pub post: &'a str,
+}
+
+#[derive(Subdiagnostic)]
+#[note(mir_transform_note)]
+pub(crate) struct MustNotSuspendReason {
+ #[primary_span]
+ pub span: Span,
+ pub reason: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(mir_transform_simd_shuffle_last_const)]
+pub(crate) struct SimdShuffleLastConst {
+ #[primary_span]
+ pub span: Span,
+}
diff --git a/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs b/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs
index db68adc..ac1de98 100644
--- a/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs
+++ b/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs
@@ -8,6 +8,8 @@
use rustc_target::spec::abi::Abi;
use rustc_target::spec::PanicStrategy;
+use crate::errors;
+
fn abi_can_unwind(abi: Abi) -> bool {
use Abi::*;
match abi {
@@ -107,13 +109,13 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool {
.lint_root;
let span = terminator.source_info.span;
- let msg = match fn_def_id {
- Some(_) => "call to foreign function with FFI-unwind ABI",
- None => "call to function pointer with FFI-unwind ABI",
- };
- tcx.struct_span_lint_hir(FFI_UNWIND_CALLS, lint_root, span, msg, |lint| {
- lint.span_label(span, msg)
- });
+ let foreign = fn_def_id.is_some();
+ tcx.emit_spanned_lint(
+ FFI_UNWIND_CALLS,
+ lint_root,
+ span,
+ errors::FfiUnwindCall { span, foreign },
+ );
tainted = true;
}
diff --git a/compiler/rustc_mir_transform/src/function_item_references.rs b/compiler/rustc_mir_transform/src/function_item_references.rs
index f26c6de..5989dbe 100644
--- a/compiler/rustc_mir_transform/src/function_item_references.rs
+++ b/compiler/rustc_mir_transform/src/function_item_references.rs
@@ -1,5 +1,4 @@
use itertools::Itertools;
-use rustc_errors::Applicability;
use rustc_hir::def_id::DefId;
use rustc_middle::mir::visit::Visitor;
use rustc_middle::mir::*;
@@ -8,7 +7,7 @@
use rustc_span::{symbol::sym, Span};
use rustc_target::spec::abi::Abi;
-use crate::MirLint;
+use crate::{errors, MirLint};
pub struct FunctionItemReferences;
@@ -174,27 +173,21 @@ fn emit_lint(
let num_args = fn_sig.inputs().map_bound(|inputs| inputs.len()).skip_binder();
let variadic = if fn_sig.c_variadic() { ", ..." } else { "" };
let ret = if fn_sig.output().skip_binder().is_unit() { "" } else { " -> _" };
- self.tcx.struct_span_lint_hir(
+ let sugg = format!(
+ "{} as {}{}fn({}{}){}",
+ if params.is_empty() { ident.clone() } else { format!("{}::<{}>", ident, params) },
+ unsafety,
+ abi,
+ vec!["_"; num_args].join(", "),
+ variadic,
+ ret,
+ );
+
+ self.tcx.emit_spanned_lint(
FUNCTION_ITEM_REFERENCES,
lint_root,
span,
- "taking a reference to a function item does not give a function pointer",
- |lint| {
- lint.span_suggestion(
- span,
- format!("cast `{}` to obtain a function pointer", ident),
- format!(
- "{} as {}{}fn({}{}){}",
- if params.is_empty() { ident } else { format!("{}::<{}>", ident, params) },
- unsafety,
- abi,
- vec!["_"; num_args].join(", "),
- variadic,
- ret,
- ),
- Applicability::Unspecified,
- )
- },
+ errors::FnItemRef { span, sugg, ident },
);
}
}
diff --git a/compiler/rustc_mir_transform/src/generator.rs b/compiler/rustc_mir_transform/src/generator.rs
index 9e16c40..c914472 100644
--- a/compiler/rustc_mir_transform/src/generator.rs
+++ b/compiler/rustc_mir_transform/src/generator.rs
@@ -51,6 +51,7 @@
//! Otherwise it drops all the values in scope at the last suspension point.
use crate::deref_separator::deref_finder;
+use crate::errors;
use crate::simplify;
use crate::MirPass;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -1891,36 +1892,21 @@ fn check_must_not_suspend_def(
data: SuspendCheckData<'_>,
) -> bool {
if let Some(attr) = tcx.get_attr(def_id, sym::must_not_suspend) {
- let msg = rustc_errors::DelayDm(|| {
- format!(
- "{}`{}`{} held across a suspend point, but should not be",
- data.descr_pre,
- tcx.def_path_str(def_id),
- data.descr_post,
- )
+ let reason = attr.value_str().map(|s| errors::MustNotSuspendReason {
+ span: data.source_span,
+ reason: s.as_str().to_string(),
});
- tcx.struct_span_lint_hir(
+ tcx.emit_spanned_lint(
rustc_session::lint::builtin::MUST_NOT_SUSPEND,
hir_id,
data.source_span,
- msg,
- |lint| {
- // add span pointing to the offending yield/await
- lint.span_label(data.yield_span, "the value is held across this suspend point");
-
- // Add optional reason note
- if let Some(note) = attr.value_str() {
- // FIXME(guswynn): consider formatting this better
- lint.span_note(data.source_span, note.as_str());
- }
-
- // Add some quick suggestions on what to do
- // FIXME: can `drop` work as a suggestion here as well?
- lint.span_help(
- data.source_span,
- "consider using a block (`{ ... }`) \
- to shrink the value's scope, ending before the suspend point",
- )
+ errors::MustNotSupend {
+ yield_sp: data.yield_span,
+ reason,
+ src_sp: data.source_span,
+ pre: data.descr_pre,
+ def_path: tcx.def_path_str(def_id),
+ post: data.descr_post,
},
);
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index f25a9f0..5c4b1ea 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -1,4 +1,6 @@
#![allow(rustc::potential_query_instability)]
+#![deny(rustc::untranslatable_diagnostic)]
+#![deny(rustc::diagnostic_outside_of_impl)]
#![feature(box_patterns)]
#![feature(drain_filter)]
#![feature(let_chains)]
@@ -69,6 +71,7 @@
mod early_otherwise_branch;
mod elaborate_box_derefs;
mod elaborate_drops;
+mod errors;
mod ffi_unwind_calls;
mod function_item_references;
mod generator;
@@ -105,6 +108,11 @@
use rustc_const_eval::transform::validate;
use rustc_mir_dataflow::rustc_peek;
+use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
+use rustc_fluent_macro::fluent_messages;
+
+fluent_messages! { "../messages.ftl" }
+
pub fn provide(providers: &mut Providers) {
check_unsafety::provide(providers);
coverage::query::provide(providers);
diff --git a/compiler/rustc_mir_transform/src/lower_intrinsics.rs b/compiler/rustc_mir_transform/src/lower_intrinsics.rs
index 69ba484..dae01e4 100644
--- a/compiler/rustc_mir_transform/src/lower_intrinsics.rs
+++ b/compiler/rustc_mir_transform/src/lower_intrinsics.rs
@@ -1,6 +1,6 @@
//! Lowers intrinsic calls
-use crate::MirPass;
+use crate::{errors, MirPass};
use rustc_middle::mir::*;
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, Ty, TyCtxt};
@@ -310,11 +310,7 @@ fn resolve_rust_intrinsic<'tcx>(
}
fn validate_simd_shuffle<'tcx>(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span) {
- match &args[2] {
- Operand::Constant(_) => {} // all good
- _ => {
- let msg = "last argument of `simd_shuffle` is required to be a `const` item";
- tcx.sess.span_err(span, msg);
- }
+ if !matches!(args[2], Operand::Constant(_)) {
+ tcx.sess.emit_err(errors::SimdShuffleLastConst { span });
}
}
diff --git a/compiler/rustc_mir_transform/src/nrvo.rs b/compiler/rustc_mir_transform/src/nrvo.rs
index b6e73ea..85b2622 100644
--- a/compiler/rustc_mir_transform/src/nrvo.rs
+++ b/compiler/rustc_mir_transform/src/nrvo.rs
@@ -34,7 +34,8 @@
impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
- sess.mir_opt_level() > 0
+ // #111005
+ sess.mir_opt_level() > 0 && sess.opts.unstable_opts.unsound_mir_opts
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut mir::Body<'tcx>) {
diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl
index cd296dc..1bbf833 100644
--- a/compiler/rustc_parse/messages.ftl
+++ b/compiler/rustc_parse/messages.ftl
@@ -257,6 +257,10 @@
.tuple_exception_line_2 = on proc macros, you'll want to use `syn::Index::from` or `proc_macro::Literal::*_unsuffixed` for code that will desugar to tuple field access
.tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information
+parse_expected_builtin_ident = expected identifier after `builtin #`
+
+parse_unknown_builtin_construct = unknown `builtin #` construct `{$name}`
+
parse_non_string_abi_literal = non-string ABI literal
.suggestion = specify the ABI with a string literal
@@ -339,6 +343,7 @@
parse_sugg_escape_identifier = escape `{$ident_name}` to use it as an identifier
parse_sugg_remove_comma = remove this comma
+parse_sugg_add_let_for_stmt = you might have meant to introduce a new binding
parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}`
parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}`
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 010a13a..b6aeaf3 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -907,6 +907,18 @@ pub(crate) struct SuggRemoveComma {
}
#[derive(Subdiagnostic)]
+#[suggestion(
+ parse_sugg_add_let_for_stmt,
+ style = "verbose",
+ applicability = "maybe-incorrect",
+ code = "let "
+)]
+pub(crate) struct SuggAddMissingLetStmt {
+ #[primary_span]
+ pub span: Span,
+}
+
+#[derive(Subdiagnostic)]
pub(crate) enum ExpectedIdentifierFound {
#[label(parse_expected_identifier_found_reserved_identifier)]
ReservedIdentifier(#[primary_span] Span),
@@ -2644,3 +2656,18 @@ pub(crate) struct MalformedCfgAttr {
pub span: Span,
pub sugg: &'static str,
}
+
+#[derive(Diagnostic)]
+#[diag(parse_unknown_builtin_construct)]
+pub(crate) struct UnknownBuiltinConstruct {
+ #[primary_span]
+ pub span: Span,
+ pub name: Symbol,
+}
+
+#[derive(Diagnostic)]
+#[diag(parse_expected_builtin_ident)]
+pub(crate) struct ExpectedBuiltinIdent {
+ #[primary_span]
+ pub span: Span,
+}
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 36883bd..3002f23 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -13,7 +13,7 @@
IncorrectUseOfAwait, ParenthesesInForHead, ParenthesesInForHeadSugg,
PatternMethodParamWithoutBody, QuestionMarkInType, QuestionMarkInTypeSugg, SelfParamNotFirst,
StructLiteralBodyWithoutPath, StructLiteralBodyWithoutPathSugg, StructLiteralNeedingParens,
- StructLiteralNeedingParensSugg, SuggEscapeIdentifier, SuggRemoveComma,
+ StructLiteralNeedingParensSugg, SuggAddMissingLetStmt, SuggEscapeIdentifier, SuggRemoveComma,
UnexpectedConstInGenericParam, UnexpectedConstParamDeclaration,
UnexpectedConstParamDeclarationSugg, UnmatchedAngleBrackets, UseEqInstead,
};
@@ -32,8 +32,8 @@
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{
- pluralize, Applicability, Diagnostic, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed,
- FatalError, Handler, IntoDiagnostic, MultiSpan, PResult,
+ pluralize, AddToDiagnostic, Applicability, Diagnostic, DiagnosticBuilder, DiagnosticMessage,
+ ErrorGuaranteed, FatalError, Handler, IntoDiagnostic, MultiSpan, PResult,
};
use rustc_session::errors::ExprParenthesesNeeded;
use rustc_span::source_map::Spanned;
@@ -1006,6 +1006,31 @@ pub(super) fn check_mistyped_turbofish_with_multiple_type_params(
Err(e)
}
+ /// Suggest add the missing `let` before the identifier in stmt
+ /// `a: Ty = 1` -> `let a: Ty = 1`
+ pub(super) fn suggest_add_missing_let_for_stmt(
+ &mut self,
+ err: &mut DiagnosticBuilder<'a, ErrorGuaranteed>,
+ ) {
+ if self.token == token::Colon {
+ let prev_span = self.prev_token.span.shrink_to_lo();
+ let snapshot = self.create_snapshot_for_diagnostic();
+ self.bump();
+ match self.parse_ty() {
+ Ok(_) => {
+ if self.token == token::Eq {
+ let sugg = SuggAddMissingLetStmt { span: prev_span };
+ sugg.add_to_diagnostic(err);
+ }
+ }
+ Err(e) => {
+ e.cancel();
+ }
+ }
+ self.restore_snapshot(snapshot);
+ }
+ }
+
/// Check to see if a pair of chained operators looks like an attempt at chained comparison,
/// e.g. `1 < x <= 3`. If so, suggest either splitting the comparison into two, or
/// parenthesising the leftmost comparison.
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 018edde..887e155 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1300,6 +1300,8 @@ fn parse_expr_bottom(&mut self) -> PResult<'a, P<Expr>> {
})
} else if self.check(&token::OpenDelim(Delimiter::Bracket)) {
self.parse_expr_array_or_repeat(Delimiter::Bracket)
+ } else if self.is_builtin() {
+ self.parse_expr_builtin()
} else if self.check_path() {
self.parse_expr_path_start()
} else if self.check_keyword(kw::Move)
@@ -1766,6 +1768,61 @@ fn parse_expr_yield(&mut self) -> PResult<'a, P<Expr>> {
self.maybe_recover_from_bad_qpath(expr)
}
+ /// Parse `builtin # ident(args,*)`.
+ fn parse_expr_builtin(&mut self) -> PResult<'a, P<Expr>> {
+ self.parse_builtin(|this, lo, ident| {
+ if ident.name == sym::offset_of {
+ return Ok(Some(this.parse_expr_offset_of(lo)?));
+ }
+
+ Ok(None)
+ })
+ }
+
+ pub(crate) fn parse_builtin<T>(
+ &mut self,
+ parse: impl FnOnce(&mut Parser<'a>, Span, Ident) -> PResult<'a, Option<T>>,
+ ) -> PResult<'a, T> {
+ let lo = self.token.span;
+
+ self.bump(); // `builtin`
+ self.bump(); // `#`
+
+ let Some((ident, false)) = self.token.ident() else {
+ let err = errors::ExpectedBuiltinIdent { span: self.token.span }
+ .into_diagnostic(&self.sess.span_diagnostic);
+ return Err(err);
+ };
+ self.sess.gated_spans.gate(sym::builtin_syntax, ident.span);
+ self.bump();
+
+ self.expect(&TokenKind::OpenDelim(Delimiter::Parenthesis))?;
+ let ret = if let Some(res) = parse(self, lo, ident)? {
+ Ok(res)
+ } else {
+ let err = errors::UnknownBuiltinConstruct { span: lo.to(ident.span), name: ident.name }
+ .into_diagnostic(&self.sess.span_diagnostic);
+ return Err(err);
+ };
+ self.expect(&TokenKind::CloseDelim(Delimiter::Parenthesis))?;
+
+ ret
+ }
+
+ pub(crate) fn parse_expr_offset_of(&mut self, lo: Span) -> PResult<'a, P<Expr>> {
+ let container = self.parse_ty()?;
+ self.expect(&TokenKind::Comma)?;
+
+ let seq_sep = SeqSep { sep: Some(token::Dot), trailing_sep_allowed: false };
+ let (fields, _trailing, _recovered) = self.parse_seq_to_before_end(
+ &TokenKind::CloseDelim(Delimiter::Parenthesis),
+ seq_sep,
+ Parser::parse_field_name,
+ )?;
+ let span = lo.to(self.token.span);
+ Ok(self.mk_expr(span, ExprKind::OffsetOf(container, fields.to_vec().into())))
+ }
+
/// Returns a string literal if the next token is a string literal.
/// In case of error returns `Some(lit)` if the next token is a literal with a wrong kind,
/// and returns `None` if the next token is not literal at all.
@@ -2835,6 +2892,10 @@ fn check_let_expr(expr: &Expr) -> (bool, bool) {
})
}
+ pub(crate) fn is_builtin(&self) -> bool {
+ self.token.is_keyword(kw::Builtin) && self.look_ahead(1, |t| *t == token::Pound)
+ }
+
/// Parses a `try {...}` expression (`try` token already eaten).
fn parse_try_block(&mut self, span_lo: Span) -> PResult<'a, P<Expr>> {
let (attrs, body) = self.parse_inner_attrs_and_block()?;
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 6ca8820..840cfe9 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -265,6 +265,9 @@ fn parse_item_kind(
// UNION ITEM
self.bump(); // `union`
self.parse_item_union()?
+ } else if self.is_builtin() {
+ // BUILTIN# ITEM
+ return self.parse_item_builtin();
} else if self.eat_keyword(kw::Macro) {
// MACROS 2.0 ITEM
self.parse_item_decl_macro(lo)?
@@ -434,6 +437,11 @@ fn recover_missing_kw_before_item(&mut self) -> PResult<'a, ()> {
}
}
+ fn parse_item_builtin(&mut self) -> PResult<'a, Option<ItemInfo>> {
+ // To be expanded
+ return Ok(None);
+ }
+
/// Parses an item macro, e.g., `item!();`.
fn parse_item_macro(&mut self, vis: &Visibility) -> PResult<'a, MacCall> {
let path = self.parse_path(PathStyle::Mod)?; // `foo::bar`
@@ -1262,6 +1270,7 @@ fn parse_item_enum(&mut self) -> PResult<'a, ItemInfo> {
}
}
+ let prev_span = self.prev_token.span;
let id = self.parse_ident()?;
let mut generics = self.parse_generics()?;
generics.where_clause = self.parse_where_clause()?;
@@ -1273,10 +1282,28 @@ fn parse_item_enum(&mut self) -> PResult<'a, ItemInfo> {
(thin_vec![], false)
} else {
self.parse_delim_comma_seq(Delimiter::Brace, |p| p.parse_enum_variant()).map_err(
- |mut e| {
- e.span_label(id.span, "while parsing this enum");
+ |mut err| {
+ err.span_label(id.span, "while parsing this enum");
+ if self.token == token::Colon {
+ let snapshot = self.create_snapshot_for_diagnostic();
+ self.bump();
+ match self.parse_ty() {
+ Ok(_) => {
+ err.span_suggestion_verbose(
+ prev_span,
+ "perhaps you meant to use `struct` here",
+ "struct".to_string(),
+ Applicability::MaybeIncorrect,
+ );
+ }
+ Err(e) => {
+ e.cancel();
+ }
+ }
+ self.restore_snapshot(snapshot);
+ }
self.recover_stmt();
- e
+ err
},
)?
};
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 1c17de3..0327912 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -90,7 +90,11 @@ pub(crate) fn parse_stmt_without_recovery(
attrs,
errors::InvalidVariableDeclarationSub::UseLetNotVar,
)?
- } else if self.check_path() && !self.token.is_qpath_start() && !self.is_path_start_item() {
+ } else if self.check_path()
+ && !self.token.is_qpath_start()
+ && !self.is_path_start_item()
+ && !self.is_builtin()
+ {
// We have avoided contextual keywords like `union`, items with `crate` visibility,
// or `auto trait` items. We aim to parse an arbitrary path `a::b` but not something
// that starts like a path (1 token), but it fact not a path.
@@ -99,7 +103,13 @@ pub(crate) fn parse_stmt_without_recovery(
ForceCollect::Yes => {
self.collect_tokens_no_attrs(|this| this.parse_stmt_path_start(lo, attrs))?
}
- ForceCollect::No => self.parse_stmt_path_start(lo, attrs)?,
+ ForceCollect::No => match self.parse_stmt_path_start(lo, attrs) {
+ Ok(stmt) => stmt,
+ Err(mut err) => {
+ self.suggest_add_missing_let_for_stmt(&mut err);
+ return Err(err);
+ }
+ },
}
} else if let Some(item) = self.parse_item_common(
attrs.clone(),
@@ -555,7 +565,6 @@ pub(crate) fn parse_block_tail(
if self.token == token::Colon {
// if next token is following a colon, it's likely a path
// and we can suggest a path separator
- let ident_span = self.prev_token.span;
self.bump();
if self.token.span.lo() == self.prev_token.span.hi() {
err.span_suggestion_verbose(
@@ -565,14 +574,6 @@ pub(crate) fn parse_block_tail(
Applicability::MaybeIncorrect,
);
}
- if self.look_ahead(1, |token| token == &token::Eq) {
- err.span_suggestion_verbose(
- ident_span.shrink_to_lo(),
- "you might have meant to introduce a new binding",
- "let ",
- Applicability::MaybeIncorrect,
- );
- }
if self.sess.unstable_features.is_nightly_build() {
// FIXME(Nilstrieb): Remove this again after a few months.
err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>");
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index b738ce3..d6eb546 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -25,7 +25,7 @@
use rustc_hir::{AssocItemKind, HirIdSet, ItemId, Node, PatKind};
use rustc_middle::bug;
use rustc_middle::hir::nested_filter;
-use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility, Level};
+use rustc_middle::middle::privacy::{EffectiveVisibilities, Level};
use rustc_middle::span_bug;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::subst::InternalSubsts;
@@ -38,7 +38,7 @@
use std::marker::PhantomData;
use std::ops::ControlFlow;
-use std::{fmt, mem};
+use std::{cmp, fmt, mem};
use errors::{
FieldIsPrivate, FieldIsPrivateLabel, FromPrivateDependencyInPublicInterface, InPublicInterface,
@@ -243,6 +243,39 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<V::BreakTy> {
// This will also visit substs if necessary, so we don't need to recurse.
return self.visit_projection_ty(proj);
}
+ ty::Alias(ty::Inherent, data) => {
+ if self.def_id_visitor.skip_assoc_tys() {
+ // Visitors searching for minimal visibility/reachability want to
+ // conservatively approximate associated types like `Type::Alias`
+ // as visible/reachable even if `Type` is private.
+ // Ideally, associated types should be substituted in the same way as
+ // free type aliases, but this isn't done yet.
+ return ControlFlow::Continue(());
+ }
+
+ self.def_id_visitor.visit_def_id(
+ data.def_id,
+ "associated type",
+ &LazyDefPathStr { def_id: data.def_id, tcx },
+ )?;
+
+ struct LazyDefPathStr<'tcx> {
+ def_id: DefId,
+ tcx: TyCtxt<'tcx>,
+ }
+ impl<'tcx> fmt::Display for LazyDefPathStr<'tcx> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "{}", self.tcx.def_path_str(self.def_id))
+ }
+ }
+
+ // This will also visit substs if necessary, so we don't need to recurse.
+ return if self.def_id_visitor.shallow() {
+ ControlFlow::Continue(())
+ } else {
+ data.substs.iter().try_for_each(|subst| subst.visit_with(self))
+ };
+ }
ty::Dynamic(predicates, ..) => {
// All traits in the list are considered the "primary" part of the type
// and are visited by shallow visitors.
@@ -375,9 +408,8 @@ fn new_min(find: &FindMin<'_, '_, Self>, def_id: LocalDefId) -> Self {
min(find.tcx.local_visibility(def_id), find.min, find.tcx)
}
}
-
-impl VisibilityLike for Option<EffectiveVisibility> {
- const MAX: Self = Some(EffectiveVisibility::from_vis(ty::Visibility::Public));
+impl VisibilityLike for Option<Level> {
+ const MAX: Self = Some(Level::Direct);
// Type inference is very smart sometimes.
// It can make an impl reachable even some components of its type or trait are unreachable.
// E.g. methods of `impl ReachableTrait<UnreachableTy> for ReachableTy<UnreachableTy> { ... }`
@@ -389,13 +421,7 @@ impl VisibilityLike for Option<EffectiveVisibility> {
// (which require reaching the `DefId`s in them).
const SHALLOW: bool = true;
fn new_min(find: &FindMin<'_, '_, Self>, def_id: LocalDefId) -> Self {
- if let Some(min) = find.min {
- return find
- .effective_visibilities
- .effective_vis(def_id)
- .map(|eff_vis| min.min(*eff_vis, find.tcx));
- }
- None
+ cmp::min(find.effective_visibilities.public_at_level(def_id), find.min)
}
}
@@ -421,79 +447,49 @@ struct EmbargoVisitor<'tcx> {
/// n::p::f()
/// }
macro_reachable: FxHashSet<(LocalDefId, LocalDefId)>,
+ /// Previous visibility level; `None` means unreachable.
+ prev_level: Option<Level>,
/// Has something changed in the level map?
changed: bool,
}
struct ReachEverythingInTheInterfaceVisitor<'a, 'tcx> {
- effective_vis: Option<EffectiveVisibility>,
+ level: Option<Level>,
item_def_id: LocalDefId,
ev: &'a mut EmbargoVisitor<'tcx>,
- level: Level,
}
impl<'tcx> EmbargoVisitor<'tcx> {
- fn get(&self, def_id: LocalDefId) -> Option<EffectiveVisibility> {
- self.effective_visibilities.effective_vis(def_id).copied()
+ fn get(&self, def_id: LocalDefId) -> Option<Level> {
+ self.effective_visibilities.public_at_level(def_id)
}
- // Updates node effective visibility.
- fn update(
- &mut self,
- def_id: LocalDefId,
- inherited_effective_vis: Option<EffectiveVisibility>,
- level: Level,
- ) {
- let nominal_vis = self.tcx.local_visibility(def_id);
- self.update_eff_vis(def_id, inherited_effective_vis, Some(nominal_vis), level);
- }
-
- fn update_eff_vis(
- &mut self,
- def_id: LocalDefId,
- inherited_effective_vis: Option<EffectiveVisibility>,
- nominal_vis: Option<ty::Visibility>,
- level: Level,
- ) {
- if let Some(inherited_effective_vis) = inherited_effective_vis {
- let private_vis =
- ty::Visibility::Restricted(self.tcx.parent_module_from_def_id(def_id));
- if Some(private_vis) != nominal_vis {
- self.changed |= self.effective_visibilities.update(
- def_id,
- nominal_vis,
- || private_vis,
- inherited_effective_vis,
- level,
- self.tcx,
- );
- }
+ /// Updates node level and returns the updated level.
+ fn update(&mut self, def_id: LocalDefId, level: Option<Level>) -> Option<Level> {
+ let old_level = self.get(def_id);
+ // Visibility levels can only grow.
+ if level > old_level {
+ self.effective_visibilities.set_public_at_level(
+ def_id,
+ || ty::Visibility::Restricted(self.tcx.parent_module_from_def_id(def_id)),
+ level.unwrap(),
+ );
+ self.changed = true;
+ level
+ } else {
+ old_level
}
}
fn reach(
&mut self,
def_id: LocalDefId,
- effective_vis: Option<EffectiveVisibility>,
+ level: Option<Level>,
) -> ReachEverythingInTheInterfaceVisitor<'_, 'tcx> {
ReachEverythingInTheInterfaceVisitor {
- effective_vis,
+ level: cmp::min(level, Some(Level::Reachable)),
item_def_id: def_id,
ev: self,
- level: Level::Reachable,
- }
- }
-
- fn reach_through_impl_trait(
- &mut self,
- def_id: LocalDefId,
- effective_vis: Option<EffectiveVisibility>,
- ) -> ReachEverythingInTheInterfaceVisitor<'_, 'tcx> {
- ReachEverythingInTheInterfaceVisitor {
- effective_vis,
- item_def_id: def_id,
- ev: self,
- level: Level::ReachableThroughImplTrait,
}
}
@@ -514,18 +510,16 @@ fn update_reachability_from_macro(&mut self, local_def_id: LocalDefId, md: &Macr
return;
}
- if self.effective_visibilities.public_at_level(local_def_id).is_none() {
+ if self.get(local_def_id).is_none() {
return;
}
// Since we are starting from an externally visible module,
// all the parents in the loop below are also guaranteed to be modules.
let mut module_def_id = macro_module_def_id;
- let macro_ev = self.get(local_def_id);
- assert!(macro_ev.is_some());
loop {
let changed_reachability =
- self.update_macro_reachable(module_def_id, macro_module_def_id, macro_ev);
+ self.update_macro_reachable(module_def_id, macro_module_def_id);
if changed_reachability || module_def_id == CRATE_DEF_ID {
break;
}
@@ -539,33 +533,21 @@ fn update_macro_reachable(
&mut self,
module_def_id: LocalDefId,
defining_mod: LocalDefId,
- macro_ev: Option<EffectiveVisibility>,
) -> bool {
if self.macro_reachable.insert((module_def_id, defining_mod)) {
- self.update_macro_reachable_mod(module_def_id, defining_mod, macro_ev);
+ self.update_macro_reachable_mod(module_def_id, defining_mod);
true
} else {
false
}
}
- fn update_macro_reachable_mod(
- &mut self,
- module_def_id: LocalDefId,
- defining_mod: LocalDefId,
- macro_ev: Option<EffectiveVisibility>,
- ) {
+ fn update_macro_reachable_mod(&mut self, module_def_id: LocalDefId, defining_mod: LocalDefId) {
let module = self.tcx.hir().get_module(module_def_id).0;
for item_id in module.item_ids {
let def_kind = self.tcx.def_kind(item_id.owner_id);
let vis = self.tcx.local_visibility(item_id.owner_id.def_id);
- self.update_macro_reachable_def(
- item_id.owner_id.def_id,
- def_kind,
- vis,
- defining_mod,
- macro_ev,
- );
+ self.update_macro_reachable_def(item_id.owner_id.def_id, def_kind, vis, defining_mod);
}
for child in self.tcx.module_children_local(module_def_id) {
// FIXME: Use module children for the logic above too.
@@ -574,7 +556,7 @@ fn update_macro_reachable_mod(
&& let Res::Def(def_kind, def_id) = child.res
&& let Some(def_id) = def_id.as_local() {
let vis = self.tcx.local_visibility(def_id);
- self.update_macro_reachable_def(def_id, def_kind, vis, defining_mod, macro_ev);
+ self.update_macro_reachable_def(def_id, def_kind, vis, defining_mod);
}
}
}
@@ -585,14 +567,16 @@ fn update_macro_reachable_def(
def_kind: DefKind,
vis: ty::Visibility,
module: LocalDefId,
- macro_ev: Option<EffectiveVisibility>,
) {
- self.update(def_id, macro_ev, Level::Reachable);
+ let level = Some(Level::Reachable);
+ if vis.is_public() {
+ self.update(def_id, level);
+ }
match def_kind {
// No type privacy, so can be directly marked as reachable.
DefKind::Const | DefKind::Static(_) | DefKind::TraitAlias | DefKind::TyAlias => {
if vis.is_accessible_from(module, self.tcx) {
- self.update(def_id, macro_ev, Level::Reachable);
+ self.update(def_id, level);
}
}
@@ -604,7 +588,7 @@ fn update_macro_reachable_def(
let item = self.tcx.hir().expect_item(def_id);
if let hir::ItemKind::Macro(MacroDef { macro_rules: false, .. }, _) = item.kind {
if vis.is_accessible_from(module, self.tcx) {
- self.update(def_id, macro_ev, Level::Reachable);
+ self.update(def_id, level);
}
}
}
@@ -615,24 +599,26 @@ fn update_macro_reachable_def(
// the module, however may be reachable.
DefKind::Mod => {
if vis.is_accessible_from(module, self.tcx) {
- self.update_macro_reachable(def_id, module, macro_ev);
+ self.update_macro_reachable(def_id, module);
}
}
DefKind::Struct | DefKind::Union => {
// While structs and unions have type privacy, their fields do not.
- let item = self.tcx.hir().expect_item(def_id);
- if let hir::ItemKind::Struct(ref struct_def, _)
- | hir::ItemKind::Union(ref struct_def, _) = item.kind
- {
- for field in struct_def.fields() {
- let field_vis = self.tcx.local_visibility(field.def_id);
- if field_vis.is_accessible_from(module, self.tcx) {
- self.reach(field.def_id, macro_ev).ty();
+ if vis.is_public() {
+ let item = self.tcx.hir().expect_item(def_id);
+ if let hir::ItemKind::Struct(ref struct_def, _)
+ | hir::ItemKind::Union(ref struct_def, _) = item.kind
+ {
+ for field in struct_def.fields() {
+ let field_vis = self.tcx.local_visibility(field.def_id);
+ if field_vis.is_accessible_from(module, self.tcx) {
+ self.reach(field.def_id, level).ty();
+ }
}
+ } else {
+ bug!("item {:?} with DefKind {:?}", item, def_kind);
}
- } else {
- bug!("item {:?} with DefKind {:?}", item, def_kind);
}
}
@@ -676,16 +662,14 @@ fn nested_visit_map(&mut self) -> Self::Map {
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
- let item_ev = match item.kind {
+ let item_level = match item.kind {
hir::ItemKind::Impl { .. } => {
- let impl_ev = Option::<EffectiveVisibility>::of_impl(
+ let impl_level = Option::<Level>::of_impl(
item.owner_id.def_id,
self.tcx,
&self.effective_visibilities,
);
-
- self.update_eff_vis(item.owner_id.def_id, impl_ev, None, Level::Direct);
- impl_ev
+ self.update(item.owner_id.def_id, impl_level)
}
_ => self.get(item.owner_id.def_id),
};
@@ -694,32 +678,38 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
match item.kind {
hir::ItemKind::Enum(ref def, _) => {
for variant in def.variants {
- self.update(variant.def_id, item_ev, Level::Reachable);
- let variant_ev = self.get(variant.def_id);
+ let variant_level = self.update(variant.def_id, item_level);
if let Some(ctor_def_id) = variant.data.ctor_def_id() {
- self.update(ctor_def_id, variant_ev, Level::Reachable);
+ self.update(ctor_def_id, item_level);
}
for field in variant.data.fields() {
- self.update(field.def_id, variant_ev, Level::Reachable);
+ self.update(field.def_id, variant_level);
}
}
}
hir::ItemKind::Impl(ref impl_) => {
for impl_item_ref in impl_.items {
- self.update(impl_item_ref.id.owner_id.def_id, item_ev, Level::Direct);
+ if impl_.of_trait.is_some()
+ || self.tcx.visibility(impl_item_ref.id.owner_id).is_public()
+ {
+ self.update(impl_item_ref.id.owner_id.def_id, item_level);
+ }
}
}
hir::ItemKind::Trait(.., trait_item_refs) => {
for trait_item_ref in trait_item_refs {
- self.update(trait_item_ref.id.owner_id.def_id, item_ev, Level::Reachable);
+ self.update(trait_item_ref.id.owner_id.def_id, item_level);
}
}
hir::ItemKind::Struct(ref def, _) | hir::ItemKind::Union(ref def, _) => {
if let Some(ctor_def_id) = def.ctor_def_id() {
- self.update(ctor_def_id, item_ev, Level::Reachable);
+ self.update(ctor_def_id, item_level);
}
for field in def.fields() {
- self.update(field.def_id, item_ev, Level::Reachable);
+ let vis = self.tcx.visibility(field.def_id);
+ if vis.is_public() {
+ self.update(field.def_id, item_level);
+ }
}
}
hir::ItemKind::Macro(ref macro_def, _) => {
@@ -727,7 +717,9 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
}
hir::ItemKind::ForeignMod { items, .. } => {
for foreign_item in items {
- self.update(foreign_item.id.owner_id.def_id, item_ev, Level::Reachable);
+ if self.tcx.visibility(foreign_item.id.owner_id).is_public() {
+ self.update(foreign_item.id.owner_id.def_id, item_level);
+ }
}
}
@@ -762,11 +754,8 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
// FIXME: This is some serious pessimization intended to workaround deficiencies
// in the reachability pass (`middle/reachable.rs`). Types are marked as link-time
// reachable if they are returned via `impl Trait`, even from private functions.
- let exist_ev = Some(EffectiveVisibility::from_vis(ty::Visibility::Public));
- self.reach_through_impl_trait(item.owner_id.def_id, exist_ev)
- .generics()
- .predicates()
- .ty();
+ let exist_level = cmp::max(item_level, Some(Level::ReachableThroughImplTrait));
+ self.reach(item.owner_id.def_id, exist_level).generics().predicates().ty();
}
}
// Visit everything.
@@ -774,18 +763,17 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
| hir::ItemKind::Static(..)
| hir::ItemKind::Fn(..)
| hir::ItemKind::TyAlias(..) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev).generics().predicates().ty();
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level).generics().predicates().ty();
}
}
hir::ItemKind::Trait(.., trait_item_refs) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev).generics().predicates();
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level).generics().predicates();
for trait_item_ref in trait_item_refs {
let tcx = self.tcx;
- let mut reach = self.reach(trait_item_ref.id.owner_id.def_id, item_ev);
-
+ let mut reach = self.reach(trait_item_ref.id.owner_id.def_id, item_level);
reach.generics().predicates();
if trait_item_ref.kind == AssocItemKind::Type
@@ -799,24 +787,23 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
}
}
hir::ItemKind::TraitAlias(..) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev).generics().predicates();
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level).generics().predicates();
}
}
// Visit everything except for private impl items.
hir::ItemKind::Impl(ref impl_) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev)
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level)
.generics()
.predicates()
.ty()
.trait_ref();
for impl_item_ref in impl_.items {
- let impl_item_ev = self.get(impl_item_ref.id.owner_id.def_id);
-
- if impl_item_ev.is_some() {
- self.reach(impl_item_ref.id.owner_id.def_id, impl_item_ev)
+ let impl_item_level = self.get(impl_item_ref.id.owner_id.def_id);
+ if impl_item_level.is_some() {
+ self.reach(impl_item_ref.id.owner_id.def_id, impl_item_level)
.generics()
.predicates()
.ty();
@@ -827,23 +814,23 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
// Visit everything, but enum variants have their own levels.
hir::ItemKind::Enum(ref def, _) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev).generics().predicates();
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level).generics().predicates();
}
for variant in def.variants {
- let variant_ev = self.get(variant.def_id);
- if variant_ev.is_some() {
+ let variant_level = self.get(variant.def_id);
+ if variant_level.is_some() {
for field in variant.data.fields() {
- self.reach(field.def_id, variant_ev).ty();
+ self.reach(field.def_id, variant_level).ty();
}
// Corner case: if the variant is reachable, but its
// enum is not, make the enum reachable as well.
- self.reach(item.owner_id.def_id, variant_ev).ty();
+ self.reach(item.owner_id.def_id, variant_level).ty();
}
if let Some(ctor_def_id) = variant.data.ctor_def_id() {
- let ctor_ev = self.get(ctor_def_id);
- if ctor_ev.is_some() {
- self.reach(item.owner_id.def_id, ctor_ev).ty();
+ let ctor_level = self.get(ctor_def_id);
+ if ctor_level.is_some() {
+ self.reach(item.owner_id.def_id, ctor_level).ty();
}
}
}
@@ -851,9 +838,9 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
// Visit everything, but foreign items have their own levels.
hir::ItemKind::ForeignMod { items, .. } => {
for foreign_item in items {
- let foreign_item_ev = self.get(foreign_item.id.owner_id.def_id);
- if foreign_item_ev.is_some() {
- self.reach(foreign_item.id.owner_id.def_id, foreign_item_ev)
+ let foreign_item_level = self.get(foreign_item.id.owner_id.def_id);
+ if foreign_item_level.is_some() {
+ self.reach(foreign_item.id.owner_id.def_id, foreign_item_level)
.generics()
.predicates()
.ty();
@@ -862,32 +849,36 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
}
// Visit everything except for private fields.
hir::ItemKind::Struct(ref struct_def, _) | hir::ItemKind::Union(ref struct_def, _) => {
- if item_ev.is_some() {
- self.reach(item.owner_id.def_id, item_ev).generics().predicates();
+ if item_level.is_some() {
+ self.reach(item.owner_id.def_id, item_level).generics().predicates();
for field in struct_def.fields() {
- let field_ev = self.get(field.def_id);
- if field_ev.is_some() {
- self.reach(field.def_id, field_ev).ty();
+ let field_level = self.get(field.def_id);
+ if field_level.is_some() {
+ self.reach(field.def_id, field_level).ty();
}
}
}
if let Some(ctor_def_id) = struct_def.ctor_def_id() {
- let ctor_ev = self.get(ctor_def_id);
- if ctor_ev.is_some() {
- self.reach(item.owner_id.def_id, ctor_ev).ty();
+ let ctor_level = self.get(ctor_def_id);
+ if ctor_level.is_some() {
+ self.reach(item.owner_id.def_id, ctor_level).ty();
}
}
}
}
+ let orig_level = mem::replace(&mut self.prev_level, item_level);
intravisit::walk_item(self, item);
+ self.prev_level = orig_level;
}
fn visit_block(&mut self, b: &'tcx hir::Block<'tcx>) {
// Blocks can have public items, for example impls, but they always
// start as completely private regardless of publicity of a function,
// constant, type, field, etc., in which this block resides.
+ let orig_level = mem::replace(&mut self.prev_level, None);
intravisit::walk_block(self, b);
+ self.prev_level = orig_level;
}
}
@@ -941,7 +932,11 @@ fn visit_def_id(
_descr: &dyn fmt::Display,
) -> ControlFlow<Self::BreakTy> {
if let Some(def_id) = def_id.as_local() {
- self.ev.update_eff_vis(def_id, self.effective_vis, None, self.level);
+ if let (ty::Visibility::Public, _) | (_, Some(Level::ReachableThroughImplTrait)) =
+ (self.tcx().visibility(def_id.to_def_id()), self.level)
+ {
+ self.ev.update(def_id, self.level);
+ }
}
ControlFlow::Continue(())
}
@@ -2169,6 +2164,7 @@ fn effective_visibilities(tcx: TyCtxt<'_>, (): ()) -> &EffectiveVisibilities {
tcx,
effective_visibilities: tcx.resolutions(()).effective_visibilities.clone(),
macro_reachable: Default::default(),
+ prev_level: Some(Level::Direct),
changed: false,
};
diff --git a/compiler/rustc_resolve/src/effective_visibilities.rs b/compiler/rustc_resolve/src/effective_visibilities.rs
index 7393bdb..8706718 100644
--- a/compiler/rustc_resolve/src/effective_visibilities.rs
+++ b/compiler/rustc_resolve/src/effective_visibilities.rs
@@ -199,7 +199,7 @@ fn update_import(&mut self, binding: ImportId<'a>, parent_id: ParentId<'a>) {
let tcx = self.r.tcx;
self.changed |= self.import_effective_visibilities.update(
binding,
- Some(nominal_vis),
+ nominal_vis,
|| cheap_private_vis.unwrap_or_else(|| self.r.private_vis_import(binding)),
inherited_eff_vis,
parent_id.level(),
@@ -213,7 +213,7 @@ fn update_def(&mut self, def_id: LocalDefId, nominal_vis: Visibility, parent_id:
let tcx = self.r.tcx;
self.changed |= self.def_effective_visibilities.update(
def_id,
- Some(nominal_vis),
+ nominal_vis,
|| cheap_private_vis.unwrap_or_else(|| self.r.private_vis_def(def_id)),
inherited_eff_vis,
parent_id.level(),
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index b97ec6c..60efcb7 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -95,6 +95,7 @@
// Weak keywords, have special meaning only in specific contexts.
Auto: "auto",
+ Builtin: "builtin",
Catch: "catch",
Default: "default",
MacroRules: "macro_rules",
@@ -440,6 +441,7 @@
breakpoint,
bridge,
bswap,
+ builtin_syntax,
c_str,
c_str_literals,
c_unwind,
@@ -1031,6 +1033,7 @@
non_exhaustive_omitted_patterns_lint,
non_lifetime_binders,
non_modrs_mods,
+ none,
nontemporal_store,
noop_method_borrow,
noop_method_clone,
diff --git a/compiler/rustc_trait_selection/messages.ftl b/compiler/rustc_trait_selection/messages.ftl
index 14eb4a5..8fea3fc 100644
--- a/compiler/rustc_trait_selection/messages.ftl
+++ b/compiler/rustc_trait_selection/messages.ftl
@@ -20,3 +20,5 @@
.negative_implementation_in_crate = negative implementation in crate `{$negative_impl_cname}`
.positive_implementation_here = positive implementation here
.positive_implementation_in_crate = positive implementation in crate `{$positive_impl_cname}`
+
+trait_selection_inherent_projection_normalization_overflow = overflow evaluating associated type `{$ty}`
diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs
index df7c4df..54e22cc 100644
--- a/compiler/rustc_trait_selection/src/errors.rs
+++ b/compiler/rustc_trait_selection/src/errors.rs
@@ -89,3 +89,11 @@ fn into_diagnostic(
diag
}
}
+
+#[derive(Diagnostic)]
+#[diag(trait_selection_inherent_projection_normalization_overflow)]
+pub struct InherentProjectionNormalizationOverflow {
+ #[primary_span]
+ pub span: Span,
+ pub ty: String,
+}
diff --git a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
index 996dc32..0ede32c 100644
--- a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
+++ b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
@@ -33,7 +33,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
ty::Dynamic(..)
| ty::Param(..)
| ty::Foreign(..)
- | ty::Alias(ty::Projection, ..)
+ | ty::Alias(ty::Projection | ty::Inherent, ..)
| ty::Placeholder(..)
| ty::Bound(..)
| ty::Infer(_) => {
diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs
index 6c98fad..04b38ed 100644
--- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs
+++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs
@@ -655,7 +655,7 @@ fn disqualify_auto_trait_candidate_due_to_possible_impl(
ty::Dynamic(..)
| ty::Param(..)
| ty::Foreign(..)
- | ty::Alias(ty::Projection, ..)
+ | ty::Alias(ty::Projection | ty::Inherent, ..)
| ty::Placeholder(..) => Some(Err(NoSolution)),
ty::Infer(_) | ty::Bound(_, _) => bug!("unexpected type `{self_ty}`"),
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs
index b7690f7..969e5fa 100644
--- a/compiler/rustc_trait_selection/src/traits/coherence.rs
+++ b/compiler/rustc_trait_selection/src/traits/coherence.rs
@@ -322,7 +322,9 @@ fn negative_impl(tcx: TyCtxt<'_>, impl1_def_id: DefId, impl2_def_id: DefId) -> b
let selcx = &mut SelectionContext::new(&infcx);
let impl2_substs = infcx.fresh_substs_for_item(DUMMY_SP, impl2_def_id);
let (subject2, obligations) =
- impl_subject_and_oblig(selcx, impl_env, impl2_def_id, impl2_substs);
+ impl_subject_and_oblig(selcx, impl_env, impl2_def_id, impl2_substs, |_, _| {
+ ObligationCause::dummy()
+ });
!equate(&infcx, impl_env, subject1, subject2, obligations, impl1_def_id)
}
@@ -673,7 +675,7 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
| ty::RawPtr(..)
| ty::Never
| ty::Tuple(..)
- | ty::Alias(ty::Projection, ..) => self.found_non_local_ty(ty),
+ | ty::Alias(ty::Projection | ty::Inherent, ..) => self.found_non_local_ty(ty),
ty::Param(..) => self.found_param_ty(ty),
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index afb64da8b61..c9e2ed0 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -1687,13 +1687,14 @@ fn type_category(tcx: TyCtxt<'_>, t: Ty<'_>) -> Option<u32> {
ty::Tuple(..) => Some(10),
ty::Param(..) => Some(11),
ty::Alias(ty::Projection, ..) => Some(12),
- ty::Alias(ty::Opaque, ..) => Some(13),
- ty::Never => Some(14),
- ty::Adt(..) => Some(15),
- ty::Generator(..) => Some(16),
- ty::Foreign(..) => Some(17),
- ty::GeneratorWitness(..) => Some(18),
- ty::GeneratorWitnessMIR(..) => Some(19),
+ ty::Alias(ty::Inherent, ..) => Some(13),
+ ty::Alias(ty::Opaque, ..) => Some(14),
+ ty::Never => Some(15),
+ ty::Adt(..) => Some(16),
+ ty::Generator(..) => Some(17),
+ ty::Foreign(..) => Some(18),
+ ty::GeneratorWitness(..) => Some(19),
+ ty::GeneratorWitnessMIR(..) => Some(20),
ty::Placeholder(..) | ty::Bound(..) | ty::Infer(..) | ty::Error(_) => None,
}
}
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index d8e5725..38daca5 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -49,12 +49,15 @@
pub use self::object_safety::is_vtable_safe_method;
pub use self::object_safety::MethodViolationCode;
pub use self::object_safety::ObjectSafetyViolation;
-pub use self::project::{normalize_projection_type, NormalizeExt};
+pub use self::project::NormalizeExt;
+pub use self::project::{normalize_inherent_projection, normalize_projection_type};
pub use self::select::{EvaluationCache, SelectionCache, SelectionContext};
pub use self::select::{EvaluationResult, IntercrateAmbiguityCause, OverflowError};
pub use self::specialize::specialization_graph::FutureCompatOverlapError;
pub use self::specialize::specialization_graph::FutureCompatOverlapErrorKind;
-pub use self::specialize::{specialization_graph, translate_substs, OverlapError};
+pub use self::specialize::{
+ specialization_graph, translate_substs, translate_substs_with_cause, OverlapError,
+};
pub use self::structural_match::{
search_for_adt_const_param_violation, search_for_structural_match_violation,
};
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 8c74860..8e684b7 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -16,6 +16,7 @@
};
use super::{Normalized, NormalizedTy, ProjectionCacheEntry, ProjectionCacheKey};
+use crate::errors::InherentProjectionNormalizationOverflow;
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use crate::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
use crate::traits::error_reporting::TypeErrCtxtExt as _;
@@ -370,10 +371,14 @@ pub(crate) fn needs_normalization<'tcx, T: TypeVisitable<TyCtxt<'tcx>>>(
reveal: Reveal,
) -> bool {
match reveal {
- Reveal::UserFacing => value
- .has_type_flags(ty::TypeFlags::HAS_TY_PROJECTION | ty::TypeFlags::HAS_CT_PROJECTION),
+ Reveal::UserFacing => value.has_type_flags(
+ ty::TypeFlags::HAS_TY_PROJECTION
+ | ty::TypeFlags::HAS_TY_INHERENT
+ | ty::TypeFlags::HAS_CT_PROJECTION,
+ ),
Reveal::All => value.has_type_flags(
ty::TypeFlags::HAS_TY_PROJECTION
+ | ty::TypeFlags::HAS_TY_INHERENT
| ty::TypeFlags::HAS_TY_OPAQUE
| ty::TypeFlags::HAS_CT_PROJECTION,
),
@@ -616,6 +621,51 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
);
normalized_ty
}
+
+ ty::Inherent if !data.has_escaping_bound_vars() => {
+ // This branch is *mostly* just an optimization: when we don't
+ // have escaping bound vars, we don't need to replace them with
+ // placeholders (see branch below). *Also*, we know that we can
+ // register an obligation to *later* project, since we know
+ // there won't be bound vars there.
+
+ let data = data.fold_with(self);
+
+ // FIXME(inherent_associated_types): Do we need to honor `self.eager_inference_replacement`
+ // here like `ty::Projection`?
+ normalize_inherent_projection(
+ self.selcx,
+ self.param_env,
+ data,
+ self.cause.clone(),
+ self.depth,
+ &mut self.obligations,
+ )
+ }
+
+ ty::Inherent => {
+ let infcx = self.selcx.infcx;
+ let (data, mapped_regions, mapped_types, mapped_consts) =
+ BoundVarReplacer::replace_bound_vars(infcx, &mut self.universes, data);
+ let data = data.fold_with(self);
+ let ty = normalize_inherent_projection(
+ self.selcx,
+ self.param_env,
+ data,
+ self.cause.clone(),
+ self.depth,
+ &mut self.obligations,
+ );
+
+ PlaceholderReplacer::replace_placeholders(
+ infcx,
+ mapped_regions,
+ mapped_types,
+ mapped_consts,
+ &self.universes,
+ ty,
+ )
+ }
}
}
@@ -1204,6 +1254,115 @@ fn normalize_to_error<'a, 'tcx>(
Normalized { value: new_value, obligations: vec![trait_obligation] }
}
+/// Confirm and normalize the given inherent projection.
+#[instrument(level = "debug", skip(selcx, param_env, cause, obligations))]
+pub fn normalize_inherent_projection<'a, 'b, 'tcx>(
+ selcx: &'a mut SelectionContext<'b, 'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
+ alias_ty: ty::AliasTy<'tcx>,
+ cause: ObligationCause<'tcx>,
+ depth: usize,
+ obligations: &mut Vec<PredicateObligation<'tcx>>,
+) -> Ty<'tcx> {
+ let tcx = selcx.tcx();
+
+ if !tcx.recursion_limit().value_within_limit(depth) {
+ // Halt compilation because it is important that overflows never be masked.
+ tcx.sess.emit_fatal(InherentProjectionNormalizationOverflow {
+ span: cause.span,
+ ty: alias_ty.to_string(),
+ });
+ }
+
+ let substs = compute_inherent_assoc_ty_substs(
+ selcx,
+ param_env,
+ alias_ty,
+ cause.clone(),
+ depth,
+ obligations,
+ );
+
+ // Register the obligations arising from the impl and from the associated type itself.
+ let predicates = tcx.predicates_of(alias_ty.def_id).instantiate(tcx, substs);
+ for (predicate, span) in predicates {
+ let predicate = normalize_with_depth_to(
+ selcx,
+ param_env,
+ cause.clone(),
+ depth + 1,
+ predicate,
+ obligations,
+ );
+
+ let nested_cause = ObligationCause::new(
+ cause.span,
+ cause.body_id,
+ // FIXME(inherent_associated_types): Since we can't pass along the self type to the
+ // cause code, inherent projections will be printed with identity substitutions in
+ // diagnostics which is not ideal.
+ // Consider creating separate cause codes for this specific situation.
+ if span.is_dummy() {
+ super::ItemObligation(alias_ty.def_id)
+ } else {
+ super::BindingObligation(alias_ty.def_id, span)
+ },
+ );
+
+ obligations.push(Obligation::with_depth(
+ tcx,
+ nested_cause,
+ depth + 1,
+ param_env,
+ predicate,
+ ));
+ }
+
+ let ty = tcx.type_of(alias_ty.def_id).subst(tcx, substs);
+
+ let mut ty = selcx.infcx.resolve_vars_if_possible(ty);
+ if ty.has_projections() {
+ ty = normalize_with_depth_to(selcx, param_env, cause.clone(), depth + 1, ty, obligations);
+ }
+
+ ty
+}
+
+pub fn compute_inherent_assoc_ty_substs<'a, 'b, 'tcx>(
+ selcx: &'a mut SelectionContext<'b, 'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
+ alias_ty: ty::AliasTy<'tcx>,
+ cause: ObligationCause<'tcx>,
+ depth: usize,
+ obligations: &mut Vec<PredicateObligation<'tcx>>,
+) -> ty::SubstsRef<'tcx> {
+ let tcx = selcx.tcx();
+
+ let impl_def_id = tcx.parent(alias_ty.def_id);
+ let impl_substs = selcx.infcx.fresh_substs_for_item(cause.span, impl_def_id);
+
+ let impl_ty = tcx.type_of(impl_def_id).subst(tcx, impl_substs);
+ let impl_ty =
+ normalize_with_depth_to(selcx, param_env, cause.clone(), depth + 1, impl_ty, obligations);
+
+ // Infer the generic parameters of the impl by unifying the
+ // impl type with the self type of the projection.
+ let self_ty = alias_ty.self_ty();
+ match selcx.infcx.at(&cause, param_env).eq(DefineOpaqueTypes::No, impl_ty, self_ty) {
+ Ok(mut ok) => obligations.append(&mut ok.obligations),
+ Err(_) => {
+ tcx.sess.delay_span_bug(
+ cause.span,
+ format!(
+ "{self_ty:?} was a subtype of {impl_ty:?} during selection but now it is not"
+ ),
+ );
+ }
+ }
+
+ alias_ty.rebase_substs_onto_impl(impl_substs, tcx)
+}
+
enum Projected<'tcx> {
Progress(Progress<'tcx>),
NoProgress(ty::Term<'tcx>),
diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
index a986a9b..8bf934c 100644
--- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
@@ -257,11 +257,11 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
ty::Opaque => ty.try_super_fold_with(self)?,
- ty::Projection => {
+ ty::Projection | ty::Inherent => {
// See note in `rustc_trait_selection::traits::project`
- let tcx = self.infcx.tcx;
let infcx = self.infcx;
+ let tcx = infcx.tcx;
// Just an optimization: When we don't have escaping bound vars,
// we don't need to replace them with placeholders.
let (data, maps) = if data.has_escaping_bound_vars() {
@@ -276,12 +276,15 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
let mut orig_values = OriginalQueryValues::default();
// HACK(matthewjasper) `'static` is special-cased in selection,
// so we cannot canonicalize it.
- let c_data = self
- .infcx
+ let c_data = infcx
.canonicalize_query_keep_static(self.param_env.and(data), &mut orig_values);
debug!("QueryNormalizer: c_data = {:#?}", c_data);
debug!("QueryNormalizer: orig_values = {:#?}", orig_values);
- let result = tcx.normalize_projection_ty(c_data)?;
+ let result = match kind {
+ ty::Projection => tcx.normalize_projection_ty(c_data),
+ ty::Inherent => tcx.normalize_inherent_projection_ty(c_data),
+ _ => unreachable!(),
+ }?;
// We don't expect ambiguity.
if result.is_ambiguous() {
// Rustdoc normalizes possibly not well-formed types, so only
@@ -294,8 +297,8 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
}
return Err(NoSolution);
}
- let InferOk { value: result, obligations } =
- self.infcx.instantiate_query_response_and_region_obligations(
+ let InferOk { value: result, obligations } = infcx
+ .instantiate_query_response_and_region_obligations(
self.cause,
self.param_env,
&orig_values,
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
index 33f502f..a8fb55d 100644
--- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
@@ -498,7 +498,7 @@ fn assemble_candidates_from_auto_impls(
// this trait and type.
}
ty::Param(..)
- | ty::Alias(ty::Projection, ..)
+ | ty::Alias(ty::Projection | ty::Inherent, ..)
| ty::Placeholder(..)
| ty::Bound(..) => {
// In these cases, we don't know what the actual
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 422285d..616187b 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -1268,7 +1268,7 @@ fn confirm_const_destruct_candidate(
// If we have a projection type, make sure to normalize it so we replace it
// with a fresh infer variable
- ty::Alias(ty::Projection, ..) => {
+ ty::Alias(ty::Projection | ty::Inherent, ..) => {
let predicate = normalize_with_depth_to(
self,
obligation.param_env,
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index 246d3ea..e4f5a84 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -2315,7 +2315,7 @@ fn constituent_types_for_ty(
| ty::Dynamic(..)
| ty::Param(..)
| ty::Foreign(..)
- | ty::Alias(ty::Projection, ..)
+ | ty::Alias(ty::Projection | ty::Inherent, ..)
| ty::Bound(..)
| ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
bug!("asked to assemble constituent types of unexpected type: {:?}", t);
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
index 233d35a..9a4b720 100644
--- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
@@ -83,6 +83,30 @@ pub fn translate_substs<'tcx>(
source_substs: SubstsRef<'tcx>,
target_node: specialization_graph::Node,
) -> SubstsRef<'tcx> {
+ translate_substs_with_cause(
+ infcx,
+ param_env,
+ source_impl,
+ source_substs,
+ target_node,
+ |_, _| ObligationCause::dummy(),
+ )
+}
+
+/// Like [translate_substs], but obligations from the parent implementation
+/// are registered with the provided `ObligationCause`.
+///
+/// This is for reporting *region* errors from those bounds. Type errors should
+/// not happen because the specialization graph already checks for those, and
+/// will result in an ICE.
+pub fn translate_substs_with_cause<'tcx>(
+ infcx: &InferCtxt<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
+ source_impl: DefId,
+ source_substs: SubstsRef<'tcx>,
+ target_node: specialization_graph::Node,
+ cause: impl Fn(usize, Span) -> ObligationCause<'tcx>,
+) -> SubstsRef<'tcx> {
debug!(
"translate_substs({:?}, {:?}, {:?}, {:?})",
param_env, source_impl, source_substs, target_node
@@ -99,14 +123,13 @@ pub fn translate_substs<'tcx>(
return source_substs;
}
- fulfill_implication(infcx, param_env, source_trait_ref, target_impl).unwrap_or_else(
- |()| {
+ fulfill_implication(infcx, param_env, source_trait_ref, source_impl, target_impl, cause)
+ .unwrap_or_else(|()| {
bug!(
"When translating substitutions from {source_impl:?} to {target_impl:?}, \
the expected specialization failed to hold"
)
- },
- )
+ })
}
specialization_graph::Node::Trait(..) => source_trait_ref.substs,
};
@@ -153,20 +176,12 @@ pub(super) fn specializes(tcx: TyCtxt<'_>, (impl1_def_id, impl2_def_id): (DefId,
// Create an infcx, taking the predicates of impl1 as assumptions:
let infcx = tcx.infer_ctxt().build();
- let impl1_trait_ref =
- match traits::fully_normalize(&infcx, ObligationCause::dummy(), penv, impl1_trait_ref) {
- Ok(impl1_trait_ref) => impl1_trait_ref,
- Err(_errors) => {
- tcx.sess.delay_span_bug(
- tcx.def_span(impl1_def_id),
- format!("failed to fully normalize {impl1_trait_ref}"),
- );
- impl1_trait_ref
- }
- };
// Attempt to prove that impl2 applies, given all of the above.
- fulfill_implication(&infcx, penv, impl1_trait_ref, impl2_def_id).is_ok()
+ fulfill_implication(&infcx, penv, impl1_trait_ref, impl1_def_id, impl2_def_id, |_, _| {
+ ObligationCause::dummy()
+ })
+ .is_ok()
}
/// Attempt to fulfill all obligations of `target_impl` after unification with
@@ -178,23 +193,41 @@ fn fulfill_implication<'tcx>(
infcx: &InferCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
source_trait_ref: ty::TraitRef<'tcx>,
+ source_impl: DefId,
target_impl: DefId,
+ error_cause: impl Fn(usize, Span) -> ObligationCause<'tcx>,
) -> Result<SubstsRef<'tcx>, ()> {
debug!(
"fulfill_implication({:?}, trait_ref={:?} |- {:?} applies)",
param_env, source_trait_ref, target_impl
);
+ let source_trait_ref = match traits::fully_normalize(
+ &infcx,
+ ObligationCause::dummy(),
+ param_env,
+ source_trait_ref,
+ ) {
+ Ok(source_trait_ref) => source_trait_ref,
+ Err(_errors) => {
+ infcx.tcx.sess.delay_span_bug(
+ infcx.tcx.def_span(source_impl),
+ format!("failed to fully normalize {source_trait_ref}"),
+ );
+ source_trait_ref
+ }
+ };
+
let source_trait = ImplSubject::Trait(source_trait_ref);
let selcx = &mut SelectionContext::new(&infcx);
let target_substs = infcx.fresh_substs_for_item(DUMMY_SP, target_impl);
let (target_trait, obligations) =
- util::impl_subject_and_oblig(selcx, param_env, target_impl, target_substs);
+ util::impl_subject_and_oblig(selcx, param_env, target_impl, target_substs, error_cause);
// do the impls unify? If not, no specialization.
let Ok(InferOk { obligations: more_obligations, .. }) =
- infcx.at(&ObligationCause::dummy(), param_env, ).eq(DefineOpaqueTypes::No,source_trait, target_trait)
+ infcx.at(&ObligationCause::dummy(), param_env).eq(DefineOpaqueTypes::No, source_trait, target_trait)
else {
debug!(
"fulfill_implication: {:?} does not unify with {:?}",
diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs
index 7b7e297..82f3df4 100644
--- a/compiler/rustc_trait_selection/src/traits/util.rs
+++ b/compiler/rustc_trait_selection/src/traits/util.rs
@@ -197,6 +197,7 @@ pub fn impl_subject_and_oblig<'a, 'tcx>(
param_env: ty::ParamEnv<'tcx>,
impl_def_id: DefId,
impl_substs: SubstsRef<'tcx>,
+ cause: impl Fn(usize, Span) -> ObligationCause<'tcx>,
) -> (ImplSubject<'tcx>, impl Iterator<Item = PredicateObligation<'tcx>>) {
let subject = selcx.tcx().impl_subject(impl_def_id);
let subject = subject.subst(selcx.tcx(), impl_substs);
@@ -208,8 +209,7 @@ pub fn impl_subject_and_oblig<'a, 'tcx>(
let predicates = predicates.instantiate(selcx.tcx(), impl_substs);
let InferOk { value: predicates, obligations: normalization_obligations2 } =
selcx.infcx.at(&ObligationCause::dummy(), param_env).normalize(predicates);
- let impl_obligations =
- super::predicates_for_generics(|_, _| ObligationCause::dummy(), param_env, predicates);
+ let impl_obligations = super::predicates_for_generics(cause, param_env, predicates);
let impl_obligations = impl_obligations
.chain(normalization_obligations1.into_iter())
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs
index 22710c7..086ab32 100644
--- a/compiler/rustc_trait_selection/src/traits/wf.rs
+++ b/compiler/rustc_trait_selection/src/traits/wf.rs
@@ -58,15 +58,8 @@ pub fn obligations<'tcx>(
GenericArgKind::Lifetime(..) => return Some(Vec::new()),
};
- let mut wf = WfPredicates {
- tcx: infcx.tcx,
- param_env,
- body_id,
- span,
- out: vec![],
- recursion_depth,
- item: None,
- };
+ let mut wf =
+ WfPredicates { infcx, param_env, body_id, span, out: vec![], recursion_depth, item: None };
wf.compute(arg);
debug!("wf::obligations({:?}, body_id={:?}) = {:?}", arg, body_id, wf.out);
@@ -91,7 +84,7 @@ pub fn unnormalized_obligations<'tcx>(
debug_assert_eq!(arg, infcx.resolve_vars_if_possible(arg));
let mut wf = WfPredicates {
- tcx: infcx.tcx,
+ infcx,
param_env,
body_id: CRATE_DEF_ID,
span: DUMMY_SP,
@@ -116,7 +109,7 @@ pub fn trait_obligations<'tcx>(
item: &'tcx hir::Item<'tcx>,
) -> Vec<traits::PredicateObligation<'tcx>> {
let mut wf = WfPredicates {
- tcx: infcx.tcx,
+ infcx,
param_env,
body_id,
span,
@@ -138,7 +131,7 @@ pub fn predicate_obligations<'tcx>(
span: Span,
) -> Vec<traits::PredicateObligation<'tcx>> {
let mut wf = WfPredicates {
- tcx: infcx.tcx,
+ infcx,
param_env,
body_id,
span,
@@ -190,8 +183,8 @@ pub fn predicate_obligations<'tcx>(
wf.normalize(infcx)
}
-struct WfPredicates<'tcx> {
- tcx: TyCtxt<'tcx>,
+struct WfPredicates<'a, 'tcx> {
+ infcx: &'a InferCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
body_id: LocalDefId,
span: Span,
@@ -290,9 +283,9 @@ fn extend_cause_with_original_assoc_item_obligation<'tcx>(
}
}
-impl<'tcx> WfPredicates<'tcx> {
+impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
fn tcx(&self) -> TyCtxt<'tcx> {
- self.tcx
+ self.infcx.tcx
}
fn cause(&self, code: traits::ObligationCauseCode<'tcx>) -> traits::ObligationCause<'tcx> {
@@ -325,7 +318,7 @@ fn normalize(self, infcx: &InferCtxt<'tcx>) -> Vec<traits::PredicateObligation<'
/// Pushes the obligations required for `trait_ref` to be WF into `self.out`.
fn compute_trait_pred(&mut self, trait_pred: &ty::TraitPredicate<'tcx>, elaborate: Elaborate) {
- let tcx = self.tcx;
+ let tcx = self.tcx();
let trait_ref = &trait_pred.trait_ref;
// Negative trait predicates don't require supertraits to hold, just
@@ -369,7 +362,6 @@ fn compute_trait_pred(&mut self, trait_pred: &ty::TraitPredicate<'tcx>, elaborat
self.out.extend(obligations);
}
- let tcx = self.tcx();
self.out.extend(
trait_ref
.substs
@@ -436,13 +428,45 @@ fn compute_projection(&mut self, data: ty::AliasTy<'tcx>) {
let obligations = self.nominal_obligations_without_const(data.def_id, data.substs);
self.out.extend(obligations);
+ self.compute_projection_substs(data.substs);
+ }
+
+ fn compute_inherent_projection(&mut self, data: ty::AliasTy<'tcx>) {
+ // An inherent projection is well-formed if
+ //
+ // (a) its predicates hold (*)
+ // (b) its substs are wf
+ //
+ // (*) The predicates of an inherent associated type include the
+ // predicates of the impl that it's contained in.
+
+ if !data.self_ty().has_escaping_bound_vars() {
+ // FIXME(inherent_associated_types): Should this happen inside of a snapshot?
+ // FIXME(inherent_associated_types): This is incompatible with the new solver and lazy norm!
+ let substs = traits::project::compute_inherent_assoc_ty_substs(
+ &mut traits::SelectionContext::new(self.infcx),
+ self.param_env,
+ data,
+ self.cause(traits::WellFormed(None)),
+ self.recursion_depth,
+ &mut self.out,
+ );
+ // Inherent projection types do not require const predicates.
+ let obligations = self.nominal_obligations_without_const(data.def_id, substs);
+ self.out.extend(obligations);
+ }
+
+ self.compute_projection_substs(data.substs);
+ }
+
+ fn compute_projection_substs(&mut self, substs: SubstsRef<'tcx>) {
let tcx = self.tcx();
let cause = self.cause(traits::WellFormed(None));
let param_env = self.param_env;
let depth = self.recursion_depth;
self.out.extend(
- data.substs
+ substs
.iter()
.filter(|arg| {
matches!(arg.unpack(), GenericArgKind::Type(..) | GenericArgKind::Const(..))
@@ -464,9 +488,9 @@ fn require_sized(&mut self, subty: Ty<'tcx>, cause: traits::ObligationCauseCode<
if !subty.has_escaping_bound_vars() {
let cause = self.cause(cause);
let trait_ref =
- ty::TraitRef::from_lang_item(self.tcx, LangItem::Sized, cause.span, [subty]);
+ ty::TraitRef::from_lang_item(self.tcx(), LangItem::Sized, cause.span, [subty]);
self.out.push(traits::Obligation::with_depth(
- self.tcx,
+ self.tcx(),
cause,
self.recursion_depth,
self.param_env,
@@ -605,6 +629,10 @@ fn compute(&mut self, arg: GenericArg<'tcx>) {
walker.skip_current_subtree(); // Subtree handled by compute_projection.
self.compute_projection(data);
}
+ ty::Alias(ty::Inherent, data) => {
+ walker.skip_current_subtree(); // Subtree handled by compute_inherent_projection.
+ self.compute_inherent_projection(data);
+ }
ty::Adt(def, substs) => {
// WfNominalType
@@ -697,7 +725,7 @@ fn compute(&mut self, arg: GenericArg<'tcx>) {
// All of the requirements on type parameters
// have already been checked for `impl Trait` in
// return position. We do need to check type-alias-impl-trait though.
- if self.tcx.is_type_alias_impl_trait(def_id) {
+ if self.tcx().is_type_alias_impl_trait(def_id) {
let obligations = self.nominal_obligations(def_id, substs);
self.out.extend(obligations);
}
@@ -767,15 +795,15 @@ fn nominal_obligations_inner(
substs: SubstsRef<'tcx>,
remap_constness: bool,
) -> Vec<traits::PredicateObligation<'tcx>> {
- let predicates = self.tcx.predicates_of(def_id);
+ let predicates = self.tcx().predicates_of(def_id);
let mut origins = vec![def_id; predicates.predicates.len()];
let mut head = predicates;
while let Some(parent) = head.parent {
- head = self.tcx.predicates_of(parent);
+ head = self.tcx().predicates_of(parent);
origins.extend(iter::repeat(parent).take(head.predicates.len()));
}
- let predicates = predicates.instantiate(self.tcx, substs);
+ let predicates = predicates.instantiate(self.tcx(), substs);
trace!("{:#?}", predicates);
debug_assert_eq!(predicates.predicates.len(), origins.len());
@@ -788,10 +816,10 @@ fn nominal_obligations_inner(
};
let cause = self.cause(code);
if remap_constness {
- pred = pred.without_const(self.tcx);
+ pred = pred.without_const(self.tcx());
}
traits::Obligation::with_depth(
- self.tcx,
+ self.tcx(),
cause,
self.recursion_depth,
self.param_env,
@@ -856,7 +884,7 @@ fn from_object_ty(
// Note: in fact we only permit builtin traits, not `Bar<'d>`, I
// am looking forward to the future here.
if !data.has_escaping_bound_vars() && !region.has_escaping_bound_vars() {
- let implicit_bounds = object_region_bounds(self.tcx, data);
+ let implicit_bounds = object_region_bounds(self.tcx(), data);
let explicit_bound = region;
@@ -866,7 +894,7 @@ fn from_object_ty(
let outlives =
ty::Binder::dummy(ty::OutlivesPredicate(explicit_bound, implicit_bound));
self.out.push(traits::Obligation::with_depth(
- self.tcx,
+ self.tcx(),
cause,
self.recursion_depth,
self.param_env,
diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs
index 4d225e3..2f9e480 100644
--- a/compiler/rustc_traits/src/chalk/lowering.rs
+++ b/compiler/rustc_traits/src/chalk/lowering.rs
@@ -372,6 +372,7 @@ fn lower_into(self, interner: RustInterner<'tcx>) -> chalk_ir::Ty<RustInterner<'
substitution: substs.lower_into(interner),
}))
}
+ ty::Alias(ty::Inherent, _) => unimplemented!(),
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => {
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
opaque_ty_id: chalk_ir::OpaqueTyId(def_id),
diff --git a/compiler/rustc_traits/src/normalize_projection_ty.rs b/compiler/rustc_traits/src/normalize_projection_ty.rs
index e805eb4..36d80a0 100644
--- a/compiler/rustc_traits/src/normalize_projection_ty.rs
+++ b/compiler/rustc_traits/src/normalize_projection_ty.rs
@@ -10,7 +10,7 @@
use std::sync::atomic::Ordering;
pub(crate) fn provide(p: &mut Providers) {
- *p = Providers { normalize_projection_ty, ..*p };
+ *p = Providers { normalize_projection_ty, normalize_inherent_projection_ty, ..*p };
}
fn normalize_projection_ty<'tcx>(
@@ -42,3 +42,30 @@ fn normalize_projection_ty<'tcx>(
},
)
}
+
+fn normalize_inherent_projection_ty<'tcx>(
+ tcx: TyCtxt<'tcx>,
+ goal: CanonicalProjectionGoal<'tcx>,
+) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, NormalizationResult<'tcx>>>, NoSolution> {
+ debug!("normalize_provider(goal={:#?})", goal);
+
+ tcx.infer_ctxt().enter_canonical_trait_query(
+ &goal,
+ |ocx, ParamEnvAnd { param_env, value: goal }| {
+ let selcx = &mut SelectionContext::new(ocx.infcx);
+ let cause = ObligationCause::dummy();
+ let mut obligations = vec![];
+ let answer = traits::normalize_inherent_projection(
+ selcx,
+ param_env,
+ goal,
+ cause,
+ 0,
+ &mut obligations,
+ );
+ ocx.register_obligations(obligations);
+
+ Ok(NormalizationResult { normalized_ty: answer })
+ },
+ )
+}
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs
index ec57707..eb3c21163 100644
--- a/compiler/rustc_ty_utils/src/instance.rs
+++ b/compiler/rustc_ty_utils/src/instance.rs
@@ -194,21 +194,18 @@ fn resolve_associated_item<'tcx>(
})
}
traits::ImplSource::Future(future_data) => {
- if cfg!(debug_assertions) && tcx.item_name(trait_item_id) != sym::poll {
- // For compiler developers who'd like to add new items to `Future`,
- // you either need to generate a shim body, or perhaps return
- // `InstanceDef::Item` pointing to a trait default method body if
- // it is given a default implementation by the trait.
- span_bug!(
- tcx.def_span(future_data.generator_def_id),
- "no definition for `{trait_ref}::{}` for built-in async generator type",
- tcx.item_name(trait_item_id)
- )
+ if Some(trait_item_id) == tcx.lang_items().future_poll_fn() {
+ // `Future::poll` is generated by the compiler.
+ Some(Instance {
+ def: ty::InstanceDef::Item(future_data.generator_def_id),
+ substs: future_data.substs,
+ })
+ } else {
+ // All other methods are default methods of the `Future` trait.
+ // (this assumes that `ImplSource::Future` is only used for methods on `Future`)
+ debug_assert!(tcx.impl_defaultness(trait_item_id).has_value());
+ Some(Instance::new(trait_item_id, rcvr_substs))
}
- Some(Instance {
- def: ty::InstanceDef::Item(future_data.generator_def_id),
- substs: future_data.substs,
- })
}
traits::ImplSource::Closure(closure_data) => {
if cfg!(debug_assertions)
diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs
index 1e91e26..7e5a4d1 100644
--- a/compiler/rustc_type_ir/src/lib.rs
+++ b/compiler/rustc_type_ir/src/lib.rs
@@ -229,29 +229,32 @@ pub struct TypeFlags: u32 {
/// Does this have `Projection`?
const HAS_TY_PROJECTION = 1 << 10;
+ /// Does this have `Inherent`?
+ const HAS_TY_INHERENT = 1 << 11;
/// Does this have `Opaque`?
- const HAS_TY_OPAQUE = 1 << 11;
+ const HAS_TY_OPAQUE = 1 << 12;
/// Does this have `ConstKind::Unevaluated`?
- const HAS_CT_PROJECTION = 1 << 12;
+ const HAS_CT_PROJECTION = 1 << 13;
/// Could this type be normalized further?
const HAS_PROJECTION = TypeFlags::HAS_TY_PROJECTION.bits
| TypeFlags::HAS_TY_OPAQUE.bits
+ | TypeFlags::HAS_TY_INHERENT.bits
| TypeFlags::HAS_CT_PROJECTION.bits;
/// Is an error type/const reachable?
- const HAS_ERROR = 1 << 13;
+ const HAS_ERROR = 1 << 14;
/// Does this have any region that "appears free" in the type?
/// Basically anything but `ReLateBound` and `ReErased`.
- const HAS_FREE_REGIONS = 1 << 14;
+ const HAS_FREE_REGIONS = 1 << 15;
/// Does this have any `ReLateBound` regions?
- const HAS_RE_LATE_BOUND = 1 << 15;
+ const HAS_RE_LATE_BOUND = 1 << 16;
/// Does this have any `Bound` types?
- const HAS_TY_LATE_BOUND = 1 << 16;
+ const HAS_TY_LATE_BOUND = 1 << 17;
/// Does this have any `ConstKind::Bound` consts?
- const HAS_CT_LATE_BOUND = 1 << 17;
+ const HAS_CT_LATE_BOUND = 1 << 18;
/// Does this have any bound variables?
/// Used to check if a global bound is safe to evaluate.
const HAS_LATE_BOUND = TypeFlags::HAS_RE_LATE_BOUND.bits
@@ -259,20 +262,20 @@ pub struct TypeFlags: u32 {
| TypeFlags::HAS_CT_LATE_BOUND.bits;
/// Does this have any `ReErased` regions?
- const HAS_RE_ERASED = 1 << 18;
+ const HAS_RE_ERASED = 1 << 19;
/// Does this value have parameters/placeholders/inference variables which could be
/// replaced later, in a way that would change the results of `impl` specialization?
- const STILL_FURTHER_SPECIALIZABLE = 1 << 19;
+ const STILL_FURTHER_SPECIALIZABLE = 1 << 20;
/// Does this value have `InferTy::FreshTy/FreshIntTy/FreshFloatTy`?
- const HAS_TY_FRESH = 1 << 20;
+ const HAS_TY_FRESH = 1 << 21;
/// Does this value have `InferConst::Fresh`?
- const HAS_CT_FRESH = 1 << 21;
+ const HAS_CT_FRESH = 1 << 22;
/// Does this have `Generator` or `GeneratorWitness`?
- const HAS_TY_GENERATOR = 1 << 22;
+ const HAS_TY_GENERATOR = 1 << 23;
}
}
diff --git a/compiler/rustc_type_ir/src/sty.rs b/compiler/rustc_type_ir/src/sty.rs
index 4c1f2dd..f7344ba 100644
--- a/compiler/rustc_type_ir/src/sty.rs
+++ b/compiler/rustc_type_ir/src/sty.rs
@@ -37,6 +37,7 @@ pub enum DynKind {
#[derive(Encodable, Decodable, HashStable_Generic)]
pub enum AliasKind {
Projection,
+ Inherent,
Opaque,
}
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 18f25ae..59fa91c 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -113,7 +113,6 @@
#![feature(const_maybe_uninit_write)]
#![feature(const_maybe_uninit_zeroed)]
#![feature(const_pin)]
-#![feature(const_ptr_read)]
#![feature(const_refs_to_cell)]
#![feature(const_size_of_val)]
#![feature(const_waker)]
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index 48b1277..faf48ae 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -1412,6 +1412,7 @@ fn cmp(&self, other: &bool) -> Ordering {
#[unstable(feature = "never_type", issue = "35121")]
impl PartialEq for ! {
+ #[inline]
fn eq(&self, _: &!) -> bool {
*self
}
@@ -1422,6 +1423,7 @@ impl Eq for ! {}
#[unstable(feature = "never_type", issue = "35121")]
impl PartialOrd for ! {
+ #[inline]
fn partial_cmp(&self, _: &!) -> Option<Ordering> {
*self
}
@@ -1429,6 +1431,7 @@ fn partial_cmp(&self, _: &!) -> Option<Ordering> {
#[unstable(feature = "never_type", issue = "35121")]
impl Ord for ! {
+ #[inline]
fn cmp(&self, _: &!) -> Ordering {
*self
}
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs
index 3ae787c..38a6d1c 100644
--- a/library/core/src/convert/mod.rs
+++ b/library/core/src/convert/mod.rs
@@ -915,6 +915,7 @@ fn cmp(&self, _other: &Self) -> crate::cmp::Ordering {
#[stable(feature = "convert_infallible", since = "1.34.0")]
impl From<!> for Infallible {
+ #[inline]
fn from(x: !) -> Self {
x
}
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index aa829ed..bac2f31 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -2267,6 +2267,7 @@ fn fmt(&self, f: &mut Formatter<'_>) -> Result { $tr::fmt(&**self, f) }
#[unstable(feature = "never_type", issue = "35121")]
impl Debug for ! {
+ #[inline]
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
*self
}
@@ -2274,6 +2275,7 @@ fn fmt(&self, _: &mut Formatter<'_>) -> Result {
#[unstable(feature = "never_type", issue = "35121")]
impl Display for ! {
+ #[inline]
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
*self
}
diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs
index 0596f6c..d37888c 100644
--- a/library/core/src/fmt/rt.rs
+++ b/library/core/src/fmt/rt.rs
@@ -152,6 +152,21 @@ pub(super) fn as_usize(&self) -> Option<usize> {
None
}
}
+
+ /// Used by `format_args` when all arguments are gone after inlining,
+ /// when using `&[]` would incorrectly allow for a bigger lifetime.
+ ///
+ /// This fails without format argument inlining, and that shouldn't be different
+ /// when the argument is inlined:
+ ///
+ /// ```compile_fail,E0716
+ /// let f = format_args!("{}", "a");
+ /// println!("{f}");
+ /// ```
+ #[inline(always)]
+ pub fn none() -> [Self; 0] {
+ []
+ }
}
/// This struct represents the unsafety of constructing an `Arguments`.
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 077c0fd..9c02029 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -2260,7 +2260,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
/// This intrinsic can *only* be called where the pointer is a local without
/// projections (`read_via_copy(ptr)`, not `read_via_copy(*ptr)`) so that it
/// trivially obeys runtime-MIR rules about derefs in operands.
- #[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+ #[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
#[rustc_nounwind]
pub fn read_via_copy<T>(ptr: *const T) -> T;
@@ -2523,6 +2523,7 @@ fn runtime$(<$($tt)*>)?($($i:$ty),*) {
}
}
#[allow(non_snake_case)]
+ #[inline]
const fn comptime$(<$($tt)*>)?($(_:$ty),*) {}
::core::intrinsics::const_eval_select(($($i,)*), comptime, runtime);
diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs
index b4639c0..19f8b94 100644
--- a/library/core/src/intrinsics/mir.rs
+++ b/library/core/src/intrinsics/mir.rs
@@ -263,6 +263,7 @@
macro_rules! define {
($name:literal, $( #[ $meta:meta ] )* fn $($sig:tt)*) => {
#[rustc_diagnostic_item = $name]
+ #[inline]
$( #[ $meta ] )*
pub fn $($sig)* { panic!() }
}
diff --git a/library/core/src/iter/adapters/flatten.rs b/library/core/src/iter/adapters/flatten.rs
index 2568aaf..520ec9a 100644
--- a/library/core/src/iter/adapters/flatten.rs
+++ b/library/core/src/iter/adapters/flatten.rs
@@ -310,7 +310,6 @@ fn default() -> Self {
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
/// this type.
#[derive(Clone, Debug)]
-#[unstable(feature = "trusted_len", issue = "37572")]
struct FlattenCompat<I, U> {
iter: Fuse<I>,
frontiter: Option<U>,
@@ -464,7 +463,6 @@ fn flatten<'a, T: IntoIterator, Acc, R: Try>(
}
}
-#[unstable(feature = "trusted_len", issue = "37572")]
impl<I, U> Iterator for FlattenCompat<I, U>
where
I: Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -579,7 +577,6 @@ fn last<U: Iterator>(last: Option<U::Item>, iter: U) -> Option<U::Item> {
}
}
-#[unstable(feature = "trusted_len", issue = "37572")]
impl<I, U> DoubleEndedIterator for FlattenCompat<I, U>
where
I: DoubleEndedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -649,7 +646,6 @@ fn advance<U: DoubleEndedIterator>(n: usize, iter: &mut U) -> ControlFlow<(), us
}
}
-#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<const N: usize, I, T> TrustedLen
for FlattenCompat<I, <[T; N] as IntoIterator>::IntoIter>
where
@@ -657,7 +653,6 @@ unsafe impl<const N: usize, I, T> TrustedLen
{
}
-#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, const N: usize, I, T> TrustedLen
for FlattenCompat<I, <&'a [T; N] as IntoIterator>::IntoIter>
where
@@ -665,7 +660,6 @@ unsafe impl<'a, const N: usize, I, T> TrustedLen
{
}
-#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, const N: usize, I, T> TrustedLen
for FlattenCompat<I, <&'a mut [T; N] as IntoIterator>::IntoIter>
where
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 3abf66d..26c51e8 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -140,7 +140,6 @@
#![feature(const_pointer_is_aligned)]
#![feature(const_ptr_as_ref)]
#![feature(const_ptr_is_null)]
-#![feature(const_ptr_read)]
#![feature(const_ptr_sub_ptr)]
#![feature(const_ptr_write)]
#![feature(const_raw_ptr_comparison)]
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 7d2f297..4913a6d 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -1315,9 +1315,9 @@ impl<T> SizedTypeProperties for T {}
///
/// assert_eq!(mem::offset_of!(NestedA, b.0), 0);
/// ```
-#[unstable(feature = "offset_of", issue = "106655")]
-#[rustc_builtin_macro]
#[cfg(not(bootstrap))]
+#[unstable(feature = "offset_of", issue = "106655")]
+#[allow_internal_unstable(builtin_syntax)]
pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) {
- /* compiler built-in */
+ builtin # offset_of($Container, $($fields).+)
}
diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs
index 2ad0f1d..14e9957 100644
--- a/library/core/src/num/error.rs
+++ b/library/core/src/num/error.rs
@@ -34,6 +34,7 @@ fn from(x: Infallible) -> TryFromIntError {
#[unstable(feature = "never_type", issue = "35121")]
impl From<!> for TryFromIntError {
+ #[inline]
fn from(never: !) -> TryFromIntError {
// Match rather than coerce to make sure that code like
// `From<Infallible> for TryFromIntError` above will keep working
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index 585b648..5ee1b5e 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -1195,7 +1195,7 @@ pub const fn wrapping_byte_sub(self, count: usize) -> Self {
///
/// [`ptr::read`]: crate::ptr::read()
#[stable(feature = "pointer_methods", since = "1.26.0")]
- #[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+ #[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read(self) -> T
@@ -1236,7 +1236,7 @@ pub unsafe fn read_volatile(self) -> T
///
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
- #[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+ #[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read_unaligned(self) -> T
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 4737ff5..ecbf4e6 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -1133,7 +1133,8 @@ macro_rules! attempt_swap_as_chunks {
/// [valid]: self#safety
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
+#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read<T>(src: *const T) -> T {
// It would be semantically correct to implement this via `copy_nonoverlapping`
@@ -1249,7 +1250,8 @@ macro_rules! attempt_swap_as_chunks {
/// ```
#[inline]
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
-#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
+#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
let mut tmp = MaybeUninit::<T>::uninit();
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index c339ccb..5edd291 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -1305,7 +1305,7 @@ pub const fn wrapping_byte_sub(self, count: usize) -> Self {
///
/// [`ptr::read`]: crate::ptr::read()
#[stable(feature = "pointer_methods", since = "1.26.0")]
- #[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+ #[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read(self) -> T
@@ -1346,7 +1346,7 @@ pub unsafe fn read_volatile(self) -> T
///
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
- #[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")]
+ #[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn read_unaligned(self) -> T
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 4c891ba..c2e9ba2 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -3478,44 +3478,13 @@ fn align_to_offsets<U>(&self) -> (usize, usize) {
// Ts = size_of::<U> / gcd(size_of::<T>, size_of::<U>)
//
// Luckily since all this is constant-evaluated... performance here matters not!
- #[inline]
- fn gcd(a: usize, b: usize) -> usize {
- use crate::intrinsics;
- // iterative stein’s algorithm
- // We should still make this `const fn` (and revert to recursive algorithm if we do)
- // because relying on llvm to consteval all this is… well, it makes me uncomfortable.
-
- // SAFETY: `a` and `b` are checked to be non-zero values.
- let (ctz_a, mut ctz_b) = unsafe {
- if a == 0 {
- return b;
- }
- if b == 0 {
- return a;
- }
- (intrinsics::cttz_nonzero(a), intrinsics::cttz_nonzero(b))
- };
- let k = ctz_a.min(ctz_b);
- let mut a = a >> ctz_a;
- let mut b = b;
- loop {
- // remove all factors of 2 from b
- b >>= ctz_b;
- if a > b {
- mem::swap(&mut a, &mut b);
- }
- b = b - a;
- // SAFETY: `b` is checked to be non-zero.
- unsafe {
- if b == 0 {
- break;
- }
- ctz_b = intrinsics::cttz_nonzero(b);
- }
- }
- a << k
+ const fn gcd(a: usize, b: usize) -> usize {
+ if b == 0 { a } else { gcd(b, a % b) }
}
- let gcd: usize = gcd(mem::size_of::<T>(), mem::size_of::<U>());
+
+ // Explicitly wrap the function call in a const block so it gets
+ // constant-evaluated even in debug mode.
+ let gcd: usize = const { gcd(mem::size_of::<T>(), mem::size_of::<U>()) };
let ts: usize = mem::size_of::<U>() / gcd;
let us: usize = mem::size_of::<T>() / gcd;
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 84859a5..3c49d17 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -18,7 +18,6 @@
#![feature(const_pointer_byte_offsets)]
#![feature(const_pointer_is_aligned)]
#![feature(const_ptr_as_ref)]
-#![feature(const_ptr_read)]
#![feature(const_ptr_write)]
#![feature(const_trait_impl)]
#![feature(const_likely)]
diff --git a/library/std/src/os/windows/io/socket.rs b/library/std/src/os/windows/io/socket.rs
index b6bd0f9..ce34cd1 100644
--- a/library/std/src/os/windows/io/socket.rs
+++ b/library/std/src/os/windows/io/socket.rs
@@ -110,7 +110,7 @@ impl BorrowedSocket<'_> {
/// object as the existing `BorrowedSocket` instance.
#[stable(feature = "io_safety", since = "1.63.0")]
pub fn try_clone_to_owned(&self) -> io::Result<OwnedSocket> {
- let mut info = unsafe { mem::zeroed::<c::WSAPROTOCOL_INFO>() };
+ let mut info = unsafe { mem::zeroed::<c::WSAPROTOCOL_INFOW>() };
let result = unsafe {
c::WSADuplicateSocketW(self.as_raw_socket(), c::GetCurrentProcessId(), &mut info)
};
diff --git a/library/std/src/personality/dwarf/eh.rs b/library/std/src/personality/dwarf/eh.rs
index 87585a8..7962470 100644
--- a/library/std/src/personality/dwarf/eh.rs
+++ b/library/std/src/personality/dwarf/eh.rs
@@ -47,6 +47,7 @@ pub enum EHAction {
None,
Cleanup(usize),
Catch(usize),
+ Filter(usize),
Terminate,
}
@@ -142,9 +143,11 @@ unsafe fn interpret_cs_action(
let ttype_index = action_reader.read_sleb128();
if ttype_index == 0 {
EHAction::Cleanup(lpad)
- } else {
+ } else if ttype_index > 0 {
// Stop unwinding Rust panics at catch_unwind.
EHAction::Catch(lpad)
+ } else {
+ EHAction::Filter(lpad)
}
}
}
diff --git a/library/std/src/personality/gcc.rs b/library/std/src/personality/gcc.rs
index 0421b47..82edb11 100644
--- a/library/std/src/personality/gcc.rs
+++ b/library/std/src/personality/gcc.rs
@@ -135,7 +135,7 @@
EHAction::None | EHAction::Cleanup(_) => {
return continue_unwind(exception_object, context);
}
- EHAction::Catch(_) => {
+ EHAction::Catch(_) | EHAction::Filter(_) => {
// EHABI requires the personality routine to update the
// SP value in the barrier cache of the exception object.
(*exception_object).private[5] =
@@ -147,7 +147,8 @@
} else {
match eh_action {
EHAction::None => return continue_unwind(exception_object, context),
- EHAction::Cleanup(lpad) | EHAction::Catch(lpad) => {
+ EHAction::Filter(_) if state & uw::_US_FORCE_UNWIND as c_int != 0 => return continue_unwind(exception_object, context),
+ EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => {
uw::_Unwind_SetGR(
context,
UNWIND_DATA_REG.0,
@@ -201,13 +202,15 @@ fn __gnu_unwind_frame(
if actions as i32 & uw::_UA_SEARCH_PHASE as i32 != 0 {
match eh_action {
EHAction::None | EHAction::Cleanup(_) => uw::_URC_CONTINUE_UNWIND,
- EHAction::Catch(_) => uw::_URC_HANDLER_FOUND,
+ EHAction::Catch(_) | EHAction::Filter(_) => uw::_URC_HANDLER_FOUND,
EHAction::Terminate => uw::_URC_FATAL_PHASE1_ERROR,
}
} else {
match eh_action {
EHAction::None => uw::_URC_CONTINUE_UNWIND,
- EHAction::Cleanup(lpad) | EHAction::Catch(lpad) => {
+ // Forced unwinding hits a terminate action.
+ EHAction::Filter(_) if actions as i32 & uw::_UA_FORCE_UNWIND as i32 != 0 => uw::_URC_CONTINUE_UNWIND,
+ EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => {
uw::_Unwind_SetGR(
context,
UNWIND_DATA_REG.0,
diff --git a/library/std/src/sys/windows/c.rs b/library/std/src/sys/windows/c.rs
index 1f4092a..2bc40c4 100644
--- a/library/std/src/sys/windows/c.rs
+++ b/library/std/src/sys/windows/c.rs
@@ -6,33 +6,18 @@
use crate::ffi::CStr;
use crate::mem;
-use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort};
-use crate::os::windows::io::{BorrowedHandle, HandleOrInvalid, HandleOrNull};
+pub use crate::os::raw::c_int;
+use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_void};
+use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
use crate::ptr;
use core::ffi::NonZero_c_ulong;
-use libc::{c_void, size_t, wchar_t};
+#[path = "c/windows_sys.rs"] // c.rs is included from two places so we need to specify this
+mod windows_sys;
+pub use windows_sys::*;
-pub use crate::os::raw::c_int;
-
-#[path = "c/errors.rs"] // c.rs is included from two places so we need to specify this
-mod errors;
-pub use errors::*;
-
-pub use self::EXCEPTION_DISPOSITION::*;
-pub use self::FILE_INFO_BY_HANDLE_CLASS::*;
-
-pub type DWORD_PTR = ULONG_PTR;
pub type DWORD = c_ulong;
pub type NonZeroDWORD = NonZero_c_ulong;
-pub type HANDLE = LPVOID;
-pub type HINSTANCE = HANDLE;
-pub type HMODULE = HINSTANCE;
-pub type HRESULT = LONG;
-pub type BOOL = c_int;
-pub type BYTE = u8;
-pub type BOOLEAN = BYTE;
-pub type GROUP = c_uint;
pub type LARGE_INTEGER = c_longlong;
pub type LONG = c_long;
pub type UINT = c_uint;
@@ -41,218 +26,40 @@
pub type SIZE_T = usize;
pub type WORD = u16;
pub type CHAR = c_char;
-pub type CCHAR = c_char;
-pub type ULONG_PTR = usize;
pub type ULONG = c_ulong;
-pub type NTSTATUS = LONG;
pub type ACCESS_MASK = DWORD;
-pub type LPBOOL = *mut BOOL;
-pub type LPBYTE = *mut BYTE;
-pub type LPCCH = *const CHAR;
-pub type LPCSTR = *const CHAR;
-pub type LPCWCH = *const WCHAR;
-pub type LPCWSTR = *const WCHAR;
pub type LPCVOID = *const c_void;
-pub type LPDWORD = *mut DWORD;
pub type LPHANDLE = *mut HANDLE;
pub type LPOVERLAPPED = *mut OVERLAPPED;
-pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
-pub type LPSTARTUPINFO = *mut STARTUPINFO;
-pub type LPSTR = *mut CHAR;
pub type LPVOID = *mut c_void;
pub type LPWCH = *mut WCHAR;
-pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW;
-pub type LPWSADATA = *mut WSADATA;
-pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
pub type LPWSTR = *mut WCHAR;
-pub type LPFILETIME = *mut FILETIME;
-pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
-pub type LPWSABUF = *mut WSABUF;
-pub type LPWSAOVERLAPPED = *mut c_void;
-pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = *mut c_void;
-pub type BCRYPT_ALG_HANDLE = LPVOID;
-pub type PCONDITION_VARIABLE = *mut CONDITION_VARIABLE;
pub type PLARGE_INTEGER = *mut c_longlong;
pub type PSRWLOCK = *mut SRWLOCK;
-pub type LPINIT_ONCE = *mut INIT_ONCE;
-pub type SOCKET = crate::os::windows::raw::SOCKET;
pub type socklen_t = c_int;
pub type ADDRESS_FAMILY = USHORT;
+pub use FD_SET as fd_set;
+pub use LINGER as linger;
+pub use TIMEVAL as timeval;
-pub const TRUE: BOOL = 1;
-pub const FALSE: BOOL = 0;
+pub type CONDITION_VARIABLE = RTL_CONDITION_VARIABLE;
+pub type SRWLOCK = RTL_SRWLOCK;
+pub type INIT_ONCE = RTL_RUN_ONCE;
-pub const CSTR_LESS_THAN: c_int = 1;
-pub const CSTR_EQUAL: c_int = 2;
-pub const CSTR_GREATER_THAN: c_int = 3;
+pub const CONDITION_VARIABLE_INIT: CONDITION_VARIABLE = CONDITION_VARIABLE { Ptr: ptr::null_mut() };
+pub const SRWLOCK_INIT: SRWLOCK = SRWLOCK { Ptr: ptr::null_mut() };
+pub const INIT_ONCE_STATIC_INIT: INIT_ONCE = INIT_ONCE { Ptr: ptr::null_mut() };
-pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x1;
-pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10;
-pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
-pub const INVALID_FILE_ATTRIBUTES: DWORD = DWORD::MAX;
-
-pub const FILE_SHARE_DELETE: DWORD = 0x4;
-pub const FILE_SHARE_READ: DWORD = 0x1;
-pub const FILE_SHARE_WRITE: DWORD = 0x2;
-
-pub const FILE_OPEN: ULONG = 0x00000001;
-pub const FILE_OPEN_REPARSE_POINT: ULONG = 0x200000;
-pub const OBJ_DONT_REPARSE: ULONG = 0x1000;
-
-pub const CREATE_ALWAYS: DWORD = 2;
-pub const CREATE_NEW: DWORD = 1;
-pub const OPEN_ALWAYS: DWORD = 4;
-pub const OPEN_EXISTING: DWORD = 3;
-pub const TRUNCATE_EXISTING: DWORD = 5;
-
-pub const FILE_LIST_DIRECTORY: DWORD = 0x1;
-pub const FILE_WRITE_DATA: DWORD = 0x00000002;
-pub const FILE_APPEND_DATA: DWORD = 0x00000004;
-pub const FILE_WRITE_EA: DWORD = 0x00000010;
-pub const FILE_WRITE_ATTRIBUTES: DWORD = 0x00000100;
-pub const DELETE: DWORD = 0x10000;
-pub const READ_CONTROL: DWORD = 0x00020000;
-pub const SYNCHRONIZE: DWORD = 0x00100000;
-pub const GENERIC_READ: DWORD = 0x80000000;
-pub const GENERIC_WRITE: DWORD = 0x40000000;
-pub const STANDARD_RIGHTS_WRITE: DWORD = READ_CONTROL;
-pub const FILE_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE
- | FILE_WRITE_DATA
- | FILE_WRITE_ATTRIBUTES
- | FILE_WRITE_EA
- | FILE_APPEND_DATA
- | SYNCHRONIZE;
-
-pub const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
-pub const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
-pub const SECURITY_SQOS_PRESENT: DWORD = 0x00100000;
-
-pub const FIONBIO: c_ulong = 0x8004667e;
-
-pub const MAX_PATH: usize = 260;
-
-pub const FILE_TYPE_PIPE: u32 = 3;
-
-pub const CP_UTF8: DWORD = 65001;
-pub const MB_ERR_INVALID_CHARS: DWORD = 0x08;
-pub const WC_ERR_INVALID_CHARS: DWORD = 0x80;
-
-#[repr(C)]
-#[derive(Copy)]
-pub struct WIN32_FIND_DATAW {
- pub dwFileAttributes: DWORD,
- pub ftCreationTime: FILETIME,
- pub ftLastAccessTime: FILETIME,
- pub ftLastWriteTime: FILETIME,
- pub nFileSizeHigh: DWORD,
- pub nFileSizeLow: DWORD,
- pub dwReserved0: DWORD,
- pub dwReserved1: DWORD,
- pub cFileName: [wchar_t; 260], // #define MAX_PATH 260
- pub cAlternateFileName: [wchar_t; 14],
-}
-impl Clone for WIN32_FIND_DATAW {
- fn clone(&self) -> Self {
- *self
- }
-}
-
-pub const WSA_FLAG_OVERLAPPED: DWORD = 0x01;
-pub const WSA_FLAG_NO_HANDLE_INHERIT: DWORD = 0x80;
-
-pub const WSADESCRIPTION_LEN: usize = 256;
-pub const WSASYS_STATUS_LEN: usize = 128;
-pub const WSAPROTOCOL_LEN: DWORD = 255;
-pub const INVALID_SOCKET: SOCKET = !0;
-
-pub const MAX_PROTOCOL_CHAIN: DWORD = 7;
-
-pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: usize = 16 * 1024;
-pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
-pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xa000000c;
-pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xa0000003;
-pub const SYMLINK_FLAG_RELATIVE: DWORD = 0x00000001;
-pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
-
-pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 0x1;
-pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: DWORD = 0x2;
-
-// Note that these are not actually HANDLEs, just values to pass to GetStdHandle
-pub const STD_INPUT_HANDLE: DWORD = -10i32 as DWORD;
-pub const STD_OUTPUT_HANDLE: DWORD = -11i32 as DWORD;
-pub const STD_ERROR_HANDLE: DWORD = -12i32 as DWORD;
-
-pub const PROGRESS_CONTINUE: DWORD = 0;
-
-pub const E_NOTIMPL: HRESULT = 0x80004001u32 as HRESULT;
-
-pub const INVALID_HANDLE_VALUE: HANDLE = ptr::invalid_mut(!0);
-
-pub const FACILITY_NT_BIT: DWORD = 0x1000_0000;
-
-pub const FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000;
-pub const FORMAT_MESSAGE_FROM_HMODULE: DWORD = 0x00000800;
-pub const FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200;
-
-pub const TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF;
-
-pub const DLL_THREAD_DETACH: DWORD = 3;
-pub const DLL_PROCESS_DETACH: DWORD = 0;
-
-pub const INFINITE: DWORD = !0;
-
-pub const DUPLICATE_SAME_ACCESS: DWORD = 0x00000002;
-
-pub const CONDITION_VARIABLE_INIT: CONDITION_VARIABLE = CONDITION_VARIABLE { ptr: ptr::null_mut() };
-pub const SRWLOCK_INIT: SRWLOCK = SRWLOCK { ptr: ptr::null_mut() };
-pub const INIT_ONCE_STATIC_INIT: INIT_ONCE = INIT_ONCE { ptr: ptr::null_mut() };
-
-pub const INIT_ONCE_INIT_FAILED: DWORD = 0x00000004;
-
-pub const DETACHED_PROCESS: DWORD = 0x00000008;
-pub const CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200;
-pub const CREATE_UNICODE_ENVIRONMENT: DWORD = 0x00000400;
-pub const STARTF_USESTDHANDLES: DWORD = 0x00000100;
-
-pub const AF_INET: c_int = 2;
-pub const AF_INET6: c_int = 23;
-pub const SD_BOTH: c_int = 2;
-pub const SD_RECEIVE: c_int = 0;
-pub const SD_SEND: c_int = 1;
-pub const SOCK_DGRAM: c_int = 2;
-pub const SOCK_STREAM: c_int = 1;
-pub const SOCKET_ERROR: c_int = -1;
-pub const SOL_SOCKET: c_int = 0xffff;
-pub const SO_LINGER: c_int = 0x0080;
-pub const SO_RCVTIMEO: c_int = 0x1006;
-pub const SO_SNDTIMEO: c_int = 0x1005;
-pub const IPPROTO_IP: c_int = 0;
-pub const IPPROTO_TCP: c_int = 6;
-pub const IPPROTO_IPV6: c_int = 41;
-pub const TCP_NODELAY: c_int = 0x0001;
-pub const IP_TTL: c_int = 4;
-pub const IPV6_V6ONLY: c_int = 27;
-pub const SO_ERROR: c_int = 0x1007;
-pub const SO_BROADCAST: c_int = 0x0020;
-pub const IP_MULTICAST_LOOP: c_int = 11;
-pub const IPV6_MULTICAST_LOOP: c_int = 11;
-pub const IP_MULTICAST_TTL: c_int = 10;
-pub const IP_ADD_MEMBERSHIP: c_int = 12;
-pub const IP_DROP_MEMBERSHIP: c_int = 13;
-pub const IPV6_ADD_MEMBERSHIP: c_int = 12;
-pub const IPV6_DROP_MEMBERSHIP: c_int = 13;
-pub const MSG_PEEK: c_int = 0x2;
-
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct linger {
- pub l_onoff: c_ushort,
- pub l_linger: c_ushort,
-}
+// Some windows_sys types have different signs than the types we use.
+pub const OBJ_DONT_REPARSE: u32 = windows_sys::OBJ_DONT_REPARSE as u32;
+pub const FRS_ERR_SYSVOL_POPULATE_TIMEOUT: u32 =
+ windows_sys::FRS_ERR_SYSVOL_POPULATE_TIMEOUT as u32;
+pub const AF_INET: c_int = windows_sys::AF_INET as c_int;
+pub const AF_INET6: c_int = windows_sys::AF_INET6 as c_int;
#[repr(C)]
pub struct ip_mreq {
@@ -266,66 +73,19 @@ pub struct ipv6_mreq {
pub ipv6mr_interface: c_uint,
}
-pub const VOLUME_NAME_DOS: DWORD = 0x0;
-pub const MOVEFILE_REPLACE_EXISTING: DWORD = 1;
-
-pub const FILE_BEGIN: DWORD = 0;
-pub const FILE_CURRENT: DWORD = 1;
-pub const FILE_END: DWORD = 2;
-
-pub const WAIT_OBJECT_0: DWORD = 0x00000000;
-pub const WAIT_TIMEOUT: DWORD = 258;
-pub const WAIT_FAILED: DWORD = 0xFFFFFFFF;
-
-pub const PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
-pub const PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
-pub const FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000;
-pub const FILE_FLAG_OVERLAPPED: DWORD = 0x40000000;
-pub const PIPE_WAIT: DWORD = 0x00000000;
-pub const PIPE_TYPE_BYTE: DWORD = 0x00000000;
-pub const PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008;
-pub const PIPE_READMODE_BYTE: DWORD = 0x00000000;
-
-pub const FD_SETSIZE: usize = 64;
-
-pub const STACK_SIZE_PARAM_IS_A_RESERVATION: DWORD = 0x00010000;
-
-pub const STATUS_SUCCESS: NTSTATUS = 0x00000000;
-pub const STATUS_DELETE_PENDING: NTSTATUS = 0xc0000056_u32 as _;
-pub const STATUS_INVALID_PARAMETER: NTSTATUS = 0xc000000d_u32 as _;
-
-pub const STATUS_PENDING: NTSTATUS = 0x103 as _;
-pub const STATUS_END_OF_FILE: NTSTATUS = 0xC0000011_u32 as _;
-
// Equivalent to the `NT_SUCCESS` C preprocessor macro.
// See: https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/using-ntstatus-values
pub fn nt_success(status: NTSTATUS) -> bool {
status >= 0
}
-pub const BCRYPT_USE_SYSTEM_PREFERRED_RNG: DWORD = 0x00000002;
-
-#[repr(C)]
-pub struct UNICODE_STRING {
- pub Length: u16,
- pub MaximumLength: u16,
- pub Buffer: *mut u16,
-}
impl UNICODE_STRING {
pub fn from_ref(slice: &[u16]) -> Self {
let len = slice.len() * mem::size_of::<u16>();
Self { Length: len as _, MaximumLength: len as _, Buffer: slice.as_ptr() as _ }
}
}
-#[repr(C)]
-pub struct OBJECT_ATTRIBUTES {
- pub Length: ULONG,
- pub RootDirectory: HANDLE,
- pub ObjectName: *const UNICODE_STRING,
- pub Attributes: ULONG,
- pub SecurityDescriptor: *mut c_void,
- pub SecurityQualityOfService: *mut c_void,
-}
+
impl Default for OBJECT_ATTRIBUTES {
fn default() -> Self {
Self {
@@ -338,193 +98,20 @@ fn default() -> Self {
}
}
}
-#[repr(C)]
-union IO_STATUS_BLOCK_union {
- Status: NTSTATUS,
- Pointer: *mut c_void,
-}
-impl Default for IO_STATUS_BLOCK_union {
- fn default() -> Self {
- let mut this = Self { Pointer: ptr::null_mut() };
- this.Status = STATUS_PENDING;
- this
- }
-}
-#[repr(C)]
-#[derive(Default)]
-pub struct IO_STATUS_BLOCK {
- u: IO_STATUS_BLOCK_union,
- pub Information: usize,
-}
+
impl IO_STATUS_BLOCK {
+ pub const PENDING: Self =
+ IO_STATUS_BLOCK { Anonymous: IO_STATUS_BLOCK_0 { Status: STATUS_PENDING }, Information: 0 };
pub fn status(&self) -> NTSTATUS {
- // SAFETY: If `self.u.Status` was set then this is obviously safe.
- // If `self.u.Pointer` was set then this is the equivalent to converting
+ // SAFETY: If `self.Anonymous.Status` was set then this is obviously safe.
+ // If `self.Anonymous.Pointer` was set then this is the equivalent to converting
// the pointer to an integer, which is also safe.
// Currently the only safe way to construct `IO_STATUS_BLOCK` outside of
// this module is to call the `default` method, which sets the `Status`.
- unsafe { self.u.Status }
+ unsafe { self.Anonymous.Status }
}
}
-pub type LPOVERLAPPED_COMPLETION_ROUTINE = unsafe extern "system" fn(
- dwErrorCode: DWORD,
- dwNumberOfBytesTransferred: DWORD,
- lpOverlapped: *mut OVERLAPPED,
-);
-
-type IO_APC_ROUTINE = unsafe extern "system" fn(
- ApcContext: *mut c_void,
- IoStatusBlock: *mut IO_STATUS_BLOCK,
- Reserved: ULONG,
-);
-
-#[repr(C)]
-#[cfg(not(target_pointer_width = "64"))]
-pub struct WSADATA {
- pub wVersion: WORD,
- pub wHighVersion: WORD,
- pub szDescription: [u8; WSADESCRIPTION_LEN + 1],
- pub szSystemStatus: [u8; WSASYS_STATUS_LEN + 1],
- pub iMaxSockets: u16,
- pub iMaxUdpDg: u16,
- pub lpVendorInfo: *mut u8,
-}
-#[repr(C)]
-#[cfg(target_pointer_width = "64")]
-pub struct WSADATA {
- pub wVersion: WORD,
- pub wHighVersion: WORD,
- pub iMaxSockets: u16,
- pub iMaxUdpDg: u16,
- pub lpVendorInfo: *mut u8,
- pub szDescription: [u8; WSADESCRIPTION_LEN + 1],
- pub szSystemStatus: [u8; WSASYS_STATUS_LEN + 1],
-}
-
-#[derive(Copy, Clone)]
-#[repr(C)]
-pub struct WSABUF {
- pub len: ULONG,
- pub buf: *mut CHAR,
-}
-
-#[repr(C)]
-pub struct WSAPROTOCOL_INFO {
- pub dwServiceFlags1: DWORD,
- pub dwServiceFlags2: DWORD,
- pub dwServiceFlags3: DWORD,
- pub dwServiceFlags4: DWORD,
- pub dwProviderFlags: DWORD,
- pub ProviderId: GUID,
- pub dwCatalogEntryId: DWORD,
- pub ProtocolChain: WSAPROTOCOLCHAIN,
- pub iVersion: c_int,
- pub iAddressFamily: c_int,
- pub iMaxSockAddr: c_int,
- pub iMinSockAddr: c_int,
- pub iSocketType: c_int,
- pub iProtocol: c_int,
- pub iProtocolMaxOffset: c_int,
- pub iNetworkByteOrder: c_int,
- pub iSecurityScheme: c_int,
- pub dwMessageSize: DWORD,
- pub dwProviderReserved: DWORD,
- pub szProtocol: [u16; (WSAPROTOCOL_LEN as usize) + 1],
-}
-
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct WIN32_FILE_ATTRIBUTE_DATA {
- pub dwFileAttributes: DWORD,
- pub ftCreationTime: FILETIME,
- pub ftLastAccessTime: FILETIME,
- pub ftLastWriteTime: FILETIME,
- pub nFileSizeHigh: DWORD,
- pub nFileSizeLow: DWORD,
-}
-
-#[repr(C)]
-#[allow(dead_code)] // we only use some variants
-pub enum FILE_INFO_BY_HANDLE_CLASS {
- FileBasicInfo = 0,
- FileStandardInfo = 1,
- FileNameInfo = 2,
- FileRenameInfo = 3,
- FileDispositionInfo = 4,
- FileAllocationInfo = 5,
- FileEndOfFileInfo = 6,
- FileStreamInfo = 7,
- FileCompressionInfo = 8,
- FileAttributeTagInfo = 9,
- FileIdBothDirectoryInfo = 10, // 0xA
- FileIdBothDirectoryRestartInfo = 11, // 0xB
- FileIoPriorityHintInfo = 12, // 0xC
- FileRemoteProtocolInfo = 13, // 0xD
- FileFullDirectoryInfo = 14, // 0xE
- FileFullDirectoryRestartInfo = 15, // 0xF
- FileStorageInfo = 16, // 0x10
- FileAlignmentInfo = 17, // 0x11
- FileIdInfo = 18, // 0x12
- FileIdExtdDirectoryInfo = 19, // 0x13
- FileIdExtdDirectoryRestartInfo = 20, // 0x14
- FileDispositionInfoEx = 21, // 0x15, Windows 10 version 1607
- MaximumFileInfoByHandlesClass,
-}
-
-#[repr(C)]
-pub struct FILE_ATTRIBUTE_TAG_INFO {
- pub FileAttributes: DWORD,
- pub ReparseTag: DWORD,
-}
-
-#[repr(C)]
-pub struct FILE_DISPOSITION_INFO {
- pub DeleteFile: BOOLEAN,
-}
-
-pub const FILE_DISPOSITION_DELETE: DWORD = 0x1;
-pub const FILE_DISPOSITION_POSIX_SEMANTICS: DWORD = 0x2;
-pub const FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE: DWORD = 0x10;
-
-#[repr(C)]
-pub struct FILE_DISPOSITION_INFO_EX {
- pub Flags: DWORD,
-}
-
-#[repr(C)]
-#[derive(Default)]
-pub struct FILE_ID_BOTH_DIR_INFO {
- pub NextEntryOffset: DWORD,
- pub FileIndex: DWORD,
- pub CreationTime: LARGE_INTEGER,
- pub LastAccessTime: LARGE_INTEGER,
- pub LastWriteTime: LARGE_INTEGER,
- pub ChangeTime: LARGE_INTEGER,
- pub EndOfFile: LARGE_INTEGER,
- pub AllocationSize: LARGE_INTEGER,
- pub FileAttributes: DWORD,
- pub FileNameLength: DWORD,
- pub EaSize: DWORD,
- pub ShortNameLength: CCHAR,
- pub ShortName: [WCHAR; 12],
- pub FileId: LARGE_INTEGER,
- pub FileName: [WCHAR; 1],
-}
-#[repr(C)]
-pub struct FILE_BASIC_INFO {
- pub CreationTime: LARGE_INTEGER,
- pub LastAccessTime: LARGE_INTEGER,
- pub LastWriteTime: LARGE_INTEGER,
- pub ChangeTime: LARGE_INTEGER,
- pub FileAttributes: DWORD,
-}
-
-#[repr(C)]
-pub struct FILE_END_OF_FILE_INFO {
- pub EndOfFile: LARGE_INTEGER,
-}
-
/// NB: Use carefully! In general using this as a reference is likely to get the
/// provenance wrong for the `rest` field!
#[repr(C)]
@@ -555,34 +142,6 @@ pub struct MOUNT_POINT_REPARSE_BUFFER {
pub PrintNameLength: c_ushort,
pub PathBuffer: WCHAR,
}
-
-pub type LPPROGRESS_ROUTINE = crate::option::Option<
- unsafe extern "system" fn(
- TotalFileSize: LARGE_INTEGER,
- TotalBytesTransferred: LARGE_INTEGER,
- StreamSize: LARGE_INTEGER,
- StreamBytesTransferred: LARGE_INTEGER,
- dwStreamNumber: DWORD,
- dwCallbackReason: DWORD,
- hSourceFile: HANDLE,
- hDestinationFile: HANDLE,
- lpData: LPVOID,
- ) -> DWORD,
->;
-
-#[repr(C)]
-pub struct CONDITION_VARIABLE {
- pub ptr: LPVOID,
-}
-#[repr(C)]
-pub struct SRWLOCK {
- pub ptr: LPVOID,
-}
-#[repr(C)]
-pub struct INIT_ONCE {
- pub ptr: LPVOID,
-}
-
#[repr(C)]
pub struct REPARSE_MOUNTPOINT_DATA_BUFFER {
pub ReparseTag: DWORD,
@@ -595,103 +154,6 @@ pub struct REPARSE_MOUNTPOINT_DATA_BUFFER {
}
#[repr(C)]
-pub struct GUID {
- pub Data1: DWORD,
- pub Data2: WORD,
- pub Data3: WORD,
- pub Data4: [BYTE; 8],
-}
-
-#[repr(C)]
-pub struct WSAPROTOCOLCHAIN {
- pub ChainLen: c_int,
- pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as usize],
-}
-
-#[repr(C)]
-pub struct SECURITY_ATTRIBUTES {
- pub nLength: DWORD,
- pub lpSecurityDescriptor: LPVOID,
- pub bInheritHandle: BOOL,
-}
-
-#[repr(C)]
-pub struct PROCESS_INFORMATION {
- pub hProcess: HANDLE,
- pub hThread: HANDLE,
- pub dwProcessId: DWORD,
- pub dwThreadId: DWORD,
-}
-
-#[repr(C)]
-pub struct STARTUPINFO {
- pub cb: DWORD,
- pub lpReserved: LPWSTR,
- pub lpDesktop: LPWSTR,
- pub lpTitle: LPWSTR,
- pub dwX: DWORD,
- pub dwY: DWORD,
- pub dwXSize: DWORD,
- pub dwYSize: DWORD,
- pub dwXCountChars: DWORD,
- pub dwYCountCharts: DWORD,
- pub dwFillAttribute: DWORD,
- pub dwFlags: DWORD,
- pub wShowWindow: WORD,
- pub cbReserved2: WORD,
- pub lpReserved2: LPBYTE,
- pub hStdInput: HANDLE,
- pub hStdOutput: HANDLE,
- pub hStdError: HANDLE,
-}
-
-#[repr(C)]
-pub struct SOCKADDR {
- pub sa_family: ADDRESS_FAMILY,
- pub sa_data: [CHAR; 14],
-}
-
-#[repr(C)]
-#[derive(Copy, Clone, Debug, Default)]
-pub struct FILETIME {
- pub dwLowDateTime: DWORD,
- pub dwHighDateTime: DWORD,
-}
-
-#[repr(C)]
-pub struct SYSTEM_INFO {
- pub wProcessorArchitecture: WORD,
- pub wReserved: WORD,
- pub dwPageSize: DWORD,
- pub lpMinimumApplicationAddress: LPVOID,
- pub lpMaximumApplicationAddress: LPVOID,
- pub dwActiveProcessorMask: DWORD_PTR,
- pub dwNumberOfProcessors: DWORD,
- pub dwProcessorType: DWORD,
- pub dwAllocationGranularity: DWORD,
- pub wProcessorLevel: WORD,
- pub wProcessorRevision: WORD,
-}
-
-#[repr(C)]
-pub struct OVERLAPPED {
- pub Internal: *mut c_ulong,
- pub InternalHigh: *mut c_ulong,
- pub Offset: DWORD,
- pub OffsetHigh: DWORD,
- pub hEvent: HANDLE,
-}
-
-#[repr(C)]
-#[allow(dead_code)] // we only use some variants
-pub enum ADDRESS_MODE {
- AddrMode1616,
- AddrMode1632,
- AddrModeReal,
- AddrModeFlat,
-}
-
-#[repr(C)]
pub struct SOCKADDR_STORAGE_LH {
pub ss_family: ADDRESS_FAMILY,
pub __ss_pad1: [CHAR; 6],
@@ -700,18 +162,6 @@ pub struct SOCKADDR_STORAGE_LH {
}
#[repr(C)]
-pub struct ADDRINFOA {
- pub ai_flags: c_int,
- pub ai_family: c_int,
- pub ai_socktype: c_int,
- pub ai_protocol: c_int,
- pub ai_addrlen: size_t,
- pub ai_canonname: *mut c_char,
- pub ai_addr: *mut SOCKADDR,
- pub ai_next: *mut ADDRINFOA,
-}
-
-#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr_in {
pub sin_family: ADDRESS_FAMILY,
@@ -742,583 +192,126 @@ pub struct in6_addr {
pub s6_addr: [u8; 16],
}
-#[repr(C)]
-#[derive(Copy, Clone)]
-#[allow(dead_code)] // we only use some variants
-pub enum EXCEPTION_DISPOSITION {
- ExceptionContinueExecution,
- ExceptionContinueSearch,
- ExceptionNestedException,
- ExceptionCollidedUnwind,
-}
-
-#[repr(C)]
-#[derive(Copy)]
-pub struct fd_set {
- pub fd_count: c_uint,
- pub fd_array: [SOCKET; FD_SETSIZE],
-}
-
-impl Clone for fd_set {
- fn clone(&self) -> fd_set {
- *self
- }
-}
-
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct timeval {
- pub tv_sec: c_long,
- pub tv_usec: c_long,
-}
-
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct CONSOLE_READCONSOLE_CONTROL {
- pub nLength: ULONG,
- pub nInitialChars: ULONG,
- pub dwCtrlWakeupMask: ULONG,
- pub dwControlKeyState: ULONG,
-}
-pub type PCONSOLE_READCONSOLE_CONTROL = *mut CONSOLE_READCONSOLE_CONTROL;
-
// Desktop specific functions & types
cfg_if::cfg_if! {
if #[cfg(not(target_vendor = "uwp"))] {
- pub const EXCEPTION_CONTINUE_SEARCH: LONG = 0;
- pub const EXCEPTION_STACK_OVERFLOW: DWORD = 0xc00000fd;
- pub const EXCEPTION_MAXIMUM_PARAMETERS: usize = 15;
-
- #[repr(C)]
- pub struct EXCEPTION_RECORD {
- pub ExceptionCode: DWORD,
- pub ExceptionFlags: DWORD,
- pub ExceptionRecord: *mut EXCEPTION_RECORD,
- pub ExceptionAddress: LPVOID,
- pub NumberParameters: DWORD,
- pub ExceptionInformation: [LPVOID; EXCEPTION_MAXIMUM_PARAMETERS],
- }
-
- pub enum CONTEXT {}
-
- #[repr(C)]
- pub struct EXCEPTION_POINTERS {
- pub ExceptionRecord: *mut EXCEPTION_RECORD,
- pub ContextRecord: *mut CONTEXT,
- }
-
- pub type PVECTORED_EXCEPTION_HANDLER =
- extern "system" fn(ExceptionInfo: *mut EXCEPTION_POINTERS) -> LONG;
-
- #[repr(C)]
- pub struct BY_HANDLE_FILE_INFORMATION {
- pub dwFileAttributes: DWORD,
- pub ftCreationTime: FILETIME,
- pub ftLastAccessTime: FILETIME,
- pub ftLastWriteTime: FILETIME,
- pub dwVolumeSerialNumber: DWORD,
- pub nFileSizeHigh: DWORD,
- pub nFileSizeLow: DWORD,
- pub nNumberOfLinks: DWORD,
- pub nFileIndexHigh: DWORD,
- pub nFileIndexLow: DWORD,
- }
-
- pub type LPBY_HANDLE_FILE_INFORMATION = *mut BY_HANDLE_FILE_INFORMATION;
-
- pub const HANDLE_FLAG_INHERIT: DWORD = 0x00000001;
-
- pub const TOKEN_READ: DWORD = 0x20008;
-
- #[link(name = "advapi32")]
- extern "system" {
- // Forbidden when targeting UWP
- #[link_name = "SystemFunction036"]
- pub fn RtlGenRandom(RandomBuffer: *mut u8, RandomBufferLength: ULONG) -> BOOLEAN;
-
- // Allowed but unused by UWP
- pub fn OpenProcessToken(
- ProcessHandle: HANDLE,
- DesiredAccess: DWORD,
- TokenHandle: *mut HANDLE,
- ) -> BOOL;
- }
-
- #[link(name = "userenv")]
- extern "system" {
- // Allowed but unused by UWP
- pub fn GetUserProfileDirectoryW(
- hToken: HANDLE,
- lpProfileDir: LPWSTR,
- lpcchSize: *mut DWORD,
- ) -> BOOL;
- }
-
- #[link(name = "kernel32")]
- extern "system" {
- // Allowed but unused by UWP
- pub fn GetFileInformationByHandle(
- hFile: HANDLE,
- lpFileInformation: LPBY_HANDLE_FILE_INFORMATION,
- ) -> BOOL;
- pub fn SetHandleInformation(hObject: HANDLE, dwMask: DWORD, dwFlags: DWORD) -> BOOL;
- pub fn AddVectoredExceptionHandler(
- FirstHandler: ULONG,
- VectoredHandler: PVECTORED_EXCEPTION_HANDLER,
- ) -> LPVOID;
- pub fn CreateHardLinkW(
- lpSymlinkFileName: LPCWSTR,
- lpTargetFileName: LPCWSTR,
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
- ) -> BOOL;
- pub fn SetThreadStackGuarantee(_size: *mut c_ulong) -> BOOL;
- pub fn GetWindowsDirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT;
- }
+ pub const EXCEPTION_CONTINUE_SEARCH: i32 = 0;
}
}
-// UWP specific functions & types
-cfg_if::cfg_if! {
-if #[cfg(target_vendor = "uwp")] {
- #[repr(C)]
- pub struct FILE_STANDARD_INFO {
- pub AllocationSize: LARGE_INTEGER,
- pub EndOfFile: LARGE_INTEGER,
- pub NumberOfLinks: DWORD,
- pub DeletePending: BOOLEAN,
- pub Directory: BOOLEAN,
- }
-}
+pub unsafe extern "system" fn WriteFileEx(
+ hFile: BorrowedHandle<'_>,
+ lpBuffer: *mut ::core::ffi::c_void,
+ nNumberOfBytesToWrite: u32,
+ lpOverlapped: *mut OVERLAPPED,
+ lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE,
+) -> BOOL {
+ windows_sys::WriteFileEx(
+ hFile.as_raw_handle(),
+ lpBuffer.cast::<u8>(),
+ nNumberOfBytesToWrite,
+ lpOverlapped,
+ lpCompletionRoutine,
+ )
}
-// Shared between Desktop & UWP
-
-#[link(name = "kernel32")]
-extern "system" {
- pub fn GetCurrentProcessId() -> DWORD;
-
- pub fn ReadConsoleW(
- hConsoleInput: HANDLE,
- lpBuffer: LPVOID,
- nNumberOfCharsToRead: DWORD,
- lpNumberOfCharsRead: LPDWORD,
- pInputControl: PCONSOLE_READCONSOLE_CONTROL,
- ) -> BOOL;
- pub fn WriteConsoleW(
- hConsoleOutput: HANDLE,
- lpBuffer: LPCVOID,
- nNumberOfCharsToWrite: DWORD,
- lpNumberOfCharsWritten: LPDWORD,
- lpReserved: LPVOID,
- ) -> BOOL;
- pub fn GetConsoleMode(hConsoleHandle: HANDLE, lpMode: LPDWORD) -> BOOL;
-
- pub fn GetSystemDirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT;
- pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
- pub fn SetFileAttributesW(lpFileName: LPCWSTR, dwFileAttributes: DWORD) -> BOOL;
- pub fn SetFileTime(
- hFile: BorrowedHandle<'_>,
- lpCreationTime: Option<&FILETIME>,
- lpLastAccessTime: Option<&FILETIME>,
- lpLastWriteTime: Option<&FILETIME>,
- ) -> BOOL;
- pub fn SetLastError(dwErrCode: DWORD);
- pub fn GetCommandLineW() -> LPWSTR;
- pub fn GetTempPathW(nBufferLength: DWORD, lpBuffer: LPCWSTR) -> DWORD;
- pub fn GetCurrentProcess() -> HANDLE;
- pub fn GetCurrentThread() -> HANDLE;
- pub fn GetStdHandle(which: DWORD) -> HANDLE;
- pub fn ExitProcess(uExitCode: c_uint) -> !;
- pub fn DeviceIoControl(
- hDevice: HANDLE,
- dwIoControlCode: DWORD,
- lpInBuffer: LPVOID,
- nInBufferSize: DWORD,
- lpOutBuffer: LPVOID,
- nOutBufferSize: DWORD,
- lpBytesReturned: LPDWORD,
- lpOverlapped: LPOVERLAPPED,
- ) -> BOOL;
- pub fn CreateThread(
- lpThreadAttributes: LPSECURITY_ATTRIBUTES,
- dwStackSize: SIZE_T,
- lpStartAddress: extern "system" fn(*mut c_void) -> DWORD,
- lpParameter: LPVOID,
- dwCreationFlags: DWORD,
- lpThreadId: LPDWORD,
- ) -> HandleOrNull;
- pub fn WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: DWORD) -> DWORD;
- pub fn SwitchToThread() -> BOOL;
- pub fn Sleep(dwMilliseconds: DWORD);
- pub fn SleepEx(dwMilliseconds: DWORD, bAlertable: BOOL) -> DWORD;
- pub fn GetProcessId(handle: HANDLE) -> DWORD;
- pub fn CopyFileExW(
- lpExistingFileName: LPCWSTR,
- lpNewFileName: LPCWSTR,
- lpProgressRoutine: LPPROGRESS_ROUTINE,
- lpData: LPVOID,
- pbCancel: LPBOOL,
- dwCopyFlags: DWORD,
- ) -> BOOL;
- pub fn FormatMessageW(
- flags: DWORD,
- lpSrc: LPVOID,
- msgId: DWORD,
- langId: DWORD,
- buf: LPWSTR,
- nsize: DWORD,
- args: *const c_void,
- ) -> DWORD;
- pub fn TlsAlloc() -> DWORD;
- pub fn TlsGetValue(dwTlsIndex: DWORD) -> LPVOID;
- pub fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
- pub fn TlsFree(dwTlsIndex: DWORD) -> BOOL;
- pub fn GetLastError() -> DWORD;
- pub fn QueryPerformanceFrequency(lpFrequency: *mut LARGE_INTEGER) -> BOOL;
- pub fn QueryPerformanceCounter(lpPerformanceCount: *mut LARGE_INTEGER) -> BOOL;
- pub fn GetExitCodeProcess(hProcess: HANDLE, lpExitCode: LPDWORD) -> BOOL;
- pub fn TerminateProcess(hProcess: HANDLE, uExitCode: UINT) -> BOOL;
- pub fn CreateProcessW(
- lpApplicationName: LPCWSTR,
- lpCommandLine: LPWSTR,
- lpProcessAttributes: LPSECURITY_ATTRIBUTES,
- lpThreadAttributes: LPSECURITY_ATTRIBUTES,
- bInheritHandles: BOOL,
- dwCreationFlags: DWORD,
- lpEnvironment: LPVOID,
- lpCurrentDirectory: LPCWSTR,
- lpStartupInfo: LPSTARTUPINFO,
- lpProcessInformation: LPPROCESS_INFORMATION,
- ) -> BOOL;
- pub fn GetEnvironmentVariableW(n: LPCWSTR, v: LPWSTR, nsize: DWORD) -> DWORD;
- pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR) -> BOOL;
- pub fn GetEnvironmentStringsW() -> LPWCH;
- pub fn FreeEnvironmentStringsW(env_ptr: LPWCH) -> BOOL;
- pub fn GetModuleFileNameW(hModule: HMODULE, lpFilename: LPWSTR, nSize: DWORD) -> DWORD;
- pub fn CreateDirectoryW(
- lpPathName: LPCWSTR,
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
- ) -> BOOL;
- pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
- pub fn GetCurrentDirectoryW(nBufferLength: DWORD, lpBuffer: LPWSTR) -> DWORD;
- pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
- pub fn DuplicateHandle(
- hSourceProcessHandle: HANDLE,
- hSourceHandle: HANDLE,
- hTargetProcessHandle: HANDLE,
- lpTargetHandle: LPHANDLE,
- dwDesiredAccess: DWORD,
- bInheritHandle: BOOL,
- dwOptions: DWORD,
- ) -> BOOL;
- pub fn ReadFile(
- hFile: BorrowedHandle<'_>,
- lpBuffer: LPVOID,
- nNumberOfBytesToRead: DWORD,
- lpNumberOfBytesRead: LPDWORD,
- lpOverlapped: LPOVERLAPPED,
- ) -> BOOL;
- pub fn ReadFileEx(
- hFile: BorrowedHandle<'_>,
- lpBuffer: LPVOID,
- nNumberOfBytesToRead: DWORD,
- lpOverlapped: LPOVERLAPPED,
- lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE,
- ) -> BOOL;
- pub fn WriteFileEx(
- hFile: BorrowedHandle<'_>,
- lpBuffer: LPVOID,
- nNumberOfBytesToWrite: DWORD,
- lpOverlapped: LPOVERLAPPED,
- lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE,
- ) -> BOOL;
- pub fn CloseHandle(hObject: HANDLE) -> BOOL;
- pub fn MoveFileExW(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR, dwFlags: DWORD)
- -> BOOL;
- pub fn SetFilePointerEx(
- hFile: HANDLE,
- liDistanceToMove: LARGE_INTEGER,
- lpNewFilePointer: PLARGE_INTEGER,
- dwMoveMethod: DWORD,
- ) -> BOOL;
- pub fn FlushFileBuffers(hFile: HANDLE) -> BOOL;
- pub fn CreateFileW(
- lpFileName: LPCWSTR,
- dwDesiredAccess: DWORD,
- dwShareMode: DWORD,
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
- dwCreationDisposition: DWORD,
- dwFlagsAndAttributes: DWORD,
- hTemplateFile: HANDLE,
- ) -> HandleOrInvalid;
-
- pub fn FindFirstFileW(fileName: LPCWSTR, findFileData: LPWIN32_FIND_DATAW) -> HANDLE;
- pub fn FindNextFileW(findFile: HANDLE, findFileData: LPWIN32_FIND_DATAW) -> BOOL;
- pub fn FindClose(findFile: HANDLE) -> BOOL;
-
- pub fn GetProcAddress(handle: HMODULE, name: LPCSTR) -> *mut c_void;
- pub fn GetModuleHandleA(lpModuleName: LPCSTR) -> HMODULE;
- pub fn GetModuleHandleW(lpModuleName: LPCWSTR) -> HMODULE;
-
- pub fn GetSystemTimeAsFileTime(lpSystemTimeAsFileTime: LPFILETIME);
- pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
-
- pub fn CreateEventW(
- lpEventAttributes: LPSECURITY_ATTRIBUTES,
- bManualReset: BOOL,
- bInitialState: BOOL,
- lpName: LPCWSTR,
- ) -> HANDLE;
- pub fn WaitForMultipleObjects(
- nCount: DWORD,
- lpHandles: *const HANDLE,
- bWaitAll: BOOL,
- dwMilliseconds: DWORD,
- ) -> DWORD;
- pub fn CreateNamedPipeW(
- lpName: LPCWSTR,
- dwOpenMode: DWORD,
- dwPipeMode: DWORD,
- nMaxInstances: DWORD,
- nOutBufferSize: DWORD,
- nInBufferSize: DWORD,
- nDefaultTimeOut: DWORD,
- lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
- ) -> HANDLE;
- pub fn CancelIo(handle: HANDLE) -> BOOL;
- pub fn GetOverlappedResult(
- hFile: HANDLE,
- lpOverlapped: LPOVERLAPPED,
- lpNumberOfBytesTransferred: LPDWORD,
- bWait: BOOL,
- ) -> BOOL;
- pub fn CreateSymbolicLinkW(
- lpSymlinkFileName: LPCWSTR,
- lpTargetFileName: LPCWSTR,
- dwFlags: DWORD,
- ) -> BOOLEAN;
- pub fn GetFinalPathNameByHandleW(
- hFile: HANDLE,
- lpszFilePath: LPCWSTR,
- cchFilePath: DWORD,
- dwFlags: DWORD,
- ) -> DWORD;
- pub fn GetFileInformationByHandleEx(
- hFile: HANDLE,
- fileInfoClass: FILE_INFO_BY_HANDLE_CLASS,
- lpFileInformation: LPVOID,
- dwBufferSize: DWORD,
- ) -> BOOL;
- pub fn SetFileInformationByHandle(
- hFile: HANDLE,
- FileInformationClass: FILE_INFO_BY_HANDLE_CLASS,
- lpFileInformation: LPVOID,
- dwBufferSize: DWORD,
- ) -> BOOL;
- pub fn GetFileType(hfile: HANDLE) -> DWORD;
- pub fn SleepConditionVariableSRW(
- ConditionVariable: PCONDITION_VARIABLE,
- SRWLock: PSRWLOCK,
- dwMilliseconds: DWORD,
- Flags: ULONG,
- ) -> BOOL;
-
- pub fn WakeConditionVariable(ConditionVariable: PCONDITION_VARIABLE);
- pub fn WakeAllConditionVariable(ConditionVariable: PCONDITION_VARIABLE);
-
- pub fn AcquireSRWLockExclusive(SRWLock: PSRWLOCK);
- pub fn AcquireSRWLockShared(SRWLock: PSRWLOCK);
- pub fn ReleaseSRWLockExclusive(SRWLock: PSRWLOCK);
- pub fn ReleaseSRWLockShared(SRWLock: PSRWLOCK);
- pub fn TryAcquireSRWLockExclusive(SRWLock: PSRWLOCK) -> BOOLEAN;
- pub fn TryAcquireSRWLockShared(SRWLock: PSRWLOCK) -> BOOLEAN;
-
- pub fn InitOnceBeginInitialize(
- lpInitOnce: LPINIT_ONCE,
- dwFlags: DWORD,
- fPending: LPBOOL,
- lpContext: *mut LPVOID,
- ) -> BOOL;
- pub fn InitOnceComplete(lpInitOnce: LPINIT_ONCE, dwFlags: DWORD, lpContext: LPVOID) -> BOOL;
-
- pub fn CompareStringOrdinal(
- lpString1: LPCWSTR,
- cchCount1: c_int,
- lpString2: LPCWSTR,
- cchCount2: c_int,
- bIgnoreCase: BOOL,
- ) -> c_int;
- pub fn GetFullPathNameW(
- lpFileName: LPCWSTR,
- nBufferLength: DWORD,
- lpBuffer: LPWSTR,
- lpFilePart: *mut LPWSTR,
- ) -> DWORD;
- pub fn GetFileAttributesW(lpFileName: LPCWSTR) -> DWORD;
-
- pub fn MultiByteToWideChar(
- CodePage: UINT,
- dwFlags: DWORD,
- lpMultiByteStr: LPCCH,
- cbMultiByte: c_int,
- lpWideCharStr: LPWSTR,
- cchWideChar: c_int,
- ) -> c_int;
- pub fn WideCharToMultiByte(
- CodePage: UINT,
- dwFlags: DWORD,
- lpWideCharStr: LPCWCH,
- cchWideChar: c_int,
- lpMultiByteStr: LPSTR,
- cbMultiByte: c_int,
- lpDefaultChar: LPCCH,
- lpUsedDefaultChar: LPBOOL,
- ) -> c_int;
+pub unsafe extern "system" fn ReadFileEx(
+ hFile: BorrowedHandle<'_>,
+ lpBuffer: *mut ::core::ffi::c_void,
+ nNumberOfBytesToRead: u32,
+ lpOverlapped: *mut OVERLAPPED,
+ lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE,
+) -> BOOL {
+ windows_sys::ReadFileEx(
+ hFile.as_raw_handle(),
+ lpBuffer,
+ nNumberOfBytesToRead,
+ lpOverlapped,
+ lpCompletionRoutine,
+ )
}
-#[link(name = "ws2_32")]
-extern "system" {
- pub fn WSAStartup(wVersionRequested: WORD, lpWSAData: LPWSADATA) -> c_int;
- pub fn WSACleanup() -> c_int;
- pub fn WSAGetLastError() -> c_int;
- pub fn WSADuplicateSocketW(
- s: SOCKET,
- dwProcessId: DWORD,
- lpProtocolInfo: LPWSAPROTOCOL_INFO,
- ) -> c_int;
- pub fn WSASend(
- s: SOCKET,
- lpBuffers: LPWSABUF,
- dwBufferCount: DWORD,
- lpNumberOfBytesSent: LPDWORD,
- dwFlags: DWORD,
- lpOverlapped: LPWSAOVERLAPPED,
- lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
- ) -> c_int;
- pub fn WSARecv(
- s: SOCKET,
- lpBuffers: LPWSABUF,
- dwBufferCount: DWORD,
- lpNumberOfBytesRecvd: LPDWORD,
- lpFlags: LPDWORD,
- lpOverlapped: LPWSAOVERLAPPED,
- lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
- ) -> c_int;
- pub fn WSASocketW(
- af: c_int,
- kind: c_int,
- protocol: c_int,
- lpProtocolInfo: LPWSAPROTOCOL_INFO,
- g: GROUP,
- dwFlags: DWORD,
- ) -> SOCKET;
- pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut c_ulong) -> c_int;
- pub fn closesocket(socket: SOCKET) -> c_int;
- pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int, flags: c_int) -> c_int;
- pub fn send(socket: SOCKET, buf: *const c_void, len: c_int, flags: c_int) -> c_int;
- pub fn recvfrom(
- socket: SOCKET,
- buf: *mut c_void,
- len: c_int,
- flags: c_int,
- addr: *mut SOCKADDR,
- addrlen: *mut c_int,
- ) -> c_int;
- pub fn sendto(
- socket: SOCKET,
- buf: *const c_void,
- len: c_int,
- flags: c_int,
- addr: *const SOCKADDR,
- addrlen: c_int,
- ) -> c_int;
- pub fn shutdown(socket: SOCKET, how: c_int) -> c_int;
- pub fn accept(socket: SOCKET, address: *mut SOCKADDR, address_len: *mut c_int) -> SOCKET;
- pub fn getsockopt(
- s: SOCKET,
- level: c_int,
- optname: c_int,
- optval: *mut c_char,
- optlen: *mut c_int,
- ) -> c_int;
- pub fn setsockopt(
- s: SOCKET,
- level: c_int,
- optname: c_int,
- optval: *const c_void,
- optlen: c_int,
- ) -> c_int;
- pub fn getsockname(socket: SOCKET, address: *mut SOCKADDR, address_len: *mut c_int) -> c_int;
- pub fn getpeername(socket: SOCKET, address: *mut SOCKADDR, address_len: *mut c_int) -> c_int;
- pub fn bind(socket: SOCKET, address: *const SOCKADDR, address_len: socklen_t) -> c_int;
- pub fn listen(socket: SOCKET, backlog: c_int) -> c_int;
- pub fn connect(socket: SOCKET, address: *const SOCKADDR, len: c_int) -> c_int;
- pub fn getaddrinfo(
- node: *const c_char,
- service: *const c_char,
- hints: *const ADDRINFOA,
- res: *mut *mut ADDRINFOA,
- ) -> c_int;
- pub fn freeaddrinfo(res: *mut ADDRINFOA);
- pub fn select(
- nfds: c_int,
- readfds: *mut fd_set,
- writefds: *mut fd_set,
- exceptfds: *mut fd_set,
- timeout: *const timeval,
- ) -> c_int;
+// POSIX compatibility shims.
+pub unsafe fn recv(socket: SOCKET, buf: *mut c_void, len: c_int, flags: c_int) -> c_int {
+ windows_sys::recv(socket, buf.cast::<u8>(), len, flags)
+}
+pub unsafe fn send(socket: SOCKET, buf: *const c_void, len: c_int, flags: c_int) -> c_int {
+ windows_sys::send(socket, buf.cast::<u8>(), len, flags)
+}
+pub unsafe fn recvfrom(
+ socket: SOCKET,
+ buf: *mut c_void,
+ len: c_int,
+ flags: c_int,
+ addr: *mut SOCKADDR,
+ addrlen: *mut c_int,
+) -> c_int {
+ windows_sys::recvfrom(socket, buf.cast::<u8>(), len, flags, addr, addrlen)
+}
+pub unsafe fn sendto(
+ socket: SOCKET,
+ buf: *const c_void,
+ len: c_int,
+ flags: c_int,
+ addr: *const SOCKADDR,
+ addrlen: c_int,
+) -> c_int {
+ windows_sys::sendto(socket, buf.cast::<u8>(), len, flags, addr, addrlen)
+}
+pub unsafe fn getaddrinfo(
+ node: *const c_char,
+ service: *const c_char,
+ hints: *const ADDRINFOA,
+ res: *mut *mut ADDRINFOA,
+) -> c_int {
+ windows_sys::getaddrinfo(node.cast::<u8>(), service.cast::<u8>(), hints, res)
}
-#[link(name = "bcrypt")]
-extern "system" {
- // >= Vista / Server 2008
- // https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
- pub fn BCryptGenRandom(
- hAlgorithm: BCRYPT_ALG_HANDLE,
- pBuffer: *mut u8,
- cbBuffer: ULONG,
- dwFlags: ULONG,
- ) -> NTSTATUS;
+pub unsafe fn NtReadFile(
+ filehandle: BorrowedHandle<'_>,
+ event: HANDLE,
+ apcroutine: PIO_APC_ROUTINE,
+ apccontext: *mut c_void,
+ iostatusblock: &mut IO_STATUS_BLOCK,
+ buffer: *mut crate::mem::MaybeUninit<u8>,
+ length: ULONG,
+ byteoffset: Option<&LARGE_INTEGER>,
+ key: Option<&ULONG>,
+) -> NTSTATUS {
+ windows_sys::NtReadFile(
+ filehandle.as_raw_handle(),
+ event,
+ apcroutine,
+ apccontext,
+ iostatusblock,
+ buffer.cast::<c_void>(),
+ length,
+ byteoffset.map(|o| o as *const i64).unwrap_or(ptr::null()),
+ key.map(|k| k as *const u32).unwrap_or(ptr::null()),
+ )
}
-
-#[link(name = "ntdll")]
-extern "system" {
- pub fn NtCreateFile(
- FileHandle: *mut HANDLE,
- DesiredAccess: ACCESS_MASK,
- ObjectAttributes: *const OBJECT_ATTRIBUTES,
- IoStatusBlock: *mut IO_STATUS_BLOCK,
- AllocationSize: *mut i64,
- FileAttributes: ULONG,
- ShareAccess: ULONG,
- CreateDisposition: ULONG,
- CreateOptions: ULONG,
- EaBuffer: *mut c_void,
- EaLength: ULONG,
- ) -> NTSTATUS;
- pub fn NtReadFile(
- FileHandle: BorrowedHandle<'_>,
- Event: HANDLE,
- ApcRoutine: Option<IO_APC_ROUTINE>,
- ApcContext: *mut c_void,
- IoStatusBlock: &mut IO_STATUS_BLOCK,
- Buffer: *mut crate::mem::MaybeUninit<u8>,
- Length: ULONG,
- ByteOffset: Option<&LARGE_INTEGER>,
- Key: Option<&ULONG>,
- ) -> NTSTATUS;
- pub fn NtWriteFile(
- FileHandle: BorrowedHandle<'_>,
- Event: HANDLE,
- ApcRoutine: Option<IO_APC_ROUTINE>,
- ApcContext: *mut c_void,
- IoStatusBlock: &mut IO_STATUS_BLOCK,
- Buffer: *const u8,
- Length: ULONG,
- ByteOffset: Option<&LARGE_INTEGER>,
- Key: Option<&ULONG>,
- ) -> NTSTATUS;
- pub fn RtlNtStatusToDosError(Status: NTSTATUS) -> ULONG;
+pub unsafe fn NtWriteFile(
+ filehandle: BorrowedHandle<'_>,
+ event: HANDLE,
+ apcroutine: PIO_APC_ROUTINE,
+ apccontext: *mut c_void,
+ iostatusblock: &mut IO_STATUS_BLOCK,
+ buffer: *const u8,
+ length: ULONG,
+ byteoffset: Option<&LARGE_INTEGER>,
+ key: Option<&ULONG>,
+) -> NTSTATUS {
+ windows_sys::NtWriteFile(
+ filehandle.as_raw_handle(),
+ event,
+ apcroutine,
+ apccontext,
+ iostatusblock,
+ buffer.cast::<c_void>(),
+ length,
+ byteoffset.map(|o| o as *const i64).unwrap_or(ptr::null()),
+ key.map(|k| k as *const u32).unwrap_or(ptr::null()),
+ )
}
// Functions that aren't available on every version of Windows that we support,
@@ -1328,34 +321,32 @@ pub fn NtWriteFile(
// >= Win10 1607
// https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreaddescription
- pub fn SetThreadDescription(hThread: HANDLE,
- lpThreadDescription: LPCWSTR) -> HRESULT {
+ pub fn SetThreadDescription(hthread: HANDLE, lpthreaddescription: PCWSTR) -> HRESULT {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED as DWORD); E_NOTIMPL
}
// >= Win8 / Server 2012
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime
- pub fn GetSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime: LPFILETIME)
- -> () {
- GetSystemTimeAsFileTime(lpSystemTimeAsFileTime)
+ pub fn GetSystemTimePreciseAsFileTime(lpsystemtimeasfiletime: *mut FILETIME) -> () {
+ GetSystemTimeAsFileTime(lpsystemtimeasfiletime)
}
// >= Win11 / Server 2022
// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppath2a
- pub fn GetTempPath2W(nBufferLength: DWORD, lpBuffer: LPCWSTR) -> DWORD {
- GetTempPathW(nBufferLength, lpBuffer)
+ pub fn GetTempPath2W(bufferlength: u32, buffer: PWSTR) -> u32 {
+ GetTempPathW(bufferlength, buffer)
}
}
compat_fn_optional! {
crate::sys::compat::load_synch_functions();
pub fn WaitOnAddress(
- Address: LPVOID,
- CompareAddress: LPVOID,
- AddressSize: SIZE_T,
- dwMilliseconds: DWORD
- );
- pub fn WakeByAddressSingle(Address: LPVOID);
+ address: *const ::core::ffi::c_void,
+ compareaddress: *const ::core::ffi::c_void,
+ addresssize: usize,
+ dwmilliseconds: u32
+ ) -> BOOL;
+ pub fn WakeByAddressSingle(address: *const ::core::ffi::c_void);
}
compat_fn_with_fallback! {
diff --git a/library/std/src/sys/windows/c/errors.rs b/library/std/src/sys/windows/c/errors.rs
deleted file mode 100644
index ad8da19..0000000
--- a/library/std/src/sys/windows/c/errors.rs
+++ /dev/null
@@ -1,1883 +0,0 @@
-// List of Windows system error codes with descriptions:
-// https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes#system-error-codes
-
-#![allow(dead_code)]
-
-use super::{c_int, DWORD};
-
-pub const ERROR_DIRECTORY_NOT_SUPPORTED: DWORD = 336;
-pub const ERROR_DRIVER_CANCEL_TIMEOUT: DWORD = 594;
-pub const ERROR_DISK_QUOTA_EXCEEDED: DWORD = 1295;
-pub const ERROR_RESOURCE_CALL_TIMED_OUT: DWORD = 5910;
-pub const FRS_ERR_SYSVOL_POPULATE_TIMEOUT: DWORD = 8014;
-pub const DNS_ERROR_RECORD_TIMED_OUT: DWORD = 9705;
-
-// The following list was obtained from
-// `/usr/x86_64-w64-mingw32/include/winerror.h`
-// in the Debian package
-// mingw-w64_6.0.0-3_all.deb
-//
-// The header of that file says:
-// * This file has no copyright assigned and is placed in the Public Domain.
-// * This file is part of the mingw-w64 runtime package.
-// * No warranty is given; refer to the file DISCLAIMER.PD within this package.
-//
-// The text here is the result of the following rune:
-// grep -P '#define ERROR' /usr/x86_64-w64-mingw32/include/winerror.h >>library/std/src/sys/windows/c/errors.rs
-// grep -P '#define WSA' /usr/x86_64-w64-mingw32/include/winerror.h >>library/std/src/sys/windows/c/errors.rs
-// and then using some manually-invented but rather obvious editor search-and-replace
-// invocations, plus some straightforward manual fixups, to turn it into Rust syntax
-// and remove all the duplicates from the manual table above.
-
-pub const ERROR_SUCCESS: DWORD = 0;
-pub const ERROR_INVALID_FUNCTION: DWORD = 1;
-pub const ERROR_FILE_NOT_FOUND: DWORD = 2;
-pub const ERROR_PATH_NOT_FOUND: DWORD = 3;
-pub const ERROR_TOO_MANY_OPEN_FILES: DWORD = 4;
-pub const ERROR_ACCESS_DENIED: DWORD = 5;
-pub const ERROR_INVALID_HANDLE: DWORD = 6;
-pub const ERROR_ARENA_TRASHED: DWORD = 7;
-pub const ERROR_NOT_ENOUGH_MEMORY: DWORD = 8;
-pub const ERROR_INVALID_BLOCK: DWORD = 9;
-pub const ERROR_BAD_ENVIRONMENT: DWORD = 10;
-pub const ERROR_BAD_FORMAT: DWORD = 11;
-pub const ERROR_INVALID_ACCESS: DWORD = 12;
-pub const ERROR_INVALID_DATA: DWORD = 13;
-pub const ERROR_OUTOFMEMORY: DWORD = 14;
-pub const ERROR_INVALID_DRIVE: DWORD = 15;
-pub const ERROR_CURRENT_DIRECTORY: DWORD = 16;
-pub const ERROR_NOT_SAME_DEVICE: DWORD = 17;
-pub const ERROR_NO_MORE_FILES: DWORD = 18;
-pub const ERROR_WRITE_PROTECT: DWORD = 19;
-pub const ERROR_BAD_UNIT: DWORD = 20;
-pub const ERROR_NOT_READY: DWORD = 21;
-pub const ERROR_BAD_COMMAND: DWORD = 22;
-pub const ERROR_CRC: DWORD = 23;
-pub const ERROR_BAD_LENGTH: DWORD = 24;
-pub const ERROR_SEEK: DWORD = 25;
-pub const ERROR_NOT_DOS_DISK: DWORD = 26;
-pub const ERROR_SECTOR_NOT_FOUND: DWORD = 27;
-pub const ERROR_OUT_OF_PAPER: DWORD = 28;
-pub const ERROR_WRITE_FAULT: DWORD = 29;
-pub const ERROR_READ_FAULT: DWORD = 30;
-pub const ERROR_GEN_FAILURE: DWORD = 31;
-pub const ERROR_SHARING_VIOLATION: DWORD = 32;
-pub const ERROR_LOCK_VIOLATION: DWORD = 33;
-pub const ERROR_WRONG_DISK: DWORD = 34;
-pub const ERROR_SHARING_BUFFER_EXCEEDED: DWORD = 36;
-pub const ERROR_HANDLE_EOF: DWORD = 38;
-pub const ERROR_HANDLE_DISK_FULL: DWORD = 39;
-pub const ERROR_NOT_SUPPORTED: DWORD = 50;
-pub const ERROR_REM_NOT_LIST: DWORD = 51;
-pub const ERROR_DUP_NAME: DWORD = 52;
-pub const ERROR_BAD_NETPATH: DWORD = 53;
-pub const ERROR_NETWORK_BUSY: DWORD = 54;
-pub const ERROR_DEV_NOT_EXIST: DWORD = 55;
-pub const ERROR_TOO_MANY_CMDS: DWORD = 56;
-pub const ERROR_ADAP_HDW_ERR: DWORD = 57;
-pub const ERROR_BAD_NET_RESP: DWORD = 58;
-pub const ERROR_UNEXP_NET_ERR: DWORD = 59;
-pub const ERROR_BAD_REM_ADAP: DWORD = 60;
-pub const ERROR_PRINTQ_FULL: DWORD = 61;
-pub const ERROR_NO_SPOOL_SPACE: DWORD = 62;
-pub const ERROR_PRINT_CANCELLED: DWORD = 63;
-pub const ERROR_NETNAME_DELETED: DWORD = 64;
-pub const ERROR_NETWORK_ACCESS_DENIED: DWORD = 65;
-pub const ERROR_BAD_DEV_TYPE: DWORD = 66;
-pub const ERROR_BAD_NET_NAME: DWORD = 67;
-pub const ERROR_TOO_MANY_NAMES: DWORD = 68;
-pub const ERROR_TOO_MANY_SESS: DWORD = 69;
-pub const ERROR_SHARING_PAUSED: DWORD = 70;
-pub const ERROR_REQ_NOT_ACCEP: DWORD = 71;
-pub const ERROR_REDIR_PAUSED: DWORD = 72;
-pub const ERROR_FILE_EXISTS: DWORD = 80;
-pub const ERROR_CANNOT_MAKE: DWORD = 82;
-pub const ERROR_FAIL_I24: DWORD = 83;
-pub const ERROR_OUT_OF_STRUCTURES: DWORD = 84;
-pub const ERROR_ALREADY_ASSIGNED: DWORD = 85;
-pub const ERROR_INVALID_PASSWORD: DWORD = 86;
-pub const ERROR_INVALID_PARAMETER: DWORD = 87;
-pub const ERROR_NET_WRITE_FAULT: DWORD = 88;
-pub const ERROR_NO_PROC_SLOTS: DWORD = 89;
-pub const ERROR_TOO_MANY_SEMAPHORES: DWORD = 100;
-pub const ERROR_EXCL_SEM_ALREADY_OWNED: DWORD = 101;
-pub const ERROR_SEM_IS_SET: DWORD = 102;
-pub const ERROR_TOO_MANY_SEM_REQUESTS: DWORD = 103;
-pub const ERROR_INVALID_AT_INTERRUPT_TIME: DWORD = 104;
-pub const ERROR_SEM_OWNER_DIED: DWORD = 105;
-pub const ERROR_SEM_USER_LIMIT: DWORD = 106;
-pub const ERROR_DISK_CHANGE: DWORD = 107;
-pub const ERROR_DRIVE_LOCKED: DWORD = 108;
-pub const ERROR_BROKEN_PIPE: DWORD = 109;
-pub const ERROR_OPEN_FAILED: DWORD = 110;
-pub const ERROR_BUFFER_OVERFLOW: DWORD = 111;
-pub const ERROR_DISK_FULL: DWORD = 112;
-pub const ERROR_NO_MORE_SEARCH_HANDLES: DWORD = 113;
-pub const ERROR_INVALID_TARGET_HANDLE: DWORD = 114;
-pub const ERROR_INVALID_CATEGORY: DWORD = 117;
-pub const ERROR_INVALID_VERIFY_SWITCH: DWORD = 118;
-pub const ERROR_BAD_DRIVER_LEVEL: DWORD = 119;
-pub const ERROR_CALL_NOT_IMPLEMENTED: DWORD = 120;
-pub const ERROR_SEM_TIMEOUT: DWORD = 121;
-pub const ERROR_INSUFFICIENT_BUFFER: DWORD = 122;
-pub const ERROR_INVALID_NAME: DWORD = 123;
-pub const ERROR_INVALID_LEVEL: DWORD = 124;
-pub const ERROR_NO_VOLUME_LABEL: DWORD = 125;
-pub const ERROR_MOD_NOT_FOUND: DWORD = 126;
-pub const ERROR_PROC_NOT_FOUND: DWORD = 127;
-pub const ERROR_WAIT_NO_CHILDREN: DWORD = 128;
-pub const ERROR_CHILD_NOT_COMPLETE: DWORD = 129;
-pub const ERROR_DIRECT_ACCESS_HANDLE: DWORD = 130;
-pub const ERROR_NEGATIVE_SEEK: DWORD = 131;
-pub const ERROR_SEEK_ON_DEVICE: DWORD = 132;
-pub const ERROR_IS_JOIN_TARGET: DWORD = 133;
-pub const ERROR_IS_JOINED: DWORD = 134;
-pub const ERROR_IS_SUBSTED: DWORD = 135;
-pub const ERROR_NOT_JOINED: DWORD = 136;
-pub const ERROR_NOT_SUBSTED: DWORD = 137;
-pub const ERROR_JOIN_TO_JOIN: DWORD = 138;
-pub const ERROR_SUBST_TO_SUBST: DWORD = 139;
-pub const ERROR_JOIN_TO_SUBST: DWORD = 140;
-pub const ERROR_SUBST_TO_JOIN: DWORD = 141;
-pub const ERROR_BUSY_DRIVE: DWORD = 142;
-pub const ERROR_SAME_DRIVE: DWORD = 143;
-pub const ERROR_DIR_NOT_ROOT: DWORD = 144;
-pub const ERROR_DIR_NOT_EMPTY: DWORD = 145;
-pub const ERROR_IS_SUBST_PATH: DWORD = 146;
-pub const ERROR_IS_JOIN_PATH: DWORD = 147;
-pub const ERROR_PATH_BUSY: DWORD = 148;
-pub const ERROR_IS_SUBST_TARGET: DWORD = 149;
-pub const ERROR_SYSTEM_TRACE: DWORD = 150;
-pub const ERROR_INVALID_EVENT_COUNT: DWORD = 151;
-pub const ERROR_TOO_MANY_MUXWAITERS: DWORD = 152;
-pub const ERROR_INVALID_LIST_FORMAT: DWORD = 153;
-pub const ERROR_LABEL_TOO_LONG: DWORD = 154;
-pub const ERROR_TOO_MANY_TCBS: DWORD = 155;
-pub const ERROR_SIGNAL_REFUSED: DWORD = 156;
-pub const ERROR_DISCARDED: DWORD = 157;
-pub const ERROR_NOT_LOCKED: DWORD = 158;
-pub const ERROR_BAD_THREADID_ADDR: DWORD = 159;
-pub const ERROR_BAD_ARGUMENTS: DWORD = 160;
-pub const ERROR_BAD_PATHNAME: DWORD = 161;
-pub const ERROR_SIGNAL_PENDING: DWORD = 162;
-pub const ERROR_MAX_THRDS_REACHED: DWORD = 164;
-pub const ERROR_LOCK_FAILED: DWORD = 167;
-pub const ERROR_BUSY: DWORD = 170;
-pub const ERROR_CANCEL_VIOLATION: DWORD = 173;
-pub const ERROR_ATOMIC_LOCKS_NOT_SUPPORTED: DWORD = 174;
-pub const ERROR_INVALID_SEGMENT_NUMBER: DWORD = 180;
-pub const ERROR_INVALID_ORDINAL: DWORD = 182;
-pub const ERROR_ALREADY_EXISTS: DWORD = 183;
-pub const ERROR_INVALID_FLAG_NUMBER: DWORD = 186;
-pub const ERROR_SEM_NOT_FOUND: DWORD = 187;
-pub const ERROR_INVALID_STARTING_CODESEG: DWORD = 188;
-pub const ERROR_INVALID_STACKSEG: DWORD = 189;
-pub const ERROR_INVALID_MODULETYPE: DWORD = 190;
-pub const ERROR_INVALID_EXE_SIGNATURE: DWORD = 191;
-pub const ERROR_EXE_MARKED_INVALID: DWORD = 192;
-pub const ERROR_BAD_EXE_FORMAT: DWORD = 193;
-pub const ERROR_ITERATED_DATA_EXCEEDS_64k: DWORD = 194;
-pub const ERROR_INVALID_MINALLOCSIZE: DWORD = 195;
-pub const ERROR_DYNLINK_FROM_INVALID_RING: DWORD = 196;
-pub const ERROR_IOPL_NOT_ENABLED: DWORD = 197;
-pub const ERROR_INVALID_SEGDPL: DWORD = 198;
-pub const ERROR_AUTODATASEG_EXCEEDS_64k: DWORD = 199;
-pub const ERROR_RING2SEG_MUST_BE_MOVABLE: DWORD = 200;
-pub const ERROR_RELOC_CHAIN_XEEDS_SEGLIM: DWORD = 201;
-pub const ERROR_INFLOOP_IN_RELOC_CHAIN: DWORD = 202;
-pub const ERROR_ENVVAR_NOT_FOUND: DWORD = 203;
-pub const ERROR_NO_SIGNAL_SENT: DWORD = 205;
-pub const ERROR_FILENAME_EXCED_RANGE: DWORD = 206;
-pub const ERROR_RING2_STACK_IN_USE: DWORD = 207;
-pub const ERROR_META_EXPANSION_TOO_LONG: DWORD = 208;
-pub const ERROR_INVALID_SIGNAL_NUMBER: DWORD = 209;
-pub const ERROR_THREAD_1_INACTIVE: DWORD = 210;
-pub const ERROR_LOCKED: DWORD = 212;
-pub const ERROR_TOO_MANY_MODULES: DWORD = 214;
-pub const ERROR_NESTING_NOT_ALLOWED: DWORD = 215;
-pub const ERROR_EXE_MACHINE_TYPE_MISMATCH: DWORD = 216;
-pub const ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY: DWORD = 217;
-pub const ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY: DWORD = 218;
-pub const ERROR_FILE_CHECKED_OUT: DWORD = 220;
-pub const ERROR_CHECKOUT_REQUIRED: DWORD = 221;
-pub const ERROR_BAD_FILE_TYPE: DWORD = 222;
-pub const ERROR_FILE_TOO_LARGE: DWORD = 223;
-pub const ERROR_FORMS_AUTH_REQUIRED: DWORD = 224;
-pub const ERROR_PIPE_LOCAL: DWORD = 229;
-pub const ERROR_BAD_PIPE: DWORD = 230;
-pub const ERROR_PIPE_BUSY: DWORD = 231;
-pub const ERROR_NO_DATA: DWORD = 232;
-pub const ERROR_PIPE_NOT_CONNECTED: DWORD = 233;
-pub const ERROR_MORE_DATA: DWORD = 234;
-pub const ERROR_VC_DISCONNECTED: DWORD = 240;
-pub const ERROR_INVALID_EA_NAME: DWORD = 254;
-pub const ERROR_EA_LIST_INCONSISTENT: DWORD = 255;
-pub const ERROR_NO_MORE_ITEMS: DWORD = 259;
-pub const ERROR_CANNOT_COPY: DWORD = 266;
-pub const ERROR_DIRECTORY: DWORD = 267;
-pub const ERROR_EAS_DIDNT_FIT: DWORD = 275;
-pub const ERROR_EA_FILE_CORRUPT: DWORD = 276;
-pub const ERROR_EA_TABLE_FULL: DWORD = 277;
-pub const ERROR_INVALID_EA_HANDLE: DWORD = 278;
-pub const ERROR_EAS_NOT_SUPPORTED: DWORD = 282;
-pub const ERROR_NOT_OWNER: DWORD = 288;
-pub const ERROR_TOO_MANY_POSTS: DWORD = 298;
-pub const ERROR_PARTIAL_COPY: DWORD = 299;
-pub const ERROR_OPLOCK_NOT_GRANTED: DWORD = 300;
-pub const ERROR_INVALID_OPLOCK_PROTOCOL: DWORD = 301;
-pub const ERROR_DISK_TOO_FRAGMENTED: DWORD = 302;
-pub const ERROR_DELETE_PENDING: DWORD = 303;
-pub const ERROR_INVALID_TOKEN: DWORD = 315;
-pub const ERROR_MR_MID_NOT_FOUND: DWORD = 317;
-pub const ERROR_SCOPE_NOT_FOUND: DWORD = 318;
-pub const ERROR_INVALID_ADDRESS: DWORD = 487;
-pub const ERROR_ARITHMETIC_OVERFLOW: DWORD = 534;
-pub const ERROR_PIPE_CONNECTED: DWORD = 535;
-pub const ERROR_PIPE_LISTENING: DWORD = 536;
-pub const ERROR_WAKE_SYSTEM: DWORD = 730;
-pub const ERROR_WAIT_1: DWORD = 731;
-pub const ERROR_WAIT_2: DWORD = 732;
-pub const ERROR_WAIT_3: DWORD = 733;
-pub const ERROR_WAIT_63: DWORD = 734;
-pub const ERROR_ABANDONED_WAIT_0: DWORD = 735;
-pub const ERROR_ABANDONED_WAIT_63: DWORD = 736;
-pub const ERROR_USER_APC: DWORD = 737;
-pub const ERROR_KERNEL_APC: DWORD = 738;
-pub const ERROR_ALERTED: DWORD = 739;
-pub const ERROR_EA_ACCESS_DENIED: DWORD = 994;
-pub const ERROR_OPERATION_ABORTED: DWORD = 995;
-pub const ERROR_IO_INCOMPLETE: DWORD = 996;
-pub const ERROR_IO_PENDING: DWORD = 997;
-pub const ERROR_NOACCESS: DWORD = 998;
-pub const ERROR_SWAPERROR: DWORD = 999;
-pub const ERROR_STACK_OVERFLOW: DWORD = 1001;
-pub const ERROR_INVALID_MESSAGE: DWORD = 1002;
-pub const ERROR_CAN_NOT_COMPLETE: DWORD = 1003;
-pub const ERROR_INVALID_FLAGS: DWORD = 1004;
-pub const ERROR_UNRECOGNIZED_VOLUME: DWORD = 1005;
-pub const ERROR_FILE_INVALID: DWORD = 1006;
-pub const ERROR_FULLSCREEN_MODE: DWORD = 1007;
-pub const ERROR_NO_TOKEN: DWORD = 1008;
-pub const ERROR_BADDB: DWORD = 1009;
-pub const ERROR_BADKEY: DWORD = 1010;
-pub const ERROR_CANTOPEN: DWORD = 1011;
-pub const ERROR_CANTREAD: DWORD = 1012;
-pub const ERROR_CANTWRITE: DWORD = 1013;
-pub const ERROR_REGISTRY_RECOVERED: DWORD = 1014;
-pub const ERROR_REGISTRY_CORRUPT: DWORD = 1015;
-pub const ERROR_REGISTRY_IO_FAILED: DWORD = 1016;
-pub const ERROR_NOT_REGISTRY_FILE: DWORD = 1017;
-pub const ERROR_KEY_DELETED: DWORD = 1018;
-pub const ERROR_NO_LOG_SPACE: DWORD = 1019;
-pub const ERROR_KEY_HAS_CHILDREN: DWORD = 1020;
-pub const ERROR_CHILD_MUST_BE_VOLATILE: DWORD = 1021;
-pub const ERROR_NOTIFY_ENUM_DIR: DWORD = 1022;
-pub const ERROR_DEPENDENT_SERVICES_RUNNING: DWORD = 1051;
-pub const ERROR_INVALID_SERVICE_CONTROL: DWORD = 1052;
-pub const ERROR_SERVICE_REQUEST_TIMEOUT: DWORD = 1053;
-pub const ERROR_SERVICE_NO_THREAD: DWORD = 1054;
-pub const ERROR_SERVICE_DATABASE_LOCKED: DWORD = 1055;
-pub const ERROR_SERVICE_ALREADY_RUNNING: DWORD = 1056;
-pub const ERROR_INVALID_SERVICE_ACCOUNT: DWORD = 1057;
-pub const ERROR_SERVICE_DISABLED: DWORD = 1058;
-pub const ERROR_CIRCULAR_DEPENDENCY: DWORD = 1059;
-pub const ERROR_SERVICE_DOES_NOT_EXIST: DWORD = 1060;
-pub const ERROR_SERVICE_CANNOT_ACCEPT_CTRL: DWORD = 1061;
-pub const ERROR_SERVICE_NOT_ACTIVE: DWORD = 1062;
-pub const ERROR_FAILED_SERVICE_CONTROLLER_CONNECT: DWORD = 1063;
-pub const ERROR_EXCEPTION_IN_SERVICE: DWORD = 1064;
-pub const ERROR_DATABASE_DOES_NOT_EXIST: DWORD = 1065;
-pub const ERROR_SERVICE_SPECIFIC_ERROR: DWORD = 1066;
-pub const ERROR_PROCESS_ABORTED: DWORD = 1067;
-pub const ERROR_SERVICE_DEPENDENCY_FAIL: DWORD = 1068;
-pub const ERROR_SERVICE_LOGON_FAILED: DWORD = 1069;
-pub const ERROR_SERVICE_START_HANG: DWORD = 1070;
-pub const ERROR_INVALID_SERVICE_LOCK: DWORD = 1071;
-pub const ERROR_SERVICE_MARKED_FOR_DELETE: DWORD = 1072;
-pub const ERROR_SERVICE_EXISTS: DWORD = 1073;
-pub const ERROR_ALREADY_RUNNING_LKG: DWORD = 1074;
-pub const ERROR_SERVICE_DEPENDENCY_DELETED: DWORD = 1075;
-pub const ERROR_BOOT_ALREADY_ACCEPTED: DWORD = 1076;
-pub const ERROR_SERVICE_NEVER_STARTED: DWORD = 1077;
-pub const ERROR_DUPLICATE_SERVICE_NAME: DWORD = 1078;
-pub const ERROR_DIFFERENT_SERVICE_ACCOUNT: DWORD = 1079;
-pub const ERROR_CANNOT_DETECT_DRIVER_FAILURE: DWORD = 1080;
-pub const ERROR_CANNOT_DETECT_PROCESS_ABORT: DWORD = 1081;
-pub const ERROR_NO_RECOVERY_PROGRAM: DWORD = 1082;
-pub const ERROR_SERVICE_NOT_IN_EXE: DWORD = 1083;
-pub const ERROR_NOT_SAFEBOOT_SERVICE: DWORD = 1084;
-pub const ERROR_END_OF_MEDIA: DWORD = 1100;
-pub const ERROR_FILEMARK_DETECTED: DWORD = 1101;
-pub const ERROR_BEGINNING_OF_MEDIA: DWORD = 1102;
-pub const ERROR_SETMARK_DETECTED: DWORD = 1103;
-pub const ERROR_NO_DATA_DETECTED: DWORD = 1104;
-pub const ERROR_PARTITION_FAILURE: DWORD = 1105;
-pub const ERROR_INVALID_BLOCK_LENGTH: DWORD = 1106;
-pub const ERROR_DEVICE_NOT_PARTITIONED: DWORD = 1107;
-pub const ERROR_UNABLE_TO_LOCK_MEDIA: DWORD = 1108;
-pub const ERROR_UNABLE_TO_UNLOAD_MEDIA: DWORD = 1109;
-pub const ERROR_MEDIA_CHANGED: DWORD = 1110;
-pub const ERROR_BUS_RESET: DWORD = 1111;
-pub const ERROR_NO_MEDIA_IN_DRIVE: DWORD = 1112;
-pub const ERROR_NO_UNICODE_TRANSLATION: DWORD = 1113;
-pub const ERROR_DLL_INIT_FAILED: DWORD = 1114;
-pub const ERROR_SHUTDOWN_IN_PROGRESS: DWORD = 1115;
-pub const ERROR_NO_SHUTDOWN_IN_PROGRESS: DWORD = 1116;
-pub const ERROR_IO_DEVICE: DWORD = 1117;
-pub const ERROR_SERIAL_NO_DEVICE: DWORD = 1118;
-pub const ERROR_IRQ_BUSY: DWORD = 1119;
-pub const ERROR_MORE_WRITES: DWORD = 1120;
-pub const ERROR_COUNTER_TIMEOUT: DWORD = 1121;
-pub const ERROR_FLOPPY_ID_MARK_NOT_FOUND: DWORD = 1122;
-pub const ERROR_FLOPPY_WRONG_CYLINDER: DWORD = 1123;
-pub const ERROR_FLOPPY_UNKNOWN_ERROR: DWORD = 1124;
-pub const ERROR_FLOPPY_BAD_REGISTERS: DWORD = 1125;
-pub const ERROR_DISK_RECALIBRATE_FAILED: DWORD = 1126;
-pub const ERROR_DISK_OPERATION_FAILED: DWORD = 1127;
-pub const ERROR_DISK_RESET_FAILED: DWORD = 1128;
-pub const ERROR_EOM_OVERFLOW: DWORD = 1129;
-pub const ERROR_NOT_ENOUGH_SERVER_MEMORY: DWORD = 1130;
-pub const ERROR_POSSIBLE_DEADLOCK: DWORD = 1131;
-pub const ERROR_MAPPED_ALIGNMENT: DWORD = 1132;
-pub const ERROR_SET_POWER_STATE_VETOED: DWORD = 1140;
-pub const ERROR_SET_POWER_STATE_FAILED: DWORD = 1141;
-pub const ERROR_TOO_MANY_LINKS: DWORD = 1142;
-pub const ERROR_OLD_WIN_VERSION: DWORD = 1150;
-pub const ERROR_APP_WRONG_OS: DWORD = 1151;
-pub const ERROR_SINGLE_INSTANCE_APP: DWORD = 1152;
-pub const ERROR_RMODE_APP: DWORD = 1153;
-pub const ERROR_INVALID_DLL: DWORD = 1154;
-pub const ERROR_NO_ASSOCIATION: DWORD = 1155;
-pub const ERROR_DDE_FAIL: DWORD = 1156;
-pub const ERROR_DLL_NOT_FOUND: DWORD = 1157;
-pub const ERROR_NO_MORE_USER_HANDLES: DWORD = 1158;
-pub const ERROR_MESSAGE_SYNC_ONLY: DWORD = 1159;
-pub const ERROR_SOURCE_ELEMENT_EMPTY: DWORD = 1160;
-pub const ERROR_DESTINATION_ELEMENT_FULL: DWORD = 1161;
-pub const ERROR_ILLEGAL_ELEMENT_ADDRESS: DWORD = 1162;
-pub const ERROR_MAGAZINE_NOT_PRESENT: DWORD = 1163;
-pub const ERROR_DEVICE_REINITIALIZATION_NEEDED: DWORD = 1164;
-pub const ERROR_DEVICE_REQUIRES_CLEANING: DWORD = 1165;
-pub const ERROR_DEVICE_DOOR_OPEN: DWORD = 1166;
-pub const ERROR_DEVICE_NOT_CONNECTED: DWORD = 1167;
-pub const ERROR_NOT_FOUND: DWORD = 1168;
-pub const ERROR_NO_MATCH: DWORD = 1169;
-pub const ERROR_SET_NOT_FOUND: DWORD = 1170;
-pub const ERROR_POINT_NOT_FOUND: DWORD = 1171;
-pub const ERROR_NO_TRACKING_SERVICE: DWORD = 1172;
-pub const ERROR_NO_VOLUME_ID: DWORD = 1173;
-pub const ERROR_UNABLE_TO_REMOVE_REPLACED: DWORD = 1175;
-pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT: DWORD = 1176;
-pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT_2: DWORD = 1177;
-pub const ERROR_JOURNAL_DELETE_IN_PROGRESS: DWORD = 1178;
-pub const ERROR_JOURNAL_NOT_ACTIVE: DWORD = 1179;
-pub const ERROR_POTENTIAL_FILE_FOUND: DWORD = 1180;
-pub const ERROR_JOURNAL_ENTRY_DELETED: DWORD = 1181;
-pub const ERROR_BAD_DEVICE: DWORD = 1200;
-pub const ERROR_CONNECTION_UNAVAIL: DWORD = 1201;
-pub const ERROR_DEVICE_ALREADY_REMEMBERED: DWORD = 1202;
-pub const ERROR_NO_NET_OR_BAD_PATH: DWORD = 1203;
-pub const ERROR_BAD_PROVIDER: DWORD = 1204;
-pub const ERROR_CANNOT_OPEN_PROFILE: DWORD = 1205;
-pub const ERROR_BAD_PROFILE: DWORD = 1206;
-pub const ERROR_NOT_CONTAINER: DWORD = 1207;
-pub const ERROR_EXTENDED_ERROR: DWORD = 1208;
-pub const ERROR_INVALID_GROUPNAME: DWORD = 1209;
-pub const ERROR_INVALID_COMPUTERNAME: DWORD = 1210;
-pub const ERROR_INVALID_EVENTNAME: DWORD = 1211;
-pub const ERROR_INVALID_DOMAINNAME: DWORD = 1212;
-pub const ERROR_INVALID_SERVICENAME: DWORD = 1213;
-pub const ERROR_INVALID_NETNAME: DWORD = 1214;
-pub const ERROR_INVALID_SHARENAME: DWORD = 1215;
-pub const ERROR_INVALID_PASSWORDNAME: DWORD = 1216;
-pub const ERROR_INVALID_MESSAGENAME: DWORD = 1217;
-pub const ERROR_INVALID_MESSAGEDEST: DWORD = 1218;
-pub const ERROR_SESSION_CREDENTIAL_CONFLICT: DWORD = 1219;
-pub const ERROR_REMOTE_SESSION_LIMIT_EXCEEDED: DWORD = 1220;
-pub const ERROR_DUP_DOMAINNAME: DWORD = 1221;
-pub const ERROR_NO_NETWORK: DWORD = 1222;
-pub const ERROR_CANCELLED: DWORD = 1223;
-pub const ERROR_USER_MAPPED_FILE: DWORD = 1224;
-pub const ERROR_CONNECTION_REFUSED: DWORD = 1225;
-pub const ERROR_GRACEFUL_DISCONNECT: DWORD = 1226;
-pub const ERROR_ADDRESS_ALREADY_ASSOCIATED: DWORD = 1227;
-pub const ERROR_ADDRESS_NOT_ASSOCIATED: DWORD = 1228;
-pub const ERROR_CONNECTION_INVALID: DWORD = 1229;
-pub const ERROR_CONNECTION_ACTIVE: DWORD = 1230;
-pub const ERROR_NETWORK_UNREACHABLE: DWORD = 1231;
-pub const ERROR_HOST_UNREACHABLE: DWORD = 1232;
-pub const ERROR_PROTOCOL_UNREACHABLE: DWORD = 1233;
-pub const ERROR_PORT_UNREACHABLE: DWORD = 1234;
-pub const ERROR_REQUEST_ABORTED: DWORD = 1235;
-pub const ERROR_CONNECTION_ABORTED: DWORD = 1236;
-pub const ERROR_RETRY: DWORD = 1237;
-pub const ERROR_CONNECTION_COUNT_LIMIT: DWORD = 1238;
-pub const ERROR_LOGIN_TIME_RESTRICTION: DWORD = 1239;
-pub const ERROR_LOGIN_WKSTA_RESTRICTION: DWORD = 1240;
-pub const ERROR_INCORRECT_ADDRESS: DWORD = 1241;
-pub const ERROR_ALREADY_REGISTERED: DWORD = 1242;
-pub const ERROR_SERVICE_NOT_FOUND: DWORD = 1243;
-pub const ERROR_NOT_AUTHENTICATED: DWORD = 1244;
-pub const ERROR_NOT_LOGGED_ON: DWORD = 1245;
-pub const ERROR_CONTINUE: DWORD = 1246;
-pub const ERROR_ALREADY_INITIALIZED: DWORD = 1247;
-pub const ERROR_NO_MORE_DEVICES: DWORD = 1248;
-pub const ERROR_NO_SUCH_SITE: DWORD = 1249;
-pub const ERROR_DOMAIN_CONTROLLER_EXISTS: DWORD = 1250;
-pub const ERROR_ONLY_IF_CONNECTED: DWORD = 1251;
-pub const ERROR_OVERRIDE_NOCHANGES: DWORD = 1252;
-pub const ERROR_BAD_USER_PROFILE: DWORD = 1253;
-pub const ERROR_NOT_SUPPORTED_ON_SBS: DWORD = 1254;
-pub const ERROR_SERVER_SHUTDOWN_IN_PROGRESS: DWORD = 1255;
-pub const ERROR_HOST_DOWN: DWORD = 1256;
-pub const ERROR_NON_ACCOUNT_SID: DWORD = 1257;
-pub const ERROR_NON_DOMAIN_SID: DWORD = 1258;
-pub const ERROR_APPHELP_BLOCK: DWORD = 1259;
-pub const ERROR_ACCESS_DISABLED_BY_POLICY: DWORD = 1260;
-pub const ERROR_REG_NAT_CONSUMPTION: DWORD = 1261;
-pub const ERROR_CSCSHARE_OFFLINE: DWORD = 1262;
-pub const ERROR_PKINIT_FAILURE: DWORD = 1263;
-pub const ERROR_SMARTCARD_SUBSYSTEM_FAILURE: DWORD = 1264;
-pub const ERROR_DOWNGRADE_DETECTED: DWORD = 1265;
-pub const ERROR_MACHINE_LOCKED: DWORD = 1271;
-pub const ERROR_CALLBACK_SUPPLIED_INVALID_DATA: DWORD = 1273;
-pub const ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED: DWORD = 1274;
-pub const ERROR_DRIVER_BLOCKED: DWORD = 1275;
-pub const ERROR_INVALID_IMPORT_OF_NON_DLL: DWORD = 1276;
-pub const ERROR_ACCESS_DISABLED_WEBBLADE: DWORD = 1277;
-pub const ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER: DWORD = 1278;
-pub const ERROR_RECOVERY_FAILURE: DWORD = 1279;
-pub const ERROR_ALREADY_FIBER: DWORD = 1280;
-pub const ERROR_ALREADY_THREAD: DWORD = 1281;
-pub const ERROR_STACK_BUFFER_OVERRUN: DWORD = 1282;
-pub const ERROR_PARAMETER_QUOTA_EXCEEDED: DWORD = 1283;
-pub const ERROR_DEBUGGER_INACTIVE: DWORD = 1284;
-pub const ERROR_DELAY_LOAD_FAILED: DWORD = 1285;
-pub const ERROR_VDM_DISALLOWED: DWORD = 1286;
-pub const ERROR_UNIDENTIFIED_ERROR: DWORD = 1287;
-pub const ERROR_NOT_ALL_ASSIGNED: DWORD = 1300;
-pub const ERROR_SOME_NOT_MAPPED: DWORD = 1301;
-pub const ERROR_NO_QUOTAS_FOR_ACCOUNT: DWORD = 1302;
-pub const ERROR_LOCAL_USER_SESSION_KEY: DWORD = 1303;
-pub const ERROR_NULL_LM_PASSWORD: DWORD = 1304;
-pub const ERROR_UNKNOWN_REVISION: DWORD = 1305;
-pub const ERROR_REVISION_MISMATCH: DWORD = 1306;
-pub const ERROR_INVALID_OWNER: DWORD = 1307;
-pub const ERROR_INVALID_PRIMARY_GROUP: DWORD = 1308;
-pub const ERROR_NO_IMPERSONATION_TOKEN: DWORD = 1309;
-pub const ERROR_CANT_DISABLE_MANDATORY: DWORD = 1310;
-pub const ERROR_NO_LOGON_SERVERS: DWORD = 1311;
-pub const ERROR_NO_SUCH_LOGON_SESSION: DWORD = 1312;
-pub const ERROR_NO_SUCH_PRIVILEGE: DWORD = 1313;
-pub const ERROR_PRIVILEGE_NOT_HELD: DWORD = 1314;
-pub const ERROR_INVALID_ACCOUNT_NAME: DWORD = 1315;
-pub const ERROR_USER_EXISTS: DWORD = 1316;
-pub const ERROR_NO_SUCH_USER: DWORD = 1317;
-pub const ERROR_GROUP_EXISTS: DWORD = 1318;
-pub const ERROR_NO_SUCH_GROUP: DWORD = 1319;
-pub const ERROR_MEMBER_IN_GROUP: DWORD = 1320;
-pub const ERROR_MEMBER_NOT_IN_GROUP: DWORD = 1321;
-pub const ERROR_LAST_ADMIN: DWORD = 1322;
-pub const ERROR_WRONG_PASSWORD: DWORD = 1323;
-pub const ERROR_ILL_FORMED_PASSWORD: DWORD = 1324;
-pub const ERROR_PASSWORD_RESTRICTION: DWORD = 1325;
-pub const ERROR_LOGON_FAILURE: DWORD = 1326;
-pub const ERROR_ACCOUNT_RESTRICTION: DWORD = 1327;
-pub const ERROR_INVALID_LOGON_HOURS: DWORD = 1328;
-pub const ERROR_INVALID_WORKSTATION: DWORD = 1329;
-pub const ERROR_PASSWORD_EXPIRED: DWORD = 1330;
-pub const ERROR_ACCOUNT_DISABLED: DWORD = 1331;
-pub const ERROR_NONE_MAPPED: DWORD = 1332;
-pub const ERROR_TOO_MANY_LUIDS_REQUESTED: DWORD = 1333;
-pub const ERROR_LUIDS_EXHAUSTED: DWORD = 1334;
-pub const ERROR_INVALID_SUB_AUTHORITY: DWORD = 1335;
-pub const ERROR_INVALID_ACL: DWORD = 1336;
-pub const ERROR_INVALID_SID: DWORD = 1337;
-pub const ERROR_INVALID_SECURITY_DESCR: DWORD = 1338;
-pub const ERROR_BAD_INHERITANCE_ACL: DWORD = 1340;
-pub const ERROR_SERVER_DISABLED: DWORD = 1341;
-pub const ERROR_SERVER_NOT_DISABLED: DWORD = 1342;
-pub const ERROR_INVALID_ID_AUTHORITY: DWORD = 1343;
-pub const ERROR_ALLOTTED_SPACE_EXCEEDED: DWORD = 1344;
-pub const ERROR_INVALID_GROUP_ATTRIBUTES: DWORD = 1345;
-pub const ERROR_BAD_IMPERSONATION_LEVEL: DWORD = 1346;
-pub const ERROR_CANT_OPEN_ANONYMOUS: DWORD = 1347;
-pub const ERROR_BAD_VALIDATION_CLASS: DWORD = 1348;
-pub const ERROR_BAD_TOKEN_TYPE: DWORD = 1349;
-pub const ERROR_NO_SECURITY_ON_OBJECT: DWORD = 1350;
-pub const ERROR_CANT_ACCESS_DOMAIN_INFO: DWORD = 1351;
-pub const ERROR_INVALID_SERVER_STATE: DWORD = 1352;
-pub const ERROR_INVALID_DOMAIN_STATE: DWORD = 1353;
-pub const ERROR_INVALID_DOMAIN_ROLE: DWORD = 1354;
-pub const ERROR_NO_SUCH_DOMAIN: DWORD = 1355;
-pub const ERROR_DOMAIN_EXISTS: DWORD = 1356;
-pub const ERROR_DOMAIN_LIMIT_EXCEEDED: DWORD = 1357;
-pub const ERROR_INTERNAL_DB_CORRUPTION: DWORD = 1358;
-pub const ERROR_INTERNAL_ERROR: DWORD = 1359;
-pub const ERROR_GENERIC_NOT_MAPPED: DWORD = 1360;
-pub const ERROR_BAD_DESCRIPTOR_FORMAT: DWORD = 1361;
-pub const ERROR_NOT_LOGON_PROCESS: DWORD = 1362;
-pub const ERROR_LOGON_SESSION_EXISTS: DWORD = 1363;
-pub const ERROR_NO_SUCH_PACKAGE: DWORD = 1364;
-pub const ERROR_BAD_LOGON_SESSION_STATE: DWORD = 1365;
-pub const ERROR_LOGON_SESSION_COLLISION: DWORD = 1366;
-pub const ERROR_INVALID_LOGON_TYPE: DWORD = 1367;
-pub const ERROR_CANNOT_IMPERSONATE: DWORD = 1368;
-pub const ERROR_RXACT_INVALID_STATE: DWORD = 1369;
-pub const ERROR_RXACT_COMMIT_FAILURE: DWORD = 1370;
-pub const ERROR_SPECIAL_ACCOUNT: DWORD = 1371;
-pub const ERROR_SPECIAL_GROUP: DWORD = 1372;
-pub const ERROR_SPECIAL_USER: DWORD = 1373;
-pub const ERROR_MEMBERS_PRIMARY_GROUP: DWORD = 1374;
-pub const ERROR_TOKEN_ALREADY_IN_USE: DWORD = 1375;
-pub const ERROR_NO_SUCH_ALIAS: DWORD = 1376;
-pub const ERROR_MEMBER_NOT_IN_ALIAS: DWORD = 1377;
-pub const ERROR_MEMBER_IN_ALIAS: DWORD = 1378;
-pub const ERROR_ALIAS_EXISTS: DWORD = 1379;
-pub const ERROR_LOGON_NOT_GRANTED: DWORD = 1380;
-pub const ERROR_TOO_MANY_SECRETS: DWORD = 1381;
-pub const ERROR_SECRET_TOO_LONG: DWORD = 1382;
-pub const ERROR_INTERNAL_DB_ERROR: DWORD = 1383;
-pub const ERROR_TOO_MANY_CONTEXT_IDS: DWORD = 1384;
-pub const ERROR_LOGON_TYPE_NOT_GRANTED: DWORD = 1385;
-pub const ERROR_NT_CROSS_ENCRYPTION_REQUIRED: DWORD = 1386;
-pub const ERROR_NO_SUCH_MEMBER: DWORD = 1387;
-pub const ERROR_INVALID_MEMBER: DWORD = 1388;
-pub const ERROR_TOO_MANY_SIDS: DWORD = 1389;
-pub const ERROR_LM_CROSS_ENCRYPTION_REQUIRED: DWORD = 1390;
-pub const ERROR_NO_INHERITANCE: DWORD = 1391;
-pub const ERROR_FILE_CORRUPT: DWORD = 1392;
-pub const ERROR_DISK_CORRUPT: DWORD = 1393;
-pub const ERROR_NO_USER_SESSION_KEY: DWORD = 1394;
-pub const ERROR_LICENSE_QUOTA_EXCEEDED: DWORD = 1395;
-pub const ERROR_WRONG_TARGET_NAME: DWORD = 1396;
-pub const ERROR_MUTUAL_AUTH_FAILED: DWORD = 1397;
-pub const ERROR_TIME_SKEW: DWORD = 1398;
-pub const ERROR_CURRENT_DOMAIN_NOT_ALLOWED: DWORD = 1399;
-pub const ERROR_INVALID_WINDOW_HANDLE: DWORD = 1400;
-pub const ERROR_INVALID_MENU_HANDLE: DWORD = 1401;
-pub const ERROR_INVALID_CURSOR_HANDLE: DWORD = 1402;
-pub const ERROR_INVALID_ACCEL_HANDLE: DWORD = 1403;
-pub const ERROR_INVALID_HOOK_HANDLE: DWORD = 1404;
-pub const ERROR_INVALID_DWP_HANDLE: DWORD = 1405;
-pub const ERROR_TLW_WITH_WSCHILD: DWORD = 1406;
-pub const ERROR_CANNOT_FIND_WND_CLASS: DWORD = 1407;
-pub const ERROR_WINDOW_OF_OTHER_THREAD: DWORD = 1408;
-pub const ERROR_HOTKEY_ALREADY_REGISTERED: DWORD = 1409;
-pub const ERROR_CLASS_ALREADY_EXISTS: DWORD = 1410;
-pub const ERROR_CLASS_DOES_NOT_EXIST: DWORD = 1411;
-pub const ERROR_CLASS_HAS_WINDOWS: DWORD = 1412;
-pub const ERROR_INVALID_INDEX: DWORD = 1413;
-pub const ERROR_INVALID_ICON_HANDLE: DWORD = 1414;
-pub const ERROR_PRIVATE_DIALOG_INDEX: DWORD = 1415;
-pub const ERROR_LISTBOX_ID_NOT_FOUND: DWORD = 1416;
-pub const ERROR_NO_WILDCARD_CHARACTERS: DWORD = 1417;
-pub const ERROR_CLIPBOARD_NOT_OPEN: DWORD = 1418;
-pub const ERROR_HOTKEY_NOT_REGISTERED: DWORD = 1419;
-pub const ERROR_WINDOW_NOT_DIALOG: DWORD = 1420;
-pub const ERROR_CONTROL_ID_NOT_FOUND: DWORD = 1421;
-pub const ERROR_INVALID_COMBOBOX_MESSAGE: DWORD = 1422;
-pub const ERROR_WINDOW_NOT_COMBOBOX: DWORD = 1423;
-pub const ERROR_INVALID_EDIT_HEIGHT: DWORD = 1424;
-pub const ERROR_DC_NOT_FOUND: DWORD = 1425;
-pub const ERROR_INVALID_HOOK_FILTER: DWORD = 1426;
-pub const ERROR_INVALID_FILTER_PROC: DWORD = 1427;
-pub const ERROR_HOOK_NEEDS_HMOD: DWORD = 1428;
-pub const ERROR_GLOBAL_ONLY_HOOK: DWORD = 1429;
-pub const ERROR_JOURNAL_HOOK_SET: DWORD = 1430;
-pub const ERROR_HOOK_NOT_INSTALLED: DWORD = 1431;
-pub const ERROR_INVALID_LB_MESSAGE: DWORD = 1432;
-pub const ERROR_SETCOUNT_ON_BAD_LB: DWORD = 1433;
-pub const ERROR_LB_WITHOUT_TABSTOPS: DWORD = 1434;
-pub const ERROR_DESTROY_OBJECT_OF_OTHER_THREAD: DWORD = 1435;
-pub const ERROR_CHILD_WINDOW_MENU: DWORD = 1436;
-pub const ERROR_NO_SYSTEM_MENU: DWORD = 1437;
-pub const ERROR_INVALID_MSGBOX_STYLE: DWORD = 1438;
-pub const ERROR_INVALID_SPI_VALUE: DWORD = 1439;
-pub const ERROR_SCREEN_ALREADY_LOCKED: DWORD = 1440;
-pub const ERROR_HWNDS_HAVE_DIFF_PARENT: DWORD = 1441;
-pub const ERROR_NOT_CHILD_WINDOW: DWORD = 1442;
-pub const ERROR_INVALID_GW_COMMAND: DWORD = 1443;
-pub const ERROR_INVALID_THREAD_ID: DWORD = 1444;
-pub const ERROR_NON_MDICHILD_WINDOW: DWORD = 1445;
-pub const ERROR_POPUP_ALREADY_ACTIVE: DWORD = 1446;
-pub const ERROR_NO_SCROLLBARS: DWORD = 1447;
-pub const ERROR_INVALID_SCROLLBAR_RANGE: DWORD = 1448;
-pub const ERROR_INVALID_SHOWWIN_COMMAND: DWORD = 1449;
-pub const ERROR_NO_SYSTEM_RESOURCES: DWORD = 1450;
-pub const ERROR_NONPAGED_SYSTEM_RESOURCES: DWORD = 1451;
-pub const ERROR_PAGED_SYSTEM_RESOURCES: DWORD = 1452;
-pub const ERROR_WORKING_SET_QUOTA: DWORD = 1453;
-pub const ERROR_PAGEFILE_QUOTA: DWORD = 1454;
-pub const ERROR_COMMITMENT_LIMIT: DWORD = 1455;
-pub const ERROR_MENU_ITEM_NOT_FOUND: DWORD = 1456;
-pub const ERROR_INVALID_KEYBOARD_HANDLE: DWORD = 1457;
-pub const ERROR_HOOK_TYPE_NOT_ALLOWED: DWORD = 1458;
-pub const ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION: DWORD = 1459;
-pub const ERROR_TIMEOUT: DWORD = 1460;
-pub const ERROR_INVALID_MONITOR_HANDLE: DWORD = 1461;
-pub const ERROR_INCORRECT_SIZE: DWORD = 1462;
-pub const ERROR_SYMLINK_CLASS_DISABLED: DWORD = 1463;
-pub const ERROR_SYMLINK_NOT_SUPPORTED: DWORD = 1464;
-pub const ERROR_XML_PARSE_ERROR: DWORD = 1465;
-pub const ERROR_XMLDSIG_ERROR: DWORD = 1466;
-pub const ERROR_RESTART_APPLICATION: DWORD = 1467;
-pub const ERROR_WRONG_COMPARTMENT: DWORD = 1468;
-pub const ERROR_AUTHIP_FAILURE: DWORD = 1469;
-pub const ERROR_NO_NVRAM_RESOURCES: DWORD = 1470;
-pub const ERROR_NOT_GUI_PROCESS: DWORD = 1471;
-pub const ERROR_EVENTLOG_FILE_CORRUPT: DWORD = 1500;
-pub const ERROR_EVENTLOG_CANT_START: DWORD = 1501;
-pub const ERROR_LOG_FILE_FULL: DWORD = 1502;
-pub const ERROR_EVENTLOG_FILE_CHANGED: DWORD = 1503;
-pub const ERROR_INSTALL_SERVICE_FAILURE: DWORD = 1601;
-pub const ERROR_INSTALL_USEREXIT: DWORD = 1602;
-pub const ERROR_INSTALL_FAILURE: DWORD = 1603;
-pub const ERROR_INSTALL_SUSPEND: DWORD = 1604;
-pub const ERROR_UNKNOWN_PRODUCT: DWORD = 1605;
-pub const ERROR_UNKNOWN_FEATURE: DWORD = 1606;
-pub const ERROR_UNKNOWN_COMPONENT: DWORD = 1607;
-pub const ERROR_UNKNOWN_PROPERTY: DWORD = 1608;
-pub const ERROR_INVALID_HANDLE_STATE: DWORD = 1609;
-pub const ERROR_BAD_CONFIGURATION: DWORD = 1610;
-pub const ERROR_INDEX_ABSENT: DWORD = 1611;
-pub const ERROR_INSTALL_SOURCE_ABSENT: DWORD = 1612;
-pub const ERROR_INSTALL_PACKAGE_VERSION: DWORD = 1613;
-pub const ERROR_PRODUCT_UNINSTALLED: DWORD = 1614;
-pub const ERROR_BAD_QUERY_SYNTAX: DWORD = 1615;
-pub const ERROR_INVALID_FIELD: DWORD = 1616;
-pub const ERROR_DEVICE_REMOVED: DWORD = 1617;
-pub const ERROR_INSTALL_ALREADY_RUNNING: DWORD = 1618;
-pub const ERROR_INSTALL_PACKAGE_OPEN_FAILED: DWORD = 1619;
-pub const ERROR_INSTALL_PACKAGE_INVALID: DWORD = 1620;
-pub const ERROR_INSTALL_UI_FAILURE: DWORD = 1621;
-pub const ERROR_INSTALL_LOG_FAILURE: DWORD = 1622;
-pub const ERROR_INSTALL_LANGUAGE_UNSUPPORTED: DWORD = 1623;
-pub const ERROR_INSTALL_TRANSFORM_FAILURE: DWORD = 1624;
-pub const ERROR_INSTALL_PACKAGE_REJECTED: DWORD = 1625;
-pub const ERROR_FUNCTION_NOT_CALLED: DWORD = 1626;
-pub const ERROR_FUNCTION_FAILED: DWORD = 1627;
-pub const ERROR_INVALID_TABLE: DWORD = 1628;
-pub const ERROR_DATATYPE_MISMATCH: DWORD = 1629;
-pub const ERROR_UNSUPPORTED_TYPE: DWORD = 1630;
-pub const ERROR_CREATE_FAILED: DWORD = 1631;
-pub const ERROR_INSTALL_TEMP_UNWRITABLE: DWORD = 1632;
-pub const ERROR_INSTALL_PLATFORM_UNSUPPORTED: DWORD = 1633;
-pub const ERROR_INSTALL_NOTUSED: DWORD = 1634;
-pub const ERROR_PATCH_PACKAGE_OPEN_FAILED: DWORD = 1635;
-pub const ERROR_PATCH_PACKAGE_INVALID: DWORD = 1636;
-pub const ERROR_PATCH_PACKAGE_UNSUPPORTED: DWORD = 1637;
-pub const ERROR_PRODUCT_VERSION: DWORD = 1638;
-pub const ERROR_INVALID_COMMAND_LINE: DWORD = 1639;
-pub const ERROR_INSTALL_REMOTE_DISALLOWED: DWORD = 1640;
-pub const ERROR_SUCCESS_REBOOT_INITIATED: DWORD = 1641;
-pub const ERROR_PATCH_TARGET_NOT_FOUND: DWORD = 1642;
-pub const ERROR_PATCH_PACKAGE_REJECTED: DWORD = 1643;
-pub const ERROR_INSTALL_TRANSFORM_REJECTED: DWORD = 1644;
-pub const ERROR_INSTALL_REMOTE_PROHIBITED: DWORD = 1645;
-pub const ERROR_INVALID_USER_BUFFER: DWORD = 1784;
-pub const ERROR_UNRECOGNIZED_MEDIA: DWORD = 1785;
-pub const ERROR_NO_TRUST_LSA_SECRET: DWORD = 1786;
-pub const ERROR_NO_TRUST_SAM_ACCOUNT: DWORD = 1787;
-pub const ERROR_TRUSTED_DOMAIN_FAILURE: DWORD = 1788;
-pub const ERROR_TRUSTED_RELATIONSHIP_FAILURE: DWORD = 1789;
-pub const ERROR_TRUST_FAILURE: DWORD = 1790;
-pub const ERROR_NETLOGON_NOT_STARTED: DWORD = 1792;
-pub const ERROR_ACCOUNT_EXPIRED: DWORD = 1793;
-pub const ERROR_REDIRECTOR_HAS_OPEN_HANDLES: DWORD = 1794;
-pub const ERROR_PRINTER_DRIVER_ALREADY_INSTALLED: DWORD = 1795;
-pub const ERROR_UNKNOWN_PORT: DWORD = 1796;
-pub const ERROR_UNKNOWN_PRINTER_DRIVER: DWORD = 1797;
-pub const ERROR_UNKNOWN_PRINTPROCESSOR: DWORD = 1798;
-pub const ERROR_INVALID_SEPARATOR_FILE: DWORD = 1799;
-pub const ERROR_INVALID_PRIORITY: DWORD = 1800;
-pub const ERROR_INVALID_PRINTER_NAME: DWORD = 1801;
-pub const ERROR_PRINTER_ALREADY_EXISTS: DWORD = 1802;
-pub const ERROR_INVALID_PRINTER_COMMAND: DWORD = 1803;
-pub const ERROR_INVALID_DATATYPE: DWORD = 1804;
-pub const ERROR_INVALID_ENVIRONMENT: DWORD = 1805;
-pub const ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT: DWORD = 1807;
-pub const ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT: DWORD = 1808;
-pub const ERROR_NOLOGON_SERVER_TRUST_ACCOUNT: DWORD = 1809;
-pub const ERROR_DOMAIN_TRUST_INCONSISTENT: DWORD = 1810;
-pub const ERROR_SERVER_HAS_OPEN_HANDLES: DWORD = 1811;
-pub const ERROR_RESOURCE_DATA_NOT_FOUND: DWORD = 1812;
-pub const ERROR_RESOURCE_TYPE_NOT_FOUND: DWORD = 1813;
-pub const ERROR_RESOURCE_NAME_NOT_FOUND: DWORD = 1814;
-pub const ERROR_RESOURCE_LANG_NOT_FOUND: DWORD = 1815;
-pub const ERROR_NOT_ENOUGH_QUOTA: DWORD = 1816;
-pub const ERROR_INVALID_TIME: DWORD = 1901;
-pub const ERROR_INVALID_FORM_NAME: DWORD = 1902;
-pub const ERROR_INVALID_FORM_SIZE: DWORD = 1903;
-pub const ERROR_ALREADY_WAITING: DWORD = 1904;
-pub const ERROR_PRINTER_DELETED: DWORD = 1905;
-pub const ERROR_INVALID_PRINTER_STATE: DWORD = 1906;
-pub const ERROR_PASSWORD_MUST_CHANGE: DWORD = 1907;
-pub const ERROR_DOMAIN_CONTROLLER_NOT_FOUND: DWORD = 1908;
-pub const ERROR_ACCOUNT_LOCKED_OUT: DWORD = 1909;
-pub const ERROR_NO_SITENAME: DWORD = 1919;
-pub const ERROR_CANT_ACCESS_FILE: DWORD = 1920;
-pub const ERROR_CANT_RESOLVE_FILENAME: DWORD = 1921;
-pub const ERROR_KM_DRIVER_BLOCKED: DWORD = 1930;
-pub const ERROR_CONTEXT_EXPIRED: DWORD = 1931;
-pub const ERROR_PER_USER_TRUST_QUOTA_EXCEEDED: DWORD = 1932;
-pub const ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED: DWORD = 1933;
-pub const ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED: DWORD = 1934;
-pub const ERROR_AUTHENTICATION_FIREWALL_FAILED: DWORD = 1935;
-pub const ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED: DWORD = 1936;
-pub const ERROR_INVALID_PIXEL_FORMAT: DWORD = 2000;
-pub const ERROR_BAD_DRIVER: DWORD = 2001;
-pub const ERROR_INVALID_WINDOW_STYLE: DWORD = 2002;
-pub const ERROR_METAFILE_NOT_SUPPORTED: DWORD = 2003;
-pub const ERROR_TRANSFORM_NOT_SUPPORTED: DWORD = 2004;
-pub const ERROR_CLIPPING_NOT_SUPPORTED: DWORD = 2005;
-pub const ERROR_INVALID_CMM: DWORD = 2010;
-pub const ERROR_INVALID_PROFILE: DWORD = 2011;
-pub const ERROR_TAG_NOT_FOUND: DWORD = 2012;
-pub const ERROR_TAG_NOT_PRESENT: DWORD = 2013;
-pub const ERROR_DUPLICATE_TAG: DWORD = 2014;
-pub const ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE: DWORD = 2015;
-pub const ERROR_PROFILE_NOT_FOUND: DWORD = 2016;
-pub const ERROR_INVALID_COLORSPACE: DWORD = 2017;
-pub const ERROR_ICM_NOT_ENABLED: DWORD = 2018;
-pub const ERROR_DELETING_ICM_XFORM: DWORD = 2019;
-pub const ERROR_INVALID_TRANSFORM: DWORD = 2020;
-pub const ERROR_COLORSPACE_MISMATCH: DWORD = 2021;
-pub const ERROR_INVALID_COLORINDEX: DWORD = 2022;
-pub const ERROR_CONNECTED_OTHER_PASSWORD: DWORD = 2108;
-pub const ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT: DWORD = 2109;
-pub const ERROR_BAD_USERNAME: DWORD = 2202;
-pub const ERROR_NOT_CONNECTED: DWORD = 2250;
-pub const ERROR_OPEN_FILES: DWORD = 2401;
-pub const ERROR_ACTIVE_CONNECTIONS: DWORD = 2402;
-pub const ERROR_DEVICE_IN_USE: DWORD = 2404;
-pub const ERROR_UNKNOWN_PRINT_MONITOR: DWORD = 3000;
-pub const ERROR_PRINTER_DRIVER_IN_USE: DWORD = 3001;
-pub const ERROR_SPOOL_FILE_NOT_FOUND: DWORD = 3002;
-pub const ERROR_SPL_NO_STARTDOC: DWORD = 3003;
-pub const ERROR_SPL_NO_ADDJOB: DWORD = 3004;
-pub const ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED: DWORD = 3005;
-pub const ERROR_PRINT_MONITOR_ALREADY_INSTALLED: DWORD = 3006;
-pub const ERROR_INVALID_PRINT_MONITOR: DWORD = 3007;
-pub const ERROR_PRINT_MONITOR_IN_USE: DWORD = 3008;
-pub const ERROR_PRINTER_HAS_JOBS_QUEUED: DWORD = 3009;
-pub const ERROR_SUCCESS_REBOOT_REQUIRED: DWORD = 3010;
-pub const ERROR_SUCCESS_RESTART_REQUIRED: DWORD = 3011;
-pub const ERROR_PRINTER_NOT_FOUND: DWORD = 3012;
-pub const ERROR_PRINTER_DRIVER_WARNED: DWORD = 3013;
-pub const ERROR_PRINTER_DRIVER_BLOCKED: DWORD = 3014;
-pub const ERROR_WINS_INTERNAL: DWORD = 4000;
-pub const ERROR_CAN_NOT_DEL_LOCAL_WINS: DWORD = 4001;
-pub const ERROR_STATIC_INIT: DWORD = 4002;
-pub const ERROR_INC_BACKUP: DWORD = 4003;
-pub const ERROR_FULL_BACKUP: DWORD = 4004;
-pub const ERROR_REC_NON_EXISTENT: DWORD = 4005;
-pub const ERROR_RPL_NOT_ALLOWED: DWORD = 4006;
-pub const ERROR_DHCP_ADDRESS_CONFLICT: DWORD = 4100;
-pub const ERROR_WMI_GUID_NOT_FOUND: DWORD = 4200;
-pub const ERROR_WMI_INSTANCE_NOT_FOUND: DWORD = 4201;
-pub const ERROR_WMI_ITEMID_NOT_FOUND: DWORD = 4202;
-pub const ERROR_WMI_TRY_AGAIN: DWORD = 4203;
-pub const ERROR_WMI_DP_NOT_FOUND: DWORD = 4204;
-pub const ERROR_WMI_UNRESOLVED_INSTANCE_REF: DWORD = 4205;
-pub const ERROR_WMI_ALREADY_ENABLED: DWORD = 4206;
-pub const ERROR_WMI_GUID_DISCONNECTED: DWORD = 4207;
-pub const ERROR_WMI_SERVER_UNAVAILABLE: DWORD = 4208;
-pub const ERROR_WMI_DP_FAILED: DWORD = 4209;
-pub const ERROR_WMI_INVALID_MOF: DWORD = 4210;
-pub const ERROR_WMI_INVALID_REGINFO: DWORD = 4211;
-pub const ERROR_WMI_ALREADY_DISABLED: DWORD = 4212;
-pub const ERROR_WMI_READ_ONLY: DWORD = 4213;
-pub const ERROR_WMI_SET_FAILURE: DWORD = 4214;
-pub const ERROR_INVALID_MEDIA: DWORD = 4300;
-pub const ERROR_INVALID_LIBRARY: DWORD = 4301;
-pub const ERROR_INVALID_MEDIA_POOL: DWORD = 4302;
-pub const ERROR_DRIVE_MEDIA_MISMATCH: DWORD = 4303;
-pub const ERROR_MEDIA_OFFLINE: DWORD = 4304;
-pub const ERROR_LIBRARY_OFFLINE: DWORD = 4305;
-pub const ERROR_EMPTY: DWORD = 4306;
-pub const ERROR_NOT_EMPTY: DWORD = 4307;
-pub const ERROR_MEDIA_UNAVAILABLE: DWORD = 4308;
-pub const ERROR_RESOURCE_DISABLED: DWORD = 4309;
-pub const ERROR_INVALID_CLEANER: DWORD = 4310;
-pub const ERROR_UNABLE_TO_CLEAN: DWORD = 4311;
-pub const ERROR_OBJECT_NOT_FOUND: DWORD = 4312;
-pub const ERROR_DATABASE_FAILURE: DWORD = 4313;
-pub const ERROR_DATABASE_FULL: DWORD = 4314;
-pub const ERROR_MEDIA_INCOMPATIBLE: DWORD = 4315;
-pub const ERROR_RESOURCE_NOT_PRESENT: DWORD = 4316;
-pub const ERROR_INVALID_OPERATION: DWORD = 4317;
-pub const ERROR_MEDIA_NOT_AVAILABLE: DWORD = 4318;
-pub const ERROR_DEVICE_NOT_AVAILABLE: DWORD = 4319;
-pub const ERROR_REQUEST_REFUSED: DWORD = 4320;
-pub const ERROR_INVALID_DRIVE_OBJECT: DWORD = 4321;
-pub const ERROR_LIBRARY_FULL: DWORD = 4322;
-pub const ERROR_MEDIUM_NOT_ACCESSIBLE: DWORD = 4323;
-pub const ERROR_UNABLE_TO_LOAD_MEDIUM: DWORD = 4324;
-pub const ERROR_UNABLE_TO_INVENTORY_DRIVE: DWORD = 4325;
-pub const ERROR_UNABLE_TO_INVENTORY_SLOT: DWORD = 4326;
-pub const ERROR_UNABLE_TO_INVENTORY_TRANSPORT: DWORD = 4327;
-pub const ERROR_TRANSPORT_FULL: DWORD = 4328;
-pub const ERROR_CONTROLLING_IEPORT: DWORD = 4329;
-pub const ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA: DWORD = 4330;
-pub const ERROR_CLEANER_SLOT_SET: DWORD = 4331;
-pub const ERROR_CLEANER_SLOT_NOT_SET: DWORD = 4332;
-pub const ERROR_CLEANER_CARTRIDGE_SPENT: DWORD = 4333;
-pub const ERROR_UNEXPECTED_OMID: DWORD = 4334;
-pub const ERROR_CANT_DELETE_LAST_ITEM: DWORD = 4335;
-pub const ERROR_MESSAGE_EXCEEDS_MAX_SIZE: DWORD = 4336;
-pub const ERROR_VOLUME_CONTAINS_SYS_FILES: DWORD = 4337;
-pub const ERROR_INDIGENOUS_TYPE: DWORD = 4338;
-pub const ERROR_NO_SUPPORTING_DRIVES: DWORD = 4339;
-pub const ERROR_CLEANER_CARTRIDGE_INSTALLED: DWORD = 4340;
-pub const ERROR_IEPORT_FULL: DWORD = 4341;
-pub const ERROR_FILE_OFFLINE: DWORD = 4350;
-pub const ERROR_REMOTE_STORAGE_NOT_ACTIVE: DWORD = 4351;
-pub const ERROR_REMOTE_STORAGE_MEDIA_ERROR: DWORD = 4352;
-pub const ERROR_NOT_A_REPARSE_POINT: DWORD = 4390;
-pub const ERROR_REPARSE_ATTRIBUTE_CONFLICT: DWORD = 4391;
-pub const ERROR_INVALID_REPARSE_DATA: DWORD = 4392;
-pub const ERROR_REPARSE_TAG_INVALID: DWORD = 4393;
-pub const ERROR_REPARSE_TAG_MISMATCH: DWORD = 4394;
-pub const ERROR_VOLUME_NOT_SIS_ENABLED: DWORD = 4500;
-pub const ERROR_DEPENDENT_RESOURCE_EXISTS: DWORD = 5001;
-pub const ERROR_DEPENDENCY_NOT_FOUND: DWORD = 5002;
-pub const ERROR_DEPENDENCY_ALREADY_EXISTS: DWORD = 5003;
-pub const ERROR_RESOURCE_NOT_ONLINE: DWORD = 5004;
-pub const ERROR_HOST_NODE_NOT_AVAILABLE: DWORD = 5005;
-pub const ERROR_RESOURCE_NOT_AVAILABLE: DWORD = 5006;
-pub const ERROR_RESOURCE_NOT_FOUND: DWORD = 5007;
-pub const ERROR_SHUTDOWN_CLUSTER: DWORD = 5008;
-pub const ERROR_CANT_EVICT_ACTIVE_NODE: DWORD = 5009;
-pub const ERROR_OBJECT_ALREADY_EXISTS: DWORD = 5010;
-pub const ERROR_OBJECT_IN_LIST: DWORD = 5011;
-pub const ERROR_GROUP_NOT_AVAILABLE: DWORD = 5012;
-pub const ERROR_GROUP_NOT_FOUND: DWORD = 5013;
-pub const ERROR_GROUP_NOT_ONLINE: DWORD = 5014;
-pub const ERROR_HOST_NODE_NOT_RESOURCE_OWNER: DWORD = 5015;
-pub const ERROR_HOST_NODE_NOT_GROUP_OWNER: DWORD = 5016;
-pub const ERROR_RESMON_CREATE_FAILED: DWORD = 5017;
-pub const ERROR_RESMON_ONLINE_FAILED: DWORD = 5018;
-pub const ERROR_RESOURCE_ONLINE: DWORD = 5019;
-pub const ERROR_QUORUM_RESOURCE: DWORD = 5020;
-pub const ERROR_NOT_QUORUM_CAPABLE: DWORD = 5021;
-pub const ERROR_CLUSTER_SHUTTING_DOWN: DWORD = 5022;
-pub const ERROR_INVALID_STATE: DWORD = 5023;
-pub const ERROR_RESOURCE_PROPERTIES_STORED: DWORD = 5024;
-pub const ERROR_NOT_QUORUM_CLASS: DWORD = 5025;
-pub const ERROR_CORE_RESOURCE: DWORD = 5026;
-pub const ERROR_QUORUM_RESOURCE_ONLINE_FAILED: DWORD = 5027;
-pub const ERROR_QUORUMLOG_OPEN_FAILED: DWORD = 5028;
-pub const ERROR_CLUSTERLOG_CORRUPT: DWORD = 5029;
-pub const ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE: DWORD = 5030;
-pub const ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE: DWORD = 5031;
-pub const ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND: DWORD = 5032;
-pub const ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE: DWORD = 5033;
-pub const ERROR_QUORUM_OWNER_ALIVE: DWORD = 5034;
-pub const ERROR_NETWORK_NOT_AVAILABLE: DWORD = 5035;
-pub const ERROR_NODE_NOT_AVAILABLE: DWORD = 5036;
-pub const ERROR_ALL_NODES_NOT_AVAILABLE: DWORD = 5037;
-pub const ERROR_RESOURCE_FAILED: DWORD = 5038;
-pub const ERROR_CLUSTER_INVALID_NODE: DWORD = 5039;
-pub const ERROR_CLUSTER_NODE_EXISTS: DWORD = 5040;
-pub const ERROR_CLUSTER_JOIN_IN_PROGRESS: DWORD = 5041;
-pub const ERROR_CLUSTER_NODE_NOT_FOUND: DWORD = 5042;
-pub const ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND: DWORD = 5043;
-pub const ERROR_CLUSTER_NETWORK_EXISTS: DWORD = 5044;
-pub const ERROR_CLUSTER_NETWORK_NOT_FOUND: DWORD = 5045;
-pub const ERROR_CLUSTER_NETINTERFACE_EXISTS: DWORD = 5046;
-pub const ERROR_CLUSTER_NETINTERFACE_NOT_FOUND: DWORD = 5047;
-pub const ERROR_CLUSTER_INVALID_REQUEST: DWORD = 5048;
-pub const ERROR_CLUSTER_INVALID_NETWORK_PROVIDER: DWORD = 5049;
-pub const ERROR_CLUSTER_NODE_DOWN: DWORD = 5050;
-pub const ERROR_CLUSTER_NODE_UNREACHABLE: DWORD = 5051;
-pub const ERROR_CLUSTER_NODE_NOT_MEMBER: DWORD = 5052;
-pub const ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS: DWORD = 5053;
-pub const ERROR_CLUSTER_INVALID_NETWORK: DWORD = 5054;
-pub const ERROR_CLUSTER_NODE_UP: DWORD = 5056;
-pub const ERROR_CLUSTER_IPADDR_IN_USE: DWORD = 5057;
-pub const ERROR_CLUSTER_NODE_NOT_PAUSED: DWORD = 5058;
-pub const ERROR_CLUSTER_NO_SECURITY_CONTEXT: DWORD = 5059;
-pub const ERROR_CLUSTER_NETWORK_NOT_INTERNAL: DWORD = 5060;
-pub const ERROR_CLUSTER_NODE_ALREADY_UP: DWORD = 5061;
-pub const ERROR_CLUSTER_NODE_ALREADY_DOWN: DWORD = 5062;
-pub const ERROR_CLUSTER_NETWORK_ALREADY_ONLINE: DWORD = 5063;
-pub const ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE: DWORD = 5064;
-pub const ERROR_CLUSTER_NODE_ALREADY_MEMBER: DWORD = 5065;
-pub const ERROR_CLUSTER_LAST_INTERNAL_NETWORK: DWORD = 5066;
-pub const ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS: DWORD = 5067;
-pub const ERROR_INVALID_OPERATION_ON_QUORUM: DWORD = 5068;
-pub const ERROR_DEPENDENCY_NOT_ALLOWED: DWORD = 5069;
-pub const ERROR_CLUSTER_NODE_PAUSED: DWORD = 5070;
-pub const ERROR_NODE_CANT_HOST_RESOURCE: DWORD = 5071;
-pub const ERROR_CLUSTER_NODE_NOT_READY: DWORD = 5072;
-pub const ERROR_CLUSTER_NODE_SHUTTING_DOWN: DWORD = 5073;
-pub const ERROR_CLUSTER_JOIN_ABORTED: DWORD = 5074;
-pub const ERROR_CLUSTER_INCOMPATIBLE_VERSIONS: DWORD = 5075;
-pub const ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED: DWORD = 5076;
-pub const ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED: DWORD = 5077;
-pub const ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND: DWORD = 5078;
-pub const ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED: DWORD = 5079;
-pub const ERROR_CLUSTER_RESNAME_NOT_FOUND: DWORD = 5080;
-pub const ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED: DWORD = 5081;
-pub const ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST: DWORD = 5082;
-pub const ERROR_CLUSTER_DATABASE_SEQMISMATCH: DWORD = 5083;
-pub const ERROR_RESMON_INVALID_STATE: DWORD = 5084;
-pub const ERROR_CLUSTER_GUM_NOT_LOCKER: DWORD = 5085;
-pub const ERROR_QUORUM_DISK_NOT_FOUND: DWORD = 5086;
-pub const ERROR_DATABASE_BACKUP_CORRUPT: DWORD = 5087;
-pub const ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT: DWORD = 5088;
-pub const ERROR_RESOURCE_PROPERTY_UNCHANGEABLE: DWORD = 5089;
-pub const ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE: DWORD = 5890;
-pub const ERROR_CLUSTER_QUORUMLOG_NOT_FOUND: DWORD = 5891;
-pub const ERROR_CLUSTER_MEMBERSHIP_HALT: DWORD = 5892;
-pub const ERROR_CLUSTER_INSTANCE_ID_MISMATCH: DWORD = 5893;
-pub const ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP: DWORD = 5894;
-pub const ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH: DWORD = 5895;
-pub const ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP: DWORD = 5896;
-pub const ERROR_CLUSTER_PARAMETER_MISMATCH: DWORD = 5897;
-pub const ERROR_NODE_CANNOT_BE_CLUSTERED: DWORD = 5898;
-pub const ERROR_CLUSTER_WRONG_OS_VERSION: DWORD = 5899;
-pub const ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME: DWORD = 5900;
-pub const ERROR_CLUSCFG_ALREADY_COMMITTED: DWORD = 5901;
-pub const ERROR_CLUSCFG_ROLLBACK_FAILED: DWORD = 5902;
-pub const ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT: DWORD = 5903;
-pub const ERROR_CLUSTER_OLD_VERSION: DWORD = 5904;
-pub const ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME: DWORD = 5905;
-pub const ERROR_ENCRYPTION_FAILED: DWORD = 6000;
-pub const ERROR_DECRYPTION_FAILED: DWORD = 6001;
-pub const ERROR_FILE_ENCRYPTED: DWORD = 6002;
-pub const ERROR_NO_RECOVERY_POLICY: DWORD = 6003;
-pub const ERROR_NO_EFS: DWORD = 6004;
-pub const ERROR_WRONG_EFS: DWORD = 6005;
-pub const ERROR_NO_USER_KEYS: DWORD = 6006;
-pub const ERROR_FILE_NOT_ENCRYPTED: DWORD = 6007;
-pub const ERROR_NOT_EXPORT_FORMAT: DWORD = 6008;
-pub const ERROR_FILE_READ_ONLY: DWORD = 6009;
-pub const ERROR_DIR_EFS_DISALLOWED: DWORD = 6010;
-pub const ERROR_EFS_SERVER_NOT_TRUSTED: DWORD = 6011;
-pub const ERROR_BAD_RECOVERY_POLICY: DWORD = 6012;
-pub const ERROR_EFS_ALG_BLOB_TOO_BIG: DWORD = 6013;
-pub const ERROR_VOLUME_NOT_SUPPORT_EFS: DWORD = 6014;
-pub const ERROR_EFS_DISABLED: DWORD = 6015;
-pub const ERROR_EFS_VERSION_NOT_SUPPORT: DWORD = 6016;
-pub const ERROR_NO_BROWSER_SERVERS_FOUND: DWORD = 6118;
-pub const ERROR_CTX_WINSTATION_NAME_INVALID: DWORD = 7001;
-pub const ERROR_CTX_INVALID_PD: DWORD = 7002;
-pub const ERROR_CTX_PD_NOT_FOUND: DWORD = 7003;
-pub const ERROR_CTX_WD_NOT_FOUND: DWORD = 7004;
-pub const ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY: DWORD = 7005;
-pub const ERROR_CTX_SERVICE_NAME_COLLISION: DWORD = 7006;
-pub const ERROR_CTX_CLOSE_PENDING: DWORD = 7007;
-pub const ERROR_CTX_NO_OUTBUF: DWORD = 7008;
-pub const ERROR_CTX_MODEM_INF_NOT_FOUND: DWORD = 7009;
-pub const ERROR_CTX_INVALID_MODEMNAME: DWORD = 7010;
-pub const ERROR_CTX_MODEM_RESPONSE_ERROR: DWORD = 7011;
-pub const ERROR_CTX_MODEM_RESPONSE_TIMEOUT: DWORD = 7012;
-pub const ERROR_CTX_MODEM_RESPONSE_NO_CARRIER: DWORD = 7013;
-pub const ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE: DWORD = 7014;
-pub const ERROR_CTX_MODEM_RESPONSE_BUSY: DWORD = 7015;
-pub const ERROR_CTX_MODEM_RESPONSE_VOICE: DWORD = 7016;
-pub const ERROR_CTX_TD_ERROR: DWORD = 7017;
-pub const ERROR_CTX_WINSTATION_NOT_FOUND: DWORD = 7022;
-pub const ERROR_CTX_WINSTATION_ALREADY_EXISTS: DWORD = 7023;
-pub const ERROR_CTX_WINSTATION_BUSY: DWORD = 7024;
-pub const ERROR_CTX_BAD_VIDEO_MODE: DWORD = 7025;
-pub const ERROR_CTX_GRAPHICS_INVALID: DWORD = 7035;
-pub const ERROR_CTX_LOGON_DISABLED: DWORD = 7037;
-pub const ERROR_CTX_NOT_CONSOLE: DWORD = 7038;
-pub const ERROR_CTX_CLIENT_QUERY_TIMEOUT: DWORD = 7040;
-pub const ERROR_CTX_CONSOLE_DISCONNECT: DWORD = 7041;
-pub const ERROR_CTX_CONSOLE_CONNECT: DWORD = 7042;
-pub const ERROR_CTX_SHADOW_DENIED: DWORD = 7044;
-pub const ERROR_CTX_WINSTATION_ACCESS_DENIED: DWORD = 7045;
-pub const ERROR_CTX_INVALID_WD: DWORD = 7049;
-pub const ERROR_CTX_SHADOW_INVALID: DWORD = 7050;
-pub const ERROR_CTX_SHADOW_DISABLED: DWORD = 7051;
-pub const ERROR_CTX_CLIENT_LICENSE_IN_USE: DWORD = 7052;
-pub const ERROR_CTX_CLIENT_LICENSE_NOT_SET: DWORD = 7053;
-pub const ERROR_CTX_LICENSE_NOT_AVAILABLE: DWORD = 7054;
-pub const ERROR_CTX_LICENSE_CLIENT_INVALID: DWORD = 7055;
-pub const ERROR_CTX_LICENSE_EXPIRED: DWORD = 7056;
-pub const ERROR_CTX_SHADOW_NOT_RUNNING: DWORD = 7057;
-pub const ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE: DWORD = 7058;
-pub const ERROR_ACTIVATION_COUNT_EXCEEDED: DWORD = 7059;
-pub const ERROR_DS_NOT_INSTALLED: DWORD = 8200;
-pub const ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY: DWORD = 8201;
-pub const ERROR_DS_NO_ATTRIBUTE_OR_VALUE: DWORD = 8202;
-pub const ERROR_DS_INVALID_ATTRIBUTE_SYNTAX: DWORD = 8203;
-pub const ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED: DWORD = 8204;
-pub const ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS: DWORD = 8205;
-pub const ERROR_DS_BUSY: DWORD = 8206;
-pub const ERROR_DS_UNAVAILABLE: DWORD = 8207;
-pub const ERROR_DS_NO_RIDS_ALLOCATED: DWORD = 8208;
-pub const ERROR_DS_NO_MORE_RIDS: DWORD = 8209;
-pub const ERROR_DS_INCORRECT_ROLE_OWNER: DWORD = 8210;
-pub const ERROR_DS_RIDMGR_INIT_ERROR: DWORD = 8211;
-pub const ERROR_DS_OBJ_CLASS_VIOLATION: DWORD = 8212;
-pub const ERROR_DS_CANT_ON_NON_LEAF: DWORD = 8213;
-pub const ERROR_DS_CANT_ON_RDN: DWORD = 8214;
-pub const ERROR_DS_CANT_MOD_OBJ_CLASS: DWORD = 8215;
-pub const ERROR_DS_CROSS_DOM_MOVE_ERROR: DWORD = 8216;
-pub const ERROR_DS_GC_NOT_AVAILABLE: DWORD = 8217;
-pub const ERROR_SHARED_POLICY: DWORD = 8218;
-pub const ERROR_POLICY_OBJECT_NOT_FOUND: DWORD = 8219;
-pub const ERROR_POLICY_ONLY_IN_DS: DWORD = 8220;
-pub const ERROR_PROMOTION_ACTIVE: DWORD = 8221;
-pub const ERROR_NO_PROMOTION_ACTIVE: DWORD = 8222;
-pub const ERROR_DS_OPERATIONS_ERROR: DWORD = 8224;
-pub const ERROR_DS_PROTOCOL_ERROR: DWORD = 8225;
-pub const ERROR_DS_TIMELIMIT_EXCEEDED: DWORD = 8226;
-pub const ERROR_DS_SIZELIMIT_EXCEEDED: DWORD = 8227;
-pub const ERROR_DS_ADMIN_LIMIT_EXCEEDED: DWORD = 8228;
-pub const ERROR_DS_COMPARE_FALSE: DWORD = 8229;
-pub const ERROR_DS_COMPARE_TRUE: DWORD = 8230;
-pub const ERROR_DS_AUTH_METHOD_NOT_SUPPORTED: DWORD = 8231;
-pub const ERROR_DS_STRONG_AUTH_REQUIRED: DWORD = 8232;
-pub const ERROR_DS_INAPPROPRIATE_AUTH: DWORD = 8233;
-pub const ERROR_DS_AUTH_UNKNOWN: DWORD = 8234;
-pub const ERROR_DS_REFERRAL: DWORD = 8235;
-pub const ERROR_DS_UNAVAILABLE_CRIT_EXTENSION: DWORD = 8236;
-pub const ERROR_DS_CONFIDENTIALITY_REQUIRED: DWORD = 8237;
-pub const ERROR_DS_INAPPROPRIATE_MATCHING: DWORD = 8238;
-pub const ERROR_DS_CONSTRAINT_VIOLATION: DWORD = 8239;
-pub const ERROR_DS_NO_SUCH_OBJECT: DWORD = 8240;
-pub const ERROR_DS_ALIAS_PROBLEM: DWORD = 8241;
-pub const ERROR_DS_INVALID_DN_SYNTAX: DWORD = 8242;
-pub const ERROR_DS_IS_LEAF: DWORD = 8243;
-pub const ERROR_DS_ALIAS_DEREF_PROBLEM: DWORD = 8244;
-pub const ERROR_DS_UNWILLING_TO_PERFORM: DWORD = 8245;
-pub const ERROR_DS_LOOP_DETECT: DWORD = 8246;
-pub const ERROR_DS_NAMING_VIOLATION: DWORD = 8247;
-pub const ERROR_DS_OBJECT_RESULTS_TOO_LARGE: DWORD = 8248;
-pub const ERROR_DS_AFFECTS_MULTIPLE_DSAS: DWORD = 8249;
-pub const ERROR_DS_SERVER_DOWN: DWORD = 8250;
-pub const ERROR_DS_LOCAL_ERROR: DWORD = 8251;
-pub const ERROR_DS_ENCODING_ERROR: DWORD = 8252;
-pub const ERROR_DS_DECODING_ERROR: DWORD = 8253;
-pub const ERROR_DS_FILTER_UNKNOWN: DWORD = 8254;
-pub const ERROR_DS_PARAM_ERROR: DWORD = 8255;
-pub const ERROR_DS_NOT_SUPPORTED: DWORD = 8256;
-pub const ERROR_DS_NO_RESULTS_RETURNED: DWORD = 8257;
-pub const ERROR_DS_CONTROL_NOT_FOUND: DWORD = 8258;
-pub const ERROR_DS_CLIENT_LOOP: DWORD = 8259;
-pub const ERROR_DS_REFERRAL_LIMIT_EXCEEDED: DWORD = 8260;
-pub const ERROR_DS_SORT_CONTROL_MISSING: DWORD = 8261;
-pub const ERROR_DS_OFFSET_RANGE_ERROR: DWORD = 8262;
-pub const ERROR_DS_ROOT_MUST_BE_NC: DWORD = 8301;
-pub const ERROR_DS_ADD_REPLICA_INHIBITED: DWORD = 8302;
-pub const ERROR_DS_ATT_NOT_DEF_IN_SCHEMA: DWORD = 8303;
-pub const ERROR_DS_MAX_OBJ_SIZE_EXCEEDED: DWORD = 8304;
-pub const ERROR_DS_OBJ_STRING_NAME_EXISTS: DWORD = 8305;
-pub const ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA: DWORD = 8306;
-pub const ERROR_DS_RDN_DOESNT_MATCH_SCHEMA: DWORD = 8307;
-pub const ERROR_DS_NO_REQUESTED_ATTS_FOUND: DWORD = 8308;
-pub const ERROR_DS_USER_BUFFER_TO_SMALL: DWORD = 8309;
-pub const ERROR_DS_ATT_IS_NOT_ON_OBJ: DWORD = 8310;
-pub const ERROR_DS_ILLEGAL_MOD_OPERATION: DWORD = 8311;
-pub const ERROR_DS_OBJ_TOO_LARGE: DWORD = 8312;
-pub const ERROR_DS_BAD_INSTANCE_TYPE: DWORD = 8313;
-pub const ERROR_DS_MASTERDSA_REQUIRED: DWORD = 8314;
-pub const ERROR_DS_OBJECT_CLASS_REQUIRED: DWORD = 8315;
-pub const ERROR_DS_MISSING_REQUIRED_ATT: DWORD = 8316;
-pub const ERROR_DS_ATT_NOT_DEF_FOR_CLASS: DWORD = 8317;
-pub const ERROR_DS_ATT_ALREADY_EXISTS: DWORD = 8318;
-pub const ERROR_DS_CANT_ADD_ATT_VALUES: DWORD = 8320;
-pub const ERROR_DS_SINGLE_VALUE_CONSTRAINT: DWORD = 8321;
-pub const ERROR_DS_RANGE_CONSTRAINT: DWORD = 8322;
-pub const ERROR_DS_ATT_VAL_ALREADY_EXISTS: DWORD = 8323;
-pub const ERROR_DS_CANT_REM_MISSING_ATT: DWORD = 8324;
-pub const ERROR_DS_CANT_REM_MISSING_ATT_VAL: DWORD = 8325;
-pub const ERROR_DS_ROOT_CANT_BE_SUBREF: DWORD = 8326;
-pub const ERROR_DS_NO_CHAINING: DWORD = 8327;
-pub const ERROR_DS_NO_CHAINED_EVAL: DWORD = 8328;
-pub const ERROR_DS_NO_PARENT_OBJECT: DWORD = 8329;
-pub const ERROR_DS_PARENT_IS_AN_ALIAS: DWORD = 8330;
-pub const ERROR_DS_CANT_MIX_MASTER_AND_REPS: DWORD = 8331;
-pub const ERROR_DS_CHILDREN_EXIST: DWORD = 8332;
-pub const ERROR_DS_OBJ_NOT_FOUND: DWORD = 8333;
-pub const ERROR_DS_ALIASED_OBJ_MISSING: DWORD = 8334;
-pub const ERROR_DS_BAD_NAME_SYNTAX: DWORD = 8335;
-pub const ERROR_DS_ALIAS_POINTS_TO_ALIAS: DWORD = 8336;
-pub const ERROR_DS_CANT_DEREF_ALIAS: DWORD = 8337;
-pub const ERROR_DS_OUT_OF_SCOPE: DWORD = 8338;
-pub const ERROR_DS_OBJECT_BEING_REMOVED: DWORD = 8339;
-pub const ERROR_DS_CANT_DELETE_DSA_OBJ: DWORD = 8340;
-pub const ERROR_DS_GENERIC_ERROR: DWORD = 8341;
-pub const ERROR_DS_DSA_MUST_BE_INT_MASTER: DWORD = 8342;
-pub const ERROR_DS_CLASS_NOT_DSA: DWORD = 8343;
-pub const ERROR_DS_INSUFF_ACCESS_RIGHTS: DWORD = 8344;
-pub const ERROR_DS_ILLEGAL_SUPERIOR: DWORD = 8345;
-pub const ERROR_DS_ATTRIBUTE_OWNED_BY_SAM: DWORD = 8346;
-pub const ERROR_DS_NAME_TOO_MANY_PARTS: DWORD = 8347;
-pub const ERROR_DS_NAME_TOO_LONG: DWORD = 8348;
-pub const ERROR_DS_NAME_VALUE_TOO_LONG: DWORD = 8349;
-pub const ERROR_DS_NAME_UNPARSEABLE: DWORD = 8350;
-pub const ERROR_DS_NAME_TYPE_UNKNOWN: DWORD = 8351;
-pub const ERROR_DS_NOT_AN_OBJECT: DWORD = 8352;
-pub const ERROR_DS_SEC_DESC_TOO_SHORT: DWORD = 8353;
-pub const ERROR_DS_SEC_DESC_INVALID: DWORD = 8354;
-pub const ERROR_DS_NO_DELETED_NAME: DWORD = 8355;
-pub const ERROR_DS_SUBREF_MUST_HAVE_PARENT: DWORD = 8356;
-pub const ERROR_DS_NCNAME_MUST_BE_NC: DWORD = 8357;
-pub const ERROR_DS_CANT_ADD_SYSTEM_ONLY: DWORD = 8358;
-pub const ERROR_DS_CLASS_MUST_BE_CONCRETE: DWORD = 8359;
-pub const ERROR_DS_INVALID_DMD: DWORD = 8360;
-pub const ERROR_DS_OBJ_GUID_EXISTS: DWORD = 8361;
-pub const ERROR_DS_NOT_ON_BACKLINK: DWORD = 8362;
-pub const ERROR_DS_NO_CROSSREF_FOR_NC: DWORD = 8363;
-pub const ERROR_DS_SHUTTING_DOWN: DWORD = 8364;
-pub const ERROR_DS_UNKNOWN_OPERATION: DWORD = 8365;
-pub const ERROR_DS_INVALID_ROLE_OWNER: DWORD = 8366;
-pub const ERROR_DS_COULDNT_CONTACT_FSMO: DWORD = 8367;
-pub const ERROR_DS_CROSS_NC_DN_RENAME: DWORD = 8368;
-pub const ERROR_DS_CANT_MOD_SYSTEM_ONLY: DWORD = 8369;
-pub const ERROR_DS_REPLICATOR_ONLY: DWORD = 8370;
-pub const ERROR_DS_OBJ_CLASS_NOT_DEFINED: DWORD = 8371;
-pub const ERROR_DS_OBJ_CLASS_NOT_SUBCLASS: DWORD = 8372;
-pub const ERROR_DS_NAME_REFERENCE_INVALID: DWORD = 8373;
-pub const ERROR_DS_CROSS_REF_EXISTS: DWORD = 8374;
-pub const ERROR_DS_CANT_DEL_MASTER_CROSSREF: DWORD = 8375;
-pub const ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD: DWORD = 8376;
-pub const ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX: DWORD = 8377;
-pub const ERROR_DS_DUP_RDN: DWORD = 8378;
-pub const ERROR_DS_DUP_OID: DWORD = 8379;
-pub const ERROR_DS_DUP_MAPI_ID: DWORD = 8380;
-pub const ERROR_DS_DUP_SCHEMA_ID_GUID: DWORD = 8381;
-pub const ERROR_DS_DUP_LDAP_DISPLAY_NAME: DWORD = 8382;
-pub const ERROR_DS_SEMANTIC_ATT_TEST: DWORD = 8383;
-pub const ERROR_DS_SYNTAX_MISMATCH: DWORD = 8384;
-pub const ERROR_DS_EXISTS_IN_MUST_HAVE: DWORD = 8385;
-pub const ERROR_DS_EXISTS_IN_MAY_HAVE: DWORD = 8386;
-pub const ERROR_DS_NONEXISTENT_MAY_HAVE: DWORD = 8387;
-pub const ERROR_DS_NONEXISTENT_MUST_HAVE: DWORD = 8388;
-pub const ERROR_DS_AUX_CLS_TEST_FAIL: DWORD = 8389;
-pub const ERROR_DS_NONEXISTENT_POSS_SUP: DWORD = 8390;
-pub const ERROR_DS_SUB_CLS_TEST_FAIL: DWORD = 8391;
-pub const ERROR_DS_BAD_RDN_ATT_ID_SYNTAX: DWORD = 8392;
-pub const ERROR_DS_EXISTS_IN_AUX_CLS: DWORD = 8393;
-pub const ERROR_DS_EXISTS_IN_SUB_CLS: DWORD = 8394;
-pub const ERROR_DS_EXISTS_IN_POSS_SUP: DWORD = 8395;
-pub const ERROR_DS_RECALCSCHEMA_FAILED: DWORD = 8396;
-pub const ERROR_DS_TREE_DELETE_NOT_FINISHED: DWORD = 8397;
-pub const ERROR_DS_CANT_DELETE: DWORD = 8398;
-pub const ERROR_DS_ATT_SCHEMA_REQ_ID: DWORD = 8399;
-pub const ERROR_DS_BAD_ATT_SCHEMA_SYNTAX: DWORD = 8400;
-pub const ERROR_DS_CANT_CACHE_ATT: DWORD = 8401;
-pub const ERROR_DS_CANT_CACHE_CLASS: DWORD = 8402;
-pub const ERROR_DS_CANT_REMOVE_ATT_CACHE: DWORD = 8403;
-pub const ERROR_DS_CANT_REMOVE_CLASS_CACHE: DWORD = 8404;
-pub const ERROR_DS_CANT_RETRIEVE_DN: DWORD = 8405;
-pub const ERROR_DS_MISSING_SUPREF: DWORD = 8406;
-pub const ERROR_DS_CANT_RETRIEVE_INSTANCE: DWORD = 8407;
-pub const ERROR_DS_CODE_INCONSISTENCY: DWORD = 8408;
-pub const ERROR_DS_DATABASE_ERROR: DWORD = 8409;
-pub const ERROR_DS_GOVERNSID_MISSING: DWORD = 8410;
-pub const ERROR_DS_MISSING_EXPECTED_ATT: DWORD = 8411;
-pub const ERROR_DS_NCNAME_MISSING_CR_REF: DWORD = 8412;
-pub const ERROR_DS_SECURITY_CHECKING_ERROR: DWORD = 8413;
-pub const ERROR_DS_SCHEMA_NOT_LOADED: DWORD = 8414;
-pub const ERROR_DS_SCHEMA_ALLOC_FAILED: DWORD = 8415;
-pub const ERROR_DS_ATT_SCHEMA_REQ_SYNTAX: DWORD = 8416;
-pub const ERROR_DS_GCVERIFY_ERROR: DWORD = 8417;
-pub const ERROR_DS_DRA_SCHEMA_MISMATCH: DWORD = 8418;
-pub const ERROR_DS_CANT_FIND_DSA_OBJ: DWORD = 8419;
-pub const ERROR_DS_CANT_FIND_EXPECTED_NC: DWORD = 8420;
-pub const ERROR_DS_CANT_FIND_NC_IN_CACHE: DWORD = 8421;
-pub const ERROR_DS_CANT_RETRIEVE_CHILD: DWORD = 8422;
-pub const ERROR_DS_SECURITY_ILLEGAL_MODIFY: DWORD = 8423;
-pub const ERROR_DS_CANT_REPLACE_HIDDEN_REC: DWORD = 8424;
-pub const ERROR_DS_BAD_HIERARCHY_FILE: DWORD = 8425;
-pub const ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED: DWORD = 8426;
-pub const ERROR_DS_CONFIG_PARAM_MISSING: DWORD = 8427;
-pub const ERROR_DS_COUNTING_AB_INDICES_FAILED: DWORD = 8428;
-pub const ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED: DWORD = 8429;
-pub const ERROR_DS_INTERNAL_FAILURE: DWORD = 8430;
-pub const ERROR_DS_UNKNOWN_ERROR: DWORD = 8431;
-pub const ERROR_DS_ROOT_REQUIRES_CLASS_TOP: DWORD = 8432;
-pub const ERROR_DS_REFUSING_FSMO_ROLES: DWORD = 8433;
-pub const ERROR_DS_MISSING_FSMO_SETTINGS: DWORD = 8434;
-pub const ERROR_DS_UNABLE_TO_SURRENDER_ROLES: DWORD = 8435;
-pub const ERROR_DS_DRA_GENERIC: DWORD = 8436;
-pub const ERROR_DS_DRA_INVALID_PARAMETER: DWORD = 8437;
-pub const ERROR_DS_DRA_BUSY: DWORD = 8438;
-pub const ERROR_DS_DRA_BAD_DN: DWORD = 8439;
-pub const ERROR_DS_DRA_BAD_NC: DWORD = 8440;
-pub const ERROR_DS_DRA_DN_EXISTS: DWORD = 8441;
-pub const ERROR_DS_DRA_INTERNAL_ERROR: DWORD = 8442;
-pub const ERROR_DS_DRA_INCONSISTENT_DIT: DWORD = 8443;
-pub const ERROR_DS_DRA_CONNECTION_FAILED: DWORD = 8444;
-pub const ERROR_DS_DRA_BAD_INSTANCE_TYPE: DWORD = 8445;
-pub const ERROR_DS_DRA_OUT_OF_MEM: DWORD = 8446;
-pub const ERROR_DS_DRA_MAIL_PROBLEM: DWORD = 8447;
-pub const ERROR_DS_DRA_REF_ALREADY_EXISTS: DWORD = 8448;
-pub const ERROR_DS_DRA_REF_NOT_FOUND: DWORD = 8449;
-pub const ERROR_DS_DRA_OBJ_IS_REP_SOURCE: DWORD = 8450;
-pub const ERROR_DS_DRA_DB_ERROR: DWORD = 8451;
-pub const ERROR_DS_DRA_NO_REPLICA: DWORD = 8452;
-pub const ERROR_DS_DRA_ACCESS_DENIED: DWORD = 8453;
-pub const ERROR_DS_DRA_NOT_SUPPORTED: DWORD = 8454;
-pub const ERROR_DS_DRA_RPC_CANCELLED: DWORD = 8455;
-pub const ERROR_DS_DRA_SOURCE_DISABLED: DWORD = 8456;
-pub const ERROR_DS_DRA_SINK_DISABLED: DWORD = 8457;
-pub const ERROR_DS_DRA_NAME_COLLISION: DWORD = 8458;
-pub const ERROR_DS_DRA_SOURCE_REINSTALLED: DWORD = 8459;
-pub const ERROR_DS_DRA_MISSING_PARENT: DWORD = 8460;
-pub const ERROR_DS_DRA_PREEMPTED: DWORD = 8461;
-pub const ERROR_DS_DRA_ABANDON_SYNC: DWORD = 8462;
-pub const ERROR_DS_DRA_SHUTDOWN: DWORD = 8463;
-pub const ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET: DWORD = 8464;
-pub const ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA: DWORD = 8465;
-pub const ERROR_DS_DRA_EXTN_CONNECTION_FAILED: DWORD = 8466;
-pub const ERROR_DS_INSTALL_SCHEMA_MISMATCH: DWORD = 8467;
-pub const ERROR_DS_DUP_LINK_ID: DWORD = 8468;
-pub const ERROR_DS_NAME_ERROR_RESOLVING: DWORD = 8469;
-pub const ERROR_DS_NAME_ERROR_NOT_FOUND: DWORD = 8470;
-pub const ERROR_DS_NAME_ERROR_NOT_UNIQUE: DWORD = 8471;
-pub const ERROR_DS_NAME_ERROR_NO_MAPPING: DWORD = 8472;
-pub const ERROR_DS_NAME_ERROR_DOMAIN_ONLY: DWORD = 8473;
-pub const ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING: DWORD = 8474;
-pub const ERROR_DS_CONSTRUCTED_ATT_MOD: DWORD = 8475;
-pub const ERROR_DS_WRONG_OM_OBJ_CLASS: DWORD = 8476;
-pub const ERROR_DS_DRA_REPL_PENDING: DWORD = 8477;
-pub const ERROR_DS_DS_REQUIRED: DWORD = 8478;
-pub const ERROR_DS_INVALID_LDAP_DISPLAY_NAME: DWORD = 8479;
-pub const ERROR_DS_NON_BASE_SEARCH: DWORD = 8480;
-pub const ERROR_DS_CANT_RETRIEVE_ATTS: DWORD = 8481;
-pub const ERROR_DS_BACKLINK_WITHOUT_LINK: DWORD = 8482;
-pub const ERROR_DS_EPOCH_MISMATCH: DWORD = 8483;
-pub const ERROR_DS_SRC_NAME_MISMATCH: DWORD = 8484;
-pub const ERROR_DS_SRC_AND_DST_NC_IDENTICAL: DWORD = 8485;
-pub const ERROR_DS_DST_NC_MISMATCH: DWORD = 8486;
-pub const ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC: DWORD = 8487;
-pub const ERROR_DS_SRC_GUID_MISMATCH: DWORD = 8488;
-pub const ERROR_DS_CANT_MOVE_DELETED_OBJECT: DWORD = 8489;
-pub const ERROR_DS_PDC_OPERATION_IN_PROGRESS: DWORD = 8490;
-pub const ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD: DWORD = 8491;
-pub const ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION: DWORD = 8492;
-pub const ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS: DWORD = 8493;
-pub const ERROR_DS_NC_MUST_HAVE_NC_PARENT: DWORD = 8494;
-pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE: DWORD = 8495;
-pub const ERROR_DS_DST_DOMAIN_NOT_NATIVE: DWORD = 8496;
-pub const ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER: DWORD = 8497;
-pub const ERROR_DS_CANT_MOVE_ACCOUNT_GROUP: DWORD = 8498;
-pub const ERROR_DS_CANT_MOVE_RESOURCE_GROUP: DWORD = 8499;
-pub const ERROR_DS_INVALID_SEARCH_FLAG: DWORD = 8500;
-pub const ERROR_DS_NO_TREE_DELETE_ABOVE_NC: DWORD = 8501;
-pub const ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE: DWORD = 8502;
-pub const ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE: DWORD = 8503;
-pub const ERROR_DS_SAM_INIT_FAILURE: DWORD = 8504;
-pub const ERROR_DS_SENSITIVE_GROUP_VIOLATION: DWORD = 8505;
-pub const ERROR_DS_CANT_MOD_PRIMARYGROUPID: DWORD = 8506;
-pub const ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD: DWORD = 8507;
-pub const ERROR_DS_NONSAFE_SCHEMA_CHANGE: DWORD = 8508;
-pub const ERROR_DS_SCHEMA_UPDATE_DISALLOWED: DWORD = 8509;
-pub const ERROR_DS_CANT_CREATE_UNDER_SCHEMA: DWORD = 8510;
-pub const ERROR_DS_INSTALL_NO_SRC_SCH_VERSION: DWORD = 8511;
-pub const ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE: DWORD = 8512;
-pub const ERROR_DS_INVALID_GROUP_TYPE: DWORD = 8513;
-pub const ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN: DWORD = 8514;
-pub const ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN: DWORD = 8515;
-pub const ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER: DWORD = 8516;
-pub const ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER: DWORD = 8517;
-pub const ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER: DWORD = 8518;
-pub const ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER: DWORD = 8519;
-pub const ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER: DWORD = 8520;
-pub const ERROR_DS_HAVE_PRIMARY_MEMBERS: DWORD = 8521;
-pub const ERROR_DS_STRING_SD_CONVERSION_FAILED: DWORD = 8522;
-pub const ERROR_DS_NAMING_MASTER_GC: DWORD = 8523;
-pub const ERROR_DS_DNS_LOOKUP_FAILURE: DWORD = 8524;
-pub const ERROR_DS_COULDNT_UPDATE_SPNS: DWORD = 8525;
-pub const ERROR_DS_CANT_RETRIEVE_SD: DWORD = 8526;
-pub const ERROR_DS_KEY_NOT_UNIQUE: DWORD = 8527;
-pub const ERROR_DS_WRONG_LINKED_ATT_SYNTAX: DWORD = 8528;
-pub const ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD: DWORD = 8529;
-pub const ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY: DWORD = 8530;
-pub const ERROR_DS_CANT_START: DWORD = 8531;
-pub const ERROR_DS_INIT_FAILURE: DWORD = 8532;
-pub const ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION: DWORD = 8533;
-pub const ERROR_DS_SOURCE_DOMAIN_IN_FOREST: DWORD = 8534;
-pub const ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST: DWORD = 8535;
-pub const ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED: DWORD = 8536;
-pub const ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN: DWORD = 8537;
-pub const ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER: DWORD = 8538;
-pub const ERROR_DS_SRC_SID_EXISTS_IN_FOREST: DWORD = 8539;
-pub const ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH: DWORD = 8540;
-pub const ERROR_SAM_INIT_FAILURE: DWORD = 8541;
-pub const ERROR_DS_DRA_SCHEMA_INFO_SHIP: DWORD = 8542;
-pub const ERROR_DS_DRA_SCHEMA_CONFLICT: DWORD = 8543;
-pub const ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT: DWORD = 8544;
-pub const ERROR_DS_DRA_OBJ_NC_MISMATCH: DWORD = 8545;
-pub const ERROR_DS_NC_STILL_HAS_DSAS: DWORD = 8546;
-pub const ERROR_DS_GC_REQUIRED: DWORD = 8547;
-pub const ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY: DWORD = 8548;
-pub const ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS: DWORD = 8549;
-pub const ERROR_DS_CANT_ADD_TO_GC: DWORD = 8550;
-pub const ERROR_DS_NO_CHECKPOINT_WITH_PDC: DWORD = 8551;
-pub const ERROR_DS_SOURCE_AUDITING_NOT_ENABLED: DWORD = 8552;
-pub const ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC: DWORD = 8553;
-pub const ERROR_DS_INVALID_NAME_FOR_SPN: DWORD = 8554;
-pub const ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS: DWORD = 8555;
-pub const ERROR_DS_UNICODEPWD_NOT_IN_QUOTES: DWORD = 8556;
-pub const ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED: DWORD = 8557;
-pub const ERROR_DS_MUST_BE_RUN_ON_DST_DC: DWORD = 8558;
-pub const ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER: DWORD = 8559;
-pub const ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ: DWORD = 8560;
-pub const ERROR_DS_INIT_FAILURE_CONSOLE: DWORD = 8561;
-pub const ERROR_DS_SAM_INIT_FAILURE_CONSOLE: DWORD = 8562;
-pub const ERROR_DS_FOREST_VERSION_TOO_HIGH: DWORD = 8563;
-pub const ERROR_DS_DOMAIN_VERSION_TOO_HIGH: DWORD = 8564;
-pub const ERROR_DS_FOREST_VERSION_TOO_LOW: DWORD = 8565;
-pub const ERROR_DS_DOMAIN_VERSION_TOO_LOW: DWORD = 8566;
-pub const ERROR_DS_INCOMPATIBLE_VERSION: DWORD = 8567;
-pub const ERROR_DS_LOW_DSA_VERSION: DWORD = 8568;
-pub const ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN: DWORD = 8569;
-pub const ERROR_DS_NOT_SUPPORTED_SORT_ORDER: DWORD = 8570;
-pub const ERROR_DS_NAME_NOT_UNIQUE: DWORD = 8571;
-pub const ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4: DWORD = 8572;
-pub const ERROR_DS_OUT_OF_VERSION_STORE: DWORD = 8573;
-pub const ERROR_DS_INCOMPATIBLE_CONTROLS_USED: DWORD = 8574;
-pub const ERROR_DS_NO_REF_DOMAIN: DWORD = 8575;
-pub const ERROR_DS_RESERVED_LINK_ID: DWORD = 8576;
-pub const ERROR_DS_LINK_ID_NOT_AVAILABLE: DWORD = 8577;
-pub const ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER: DWORD = 8578;
-pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE: DWORD = 8579;
-pub const ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC: DWORD = 8580;
-pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG: DWORD = 8581;
-pub const ERROR_DS_MODIFYDN_WRONG_GRANDPARENT: DWORD = 8582;
-pub const ERROR_DS_NAME_ERROR_TRUST_REFERRAL: DWORD = 8583;
-pub const ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER: DWORD = 8584;
-pub const ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD: DWORD = 8585;
-pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2: DWORD = 8586;
-pub const ERROR_DS_THREAD_LIMIT_EXCEEDED: DWORD = 8587;
-pub const ERROR_DS_NOT_CLOSEST: DWORD = 8588;
-pub const ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF: DWORD = 8589;
-pub const ERROR_DS_SINGLE_USER_MODE_FAILED: DWORD = 8590;
-pub const ERROR_DS_NTDSCRIPT_SYNTAX_ERROR: DWORD = 8591;
-pub const ERROR_DS_NTDSCRIPT_PROCESS_ERROR: DWORD = 8592;
-pub const ERROR_DS_DIFFERENT_REPL_EPOCHS: DWORD = 8593;
-pub const ERROR_DS_DRS_EXTENSIONS_CHANGED: DWORD = 8594;
-pub const ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR: DWORD = 8595;
-pub const ERROR_DS_NO_MSDS_INTID: DWORD = 8596;
-pub const ERROR_DS_DUP_MSDS_INTID: DWORD = 8597;
-pub const ERROR_DS_EXISTS_IN_RDNATTID: DWORD = 8598;
-pub const ERROR_DS_AUTHORIZATION_FAILED: DWORD = 8599;
-pub const ERROR_DS_INVALID_SCRIPT: DWORD = 8600;
-pub const ERROR_DS_REMOTE_CROSSREF_OP_FAILED: DWORD = 8601;
-pub const ERROR_DS_CROSS_REF_BUSY: DWORD = 8602;
-pub const ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN: DWORD = 8603;
-pub const ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC: DWORD = 8604;
-pub const ERROR_DS_DUPLICATE_ID_FOUND: DWORD = 8605;
-pub const ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT: DWORD = 8606;
-pub const ERROR_DS_GROUP_CONVERSION_ERROR: DWORD = 8607;
-pub const ERROR_DS_CANT_MOVE_APP_BASIC_GROUP: DWORD = 8608;
-pub const ERROR_DS_CANT_MOVE_APP_QUERY_GROUP: DWORD = 8609;
-pub const ERROR_DS_ROLE_NOT_VERIFIED: DWORD = 8610;
-pub const ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL: DWORD = 8611;
-pub const ERROR_DS_DOMAIN_RENAME_IN_PROGRESS: DWORD = 8612;
-pub const ERROR_DS_EXISTING_AD_CHILD_NC: DWORD = 8613;
-pub const ERROR_DS_REPL_LIFETIME_EXCEEDED: DWORD = 8614;
-pub const ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER: DWORD = 8615;
-pub const ERROR_DS_LDAP_SEND_QUEUE_FULL: DWORD = 8616;
-pub const ERROR_DS_DRA_OUT_SCHEDULE_WINDOW: DWORD = 8617;
-pub const ERROR_SXS_SECTION_NOT_FOUND: DWORD = 14000;
-pub const ERROR_SXS_CANT_GEN_ACTCTX: DWORD = 14001;
-pub const ERROR_SXS_INVALID_ACTCTXDATA_FORMAT: DWORD = 14002;
-pub const ERROR_SXS_ASSEMBLY_NOT_FOUND: DWORD = 14003;
-pub const ERROR_SXS_MANIFEST_FORMAT_ERROR: DWORD = 14004;
-pub const ERROR_SXS_MANIFEST_PARSE_ERROR: DWORD = 14005;
-pub const ERROR_SXS_ACTIVATION_CONTEXT_DISABLED: DWORD = 14006;
-pub const ERROR_SXS_KEY_NOT_FOUND: DWORD = 14007;
-pub const ERROR_SXS_VERSION_CONFLICT: DWORD = 14008;
-pub const ERROR_SXS_WRONG_SECTION_TYPE: DWORD = 14009;
-pub const ERROR_SXS_THREAD_QUERIES_DISABLED: DWORD = 14010;
-pub const ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET: DWORD = 14011;
-pub const ERROR_SXS_UNKNOWN_ENCODING_GROUP: DWORD = 14012;
-pub const ERROR_SXS_UNKNOWN_ENCODING: DWORD = 14013;
-pub const ERROR_SXS_INVALID_XML_NAMESPACE_URI: DWORD = 14014;
-pub const ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED: DWORD = 14015;
-pub const ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED: DWORD = 14016;
-pub const ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE: DWORD = 14017;
-pub const ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE: DWORD = 14018;
-pub const ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE: DWORD = 14019;
-pub const ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT: DWORD = 14020;
-pub const ERROR_SXS_DUPLICATE_DLL_NAME: DWORD = 14021;
-pub const ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME: DWORD = 14022;
-pub const ERROR_SXS_DUPLICATE_CLSID: DWORD = 14023;
-pub const ERROR_SXS_DUPLICATE_IID: DWORD = 14024;
-pub const ERROR_SXS_DUPLICATE_TLBID: DWORD = 14025;
-pub const ERROR_SXS_DUPLICATE_PROGID: DWORD = 14026;
-pub const ERROR_SXS_DUPLICATE_ASSEMBLY_NAME: DWORD = 14027;
-pub const ERROR_SXS_FILE_HASH_MISMATCH: DWORD = 14028;
-pub const ERROR_SXS_POLICY_PARSE_ERROR: DWORD = 14029;
-pub const ERROR_SXS_XML_E_MISSINGQUOTE: DWORD = 14030;
-pub const ERROR_SXS_XML_E_COMMENTSYNTAX: DWORD = 14031;
-pub const ERROR_SXS_XML_E_BADSTARTNAMECHAR: DWORD = 14032;
-pub const ERROR_SXS_XML_E_BADNAMECHAR: DWORD = 14033;
-pub const ERROR_SXS_XML_E_BADCHARINSTRING: DWORD = 14034;
-pub const ERROR_SXS_XML_E_XMLDECLSYNTAX: DWORD = 14035;
-pub const ERROR_SXS_XML_E_BADCHARDATA: DWORD = 14036;
-pub const ERROR_SXS_XML_E_MISSINGWHITESPACE: DWORD = 14037;
-pub const ERROR_SXS_XML_E_EXPECTINGTAGEND: DWORD = 14038;
-pub const ERROR_SXS_XML_E_MISSINGSEMICOLON: DWORD = 14039;
-pub const ERROR_SXS_XML_E_UNBALANCEDPAREN: DWORD = 14040;
-pub const ERROR_SXS_XML_E_INTERNALERROR: DWORD = 14041;
-pub const ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE: DWORD = 14042;
-pub const ERROR_SXS_XML_E_INCOMPLETE_ENCODING: DWORD = 14043;
-pub const ERROR_SXS_XML_E_MISSING_PAREN: DWORD = 14044;
-pub const ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE: DWORD = 14045;
-pub const ERROR_SXS_XML_E_MULTIPLE_COLONS: DWORD = 14046;
-pub const ERROR_SXS_XML_E_INVALID_DECIMAL: DWORD = 14047;
-pub const ERROR_SXS_XML_E_INVALID_HEXIDECIMAL: DWORD = 14048;
-pub const ERROR_SXS_XML_E_INVALID_UNICODE: DWORD = 14049;
-pub const ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK: DWORD = 14050;
-pub const ERROR_SXS_XML_E_UNEXPECTEDENDTAG: DWORD = 14051;
-pub const ERROR_SXS_XML_E_UNCLOSEDTAG: DWORD = 14052;
-pub const ERROR_SXS_XML_E_DUPLICATEATTRIBUTE: DWORD = 14053;
-pub const ERROR_SXS_XML_E_MULTIPLEROOTS: DWORD = 14054;
-pub const ERROR_SXS_XML_E_INVALIDATROOTLEVEL: DWORD = 14055;
-pub const ERROR_SXS_XML_E_BADXMLDECL: DWORD = 14056;
-pub const ERROR_SXS_XML_E_MISSINGROOT: DWORD = 14057;
-pub const ERROR_SXS_XML_E_UNEXPECTEDEOF: DWORD = 14058;
-pub const ERROR_SXS_XML_E_BADPEREFINSUBSET: DWORD = 14059;
-pub const ERROR_SXS_XML_E_UNCLOSEDSTARTTAG: DWORD = 14060;
-pub const ERROR_SXS_XML_E_UNCLOSEDENDTAG: DWORD = 14061;
-pub const ERROR_SXS_XML_E_UNCLOSEDSTRING: DWORD = 14062;
-pub const ERROR_SXS_XML_E_UNCLOSEDCOMMENT: DWORD = 14063;
-pub const ERROR_SXS_XML_E_UNCLOSEDDECL: DWORD = 14064;
-pub const ERROR_SXS_XML_E_UNCLOSEDCDATA: DWORD = 14065;
-pub const ERROR_SXS_XML_E_RESERVEDNAMESPACE: DWORD = 14066;
-pub const ERROR_SXS_XML_E_INVALIDENCODING: DWORD = 14067;
-pub const ERROR_SXS_XML_E_INVALIDSWITCH: DWORD = 14068;
-pub const ERROR_SXS_XML_E_BADXMLCASE: DWORD = 14069;
-pub const ERROR_SXS_XML_E_INVALID_STANDALONE: DWORD = 14070;
-pub const ERROR_SXS_XML_E_UNEXPECTED_STANDALONE: DWORD = 14071;
-pub const ERROR_SXS_XML_E_INVALID_VERSION: DWORD = 14072;
-pub const ERROR_SXS_XML_E_MISSINGEQUALS: DWORD = 14073;
-pub const ERROR_SXS_PROTECTION_RECOVERY_FAILED: DWORD = 14074;
-pub const ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT: DWORD = 14075;
-pub const ERROR_SXS_PROTECTION_CATALOG_NOT_VALID: DWORD = 14076;
-pub const ERROR_SXS_UNTRANSLATABLE_HRESULT: DWORD = 14077;
-pub const ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING: DWORD = 14078;
-pub const ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE: DWORD = 14079;
-pub const ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME: DWORD = 14080;
-pub const ERROR_SXS_ASSEMBLY_MISSING: DWORD = 14081;
-pub const ERROR_SXS_CORRUPT_ACTIVATION_STACK: DWORD = 14082;
-pub const ERROR_SXS_CORRUPTION: DWORD = 14083;
-pub const ERROR_SXS_EARLY_DEACTIVATION: DWORD = 14084;
-pub const ERROR_SXS_INVALID_DEACTIVATION: DWORD = 14085;
-pub const ERROR_SXS_MULTIPLE_DEACTIVATION: DWORD = 14086;
-pub const ERROR_SXS_PROCESS_TERMINATION_REQUESTED: DWORD = 14087;
-pub const ERROR_SXS_RELEASE_ACTIVATION_CONTEXT: DWORD = 14088;
-pub const ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY: DWORD = 14089;
-pub const ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE: DWORD = 14090;
-pub const ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME: DWORD = 14091;
-pub const ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE: DWORD = 14092;
-pub const ERROR_SXS_IDENTITY_PARSE_ERROR: DWORD = 14093;
-pub const ERROR_MALFORMED_SUBSTITUTION_STRING: DWORD = 14094;
-pub const ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN: DWORD = 14095;
-pub const ERROR_UNMAPPED_SUBSTITUTION_STRING: DWORD = 14096;
-pub const ERROR_SXS_ASSEMBLY_NOT_LOCKED: DWORD = 14097;
-pub const ERROR_SXS_COMPONENT_STORE_CORRUPT: DWORD = 14098;
-pub const ERROR_ADVANCED_INSTALLER_FAILED: DWORD = 14099;
-pub const ERROR_XML_ENCODING_MISMATCH: DWORD = 14100;
-pub const ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT: DWORD = 14101;
-pub const ERROR_SXS_IDENTITIES_DIFFERENT: DWORD = 14102;
-pub const ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT: DWORD = 14103;
-pub const ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY: DWORD = 14104;
-pub const ERROR_SXS_MANIFEST_TOO_BIG: DWORD = 14105;
-pub const ERROR_SXS_SETTING_NOT_REGISTERED: DWORD = 14106;
-pub const ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE: DWORD = 14107;
-pub const ERROR_SMI_PRIMITIVE_INSTALLER_FAILED: DWORD = 14108;
-pub const ERROR_GENERIC_COMMAND_FAILED: DWORD = 14109;
-pub const ERROR_SXS_FILE_HASH_MISSING: DWORD = 14110;
-pub const ERROR_IPSEC_QM_POLICY_EXISTS: DWORD = 13000;
-pub const ERROR_IPSEC_QM_POLICY_NOT_FOUND: DWORD = 13001;
-pub const ERROR_IPSEC_QM_POLICY_IN_USE: DWORD = 13002;
-pub const ERROR_IPSEC_MM_POLICY_EXISTS: DWORD = 13003;
-pub const ERROR_IPSEC_MM_POLICY_NOT_FOUND: DWORD = 13004;
-pub const ERROR_IPSEC_MM_POLICY_IN_USE: DWORD = 13005;
-pub const ERROR_IPSEC_MM_FILTER_EXISTS: DWORD = 13006;
-pub const ERROR_IPSEC_MM_FILTER_NOT_FOUND: DWORD = 13007;
-pub const ERROR_IPSEC_TRANSPORT_FILTER_EXISTS: DWORD = 13008;
-pub const ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND: DWORD = 13009;
-pub const ERROR_IPSEC_MM_AUTH_EXISTS: DWORD = 13010;
-pub const ERROR_IPSEC_MM_AUTH_NOT_FOUND: DWORD = 13011;
-pub const ERROR_IPSEC_MM_AUTH_IN_USE: DWORD = 13012;
-pub const ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND: DWORD = 13013;
-pub const ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND: DWORD = 13014;
-pub const ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND: DWORD = 13015;
-pub const ERROR_IPSEC_TUNNEL_FILTER_EXISTS: DWORD = 13016;
-pub const ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND: DWORD = 13017;
-pub const ERROR_IPSEC_MM_FILTER_PENDING_DELETION: DWORD = 13018;
-pub const ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION: DWORD = 13019;
-pub const ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION: DWORD = 13020;
-pub const ERROR_IPSEC_MM_POLICY_PENDING_DELETION: DWORD = 13021;
-pub const ERROR_IPSEC_MM_AUTH_PENDING_DELETION: DWORD = 13022;
-pub const ERROR_IPSEC_QM_POLICY_PENDING_DELETION: DWORD = 13023;
-pub const ERROR_IPSEC_IKE_NEG_STATUS_BEGIN: DWORD = 13800;
-pub const ERROR_IPSEC_IKE_AUTH_FAIL: DWORD = 13801;
-pub const ERROR_IPSEC_IKE_ATTRIB_FAIL: DWORD = 13802;
-pub const ERROR_IPSEC_IKE_NEGOTIATION_PENDING: DWORD = 13803;
-pub const ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR: DWORD = 13804;
-pub const ERROR_IPSEC_IKE_TIMED_OUT: DWORD = 13805;
-pub const ERROR_IPSEC_IKE_NO_CERT: DWORD = 13806;
-pub const ERROR_IPSEC_IKE_SA_DELETED: DWORD = 13807;
-pub const ERROR_IPSEC_IKE_SA_REAPED: DWORD = 13808;
-pub const ERROR_IPSEC_IKE_MM_ACQUIRE_DROP: DWORD = 13809;
-pub const ERROR_IPSEC_IKE_QM_ACQUIRE_DROP: DWORD = 13810;
-pub const ERROR_IPSEC_IKE_QUEUE_DROP_MM: DWORD = 13811;
-pub const ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM: DWORD = 13812;
-pub const ERROR_IPSEC_IKE_DROP_NO_RESPONSE: DWORD = 13813;
-pub const ERROR_IPSEC_IKE_MM_DELAY_DROP: DWORD = 13814;
-pub const ERROR_IPSEC_IKE_QM_DELAY_DROP: DWORD = 13815;
-pub const ERROR_IPSEC_IKE_ERROR: DWORD = 13816;
-pub const ERROR_IPSEC_IKE_CRL_FAILED: DWORD = 13817;
-pub const ERROR_IPSEC_IKE_INVALID_KEY_USAGE: DWORD = 13818;
-pub const ERROR_IPSEC_IKE_INVALID_CERT_TYPE: DWORD = 13819;
-pub const ERROR_IPSEC_IKE_NO_PRIVATE_KEY: DWORD = 13820;
-pub const ERROR_IPSEC_IKE_DH_FAIL: DWORD = 13822;
-pub const ERROR_IPSEC_IKE_INVALID_HEADER: DWORD = 13824;
-pub const ERROR_IPSEC_IKE_NO_POLICY: DWORD = 13825;
-pub const ERROR_IPSEC_IKE_INVALID_SIGNATURE: DWORD = 13826;
-pub const ERROR_IPSEC_IKE_KERBEROS_ERROR: DWORD = 13827;
-pub const ERROR_IPSEC_IKE_NO_PUBLIC_KEY: DWORD = 13828;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR: DWORD = 13829;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_SA: DWORD = 13830;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_PROP: DWORD = 13831;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_TRANS: DWORD = 13832;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_KE: DWORD = 13833;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_ID: DWORD = 13834;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_CERT: DWORD = 13835;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ: DWORD = 13836;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_HASH: DWORD = 13837;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_SIG: DWORD = 13838;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_NONCE: DWORD = 13839;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY: DWORD = 13840;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_DELETE: DWORD = 13841;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR: DWORD = 13842;
-pub const ERROR_IPSEC_IKE_INVALID_PAYLOAD: DWORD = 13843;
-pub const ERROR_IPSEC_IKE_LOAD_SOFT_SA: DWORD = 13844;
-pub const ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN: DWORD = 13845;
-pub const ERROR_IPSEC_IKE_INVALID_COOKIE: DWORD = 13846;
-pub const ERROR_IPSEC_IKE_NO_PEER_CERT: DWORD = 13847;
-pub const ERROR_IPSEC_IKE_PEER_CRL_FAILED: DWORD = 13848;
-pub const ERROR_IPSEC_IKE_POLICY_CHANGE: DWORD = 13849;
-pub const ERROR_IPSEC_IKE_NO_MM_POLICY: DWORD = 13850;
-pub const ERROR_IPSEC_IKE_NOTCBPRIV: DWORD = 13851;
-pub const ERROR_IPSEC_IKE_SECLOADFAIL: DWORD = 13852;
-pub const ERROR_IPSEC_IKE_FAILSSPINIT: DWORD = 13853;
-pub const ERROR_IPSEC_IKE_FAILQUERYSSP: DWORD = 13854;
-pub const ERROR_IPSEC_IKE_SRVACQFAIL: DWORD = 13855;
-pub const ERROR_IPSEC_IKE_SRVQUERYCRED: DWORD = 13856;
-pub const ERROR_IPSEC_IKE_GETSPIFAIL: DWORD = 13857;
-pub const ERROR_IPSEC_IKE_INVALID_FILTER: DWORD = 13858;
-pub const ERROR_IPSEC_IKE_OUT_OF_MEMORY: DWORD = 13859;
-pub const ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED: DWORD = 13860;
-pub const ERROR_IPSEC_IKE_INVALID_POLICY: DWORD = 13861;
-pub const ERROR_IPSEC_IKE_UNKNOWN_DOI: DWORD = 13862;
-pub const ERROR_IPSEC_IKE_INVALID_SITUATION: DWORD = 13863;
-pub const ERROR_IPSEC_IKE_DH_FAILURE: DWORD = 13864;
-pub const ERROR_IPSEC_IKE_INVALID_GROUP: DWORD = 13865;
-pub const ERROR_IPSEC_IKE_ENCRYPT: DWORD = 13866;
-pub const ERROR_IPSEC_IKE_DECRYPT: DWORD = 13867;
-pub const ERROR_IPSEC_IKE_POLICY_MATCH: DWORD = 13868;
-pub const ERROR_IPSEC_IKE_UNSUPPORTED_ID: DWORD = 13869;
-pub const ERROR_IPSEC_IKE_INVALID_HASH: DWORD = 13870;
-pub const ERROR_IPSEC_IKE_INVALID_HASH_ALG: DWORD = 13871;
-pub const ERROR_IPSEC_IKE_INVALID_HASH_SIZE: DWORD = 13872;
-pub const ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG: DWORD = 13873;
-pub const ERROR_IPSEC_IKE_INVALID_AUTH_ALG: DWORD = 13874;
-pub const ERROR_IPSEC_IKE_INVALID_SIG: DWORD = 13875;
-pub const ERROR_IPSEC_IKE_LOAD_FAILED: DWORD = 13876;
-pub const ERROR_IPSEC_IKE_RPC_DELETE: DWORD = 13877;
-pub const ERROR_IPSEC_IKE_BENIGN_REINIT: DWORD = 13878;
-pub const ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY: DWORD = 13879;
-pub const ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN: DWORD = 13881;
-pub const ERROR_IPSEC_IKE_MM_LIMIT: DWORD = 13882;
-pub const ERROR_IPSEC_IKE_NEGOTIATION_DISABLED: DWORD = 13883;
-/*pub const ERROR_IPSEC_IKE_NEG_STATUS_END: DWORD = 13884)*/
-pub const ERROR_IPSEC_IKE_QM_LIMIT: DWORD = 13884;
-pub const ERROR_IPSEC_IKE_MM_EXPIRED: DWORD = 13885;
-pub const ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID: DWORD = 13886;
-pub const ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH: DWORD = 13887;
-pub const ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID: DWORD = 13888;
-pub const ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD: DWORD = 13889;
-pub const ERROR_IPSEC_IKE_DOS_COOKIE_SENT: DWORD = 13890;
-pub const ERROR_IPSEC_IKE_SHUTTING_DOWN: DWORD = 13891;
-pub const ERROR_IPSEC_IKE_CGA_AUTH_FAILED: DWORD = 13892;
-pub const ERROR_IPSEC_IKE_PROCESS_ERR_NATOA: DWORD = 13893;
-pub const ERROR_IPSEC_IKE_INVALID_MM_FOR_QM: DWORD = 13894;
-pub const ERROR_IPSEC_IKE_QM_EXPIRED: DWORD = 13895;
-pub const ERROR_IPSEC_IKE_TOO_MANY_FILTERS: DWORD = 13896;
-pub const ERROR_IPSEC_IKE_NEG_STATUS_END: DWORD = 13897;
-pub const ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL: DWORD = 13898;
-pub const ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE: DWORD = 13899;
-pub const ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING: DWORD = 13900;
-pub const ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING: DWORD = 13901;
-pub const ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS: DWORD = 13902;
-pub const ERROR_IPSEC_IKE_RATELIMIT_DROP: DWORD = 13903;
-pub const ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE: DWORD = 13904;
-pub const ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE: DWORD = 13905;
-pub const ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE: DWORD = 13906;
-pub const ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY: DWORD = 13907;
-pub const ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE: DWORD = 13908;
-pub const ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END: DWORD = 13909;
-pub const ERROR_IPSEC_BAD_SPI: DWORD = 13910;
-pub const ERROR_IPSEC_SA_LIFETIME_EXPIRED: DWORD = 13911;
-pub const ERROR_IPSEC_WRONG_SA: DWORD = 13912;
-pub const ERROR_IPSEC_REPLAY_CHECK_FAILED: DWORD = 13913;
-pub const ERROR_IPSEC_INVALID_PACKET: DWORD = 13914;
-pub const ERROR_IPSEC_INTEGRITY_CHECK_FAILED: DWORD = 13915;
-pub const ERROR_IPSEC_CLEAR_TEXT_DROP: DWORD = 13916;
-pub const ERROR_IPSEC_AUTH_FIREWALL_DROP: DWORD = 13917;
-pub const ERROR_IPSEC_THROTTLE_DROP: DWORD = 13918;
-pub const ERROR_IPSEC_DOSP_BLOCK: DWORD = 13925;
-pub const ERROR_IPSEC_DOSP_RECEIVED_MULTICAST: DWORD = 13926;
-pub const ERROR_IPSEC_DOSP_INVALID_PACKET: DWORD = 13927;
-pub const ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED: DWORD = 13928;
-pub const ERROR_IPSEC_DOSP_MAX_ENTRIES: DWORD = 13929;
-pub const ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED: DWORD = 13930;
-pub const ERROR_IPSEC_DOSP_NOT_INSTALLED: DWORD = 13931;
-pub const ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES: DWORD = 13932;
-pub const ERROR_EVT_INVALID_CHANNEL_PATH: DWORD = 15000;
-pub const ERROR_EVT_INVALID_QUERY: DWORD = 15001;
-pub const ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND: DWORD = 15002;
-pub const ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND: DWORD = 15003;
-pub const ERROR_EVT_INVALID_PUBLISHER_NAME: DWORD = 15004;
-pub const ERROR_EVT_INVALID_EVENT_DATA: DWORD = 15005;
-pub const ERROR_EVT_CHANNEL_NOT_FOUND: DWORD = 15007;
-pub const ERROR_EVT_MALFORMED_XML_TEXT: DWORD = 15008;
-pub const ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL: DWORD = 15009;
-pub const ERROR_EVT_CONFIGURATION_ERROR: DWORD = 15010;
-pub const ERROR_EVT_QUERY_RESULT_STALE: DWORD = 15011;
-pub const ERROR_EVT_QUERY_RESULT_INVALID_POSITION: DWORD = 15012;
-pub const ERROR_EVT_NON_VALIDATING_MSXML: DWORD = 15013;
-pub const ERROR_EVT_FILTER_ALREADYSCOPED: DWORD = 15014;
-pub const ERROR_EVT_FILTER_NOTELTSET: DWORD = 15015;
-pub const ERROR_EVT_FILTER_INVARG: DWORD = 15016;
-pub const ERROR_EVT_FILTER_INVTEST: DWORD = 15017;
-pub const ERROR_EVT_FILTER_INVTYPE: DWORD = 15018;
-pub const ERROR_EVT_FILTER_PARSEERR: DWORD = 15019;
-pub const ERROR_EVT_FILTER_UNSUPPORTEDOP: DWORD = 15020;
-pub const ERROR_EVT_FILTER_UNEXPECTEDTOKEN: DWORD = 15021;
-pub const ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL: DWORD = 15022;
-pub const ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE: DWORD = 15023;
-pub const ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE: DWORD = 15024;
-pub const ERROR_EVT_CHANNEL_CANNOT_ACTIVATE: DWORD = 15025;
-pub const ERROR_EVT_FILTER_TOO_COMPLEX: DWORD = 15026;
-pub const ERROR_EVT_MESSAGE_NOT_FOUND: DWORD = 15027;
-pub const ERROR_EVT_MESSAGE_ID_NOT_FOUND: DWORD = 15028;
-pub const ERROR_EVT_UNRESOLVED_VALUE_INSERT: DWORD = 15029;
-pub const ERROR_EVT_UNRESOLVED_PARAMETER_INSERT: DWORD = 15030;
-pub const ERROR_EVT_MAX_INSERTS_REACHED: DWORD = 15031;
-pub const ERROR_EVT_EVENT_DEFINITION_NOT_FOUND: DWORD = 15032;
-pub const ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND: DWORD = 15033;
-pub const ERROR_EVT_VERSION_TOO_OLD: DWORD = 15034;
-pub const ERROR_EVT_VERSION_TOO_NEW: DWORD = 15035;
-pub const ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY: DWORD = 15036;
-pub const ERROR_EVT_PUBLISHER_DISABLED: DWORD = 15037;
-pub const ERROR_EVT_FILTER_OUT_OF_RANGE: DWORD = 15038;
-pub const ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE: DWORD = 15080;
-pub const ERROR_EC_LOG_DISABLED: DWORD = 15081;
-pub const ERROR_EC_CIRCULAR_FORWARDING: DWORD = 15082;
-pub const ERROR_EC_CREDSTORE_FULL: DWORD = 15083;
-pub const ERROR_EC_CRED_NOT_FOUND: DWORD = 15084;
-pub const ERROR_EC_NO_ACTIVE_CHANNEL: DWORD = 15085;
-pub const ERROR_MUI_FILE_NOT_FOUND: DWORD = 15100;
-pub const ERROR_MUI_INVALID_FILE: DWORD = 15101;
-pub const ERROR_MUI_INVALID_RC_CONFIG: DWORD = 15102;
-pub const ERROR_MUI_INVALID_LOCALE_NAME: DWORD = 15103;
-pub const ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME: DWORD = 15104;
-pub const ERROR_MUI_FILE_NOT_LOADED: DWORD = 15105;
-pub const ERROR_RESOURCE_ENUM_USER_STOP: DWORD = 15106;
-pub const ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED: DWORD = 15107;
-pub const ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME: DWORD = 15108;
-pub const ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE: DWORD = 15110;
-pub const ERROR_MRM_INVALID_PRICONFIG: DWORD = 15111;
-pub const ERROR_MRM_INVALID_FILE_TYPE: DWORD = 15112;
-pub const ERROR_MRM_UNKNOWN_QUALIFIER: DWORD = 15113;
-pub const ERROR_MRM_INVALID_QUALIFIER_VALUE: DWORD = 15114;
-pub const ERROR_MRM_NO_CANDIDATE: DWORD = 15115;
-pub const ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE: DWORD = 15116;
-pub const ERROR_MRM_RESOURCE_TYPE_MISMATCH: DWORD = 15117;
-pub const ERROR_MRM_DUPLICATE_MAP_NAME: DWORD = 15118;
-pub const ERROR_MRM_DUPLICATE_ENTRY: DWORD = 15119;
-pub const ERROR_MRM_INVALID_RESOURCE_IDENTIFIER: DWORD = 15120;
-pub const ERROR_MRM_FILEPATH_TOO_LONG: DWORD = 15121;
-pub const ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE: DWORD = 15122;
-pub const ERROR_MRM_INVALID_PRI_FILE: DWORD = 15126;
-pub const ERROR_MRM_NAMED_RESOURCE_NOT_FOUND: DWORD = 15127;
-pub const ERROR_MRM_MAP_NOT_FOUND: DWORD = 15135;
-pub const ERROR_MRM_UNSUPPORTED_PROFILE_TYPE: DWORD = 15136;
-pub const ERROR_MRM_INVALID_QUALIFIER_OPERATOR: DWORD = 15137;
-pub const ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE: DWORD = 15138;
-pub const ERROR_MRM_AUTOMERGE_ENABLED: DWORD = 15139;
-pub const ERROR_MRM_TOO_MANY_RESOURCES: DWORD = 15140;
-pub const ERROR_MCA_INVALID_CAPABILITIES_STRING: DWORD = 15200;
-pub const ERROR_MCA_INVALID_VCP_VERSION: DWORD = 15201;
-pub const ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION: DWORD = 15202;
-pub const ERROR_MCA_MCCS_VERSION_MISMATCH: DWORD = 15203;
-pub const ERROR_MCA_UNSUPPORTED_MCCS_VERSION: DWORD = 15204;
-pub const ERROR_MCA_INTERNAL_ERROR: DWORD = 15205;
-pub const ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED: DWORD = 15206;
-pub const ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE: DWORD = 15207;
-pub const ERROR_AMBIGUOUS_SYSTEM_DEVICE: DWORD = 15250;
-pub const ERROR_SYSTEM_DEVICE_NOT_FOUND: DWORD = 15299;
-pub const ERROR_HASH_NOT_SUPPORTED: DWORD = 15300;
-pub const ERROR_HASH_NOT_PRESENT: DWORD = 15301;
-pub const ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED: DWORD = 15321;
-pub const ERROR_GPIO_CLIENT_INFORMATION_INVALID: DWORD = 15322;
-pub const ERROR_GPIO_VERSION_NOT_SUPPORTED: DWORD = 15323;
-pub const ERROR_GPIO_INVALID_REGISTRATION_PACKET: DWORD = 15324;
-pub const ERROR_GPIO_OPERATION_DENIED: DWORD = 15325;
-pub const ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE: DWORD = 15326;
-pub const ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED: DWORD = 15327;
-pub const ERROR_CANNOT_SWITCH_RUNLEVEL: DWORD = 15400;
-pub const ERROR_INVALID_RUNLEVEL_SETTING: DWORD = 15401;
-pub const ERROR_RUNLEVEL_SWITCH_TIMEOUT: DWORD = 15402;
-pub const ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT: DWORD = 15403;
-pub const ERROR_RUNLEVEL_SWITCH_IN_PROGRESS: DWORD = 15404;
-pub const ERROR_SERVICES_FAILED_AUTOSTART: DWORD = 15405;
-pub const ERROR_COM_TASK_STOP_PENDING: DWORD = 15501;
-pub const ERROR_INSTALL_OPEN_PACKAGE_FAILED: DWORD = 15600;
-pub const ERROR_INSTALL_PACKAGE_NOT_FOUND: DWORD = 15601;
-pub const ERROR_INSTALL_INVALID_PACKAGE: DWORD = 15602;
-pub const ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED: DWORD = 15603;
-pub const ERROR_INSTALL_OUT_OF_DISK_SPACE: DWORD = 15604;
-pub const ERROR_INSTALL_NETWORK_FAILURE: DWORD = 15605;
-pub const ERROR_INSTALL_REGISTRATION_FAILURE: DWORD = 15606;
-pub const ERROR_INSTALL_DEREGISTRATION_FAILURE: DWORD = 15607;
-pub const ERROR_INSTALL_CANCEL: DWORD = 15608;
-pub const ERROR_INSTALL_FAILED: DWORD = 15609;
-pub const ERROR_REMOVE_FAILED: DWORD = 15610;
-pub const ERROR_PACKAGE_ALREADY_EXISTS: DWORD = 15611;
-pub const ERROR_NEEDS_REMEDIATION: DWORD = 15612;
-pub const ERROR_INSTALL_PREREQUISITE_FAILED: DWORD = 15613;
-pub const ERROR_PACKAGE_REPOSITORY_CORRUPTED: DWORD = 15614;
-pub const ERROR_INSTALL_POLICY_FAILURE: DWORD = 15615;
-pub const ERROR_PACKAGE_UPDATING: DWORD = 15616;
-pub const ERROR_DEPLOYMENT_BLOCKED_BY_POLICY: DWORD = 15617;
-pub const ERROR_PACKAGES_IN_USE: DWORD = 15618;
-pub const ERROR_RECOVERY_FILE_CORRUPT: DWORD = 15619;
-pub const ERROR_INVALID_STAGED_SIGNATURE: DWORD = 15620;
-pub const ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED: DWORD = 15621;
-pub const ERROR_INSTALL_PACKAGE_DOWNGRADE: DWORD = 15622;
-pub const ERROR_SYSTEM_NEEDS_REMEDIATION: DWORD = 15623;
-pub const ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN: DWORD = 15624;
-pub const ERROR_RESILIENCY_FILE_CORRUPT: DWORD = 15625;
-pub const ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING: DWORD = 15626;
-pub const ERROR_STATE_LOAD_STORE_FAILED: DWORD = 15800;
-pub const ERROR_STATE_GET_VERSION_FAILED: DWORD = 15801;
-pub const ERROR_STATE_SET_VERSION_FAILED: DWORD = 15802;
-pub const ERROR_STATE_STRUCTURED_RESET_FAILED: DWORD = 15803;
-pub const ERROR_STATE_OPEN_CONTAINER_FAILED: DWORD = 15804;
-pub const ERROR_STATE_CREATE_CONTAINER_FAILED: DWORD = 15805;
-pub const ERROR_STATE_DELETE_CONTAINER_FAILED: DWORD = 15806;
-pub const ERROR_STATE_READ_SETTING_FAILED: DWORD = 15807;
-pub const ERROR_STATE_WRITE_SETTING_FAILED: DWORD = 15808;
-pub const ERROR_STATE_DELETE_SETTING_FAILED: DWORD = 15809;
-pub const ERROR_STATE_QUERY_SETTING_FAILED: DWORD = 15810;
-pub const ERROR_STATE_READ_COMPOSITE_SETTING_FAILED: DWORD = 15811;
-pub const ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED: DWORD = 15812;
-pub const ERROR_STATE_ENUMERATE_CONTAINER_FAILED: DWORD = 15813;
-pub const ERROR_STATE_ENUMERATE_SETTINGS_FAILED: DWORD = 15814;
-pub const ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED: DWORD = 15815;
-pub const ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED: DWORD = 15816;
-pub const ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED: DWORD = 15817;
-pub const ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED: DWORD = 15818;
-pub const ERROR_API_UNAVAILABLE: DWORD = 15841;
-pub const ERROR_AUDITING_DISABLED: DWORD = 0xC0090001;
-pub const ERROR_ALL_SIDS_FILTERED: DWORD = 0xC0090002;
-
-pub const WSABASEERR: c_int = 10000;
-pub const WSAEINTR: c_int = WSABASEERR + 4;
-pub const WSAEBADF: c_int = WSABASEERR + 9;
-pub const WSAEACCES: c_int = WSABASEERR + 13;
-pub const WSAEFAULT: c_int = WSABASEERR + 14;
-pub const WSAEINVAL: c_int = WSABASEERR + 22;
-pub const WSAEMFILE: c_int = WSABASEERR + 24;
-pub const WSAEWOULDBLOCK: c_int = WSABASEERR + 35;
-pub const WSAEINPROGRESS: c_int = WSABASEERR + 36;
-pub const WSAEALREADY: c_int = WSABASEERR + 37;
-pub const WSAENOTSOCK: c_int = WSABASEERR + 38;
-pub const WSAEDESTADDRREQ: c_int = WSABASEERR + 39;
-pub const WSAEMSGSIZE: c_int = WSABASEERR + 40;
-pub const WSAEPROTOTYPE: c_int = WSABASEERR + 41;
-pub const WSAENOPROTOOPT: c_int = WSABASEERR + 42;
-pub const WSAEPROTONOSUPPORT: c_int = WSABASEERR + 43;
-pub const WSAESOCKTNOSUPPORT: c_int = WSABASEERR + 44;
-pub const WSAEOPNOTSUPP: c_int = WSABASEERR + 45;
-pub const WSAEPFNOSUPPORT: c_int = WSABASEERR + 46;
-pub const WSAEAFNOSUPPORT: c_int = WSABASEERR + 47;
-pub const WSAEADDRINUSE: c_int = WSABASEERR + 48;
-pub const WSAEADDRNOTAVAIL: c_int = WSABASEERR + 49;
-pub const WSAENETDOWN: c_int = WSABASEERR + 50;
-pub const WSAENETUNREACH: c_int = WSABASEERR + 51;
-pub const WSAENETRESET: c_int = WSABASEERR + 52;
-pub const WSAECONNABORTED: c_int = WSABASEERR + 53;
-pub const WSAECONNRESET: c_int = WSABASEERR + 54;
-pub const WSAENOBUFS: c_int = WSABASEERR + 55;
-pub const WSAEISCONN: c_int = WSABASEERR + 56;
-pub const WSAENOTCONN: c_int = WSABASEERR + 57;
-pub const WSAESHUTDOWN: c_int = WSABASEERR + 58;
-pub const WSAETOOMANYREFS: c_int = WSABASEERR + 59;
-pub const WSAETIMEDOUT: c_int = WSABASEERR + 60;
-pub const WSAECONNREFUSED: c_int = WSABASEERR + 61;
-pub const WSAELOOP: c_int = WSABASEERR + 62;
-pub const WSAENAMETOOLONG: c_int = WSABASEERR + 63;
-pub const WSAEHOSTDOWN: c_int = WSABASEERR + 64;
-pub const WSAEHOSTUNREACH: c_int = WSABASEERR + 65;
-pub const WSAENOTEMPTY: c_int = WSABASEERR + 66;
-pub const WSAEPROCLIM: c_int = WSABASEERR + 67;
-pub const WSAEUSERS: c_int = WSABASEERR + 68;
-pub const WSAEDQUOT: c_int = WSABASEERR + 69;
-pub const WSAESTALE: c_int = WSABASEERR + 70;
-pub const WSAEREMOTE: c_int = WSABASEERR + 71;
-pub const WSASYSNOTREADY: c_int = WSABASEERR + 91;
-pub const WSAVERNOTSUPPORTED: c_int = WSABASEERR + 92;
-pub const WSANOTINITIALISED: c_int = WSABASEERR + 93;
-pub const WSAEDISCON: c_int = WSABASEERR + 101;
-pub const WSAENOMORE: c_int = WSABASEERR + 102;
-pub const WSAECANCELLED: c_int = WSABASEERR + 103;
-pub const WSAEINVALIDPROCTABLE: c_int = WSABASEERR + 104;
-pub const WSAEINVALIDPROVIDER: c_int = WSABASEERR + 105;
-pub const WSAEPROVIDERFAILEDINIT: c_int = WSABASEERR + 106;
-pub const WSASYSCALLFAILURE: c_int = WSABASEERR + 107;
-pub const WSASERVICE_NOT_FOUND: c_int = WSABASEERR + 108;
-pub const WSATYPE_NOT_FOUND: c_int = WSABASEERR + 109;
-pub const WSA_E_NO_MORE: c_int = WSABASEERR + 110;
-pub const WSA_E_CANCELLED: c_int = WSABASEERR + 111;
-pub const WSAEREFUSED: c_int = WSABASEERR + 112;
-pub const WSAHOST_NOT_FOUND: c_int = WSABASEERR + 1001;
-pub const WSATRY_AGAIN: c_int = WSABASEERR + 1002;
-pub const WSANO_RECOVERY: c_int = WSABASEERR + 1003;
-pub const WSANO_DATA: c_int = WSABASEERR + 1004;
-pub const WSA_QOS_RECEIVERS: c_int = WSABASEERR + 1005;
-pub const WSA_QOS_SENDERS: c_int = WSABASEERR + 1006;
-pub const WSA_QOS_NO_SENDERS: c_int = WSABASEERR + 1007;
-pub const WSA_QOS_NO_RECEIVERS: c_int = WSABASEERR + 1008;
-pub const WSA_QOS_REQUEST_CONFIRMED: c_int = WSABASEERR + 1009;
-pub const WSA_QOS_ADMISSION_FAILURE: c_int = WSABASEERR + 1010;
-pub const WSA_QOS_POLICY_FAILURE: c_int = WSABASEERR + 1011;
-pub const WSA_QOS_BAD_STYLE: c_int = WSABASEERR + 1012;
-pub const WSA_QOS_BAD_OBJECT: c_int = WSABASEERR + 1013;
-pub const WSA_QOS_TRAFFIC_CTRL_ERROR: c_int = WSABASEERR + 1014;
-pub const WSA_QOS_GENERIC_ERROR: c_int = WSABASEERR + 1015;
-pub const WSA_QOS_ESERVICETYPE: c_int = WSABASEERR + 1016;
-pub const WSA_QOS_EFLOWSPEC: c_int = WSABASEERR + 1017;
-pub const WSA_QOS_EPROVSPECBUF: c_int = WSABASEERR + 1018;
-pub const WSA_QOS_EFILTERSTYLE: c_int = WSABASEERR + 1019;
-pub const WSA_QOS_EFILTERTYPE: c_int = WSABASEERR + 1020;
-pub const WSA_QOS_EFILTERCOUNT: c_int = WSABASEERR + 1021;
-pub const WSA_QOS_EOBJLENGTH: c_int = WSABASEERR + 1022;
-pub const WSA_QOS_EFLOWCOUNT: c_int = WSABASEERR + 1023;
-pub const WSA_QOS_EUNKNOWNPSOBJ: c_int = WSABASEERR + 1024;
-pub const WSA_QOS_EUNKOWNPSOBJ: c_int = WSA_QOS_EUNKNOWNPSOBJ;
-pub const WSA_QOS_EPOLICYOBJ: c_int = WSABASEERR + 1025;
-pub const WSA_QOS_EFLOWDESC: c_int = WSABASEERR + 1026;
-pub const WSA_QOS_EPSFLOWSPEC: c_int = WSABASEERR + 1027;
-pub const WSA_QOS_EPSFILTERSPEC: c_int = WSABASEERR + 1028;
-pub const WSA_QOS_ESDMODEOBJ: c_int = WSABASEERR + 1029;
-pub const WSA_QOS_ESHAPERATEOBJ: c_int = WSABASEERR + 1030;
-pub const WSA_QOS_RESERVED_PETYPE: c_int = WSABASEERR + 1031;
diff --git a/library/std/src/sys/windows/c/windows_sys.lst b/library/std/src/sys/windows/c/windows_sys.lst
new file mode 100644
index 0000000..3e45419
--- /dev/null
+++ b/library/std/src/sys/windows/c/windows_sys.lst
@@ -0,0 +1,2590 @@
+// tidy-alphabetical-start
+Windows.Wdk.Storage.FileSystem.FILE_COMPLETE_IF_OPLOCKED
+Windows.Wdk.Storage.FileSystem.FILE_CONTAINS_EXTENDED_CREATE_INFORMATION
+Windows.Wdk.Storage.FileSystem.FILE_CREATE
+Windows.Wdk.Storage.FileSystem.FILE_CREATE_TREE_CONNECTION
+Windows.Wdk.Storage.FileSystem.FILE_DELETE_ON_CLOSE
+Windows.Wdk.Storage.FileSystem.FILE_DIRECTORY_FILE
+Windows.Wdk.Storage.FileSystem.FILE_DISALLOW_EXCLUSIVE
+Windows.Wdk.Storage.FileSystem.FILE_NO_COMPRESSION
+Windows.Wdk.Storage.FileSystem.FILE_NO_EA_KNOWLEDGE
+Windows.Wdk.Storage.FileSystem.FILE_NO_INTERMEDIATE_BUFFERING
+Windows.Wdk.Storage.FileSystem.FILE_NON_DIRECTORY_FILE
+Windows.Wdk.Storage.FileSystem.FILE_OPEN
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_BY_FILE_ID
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_FOR_BACKUP_INTENT
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_FOR_FREE_SPACE_QUERY
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_IF
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_NO_RECALL
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_REPARSE_POINT
+Windows.Wdk.Storage.FileSystem.FILE_OPEN_REQUIRING_OPLOCK
+Windows.Wdk.Storage.FileSystem.FILE_OVERWRITE
+Windows.Wdk.Storage.FileSystem.FILE_OVERWRITE_IF
+Windows.Wdk.Storage.FileSystem.FILE_RANDOM_ACCESS
+Windows.Wdk.Storage.FileSystem.FILE_RESERVE_OPFILTER
+Windows.Wdk.Storage.FileSystem.FILE_SEQUENTIAL_ONLY
+Windows.Wdk.Storage.FileSystem.FILE_SESSION_AWARE
+Windows.Wdk.Storage.FileSystem.FILE_SUPERSEDE
+Windows.Wdk.Storage.FileSystem.FILE_SYNCHRONOUS_IO_ALERT
+Windows.Wdk.Storage.FileSystem.FILE_SYNCHRONOUS_IO_NONALERT
+Windows.Wdk.Storage.FileSystem.FILE_WRITE_THROUGH
+Windows.Wdk.Storage.FileSystem.NtCreateFile
+Windows.Wdk.Storage.FileSystem.NTCREATEFILE_CREATE_DISPOSITION
+Windows.Wdk.Storage.FileSystem.NTCREATEFILE_CREATE_OPTIONS
+Windows.Wdk.Storage.FileSystem.NtReadFile
+Windows.Wdk.Storage.FileSystem.NtWriteFile
+Windows.Wdk.Storage.FileSystem.SYMLINK_FLAG_RELATIVE
+Windows.Win32.Foundation.BOOL
+Windows.Win32.Foundation.BOOLEAN
+Windows.Win32.Foundation.CloseHandle
+Windows.Win32.Foundation.DNS_ERROR_ADDRESS_REQUIRED
+Windows.Win32.Foundation.DNS_ERROR_ALIAS_LOOP
+Windows.Win32.Foundation.DNS_ERROR_AUTOZONE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_AXFR
+Windows.Win32.Foundation.DNS_ERROR_BACKGROUND_LOADING
+Windows.Win32.Foundation.DNS_ERROR_BAD_KEYMASTER
+Windows.Win32.Foundation.DNS_ERROR_BAD_PACKET
+Windows.Win32.Foundation.DNS_ERROR_CANNOT_FIND_ROOT_HINTS
+Windows.Win32.Foundation.DNS_ERROR_CLIENT_SUBNET_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_CLIENT_SUBNET_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_CLIENT_SUBNET_IS_ACCESSED
+Windows.Win32.Foundation.DNS_ERROR_CNAME_COLLISION
+Windows.Win32.Foundation.DNS_ERROR_CNAME_LOOP
+Windows.Win32.Foundation.DNS_ERROR_DATAFILE_OPEN_FAILURE
+Windows.Win32.Foundation.DNS_ERROR_DATAFILE_PARSING
+Windows.Win32.Foundation.DNS_ERROR_DEFAULT_SCOPE
+Windows.Win32.Foundation.DNS_ERROR_DEFAULT_VIRTUALIZATION_INSTANCE
+Windows.Win32.Foundation.DNS_ERROR_DEFAULT_ZONESCOPE
+Windows.Win32.Foundation.DNS_ERROR_DELEGATION_REQUIRED
+Windows.Win32.Foundation.DNS_ERROR_DNAME_COLLISION
+Windows.Win32.Foundation.DNS_ERROR_DNSSEC_IS_DISABLED
+Windows.Win32.Foundation.DNS_ERROR_DP_ALREADY_ENLISTED
+Windows.Win32.Foundation.DNS_ERROR_DP_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_DP_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_DP_FSMO_ERROR
+Windows.Win32.Foundation.DNS_ERROR_DP_NOT_AVAILABLE
+Windows.Win32.Foundation.DNS_ERROR_DP_NOT_ENLISTED
+Windows.Win32.Foundation.DNS_ERROR_DS_UNAVAILABLE
+Windows.Win32.Foundation.DNS_ERROR_DS_ZONE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_DWORD_VALUE_TOO_LARGE
+Windows.Win32.Foundation.DNS_ERROR_DWORD_VALUE_TOO_SMALL
+Windows.Win32.Foundation.DNS_ERROR_FILE_WRITEBACK_FAILED
+Windows.Win32.Foundation.DNS_ERROR_FORWARDER_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_INCONSISTENT_ROOT_HINTS
+Windows.Win32.Foundation.DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME
+Windows.Win32.Foundation.DNS_ERROR_INVALID_CLIENT_SUBNET_NAME
+Windows.Win32.Foundation.DNS_ERROR_INVALID_DATA
+Windows.Win32.Foundation.DNS_ERROR_INVALID_DATAFILE_NAME
+Windows.Win32.Foundation.DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET
+Windows.Win32.Foundation.DNS_ERROR_INVALID_IP_ADDRESS
+Windows.Win32.Foundation.DNS_ERROR_INVALID_KEY_SIZE
+Windows.Win32.Foundation.DNS_ERROR_INVALID_NAME
+Windows.Win32.Foundation.DNS_ERROR_INVALID_NAME_CHAR
+Windows.Win32.Foundation.DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT
+Windows.Win32.Foundation.DNS_ERROR_INVALID_POLICY_TABLE
+Windows.Win32.Foundation.DNS_ERROR_INVALID_PROPERTY
+Windows.Win32.Foundation.DNS_ERROR_INVALID_ROLLOVER_PERIOD
+Windows.Win32.Foundation.DNS_ERROR_INVALID_SCOPE_NAME
+Windows.Win32.Foundation.DNS_ERROR_INVALID_SCOPE_OPERATION
+Windows.Win32.Foundation.DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD
+Windows.Win32.Foundation.DNS_ERROR_INVALID_TYPE
+Windows.Win32.Foundation.DNS_ERROR_INVALID_XML
+Windows.Win32.Foundation.DNS_ERROR_INVALID_ZONE_OPERATION
+Windows.Win32.Foundation.DNS_ERROR_INVALID_ZONE_TYPE
+Windows.Win32.Foundation.DNS_ERROR_INVALID_ZONESCOPE_NAME
+Windows.Win32.Foundation.DNS_ERROR_KEYMASTER_REQUIRED
+Windows.Win32.Foundation.DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION
+Windows.Win32.Foundation.DNS_ERROR_KSP_NOT_ACCESSIBLE
+Windows.Win32.Foundation.DNS_ERROR_LOAD_ZONESCOPE_FAILED
+Windows.Win32.Foundation.DNS_ERROR_NAME_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_NAME_NOT_IN_ZONE
+Windows.Win32.Foundation.DNS_ERROR_NBSTAT_INIT_FAILED
+Windows.Win32.Foundation.DNS_ERROR_NEED_SECONDARY_ADDRESSES
+Windows.Win32.Foundation.DNS_ERROR_NEED_WINS_SERVERS
+Windows.Win32.Foundation.DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE
+Windows.Win32.Foundation.DNS_ERROR_NO_CREATE_CACHE_DATA
+Windows.Win32.Foundation.DNS_ERROR_NO_DNS_SERVERS
+Windows.Win32.Foundation.DNS_ERROR_NO_MEMORY
+Windows.Win32.Foundation.DNS_ERROR_NO_PACKET
+Windows.Win32.Foundation.DNS_ERROR_NO_TCPIP
+Windows.Win32.Foundation.DNS_ERROR_NO_VALID_TRUST_ANCHORS
+Windows.Win32.Foundation.DNS_ERROR_NO_ZONE_INFO
+Windows.Win32.Foundation.DNS_ERROR_NODE_CREATION_FAILED
+Windows.Win32.Foundation.DNS_ERROR_NODE_IS_CNAME
+Windows.Win32.Foundation.DNS_ERROR_NODE_IS_DNAME
+Windows.Win32.Foundation.DNS_ERROR_NON_RFC_NAME
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_RODC
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_ON_ZSK
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_UNDER_DNAME
+Windows.Win32.Foundation.DNS_ERROR_NOT_ALLOWED_WITH_ZONESCOPES
+Windows.Win32.Foundation.DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS
+Windows.Win32.Foundation.DNS_ERROR_NOT_UNIQUE
+Windows.Win32.Foundation.DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1
+Windows.Win32.Foundation.DNS_ERROR_NSEC3_NAME_COLLISION
+Windows.Win32.Foundation.DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1
+Windows.Win32.Foundation.DNS_ERROR_NUMERIC_NAME
+Windows.Win32.Foundation.DNS_ERROR_POLICY_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_POLICY_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_CLIENT_SUBNET
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_FQDN
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_INTERFACE
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_NETWORK_PROTOCOL
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_QUERY_TYPE
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_TIME_OF_DAY
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_CRITERIA_TRANSPORT_PROTOCOL
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_NAME
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_SETTINGS
+Windows.Win32.Foundation.DNS_ERROR_POLICY_INVALID_WEIGHT
+Windows.Win32.Foundation.DNS_ERROR_POLICY_LOCKED
+Windows.Win32.Foundation.DNS_ERROR_POLICY_MISSING_CRITERIA
+Windows.Win32.Foundation.DNS_ERROR_POLICY_PROCESSING_ORDER_INVALID
+Windows.Win32.Foundation.DNS_ERROR_POLICY_SCOPE_MISSING
+Windows.Win32.Foundation.DNS_ERROR_POLICY_SCOPE_NOT_ALLOWED
+Windows.Win32.Foundation.DNS_ERROR_PRIMARY_REQUIRES_DATAFILE
+Windows.Win32.Foundation.DNS_ERROR_RCODE
+Windows.Win32.Foundation.DNS_ERROR_RCODE_BADKEY
+Windows.Win32.Foundation.DNS_ERROR_RCODE_BADSIG
+Windows.Win32.Foundation.DNS_ERROR_RCODE_BADTIME
+Windows.Win32.Foundation.DNS_ERROR_RCODE_FORMAT_ERROR
+Windows.Win32.Foundation.DNS_ERROR_RCODE_NAME_ERROR
+Windows.Win32.Foundation.DNS_ERROR_RCODE_NOT_IMPLEMENTED
+Windows.Win32.Foundation.DNS_ERROR_RCODE_NOTAUTH
+Windows.Win32.Foundation.DNS_ERROR_RCODE_NOTZONE
+Windows.Win32.Foundation.DNS_ERROR_RCODE_NXRRSET
+Windows.Win32.Foundation.DNS_ERROR_RCODE_REFUSED
+Windows.Win32.Foundation.DNS_ERROR_RCODE_SERVER_FAILURE
+Windows.Win32.Foundation.DNS_ERROR_RCODE_YXDOMAIN
+Windows.Win32.Foundation.DNS_ERROR_RCODE_YXRRSET
+Windows.Win32.Foundation.DNS_ERROR_RECORD_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_RECORD_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_RECORD_FORMAT
+Windows.Win32.Foundation.DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT
+Windows.Win32.Foundation.DNS_ERROR_RECORD_TIMED_OUT
+Windows.Win32.Foundation.DNS_ERROR_ROLLOVER_ALREADY_QUEUED
+Windows.Win32.Foundation.DNS_ERROR_ROLLOVER_IN_PROGRESS
+Windows.Win32.Foundation.DNS_ERROR_ROLLOVER_NOT_POKEABLE
+Windows.Win32.Foundation.DNS_ERROR_RRL_INVALID_IPV4_PREFIX
+Windows.Win32.Foundation.DNS_ERROR_RRL_INVALID_IPV6_PREFIX
+Windows.Win32.Foundation.DNS_ERROR_RRL_INVALID_LEAK_RATE
+Windows.Win32.Foundation.DNS_ERROR_RRL_INVALID_TC_RATE
+Windows.Win32.Foundation.DNS_ERROR_RRL_INVALID_WINDOW_SIZE
+Windows.Win32.Foundation.DNS_ERROR_RRL_LEAK_RATE_LESSTHAN_TC_RATE
+Windows.Win32.Foundation.DNS_ERROR_RRL_NOT_ENABLED
+Windows.Win32.Foundation.DNS_ERROR_SCOPE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_SCOPE_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_SCOPE_LOCKED
+Windows.Win32.Foundation.DNS_ERROR_SECONDARY_DATA
+Windows.Win32.Foundation.DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP
+Windows.Win32.Foundation.DNS_ERROR_SERVERSCOPE_IS_REFERENCED
+Windows.Win32.Foundation.DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE
+Windows.Win32.Foundation.DNS_ERROR_SOA_DELETE_INVALID
+Windows.Win32.Foundation.DNS_ERROR_STANDBY_KEY_NOT_PRESENT
+Windows.Win32.Foundation.DNS_ERROR_SUBNET_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_SUBNET_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_TOO_MANY_SKDS
+Windows.Win32.Foundation.DNS_ERROR_TRY_AGAIN_LATER
+Windows.Win32.Foundation.DNS_ERROR_UNEXPECTED_CNG_ERROR
+Windows.Win32.Foundation.DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR
+Windows.Win32.Foundation.DNS_ERROR_UNKNOWN_RECORD_TYPE
+Windows.Win32.Foundation.DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION
+Windows.Win32.Foundation.DNS_ERROR_UNSECURE_PACKET
+Windows.Win32.Foundation.DNS_ERROR_UNSUPPORTED_ALGORITHM
+Windows.Win32.Foundation.DNS_ERROR_VIRTUALIZATION_INSTANCE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_VIRTUALIZATION_INSTANCE_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_VIRTUALIZATION_TREE_LOCKED
+Windows.Win32.Foundation.DNS_ERROR_WINS_INIT_FAILED
+Windows.Win32.Foundation.DNS_ERROR_ZONE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_ZONE_CONFIGURATION_ERROR
+Windows.Win32.Foundation.DNS_ERROR_ZONE_CREATION_FAILED
+Windows.Win32.Foundation.DNS_ERROR_ZONE_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_ZONE_HAS_NO_NS_RECORDS
+Windows.Win32.Foundation.DNS_ERROR_ZONE_HAS_NO_SOA_RECORD
+Windows.Win32.Foundation.DNS_ERROR_ZONE_IS_SHUTDOWN
+Windows.Win32.Foundation.DNS_ERROR_ZONE_LOCKED
+Windows.Win32.Foundation.DNS_ERROR_ZONE_LOCKED_FOR_SIGNING
+Windows.Win32.Foundation.DNS_ERROR_ZONE_NOT_SECONDARY
+Windows.Win32.Foundation.DNS_ERROR_ZONE_REQUIRES_MASTER_IP
+Windows.Win32.Foundation.DNS_ERROR_ZONESCOPE_ALREADY_EXISTS
+Windows.Win32.Foundation.DNS_ERROR_ZONESCOPE_DOES_NOT_EXIST
+Windows.Win32.Foundation.DNS_ERROR_ZONESCOPE_FILE_WRITEBACK_FAILED
+Windows.Win32.Foundation.DNS_ERROR_ZONESCOPE_IS_REFERENCED
+Windows.Win32.Foundation.DUPLICATE_CLOSE_SOURCE
+Windows.Win32.Foundation.DUPLICATE_HANDLE_OPTIONS
+Windows.Win32.Foundation.DUPLICATE_SAME_ACCESS
+Windows.Win32.Foundation.DuplicateHandle
+Windows.Win32.Foundation.E_NOTIMPL
+Windows.Win32.Foundation.ERROR_ABANDON_HIBERFILE
+Windows.Win32.Foundation.ERROR_ABANDONED_WAIT_0
+Windows.Win32.Foundation.ERROR_ABANDONED_WAIT_63
+Windows.Win32.Foundation.ERROR_ABIOS_ERROR
+Windows.Win32.Foundation.ERROR_ACCESS_AUDIT_BY_POLICY
+Windows.Win32.Foundation.ERROR_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_ACCESS_DENIED_APPDATA
+Windows.Win32.Foundation.ERROR_ACCESS_DISABLED_BY_POLICY
+Windows.Win32.Foundation.ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY
+Windows.Win32.Foundation.ERROR_ACCESS_DISABLED_WEBBLADE
+Windows.Win32.Foundation.ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER
+Windows.Win32.Foundation.ERROR_ACCOUNT_DISABLED
+Windows.Win32.Foundation.ERROR_ACCOUNT_EXPIRED
+Windows.Win32.Foundation.ERROR_ACCOUNT_LOCKED_OUT
+Windows.Win32.Foundation.ERROR_ACCOUNT_RESTRICTION
+Windows.Win32.Foundation.ERROR_ACPI_ERROR
+Windows.Win32.Foundation.ERROR_ACTIVE_CONNECTIONS
+Windows.Win32.Foundation.ERROR_ADAP_HDW_ERR
+Windows.Win32.Foundation.ERROR_ADDRESS_ALREADY_ASSOCIATED
+Windows.Win32.Foundation.ERROR_ADDRESS_NOT_ASSOCIATED
+Windows.Win32.Foundation.ERROR_ALERTED
+Windows.Win32.Foundation.ERROR_ALIAS_EXISTS
+Windows.Win32.Foundation.ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_ALLOCATE_BUCKET
+Windows.Win32.Foundation.ERROR_ALLOTTED_SPACE_EXCEEDED
+Windows.Win32.Foundation.ERROR_ALREADY_ASSIGNED
+Windows.Win32.Foundation.ERROR_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_ALREADY_FIBER
+Windows.Win32.Foundation.ERROR_ALREADY_HAS_STREAM_ID
+Windows.Win32.Foundation.ERROR_ALREADY_INITIALIZED
+Windows.Win32.Foundation.ERROR_ALREADY_REGISTERED
+Windows.Win32.Foundation.ERROR_ALREADY_RUNNING_LKG
+Windows.Win32.Foundation.ERROR_ALREADY_THREAD
+Windows.Win32.Foundation.ERROR_ALREADY_WAITING
+Windows.Win32.Foundation.ERROR_ALREADY_WIN32
+Windows.Win32.Foundation.ERROR_API_UNAVAILABLE
+Windows.Win32.Foundation.ERROR_APP_HANG
+Windows.Win32.Foundation.ERROR_APP_INIT_FAILURE
+Windows.Win32.Foundation.ERROR_APP_WRONG_OS
+Windows.Win32.Foundation.ERROR_APPCONTAINER_REQUIRED
+Windows.Win32.Foundation.ERROR_APPEXEC_APP_COMPAT_BLOCK
+Windows.Win32.Foundation.ERROR_APPEXEC_CALLER_WAIT_TIMEOUT
+Windows.Win32.Foundation.ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_LICENSING
+Windows.Win32.Foundation.ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_RESOURCES
+Windows.Win32.Foundation.ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_TERMINATION
+Windows.Win32.Foundation.ERROR_APPEXEC_CONDITION_NOT_SATISFIED
+Windows.Win32.Foundation.ERROR_APPEXEC_HANDLE_INVALIDATED
+Windows.Win32.Foundation.ERROR_APPEXEC_HOST_ID_MISMATCH
+Windows.Win32.Foundation.ERROR_APPEXEC_INVALID_HOST_GENERATION
+Windows.Win32.Foundation.ERROR_APPEXEC_INVALID_HOST_STATE
+Windows.Win32.Foundation.ERROR_APPEXEC_NO_DONOR
+Windows.Win32.Foundation.ERROR_APPEXEC_UNEXPECTED_PROCESS_REGISTRATION
+Windows.Win32.Foundation.ERROR_APPEXEC_UNKNOWN_USER
+Windows.Win32.Foundation.ERROR_APPHELP_BLOCK
+Windows.Win32.Foundation.ERROR_APPX_FILE_NOT_ENCRYPTED
+Windows.Win32.Foundation.ERROR_ARBITRATION_UNHANDLED
+Windows.Win32.Foundation.ERROR_ARENA_TRASHED
+Windows.Win32.Foundation.ERROR_ARITHMETIC_OVERFLOW
+Windows.Win32.Foundation.ERROR_ASSERTION_FAILURE
+Windows.Win32.Foundation.ERROR_ATOMIC_LOCKS_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_AUDIT_FAILED
+Windows.Win32.Foundation.ERROR_AUTHENTICATION_FIREWALL_FAILED
+Windows.Win32.Foundation.ERROR_AUTHIP_FAILURE
+Windows.Win32.Foundation.ERROR_AUTODATASEG_EXCEEDS_64k
+Windows.Win32.Foundation.ERROR_BACKUP_CONTROLLER
+Windows.Win32.Foundation.ERROR_BAD_ACCESSOR_FLAGS
+Windows.Win32.Foundation.ERROR_BAD_ARGUMENTS
+Windows.Win32.Foundation.ERROR_BAD_COMMAND
+Windows.Win32.Foundation.ERROR_BAD_COMPRESSION_BUFFER
+Windows.Win32.Foundation.ERROR_BAD_CONFIGURATION
+Windows.Win32.Foundation.ERROR_BAD_CURRENT_DIRECTORY
+Windows.Win32.Foundation.ERROR_BAD_DESCRIPTOR_FORMAT
+Windows.Win32.Foundation.ERROR_BAD_DEV_TYPE
+Windows.Win32.Foundation.ERROR_BAD_DEVICE
+Windows.Win32.Foundation.ERROR_BAD_DEVICE_PATH
+Windows.Win32.Foundation.ERROR_BAD_DLL_ENTRYPOINT
+Windows.Win32.Foundation.ERROR_BAD_DRIVER_LEVEL
+Windows.Win32.Foundation.ERROR_BAD_ENVIRONMENT
+Windows.Win32.Foundation.ERROR_BAD_EXE_FORMAT
+Windows.Win32.Foundation.ERROR_BAD_FILE_TYPE
+Windows.Win32.Foundation.ERROR_BAD_FORMAT
+Windows.Win32.Foundation.ERROR_BAD_FUNCTION_TABLE
+Windows.Win32.Foundation.ERROR_BAD_IMPERSONATION_LEVEL
+Windows.Win32.Foundation.ERROR_BAD_INHERITANCE_ACL
+Windows.Win32.Foundation.ERROR_BAD_LENGTH
+Windows.Win32.Foundation.ERROR_BAD_LOGON_SESSION_STATE
+Windows.Win32.Foundation.ERROR_BAD_MCFG_TABLE
+Windows.Win32.Foundation.ERROR_BAD_NET_NAME
+Windows.Win32.Foundation.ERROR_BAD_NET_RESP
+Windows.Win32.Foundation.ERROR_BAD_NETPATH
+Windows.Win32.Foundation.ERROR_BAD_PATHNAME
+Windows.Win32.Foundation.ERROR_BAD_PIPE
+Windows.Win32.Foundation.ERROR_BAD_PROFILE
+Windows.Win32.Foundation.ERROR_BAD_PROVIDER
+Windows.Win32.Foundation.ERROR_BAD_QUERY_SYNTAX
+Windows.Win32.Foundation.ERROR_BAD_RECOVERY_POLICY
+Windows.Win32.Foundation.ERROR_BAD_REM_ADAP
+Windows.Win32.Foundation.ERROR_BAD_SERVICE_ENTRYPOINT
+Windows.Win32.Foundation.ERROR_BAD_STACK
+Windows.Win32.Foundation.ERROR_BAD_THREADID_ADDR
+Windows.Win32.Foundation.ERROR_BAD_TOKEN_TYPE
+Windows.Win32.Foundation.ERROR_BAD_UNIT
+Windows.Win32.Foundation.ERROR_BAD_USER_PROFILE
+Windows.Win32.Foundation.ERROR_BAD_USERNAME
+Windows.Win32.Foundation.ERROR_BAD_VALIDATION_CLASS
+Windows.Win32.Foundation.ERROR_BADDB
+Windows.Win32.Foundation.ERROR_BADKEY
+Windows.Win32.Foundation.ERROR_BADSTARTPOSITION
+Windows.Win32.Foundation.ERROR_BEGINNING_OF_MEDIA
+Windows.Win32.Foundation.ERROR_BEYOND_VDL
+Windows.Win32.Foundation.ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT
+Windows.Win32.Foundation.ERROR_BLOCK_SHARED
+Windows.Win32.Foundation.ERROR_BLOCK_SOURCE_WEAK_REFERENCE_INVALID
+Windows.Win32.Foundation.ERROR_BLOCK_TARGET_WEAK_REFERENCE_INVALID
+Windows.Win32.Foundation.ERROR_BLOCK_TOO_MANY_REFERENCES
+Windows.Win32.Foundation.ERROR_BLOCK_WEAK_REFERENCE_INVALID
+Windows.Win32.Foundation.ERROR_BLOCKED_BY_PARENTAL_CONTROLS
+Windows.Win32.Foundation.ERROR_BOOT_ALREADY_ACCEPTED
+Windows.Win32.Foundation.ERROR_BROKEN_PIPE
+Windows.Win32.Foundation.ERROR_BUFFER_ALL_ZEROS
+Windows.Win32.Foundation.ERROR_BUFFER_OVERFLOW
+Windows.Win32.Foundation.ERROR_BUS_RESET
+Windows.Win32.Foundation.ERROR_BUSY
+Windows.Win32.Foundation.ERROR_BUSY_DRIVE
+Windows.Win32.Foundation.ERROR_BYPASSIO_FLT_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_CACHE_PAGE_LOCKED
+Windows.Win32.Foundation.ERROR_CALL_NOT_IMPLEMENTED
+Windows.Win32.Foundation.ERROR_CALLBACK_INVOKE_INLINE
+Windows.Win32.Foundation.ERROR_CALLBACK_POP_STACK
+Windows.Win32.Foundation.ERROR_CALLBACK_SUPPLIED_INVALID_DATA
+Windows.Win32.Foundation.ERROR_CAN_NOT_COMPLETE
+Windows.Win32.Foundation.ERROR_CANCEL_VIOLATION
+Windows.Win32.Foundation.ERROR_CANCELLED
+Windows.Win32.Foundation.ERROR_CANNOT_BREAK_OPLOCK
+Windows.Win32.Foundation.ERROR_CANNOT_COPY
+Windows.Win32.Foundation.ERROR_CANNOT_DETECT_DRIVER_FAILURE
+Windows.Win32.Foundation.ERROR_CANNOT_DETECT_PROCESS_ABORT
+Windows.Win32.Foundation.ERROR_CANNOT_FIND_WND_CLASS
+Windows.Win32.Foundation.ERROR_CANNOT_GRANT_REQUESTED_OPLOCK
+Windows.Win32.Foundation.ERROR_CANNOT_IMPERSONATE
+Windows.Win32.Foundation.ERROR_CANNOT_LOAD_REGISTRY_FILE
+Windows.Win32.Foundation.ERROR_CANNOT_MAKE
+Windows.Win32.Foundation.ERROR_CANNOT_OPEN_PROFILE
+Windows.Win32.Foundation.ERROR_CANT_ACCESS_DOMAIN_INFO
+Windows.Win32.Foundation.ERROR_CANT_ACCESS_FILE
+Windows.Win32.Foundation.ERROR_CANT_CLEAR_ENCRYPTION_FLAG
+Windows.Win32.Foundation.ERROR_CANT_DISABLE_MANDATORY
+Windows.Win32.Foundation.ERROR_CANT_ENABLE_DENY_ONLY
+Windows.Win32.Foundation.ERROR_CANT_OPEN_ANONYMOUS
+Windows.Win32.Foundation.ERROR_CANT_RESOLVE_FILENAME
+Windows.Win32.Foundation.ERROR_CANT_TERMINATE_SELF
+Windows.Win32.Foundation.ERROR_CANT_WAIT
+Windows.Win32.Foundation.ERROR_CANTFETCHBACKWARDS
+Windows.Win32.Foundation.ERROR_CANTOPEN
+Windows.Win32.Foundation.ERROR_CANTREAD
+Windows.Win32.Foundation.ERROR_CANTSCROLLBACKWARDS
+Windows.Win32.Foundation.ERROR_CANTWRITE
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_CHANGE_TYPE
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_DB_CORRUPTED
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_NO_POLICY
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_NOT_AUTHORIZED
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_NOT_DEVUNLOCKED
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_NOT_PROVISIONED
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_SCCD_DEV_MODE_REQUIRED
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_SCCD_INVALID_CATALOG
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_SCCD_NO_AUTH_ENTITY
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_SCCD_NO_CAPABILITY_MATCH
+Windows.Win32.Foundation.ERROR_CAPAUTHZ_SCCD_PARSE_ERROR
+Windows.Win32.Foundation.ERROR_CARDBUS_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_CASE_DIFFERING_NAMES_IN_DIR
+Windows.Win32.Foundation.ERROR_CASE_SENSITIVE_PATH
+Windows.Win32.Foundation.ERROR_CERTIFICATE_VALIDATION_PREFERENCE_CONFLICT
+Windows.Win32.Foundation.ERROR_CHECKING_FILE_SYSTEM
+Windows.Win32.Foundation.ERROR_CHECKOUT_REQUIRED
+Windows.Win32.Foundation.ERROR_CHILD_MUST_BE_VOLATILE
+Windows.Win32.Foundation.ERROR_CHILD_NOT_COMPLETE
+Windows.Win32.Foundation.ERROR_CHILD_PROCESS_BLOCKED
+Windows.Win32.Foundation.ERROR_CHILD_WINDOW_MENU
+Windows.Win32.Foundation.ERROR_CIMFS_IMAGE_CORRUPT
+Windows.Win32.Foundation.ERROR_CIMFS_IMAGE_VERSION_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_CIRCULAR_DEPENDENCY
+Windows.Win32.Foundation.ERROR_CLASS_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_CLASS_DOES_NOT_EXIST
+Windows.Win32.Foundation.ERROR_CLASS_HAS_WINDOWS
+Windows.Win32.Foundation.ERROR_CLIENT_SERVER_PARAMETERS_INVALID
+Windows.Win32.Foundation.ERROR_CLIPBOARD_NOT_OPEN
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_ALREADY_CONNECTED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_AUTHENTICATION_FAILED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_CONNECTED_PROVIDER_ONLY
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_DEHYDRATION_DISALLOWED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_IN_USE
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_INCOMPATIBLE_HARDLINKS
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_INSUFFICIENT_RESOURCES
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_INVALID_REQUEST
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_METADATA_CORRUPT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_METADATA_TOO_LARGE
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_NETWORK_UNAVAILABLE
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_NOT_IN_SYNC
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PINNED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROPERTY_CORRUPT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROPERTY_LOCK_CONFLICT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROPERTY_VERSION_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROVIDER_NOT_RUNNING
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_PROVIDER_TERMINATED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_READ_ONLY_VOLUME
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_REQUEST_ABORTED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_REQUEST_CANCELED
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_REQUEST_TIMEOUT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_SYNC_ROOT_METADATA_CORRUPT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_TOO_MANY_PROPERTY_BLOBS
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_UNSUCCESSFUL
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_US_MESSAGE_TIMEOUT
+Windows.Win32.Foundation.ERROR_CLOUD_FILE_VALIDATION_FAILED
+Windows.Win32.Foundation.ERROR_COMMITMENT_LIMIT
+Windows.Win32.Foundation.ERROR_COMMITMENT_MINIMUM
+Windows.Win32.Foundation.ERROR_COMPRESSED_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_COMPRESSION_DISABLED
+Windows.Win32.Foundation.ERROR_COMPRESSION_NOT_BENEFICIAL
+Windows.Win32.Foundation.ERROR_CONNECTED_OTHER_PASSWORD
+Windows.Win32.Foundation.ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT
+Windows.Win32.Foundation.ERROR_CONNECTION_ABORTED
+Windows.Win32.Foundation.ERROR_CONNECTION_ACTIVE
+Windows.Win32.Foundation.ERROR_CONNECTION_COUNT_LIMIT
+Windows.Win32.Foundation.ERROR_CONNECTION_INVALID
+Windows.Win32.Foundation.ERROR_CONNECTION_REFUSED
+Windows.Win32.Foundation.ERROR_CONNECTION_UNAVAIL
+Windows.Win32.Foundation.ERROR_CONTAINER_ASSIGNED
+Windows.Win32.Foundation.ERROR_CONTENT_BLOCKED
+Windows.Win32.Foundation.ERROR_CONTEXT_EXPIRED
+Windows.Win32.Foundation.ERROR_CONTINUE
+Windows.Win32.Foundation.ERROR_CONTROL_C_EXIT
+Windows.Win32.Foundation.ERROR_CONTROL_ID_NOT_FOUND
+Windows.Win32.Foundation.ERROR_CONVERT_TO_LARGE
+Windows.Win32.Foundation.ERROR_CORRUPT_LOG_CLEARED
+Windows.Win32.Foundation.ERROR_CORRUPT_LOG_CORRUPTED
+Windows.Win32.Foundation.ERROR_CORRUPT_LOG_DELETED_FULL
+Windows.Win32.Foundation.ERROR_CORRUPT_LOG_OVERFULL
+Windows.Win32.Foundation.ERROR_CORRUPT_LOG_UNAVAILABLE
+Windows.Win32.Foundation.ERROR_CORRUPT_SYSTEM_FILE
+Windows.Win32.Foundation.ERROR_COULD_NOT_INTERPRET
+Windows.Win32.Foundation.ERROR_COUNTER_TIMEOUT
+Windows.Win32.Foundation.ERROR_CPU_SET_INVALID
+Windows.Win32.Foundation.ERROR_CRASH_DUMP
+Windows.Win32.Foundation.ERROR_CRC
+Windows.Win32.Foundation.ERROR_CREATE_FAILED
+Windows.Win32.Foundation.ERROR_CROSS_PARTITION_VIOLATION
+Windows.Win32.Foundation.ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE
+Windows.Win32.Foundation.ERROR_CS_ENCRYPTION_FILE_NOT_CSE
+Windows.Win32.Foundation.ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE
+Windows.Win32.Foundation.ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE
+Windows.Win32.Foundation.ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER
+Windows.Win32.Foundation.ERROR_CSCSHARE_OFFLINE
+Windows.Win32.Foundation.ERROR_CTX_CLIENT_QUERY_TIMEOUT
+Windows.Win32.Foundation.ERROR_CTX_MODEM_RESPONSE_TIMEOUT
+Windows.Win32.Foundation.ERROR_CURRENT_DIRECTORY
+Windows.Win32.Foundation.ERROR_CURRENT_DOMAIN_NOT_ALLOWED
+Windows.Win32.Foundation.ERROR_DATA_CHECKSUM_ERROR
+Windows.Win32.Foundation.ERROR_DATA_NOT_ACCEPTED
+Windows.Win32.Foundation.ERROR_DATABASE_DOES_NOT_EXIST
+Windows.Win32.Foundation.ERROR_DATATYPE_MISMATCH
+Windows.Win32.Foundation.ERROR_DAX_MAPPING_EXISTS
+Windows.Win32.Foundation.ERROR_DBG_COMMAND_EXCEPTION
+Windows.Win32.Foundation.ERROR_DBG_CONTINUE
+Windows.Win32.Foundation.ERROR_DBG_CONTROL_BREAK
+Windows.Win32.Foundation.ERROR_DBG_CONTROL_C
+Windows.Win32.Foundation.ERROR_DBG_EXCEPTION_HANDLED
+Windows.Win32.Foundation.ERROR_DBG_EXCEPTION_NOT_HANDLED
+Windows.Win32.Foundation.ERROR_DBG_PRINTEXCEPTION_C
+Windows.Win32.Foundation.ERROR_DBG_REPLY_LATER
+Windows.Win32.Foundation.ERROR_DBG_RIPEXCEPTION
+Windows.Win32.Foundation.ERROR_DBG_TERMINATE_PROCESS
+Windows.Win32.Foundation.ERROR_DBG_TERMINATE_THREAD
+Windows.Win32.Foundation.ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE
+Windows.Win32.Foundation.ERROR_DC_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DDE_FAIL
+Windows.Win32.Foundation.ERROR_DEBUG_ATTACH_FAILED
+Windows.Win32.Foundation.ERROR_DEBUGGER_INACTIVE
+Windows.Win32.Foundation.ERROR_DECRYPTION_FAILED
+Windows.Win32.Foundation.ERROR_DELAY_LOAD_FAILED
+Windows.Win32.Foundation.ERROR_DELETE_PENDING
+Windows.Win32.Foundation.ERROR_DEPENDENT_SERVICES_RUNNING
+Windows.Win32.Foundation.ERROR_DESTINATION_ELEMENT_FULL
+Windows.Win32.Foundation.ERROR_DESTROY_OBJECT_OF_OTHER_THREAD
+Windows.Win32.Foundation.ERROR_DEV_NOT_EXIST
+Windows.Win32.Foundation.ERROR_DEVICE_ALREADY_ATTACHED
+Windows.Win32.Foundation.ERROR_DEVICE_ALREADY_REMEMBERED
+Windows.Win32.Foundation.ERROR_DEVICE_DOOR_OPEN
+Windows.Win32.Foundation.ERROR_DEVICE_ENUMERATION_ERROR
+Windows.Win32.Foundation.ERROR_DEVICE_FEATURE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_DEVICE_HARDWARE_ERROR
+Windows.Win32.Foundation.ERROR_DEVICE_HINT_NAME_BUFFER_TOO_SMALL
+Windows.Win32.Foundation.ERROR_DEVICE_IN_MAINTENANCE
+Windows.Win32.Foundation.ERROR_DEVICE_IN_USE
+Windows.Win32.Foundation.ERROR_DEVICE_NO_RESOURCES
+Windows.Win32.Foundation.ERROR_DEVICE_NOT_CONNECTED
+Windows.Win32.Foundation.ERROR_DEVICE_NOT_PARTITIONED
+Windows.Win32.Foundation.ERROR_DEVICE_REINITIALIZATION_NEEDED
+Windows.Win32.Foundation.ERROR_DEVICE_REMOVED
+Windows.Win32.Foundation.ERROR_DEVICE_REQUIRES_CLEANING
+Windows.Win32.Foundation.ERROR_DEVICE_RESET_REQUIRED
+Windows.Win32.Foundation.ERROR_DEVICE_SUPPORT_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_DEVICE_UNREACHABLE
+Windows.Win32.Foundation.ERROR_DHCP_ADDRESS_CONFLICT
+Windows.Win32.Foundation.ERROR_DIFFERENT_SERVICE_ACCOUNT
+Windows.Win32.Foundation.ERROR_DIR_EFS_DISALLOWED
+Windows.Win32.Foundation.ERROR_DIR_NOT_EMPTY
+Windows.Win32.Foundation.ERROR_DIR_NOT_ROOT
+Windows.Win32.Foundation.ERROR_DIRECT_ACCESS_HANDLE
+Windows.Win32.Foundation.ERROR_DIRECTORY
+Windows.Win32.Foundation.ERROR_DIRECTORY_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_DISCARDED
+Windows.Win32.Foundation.ERROR_DISK_CHANGE
+Windows.Win32.Foundation.ERROR_DISK_CORRUPT
+Windows.Win32.Foundation.ERROR_DISK_FULL
+Windows.Win32.Foundation.ERROR_DISK_OPERATION_FAILED
+Windows.Win32.Foundation.ERROR_DISK_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_DISK_RECALIBRATE_FAILED
+Windows.Win32.Foundation.ERROR_DISK_REPAIR_DISABLED
+Windows.Win32.Foundation.ERROR_DISK_REPAIR_REDIRECTED
+Windows.Win32.Foundation.ERROR_DISK_REPAIR_UNSUCCESSFUL
+Windows.Win32.Foundation.ERROR_DISK_RESET_FAILED
+Windows.Win32.Foundation.ERROR_DISK_RESOURCES_EXHAUSTED
+Windows.Win32.Foundation.ERROR_DISK_TOO_FRAGMENTED
+Windows.Win32.Foundation.ERROR_DLL_INIT_FAILED
+Windows.Win32.Foundation.ERROR_DLL_INIT_FAILED_LOGOFF
+Windows.Win32.Foundation.ERROR_DLL_MIGHT_BE_INCOMPATIBLE
+Windows.Win32.Foundation.ERROR_DLL_MIGHT_BE_INSECURE
+Windows.Win32.Foundation.ERROR_DLL_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DLP_POLICY_DENIES_OPERATION
+Windows.Win32.Foundation.ERROR_DLP_POLICY_SILENTLY_FAIL
+Windows.Win32.Foundation.ERROR_DLP_POLICY_WARNS_AGAINST_OPERATION
+Windows.Win32.Foundation.ERROR_DOMAIN_CONTROLLER_EXISTS
+Windows.Win32.Foundation.ERROR_DOMAIN_CONTROLLER_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DOMAIN_CTRLR_CONFIG_ERROR
+Windows.Win32.Foundation.ERROR_DOMAIN_EXISTS
+Windows.Win32.Foundation.ERROR_DOMAIN_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION
+Windows.Win32.Foundation.ERROR_DOMAIN_TRUST_INCONSISTENT
+Windows.Win32.Foundation.ERROR_DOWNGRADE_DETECTED
+Windows.Win32.Foundation.ERROR_DPL_NOT_SUPPORTED_FOR_USER
+Windows.Win32.Foundation.ERROR_DRIVE_LOCKED
+Windows.Win32.Foundation.ERROR_DRIVER_BLOCKED
+Windows.Win32.Foundation.ERROR_DRIVER_CANCEL_TIMEOUT
+Windows.Win32.Foundation.ERROR_DRIVER_DATABASE_ERROR
+Windows.Win32.Foundation.ERROR_DRIVER_FAILED_PRIOR_UNLOAD
+Windows.Win32.Foundation.ERROR_DRIVER_FAILED_SLEEP
+Windows.Win32.Foundation.ERROR_DRIVER_PROCESS_TERMINATED
+Windows.Win32.Foundation.ERROR_DRIVERS_LEAKING_LOCKED_PAGES
+Windows.Win32.Foundation.ERROR_DS_ADD_REPLICA_INHIBITED
+Windows.Win32.Foundation.ERROR_DS_ADMIN_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_AFFECTS_MULTIPLE_DSAS
+Windows.Win32.Foundation.ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER
+Windows.Win32.Foundation.ERROR_DS_ALIAS_DEREF_PROBLEM
+Windows.Win32.Foundation.ERROR_DS_ALIAS_POINTS_TO_ALIAS
+Windows.Win32.Foundation.ERROR_DS_ALIAS_PROBLEM
+Windows.Win32.Foundation.ERROR_DS_ALIASED_OBJ_MISSING
+Windows.Win32.Foundation.ERROR_DS_ATT_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_DS_ATT_IS_NOT_ON_OBJ
+Windows.Win32.Foundation.ERROR_DS_ATT_NOT_DEF_FOR_CLASS
+Windows.Win32.Foundation.ERROR_DS_ATT_NOT_DEF_IN_SCHEMA
+Windows.Win32.Foundation.ERROR_DS_ATT_SCHEMA_REQ_ID
+Windows.Win32.Foundation.ERROR_DS_ATT_SCHEMA_REQ_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_ATT_VAL_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS
+Windows.Win32.Foundation.ERROR_DS_ATTRIBUTE_OWNED_BY_SAM
+Windows.Win32.Foundation.ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED
+Windows.Win32.Foundation.ERROR_DS_AUDIT_FAILURE
+Windows.Win32.Foundation.ERROR_DS_AUTH_METHOD_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_DS_AUTH_UNKNOWN
+Windows.Win32.Foundation.ERROR_DS_AUTHORIZATION_FAILED
+Windows.Win32.Foundation.ERROR_DS_AUX_CLS_TEST_FAIL
+Windows.Win32.Foundation.ERROR_DS_BACKLINK_WITHOUT_LINK
+Windows.Win32.Foundation.ERROR_DS_BAD_ATT_SCHEMA_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_BAD_HIERARCHY_FILE
+Windows.Win32.Foundation.ERROR_DS_BAD_INSTANCE_TYPE
+Windows.Win32.Foundation.ERROR_DS_BAD_NAME_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_BAD_RDN_ATT_ID_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED
+Windows.Win32.Foundation.ERROR_DS_BUSY
+Windows.Win32.Foundation.ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD
+Windows.Win32.Foundation.ERROR_DS_CANT_ADD_ATT_VALUES
+Windows.Win32.Foundation.ERROR_DS_CANT_ADD_SYSTEM_ONLY
+Windows.Win32.Foundation.ERROR_DS_CANT_ADD_TO_GC
+Windows.Win32.Foundation.ERROR_DS_CANT_CACHE_ATT
+Windows.Win32.Foundation.ERROR_DS_CANT_CACHE_CLASS
+Windows.Win32.Foundation.ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC
+Windows.Win32.Foundation.ERROR_DS_CANT_CREATE_UNDER_SCHEMA
+Windows.Win32.Foundation.ERROR_DS_CANT_DEL_MASTER_CROSSREF
+Windows.Win32.Foundation.ERROR_DS_CANT_DELETE
+Windows.Win32.Foundation.ERROR_DS_CANT_DELETE_DSA_OBJ
+Windows.Win32.Foundation.ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC
+Windows.Win32.Foundation.ERROR_DS_CANT_DEREF_ALIAS
+Windows.Win32.Foundation.ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN
+Windows.Win32.Foundation.ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF
+Windows.Win32.Foundation.ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN
+Windows.Win32.Foundation.ERROR_DS_CANT_FIND_DSA_OBJ
+Windows.Win32.Foundation.ERROR_DS_CANT_FIND_EXPECTED_NC
+Windows.Win32.Foundation.ERROR_DS_CANT_FIND_NC_IN_CACHE
+Windows.Win32.Foundation.ERROR_DS_CANT_MIX_MASTER_AND_REPS
+Windows.Win32.Foundation.ERROR_DS_CANT_MOD_OBJ_CLASS
+Windows.Win32.Foundation.ERROR_DS_CANT_MOD_PRIMARYGROUPID
+Windows.Win32.Foundation.ERROR_DS_CANT_MOD_SYSTEM_ONLY
+Windows.Win32.Foundation.ERROR_DS_CANT_MOVE_ACCOUNT_GROUP
+Windows.Win32.Foundation.ERROR_DS_CANT_MOVE_APP_BASIC_GROUP
+Windows.Win32.Foundation.ERROR_DS_CANT_MOVE_APP_QUERY_GROUP
+Windows.Win32.Foundation.ERROR_DS_CANT_MOVE_DELETED_OBJECT
+Windows.Win32.Foundation.ERROR_DS_CANT_MOVE_RESOURCE_GROUP
+Windows.Win32.Foundation.ERROR_DS_CANT_ON_NON_LEAF
+Windows.Win32.Foundation.ERROR_DS_CANT_ON_RDN
+Windows.Win32.Foundation.ERROR_DS_CANT_REM_MISSING_ATT
+Windows.Win32.Foundation.ERROR_DS_CANT_REM_MISSING_ATT_VAL
+Windows.Win32.Foundation.ERROR_DS_CANT_REMOVE_ATT_CACHE
+Windows.Win32.Foundation.ERROR_DS_CANT_REMOVE_CLASS_CACHE
+Windows.Win32.Foundation.ERROR_DS_CANT_REPLACE_HIDDEN_REC
+Windows.Win32.Foundation.ERROR_DS_CANT_RETRIEVE_ATTS
+Windows.Win32.Foundation.ERROR_DS_CANT_RETRIEVE_CHILD
+Windows.Win32.Foundation.ERROR_DS_CANT_RETRIEVE_DN
+Windows.Win32.Foundation.ERROR_DS_CANT_RETRIEVE_INSTANCE
+Windows.Win32.Foundation.ERROR_DS_CANT_RETRIEVE_SD
+Windows.Win32.Foundation.ERROR_DS_CANT_START
+Windows.Win32.Foundation.ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ
+Windows.Win32.Foundation.ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS
+Windows.Win32.Foundation.ERROR_DS_CHILDREN_EXIST
+Windows.Win32.Foundation.ERROR_DS_CLASS_MUST_BE_CONCRETE
+Windows.Win32.Foundation.ERROR_DS_CLASS_NOT_DSA
+Windows.Win32.Foundation.ERROR_DS_CLIENT_LOOP
+Windows.Win32.Foundation.ERROR_DS_CODE_INCONSISTENCY
+Windows.Win32.Foundation.ERROR_DS_COMPARE_FALSE
+Windows.Win32.Foundation.ERROR_DS_COMPARE_TRUE
+Windows.Win32.Foundation.ERROR_DS_CONFIDENTIALITY_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_CONFIG_PARAM_MISSING
+Windows.Win32.Foundation.ERROR_DS_CONSTRAINT_VIOLATION
+Windows.Win32.Foundation.ERROR_DS_CONSTRUCTED_ATT_MOD
+Windows.Win32.Foundation.ERROR_DS_CONTROL_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DS_COULDNT_CONTACT_FSMO
+Windows.Win32.Foundation.ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE
+Windows.Win32.Foundation.ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE
+Windows.Win32.Foundation.ERROR_DS_COULDNT_UPDATE_SPNS
+Windows.Win32.Foundation.ERROR_DS_COUNTING_AB_INDICES_FAILED
+Windows.Win32.Foundation.ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE
+Windows.Win32.Foundation.ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2
+Windows.Win32.Foundation.ERROR_DS_CROSS_DOM_MOVE_ERROR
+Windows.Win32.Foundation.ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD
+Windows.Win32.Foundation.ERROR_DS_CROSS_NC_DN_RENAME
+Windows.Win32.Foundation.ERROR_DS_CROSS_REF_BUSY
+Windows.Win32.Foundation.ERROR_DS_CROSS_REF_EXISTS
+Windows.Win32.Foundation.ERROR_DS_DATABASE_ERROR
+Windows.Win32.Foundation.ERROR_DS_DECODING_ERROR
+Windows.Win32.Foundation.ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED
+Windows.Win32.Foundation.ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_DIFFERENT_REPL_EPOCHS
+Windows.Win32.Foundation.ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER
+Windows.Win32.Foundation.ERROR_DS_DISALLOWED_NC_REDIRECT
+Windows.Win32.Foundation.ERROR_DS_DNS_LOOKUP_FAILURE
+Windows.Win32.Foundation.ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_DOMAIN_RENAME_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_DS_DOMAIN_VERSION_TOO_HIGH
+Windows.Win32.Foundation.ERROR_DS_DOMAIN_VERSION_TOO_LOW
+Windows.Win32.Foundation.ERROR_DS_DRA_ABANDON_SYNC
+Windows.Win32.Foundation.ERROR_DS_DRA_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_DS_DRA_BAD_DN
+Windows.Win32.Foundation.ERROR_DS_DRA_BAD_INSTANCE_TYPE
+Windows.Win32.Foundation.ERROR_DS_DRA_BAD_NC
+Windows.Win32.Foundation.ERROR_DS_DRA_BUSY
+Windows.Win32.Foundation.ERROR_DS_DRA_CONNECTION_FAILED
+Windows.Win32.Foundation.ERROR_DS_DRA_CORRUPT_UTD_VECTOR
+Windows.Win32.Foundation.ERROR_DS_DRA_DB_ERROR
+Windows.Win32.Foundation.ERROR_DS_DRA_DN_EXISTS
+Windows.Win32.Foundation.ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT
+Windows.Win32.Foundation.ERROR_DS_DRA_EXTN_CONNECTION_FAILED
+Windows.Win32.Foundation.ERROR_DS_DRA_GENERIC
+Windows.Win32.Foundation.ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET
+Windows.Win32.Foundation.ERROR_DS_DRA_INCONSISTENT_DIT
+Windows.Win32.Foundation.ERROR_DS_DRA_INTERNAL_ERROR
+Windows.Win32.Foundation.ERROR_DS_DRA_INVALID_PARAMETER
+Windows.Win32.Foundation.ERROR_DS_DRA_MAIL_PROBLEM
+Windows.Win32.Foundation.ERROR_DS_DRA_MISSING_KRBTGT_SECRET
+Windows.Win32.Foundation.ERROR_DS_DRA_MISSING_PARENT
+Windows.Win32.Foundation.ERROR_DS_DRA_NAME_COLLISION
+Windows.Win32.Foundation.ERROR_DS_DRA_NO_REPLICA
+Windows.Win32.Foundation.ERROR_DS_DRA_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_DS_DRA_OBJ_IS_REP_SOURCE
+Windows.Win32.Foundation.ERROR_DS_DRA_OBJ_NC_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_DRA_OUT_OF_MEM
+Windows.Win32.Foundation.ERROR_DS_DRA_OUT_SCHEDULE_WINDOW
+Windows.Win32.Foundation.ERROR_DS_DRA_PREEMPTED
+Windows.Win32.Foundation.ERROR_DS_DRA_RECYCLED_TARGET
+Windows.Win32.Foundation.ERROR_DS_DRA_REF_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_DS_DRA_REF_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DS_DRA_REPL_PENDING
+Windows.Win32.Foundation.ERROR_DS_DRA_RPC_CANCELLED
+Windows.Win32.Foundation.ERROR_DS_DRA_SCHEMA_CONFLICT
+Windows.Win32.Foundation.ERROR_DS_DRA_SCHEMA_INFO_SHIP
+Windows.Win32.Foundation.ERROR_DS_DRA_SCHEMA_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_DRA_SECRETS_DENIED
+Windows.Win32.Foundation.ERROR_DS_DRA_SHUTDOWN
+Windows.Win32.Foundation.ERROR_DS_DRA_SINK_DISABLED
+Windows.Win32.Foundation.ERROR_DS_DRA_SOURCE_DISABLED
+Windows.Win32.Foundation.ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA
+Windows.Win32.Foundation.ERROR_DS_DRA_SOURCE_REINSTALLED
+Windows.Win32.Foundation.ERROR_DS_DRS_EXTENSIONS_CHANGED
+Windows.Win32.Foundation.ERROR_DS_DS_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_DSA_MUST_BE_INT_MASTER
+Windows.Win32.Foundation.ERROR_DS_DST_DOMAIN_NOT_NATIVE
+Windows.Win32.Foundation.ERROR_DS_DST_NC_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_DUP_LDAP_DISPLAY_NAME
+Windows.Win32.Foundation.ERROR_DS_DUP_LINK_ID
+Windows.Win32.Foundation.ERROR_DS_DUP_MAPI_ID
+Windows.Win32.Foundation.ERROR_DS_DUP_MSDS_INTID
+Windows.Win32.Foundation.ERROR_DS_DUP_OID
+Windows.Win32.Foundation.ERROR_DS_DUP_RDN
+Windows.Win32.Foundation.ERROR_DS_DUP_SCHEMA_ID_GUID
+Windows.Win32.Foundation.ERROR_DS_DUPLICATE_ID_FOUND
+Windows.Win32.Foundation.ERROR_DS_ENCODING_ERROR
+Windows.Win32.Foundation.ERROR_DS_EPOCH_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_EXISTING_AD_CHILD_NC
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_AUX_CLS
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_MAY_HAVE
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_MUST_HAVE
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_POSS_SUP
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_RDNATTID
+Windows.Win32.Foundation.ERROR_DS_EXISTS_IN_SUB_CLS
+Windows.Win32.Foundation.ERROR_DS_FILTER_UNKNOWN
+Windows.Win32.Foundation.ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS
+Windows.Win32.Foundation.ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_FOREST_VERSION_TOO_HIGH
+Windows.Win32.Foundation.ERROR_DS_FOREST_VERSION_TOO_LOW
+Windows.Win32.Foundation.ERROR_DS_GC_NOT_AVAILABLE
+Windows.Win32.Foundation.ERROR_DS_GC_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_GCVERIFY_ERROR
+Windows.Win32.Foundation.ERROR_DS_GENERIC_ERROR
+Windows.Win32.Foundation.ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER
+Windows.Win32.Foundation.ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER
+Windows.Win32.Foundation.ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER
+Windows.Win32.Foundation.ERROR_DS_GOVERNSID_MISSING
+Windows.Win32.Foundation.ERROR_DS_GROUP_CONVERSION_ERROR
+Windows.Win32.Foundation.ERROR_DS_HAVE_PRIMARY_MEMBERS
+Windows.Win32.Foundation.ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED
+Windows.Win32.Foundation.ERROR_DS_HIERARCHY_TABLE_TOO_DEEP
+Windows.Win32.Foundation.ERROR_DS_HIGH_ADLDS_FFL
+Windows.Win32.Foundation.ERROR_DS_HIGH_DSA_VERSION
+Windows.Win32.Foundation.ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD
+Windows.Win32.Foundation.ERROR_DS_ILLEGAL_MOD_OPERATION
+Windows.Win32.Foundation.ERROR_DS_ILLEGAL_SUPERIOR
+Windows.Win32.Foundation.ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION
+Windows.Win32.Foundation.ERROR_DS_INAPPROPRIATE_AUTH
+Windows.Win32.Foundation.ERROR_DS_INAPPROPRIATE_MATCHING
+Windows.Win32.Foundation.ERROR_DS_INCOMPATIBLE_CONTROLS_USED
+Windows.Win32.Foundation.ERROR_DS_INCOMPATIBLE_VERSION
+Windows.Win32.Foundation.ERROR_DS_INCORRECT_ROLE_OWNER
+Windows.Win32.Foundation.ERROR_DS_INIT_FAILURE
+Windows.Win32.Foundation.ERROR_DS_INIT_FAILURE_CONSOLE
+Windows.Win32.Foundation.ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE
+Windows.Win32.Foundation.ERROR_DS_INSTALL_NO_SRC_SCH_VERSION
+Windows.Win32.Foundation.ERROR_DS_INSTALL_SCHEMA_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_INSUFF_ACCESS_RIGHTS
+Windows.Win32.Foundation.ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT
+Windows.Win32.Foundation.ERROR_DS_INTERNAL_FAILURE
+Windows.Win32.Foundation.ERROR_DS_INVALID_ATTRIBUTE_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_INVALID_DMD
+Windows.Win32.Foundation.ERROR_DS_INVALID_DN_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_INVALID_GROUP_TYPE
+Windows.Win32.Foundation.ERROR_DS_INVALID_LDAP_DISPLAY_NAME
+Windows.Win32.Foundation.ERROR_DS_INVALID_NAME_FOR_SPN
+Windows.Win32.Foundation.ERROR_DS_INVALID_ROLE_OWNER
+Windows.Win32.Foundation.ERROR_DS_INVALID_SCRIPT
+Windows.Win32.Foundation.ERROR_DS_INVALID_SEARCH_FLAG
+Windows.Win32.Foundation.ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE
+Windows.Win32.Foundation.ERROR_DS_INVALID_SEARCH_FLAG_TUPLE
+Windows.Win32.Foundation.ERROR_DS_IS_LEAF
+Windows.Win32.Foundation.ERROR_DS_KEY_NOT_UNIQUE
+Windows.Win32.Foundation.ERROR_DS_LDAP_SEND_QUEUE_FULL
+Windows.Win32.Foundation.ERROR_DS_LINK_ID_NOT_AVAILABLE
+Windows.Win32.Foundation.ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER
+Windows.Win32.Foundation.ERROR_DS_LOCAL_ERROR
+Windows.Win32.Foundation.ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY
+Windows.Win32.Foundation.ERROR_DS_LOOP_DETECT
+Windows.Win32.Foundation.ERROR_DS_LOW_ADLDS_FFL
+Windows.Win32.Foundation.ERROR_DS_LOW_DSA_VERSION
+Windows.Win32.Foundation.ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4
+Windows.Win32.Foundation.ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_MAPI_ID_NOT_AVAILABLE
+Windows.Win32.Foundation.ERROR_DS_MASTERDSA_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_MAX_OBJ_SIZE_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY
+Windows.Win32.Foundation.ERROR_DS_MISSING_EXPECTED_ATT
+Windows.Win32.Foundation.ERROR_DS_MISSING_FOREST_TRUST
+Windows.Win32.Foundation.ERROR_DS_MISSING_FSMO_SETTINGS
+Windows.Win32.Foundation.ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER
+Windows.Win32.Foundation.ERROR_DS_MISSING_REQUIRED_ATT
+Windows.Win32.Foundation.ERROR_DS_MISSING_SUPREF
+Windows.Win32.Foundation.ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG
+Windows.Win32.Foundation.ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE
+Windows.Win32.Foundation.ERROR_DS_MODIFYDN_WRONG_GRANDPARENT
+Windows.Win32.Foundation.ERROR_DS_MUST_BE_RUN_ON_DST_DC
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_DOMAIN_ONLY
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_NO_MAPPING
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_NOT_UNIQUE
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_RESOLVING
+Windows.Win32.Foundation.ERROR_DS_NAME_ERROR_TRUST_REFERRAL
+Windows.Win32.Foundation.ERROR_DS_NAME_NOT_UNIQUE
+Windows.Win32.Foundation.ERROR_DS_NAME_REFERENCE_INVALID
+Windows.Win32.Foundation.ERROR_DS_NAME_TOO_LONG
+Windows.Win32.Foundation.ERROR_DS_NAME_TOO_MANY_PARTS
+Windows.Win32.Foundation.ERROR_DS_NAME_TYPE_UNKNOWN
+Windows.Win32.Foundation.ERROR_DS_NAME_UNPARSEABLE
+Windows.Win32.Foundation.ERROR_DS_NAME_VALUE_TOO_LONG
+Windows.Win32.Foundation.ERROR_DS_NAMING_MASTER_GC
+Windows.Win32.Foundation.ERROR_DS_NAMING_VIOLATION
+Windows.Win32.Foundation.ERROR_DS_NC_MUST_HAVE_NC_PARENT
+Windows.Win32.Foundation.ERROR_DS_NC_STILL_HAS_DSAS
+Windows.Win32.Foundation.ERROR_DS_NCNAME_MISSING_CR_REF
+Windows.Win32.Foundation.ERROR_DS_NCNAME_MUST_BE_NC
+Windows.Win32.Foundation.ERROR_DS_NO_ATTRIBUTE_OR_VALUE
+Windows.Win32.Foundation.ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN
+Windows.Win32.Foundation.ERROR_DS_NO_CHAINED_EVAL
+Windows.Win32.Foundation.ERROR_DS_NO_CHAINING
+Windows.Win32.Foundation.ERROR_DS_NO_CHECKPOINT_WITH_PDC
+Windows.Win32.Foundation.ERROR_DS_NO_CROSSREF_FOR_NC
+Windows.Win32.Foundation.ERROR_DS_NO_DELETED_NAME
+Windows.Win32.Foundation.ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS
+Windows.Win32.Foundation.ERROR_DS_NO_MORE_RIDS
+Windows.Win32.Foundation.ERROR_DS_NO_MSDS_INTID
+Windows.Win32.Foundation.ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN
+Windows.Win32.Foundation.ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN
+Windows.Win32.Foundation.ERROR_DS_NO_NTDSA_OBJECT
+Windows.Win32.Foundation.ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC
+Windows.Win32.Foundation.ERROR_DS_NO_PARENT_OBJECT
+Windows.Win32.Foundation.ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION
+Windows.Win32.Foundation.ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA
+Windows.Win32.Foundation.ERROR_DS_NO_REF_DOMAIN
+Windows.Win32.Foundation.ERROR_DS_NO_REQUESTED_ATTS_FOUND
+Windows.Win32.Foundation.ERROR_DS_NO_RESULTS_RETURNED
+Windows.Win32.Foundation.ERROR_DS_NO_RIDS_ALLOCATED
+Windows.Win32.Foundation.ERROR_DS_NO_SERVER_OBJECT
+Windows.Win32.Foundation.ERROR_DS_NO_SUCH_OBJECT
+Windows.Win32.Foundation.ERROR_DS_NO_TREE_DELETE_ABOVE_NC
+Windows.Win32.Foundation.ERROR_DS_NON_ASQ_SEARCH
+Windows.Win32.Foundation.ERROR_DS_NON_BASE_SEARCH
+Windows.Win32.Foundation.ERROR_DS_NONEXISTENT_MAY_HAVE
+Windows.Win32.Foundation.ERROR_DS_NONEXISTENT_MUST_HAVE
+Windows.Win32.Foundation.ERROR_DS_NONEXISTENT_POSS_SUP
+Windows.Win32.Foundation.ERROR_DS_NONSAFE_SCHEMA_CHANGE
+Windows.Win32.Foundation.ERROR_DS_NOT_AN_OBJECT
+Windows.Win32.Foundation.ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC
+Windows.Win32.Foundation.ERROR_DS_NOT_CLOSEST
+Windows.Win32.Foundation.ERROR_DS_NOT_INSTALLED
+Windows.Win32.Foundation.ERROR_DS_NOT_ON_BACKLINK
+Windows.Win32.Foundation.ERROR_DS_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_DS_NOT_SUPPORTED_SORT_ORDER
+Windows.Win32.Foundation.ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX
+Windows.Win32.Foundation.ERROR_DS_NTDSCRIPT_PROCESS_ERROR
+Windows.Win32.Foundation.ERROR_DS_NTDSCRIPT_SYNTAX_ERROR
+Windows.Win32.Foundation.ERROR_DS_OBJ_CLASS_NOT_DEFINED
+Windows.Win32.Foundation.ERROR_DS_OBJ_CLASS_NOT_SUBCLASS
+Windows.Win32.Foundation.ERROR_DS_OBJ_CLASS_VIOLATION
+Windows.Win32.Foundation.ERROR_DS_OBJ_GUID_EXISTS
+Windows.Win32.Foundation.ERROR_DS_OBJ_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DS_OBJ_STRING_NAME_EXISTS
+Windows.Win32.Foundation.ERROR_DS_OBJ_TOO_LARGE
+Windows.Win32.Foundation.ERROR_DS_OBJECT_BEING_REMOVED
+Windows.Win32.Foundation.ERROR_DS_OBJECT_CLASS_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_OBJECT_RESULTS_TOO_LARGE
+Windows.Win32.Foundation.ERROR_DS_OFFSET_RANGE_ERROR
+Windows.Win32.Foundation.ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS
+Windows.Win32.Foundation.ERROR_DS_OID_NOT_FOUND
+Windows.Win32.Foundation.ERROR_DS_OPERATIONS_ERROR
+Windows.Win32.Foundation.ERROR_DS_OUT_OF_SCOPE
+Windows.Win32.Foundation.ERROR_DS_OUT_OF_VERSION_STORE
+Windows.Win32.Foundation.ERROR_DS_PARAM_ERROR
+Windows.Win32.Foundation.ERROR_DS_PARENT_IS_AN_ALIAS
+Windows.Win32.Foundation.ERROR_DS_PDC_OPERATION_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_DS_PER_ATTRIBUTE_AUTHZ_FAILED_DURING_ADD
+Windows.Win32.Foundation.ERROR_DS_POLICY_NOT_KNOWN
+Windows.Win32.Foundation.ERROR_DS_PROTOCOL_ERROR
+Windows.Win32.Foundation.ERROR_DS_RANGE_CONSTRAINT
+Windows.Win32.Foundation.ERROR_DS_RDN_DOESNT_MATCH_SCHEMA
+Windows.Win32.Foundation.ERROR_DS_RECALCSCHEMA_FAILED
+Windows.Win32.Foundation.ERROR_DS_REFERRAL
+Windows.Win32.Foundation.ERROR_DS_REFERRAL_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_REFUSING_FSMO_ROLES
+Windows.Win32.Foundation.ERROR_DS_REMOTE_CROSSREF_OP_FAILED
+Windows.Win32.Foundation.ERROR_DS_REPL_LIFETIME_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR
+Windows.Win32.Foundation.ERROR_DS_REPLICATOR_ONLY
+Windows.Win32.Foundation.ERROR_DS_RESERVED_LINK_ID
+Windows.Win32.Foundation.ERROR_DS_RESERVED_MAPI_ID
+Windows.Win32.Foundation.ERROR_DS_RIDMGR_DISABLED
+Windows.Win32.Foundation.ERROR_DS_RIDMGR_INIT_ERROR
+Windows.Win32.Foundation.ERROR_DS_ROLE_NOT_VERIFIED
+Windows.Win32.Foundation.ERROR_DS_ROOT_CANT_BE_SUBREF
+Windows.Win32.Foundation.ERROR_DS_ROOT_MUST_BE_NC
+Windows.Win32.Foundation.ERROR_DS_ROOT_REQUIRES_CLASS_TOP
+Windows.Win32.Foundation.ERROR_DS_SAM_INIT_FAILURE
+Windows.Win32.Foundation.ERROR_DS_SAM_INIT_FAILURE_CONSOLE
+Windows.Win32.Foundation.ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY
+Windows.Win32.Foundation.ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD
+Windows.Win32.Foundation.ERROR_DS_SCHEMA_ALLOC_FAILED
+Windows.Win32.Foundation.ERROR_DS_SCHEMA_NOT_LOADED
+Windows.Win32.Foundation.ERROR_DS_SCHEMA_UPDATE_DISALLOWED
+Windows.Win32.Foundation.ERROR_DS_SEC_DESC_INVALID
+Windows.Win32.Foundation.ERROR_DS_SEC_DESC_TOO_SHORT
+Windows.Win32.Foundation.ERROR_DS_SECURITY_CHECKING_ERROR
+Windows.Win32.Foundation.ERROR_DS_SECURITY_ILLEGAL_MODIFY
+Windows.Win32.Foundation.ERROR_DS_SEMANTIC_ATT_TEST
+Windows.Win32.Foundation.ERROR_DS_SENSITIVE_GROUP_VIOLATION
+Windows.Win32.Foundation.ERROR_DS_SERVER_DOWN
+Windows.Win32.Foundation.ERROR_DS_SHUTTING_DOWN
+Windows.Win32.Foundation.ERROR_DS_SINGLE_USER_MODE_FAILED
+Windows.Win32.Foundation.ERROR_DS_SINGLE_VALUE_CONSTRAINT
+Windows.Win32.Foundation.ERROR_DS_SIZELIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_SORT_CONTROL_MISSING
+Windows.Win32.Foundation.ERROR_DS_SOURCE_AUDITING_NOT_ENABLED
+Windows.Win32.Foundation.ERROR_DS_SOURCE_DOMAIN_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_SPN_VALUE_NOT_UNIQUE_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_SRC_AND_DST_NC_IDENTICAL
+Windows.Win32.Foundation.ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER
+Windows.Win32.Foundation.ERROR_DS_SRC_GUID_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_SRC_NAME_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER
+Windows.Win32.Foundation.ERROR_DS_SRC_SID_EXISTS_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_STRING_SD_CONVERSION_FAILED
+Windows.Win32.Foundation.ERROR_DS_STRONG_AUTH_REQUIRED
+Windows.Win32.Foundation.ERROR_DS_SUB_CLS_TEST_FAIL
+Windows.Win32.Foundation.ERROR_DS_SUBREF_MUST_HAVE_PARENT
+Windows.Win32.Foundation.ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD
+Windows.Win32.Foundation.ERROR_DS_SYNTAX_MISMATCH
+Windows.Win32.Foundation.ERROR_DS_THREAD_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_TIMELIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_DS_TREE_DELETE_NOT_FINISHED
+Windows.Win32.Foundation.ERROR_DS_UNABLE_TO_SURRENDER_ROLES
+Windows.Win32.Foundation.ERROR_DS_UNAVAILABLE
+Windows.Win32.Foundation.ERROR_DS_UNAVAILABLE_CRIT_EXTENSION
+Windows.Win32.Foundation.ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED
+Windows.Win32.Foundation.ERROR_DS_UNICODEPWD_NOT_IN_QUOTES
+Windows.Win32.Foundation.ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER
+Windows.Win32.Foundation.ERROR_DS_UNKNOWN_ERROR
+Windows.Win32.Foundation.ERROR_DS_UNKNOWN_OPERATION
+Windows.Win32.Foundation.ERROR_DS_UNWILLING_TO_PERFORM
+Windows.Win32.Foundation.ERROR_DS_UPN_VALUE_NOT_UNIQUE_IN_FOREST
+Windows.Win32.Foundation.ERROR_DS_USER_BUFFER_TO_SMALL
+Windows.Win32.Foundation.ERROR_DS_VALUE_KEY_NOT_UNIQUE
+Windows.Win32.Foundation.ERROR_DS_VERSION_CHECK_FAILURE
+Windows.Win32.Foundation.ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL
+Windows.Win32.Foundation.ERROR_DS_WRONG_LINKED_ATT_SYNTAX
+Windows.Win32.Foundation.ERROR_DS_WRONG_OM_OBJ_CLASS
+Windows.Win32.Foundation.ERROR_DUP_DOMAINNAME
+Windows.Win32.Foundation.ERROR_DUP_NAME
+Windows.Win32.Foundation.ERROR_DUPLICATE_PRIVILEGES
+Windows.Win32.Foundation.ERROR_DUPLICATE_SERVICE_NAME
+Windows.Win32.Foundation.ERROR_DYNAMIC_CODE_BLOCKED
+Windows.Win32.Foundation.ERROR_DYNLINK_FROM_INVALID_RING
+Windows.Win32.Foundation.ERROR_EA_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_EA_FILE_CORRUPT
+Windows.Win32.Foundation.ERROR_EA_LIST_INCONSISTENT
+Windows.Win32.Foundation.ERROR_EA_TABLE_FULL
+Windows.Win32.Foundation.ERROR_EAS_DIDNT_FIT
+Windows.Win32.Foundation.ERROR_EAS_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_EDP_DPL_POLICY_CANT_BE_SATISFIED
+Windows.Win32.Foundation.ERROR_EDP_POLICY_DENIES_OPERATION
+Windows.Win32.Foundation.ERROR_EFS_ALG_BLOB_TOO_BIG
+Windows.Win32.Foundation.ERROR_EFS_DISABLED
+Windows.Win32.Foundation.ERROR_EFS_SERVER_NOT_TRUSTED
+Windows.Win32.Foundation.ERROR_EFS_VERSION_NOT_SUPPORT
+Windows.Win32.Foundation.ERROR_ELEVATION_REQUIRED
+Windows.Win32.Foundation.ERROR_ENCLAVE_FAILURE
+Windows.Win32.Foundation.ERROR_ENCLAVE_NOT_TERMINATED
+Windows.Win32.Foundation.ERROR_ENCLAVE_VIOLATION
+Windows.Win32.Foundation.ERROR_ENCRYPTED_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_ENCRYPTED_IO_NOT_POSSIBLE
+Windows.Win32.Foundation.ERROR_ENCRYPTING_METADATA_DISALLOWED
+Windows.Win32.Foundation.ERROR_ENCRYPTION_DISABLED
+Windows.Win32.Foundation.ERROR_ENCRYPTION_FAILED
+Windows.Win32.Foundation.ERROR_ENCRYPTION_POLICY_DENIES_OPERATION
+Windows.Win32.Foundation.ERROR_END_OF_MEDIA
+Windows.Win32.Foundation.ERROR_ENVVAR_NOT_FOUND
+Windows.Win32.Foundation.ERROR_EOM_OVERFLOW
+Windows.Win32.Foundation.ERROR_ERRORS_ENCOUNTERED
+Windows.Win32.Foundation.ERROR_EVALUATION_EXPIRATION
+Windows.Win32.Foundation.ERROR_EVENT_DONE
+Windows.Win32.Foundation.ERROR_EVENT_PENDING
+Windows.Win32.Foundation.ERROR_EVENTLOG_CANT_START
+Windows.Win32.Foundation.ERROR_EVENTLOG_FILE_CHANGED
+Windows.Win32.Foundation.ERROR_EVENTLOG_FILE_CORRUPT
+Windows.Win32.Foundation.ERROR_EXCEPTION_IN_SERVICE
+Windows.Win32.Foundation.ERROR_EXCL_SEM_ALREADY_OWNED
+Windows.Win32.Foundation.ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY
+Windows.Win32.Foundation.ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY
+Windows.Win32.Foundation.ERROR_EXE_MACHINE_TYPE_MISMATCH
+Windows.Win32.Foundation.ERROR_EXE_MARKED_INVALID
+Windows.Win32.Foundation.ERROR_EXTENDED_ERROR
+Windows.Win32.Foundation.ERROR_EXTERNAL_BACKING_PROVIDER_UNKNOWN
+Windows.Win32.Foundation.ERROR_EXTERNAL_SYSKEY_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_EXTRANEOUS_INFORMATION
+Windows.Win32.Foundation.ERROR_FAIL_FAST_EXCEPTION
+Windows.Win32.Foundation.ERROR_FAIL_I24
+Windows.Win32.Foundation.ERROR_FAIL_NOACTION_REBOOT
+Windows.Win32.Foundation.ERROR_FAIL_RESTART
+Windows.Win32.Foundation.ERROR_FAIL_SHUTDOWN
+Windows.Win32.Foundation.ERROR_FAILED_DRIVER_ENTRY
+Windows.Win32.Foundation.ERROR_FAILED_SERVICE_CONTROLLER_CONNECT
+Windows.Win32.Foundation.ERROR_FATAL_APP_EXIT
+Windows.Win32.Foundation.ERROR_FILE_CHECKED_OUT
+Windows.Win32.Foundation.ERROR_FILE_CORRUPT
+Windows.Win32.Foundation.ERROR_FILE_ENCRYPTED
+Windows.Win32.Foundation.ERROR_FILE_EXISTS
+Windows.Win32.Foundation.ERROR_FILE_HANDLE_REVOKED
+Windows.Win32.Foundation.ERROR_FILE_INVALID
+Windows.Win32.Foundation.ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_FILE_METADATA_OPTIMIZATION_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_FILE_NOT_ENCRYPTED
+Windows.Win32.Foundation.ERROR_FILE_NOT_FOUND
+Windows.Win32.Foundation.ERROR_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_FILE_OFFLINE
+Windows.Win32.Foundation.ERROR_FILE_PROTECTED_UNDER_DPL
+Windows.Win32.Foundation.ERROR_FILE_READ_ONLY
+Windows.Win32.Foundation.ERROR_FILE_SNAP_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_FILE_SNAP_INVALID_PARAMETER
+Windows.Win32.Foundation.ERROR_FILE_SNAP_IO_NOT_COORDINATED
+Windows.Win32.Foundation.ERROR_FILE_SNAP_MODIFY_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_FILE_SNAP_UNEXPECTED_ERROR
+Windows.Win32.Foundation.ERROR_FILE_SNAP_USER_SECTION_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_LIMITATION
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_VIRTUALIZATION_BUSY
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_VIRTUALIZATION_INVALID_OPERATION
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_VIRTUALIZATION_METADATA_CORRUPT
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_VIRTUALIZATION_PROVIDER_UNKNOWN
+Windows.Win32.Foundation.ERROR_FILE_SYSTEM_VIRTUALIZATION_UNAVAILABLE
+Windows.Win32.Foundation.ERROR_FILE_TOO_LARGE
+Windows.Win32.Foundation.ERROR_FILEMARK_DETECTED
+Windows.Win32.Foundation.ERROR_FILENAME_EXCED_RANGE
+Windows.Win32.Foundation.ERROR_FIRMWARE_UPDATED
+Windows.Win32.Foundation.ERROR_FLOAT_MULTIPLE_FAULTS
+Windows.Win32.Foundation.ERROR_FLOAT_MULTIPLE_TRAPS
+Windows.Win32.Foundation.ERROR_FLOPPY_BAD_REGISTERS
+Windows.Win32.Foundation.ERROR_FLOPPY_ID_MARK_NOT_FOUND
+Windows.Win32.Foundation.ERROR_FLOPPY_UNKNOWN_ERROR
+Windows.Win32.Foundation.ERROR_FLOPPY_VOLUME
+Windows.Win32.Foundation.ERROR_FLOPPY_WRONG_CYLINDER
+Windows.Win32.Foundation.ERROR_FORMS_AUTH_REQUIRED
+Windows.Win32.Foundation.ERROR_FOUND_OUT_OF_SCOPE
+Windows.Win32.Foundation.ERROR_FS_DRIVER_REQUIRED
+Windows.Win32.Foundation.ERROR_FS_METADATA_INCONSISTENT
+Windows.Win32.Foundation.ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY
+Windows.Win32.Foundation.ERROR_FT_DI_SCAN_REQUIRED
+Windows.Win32.Foundation.ERROR_FT_READ_FAILURE
+Windows.Win32.Foundation.ERROR_FT_READ_FROM_COPY_FAILURE
+Windows.Win32.Foundation.ERROR_FT_READ_RECOVERY_FROM_BACKUP
+Windows.Win32.Foundation.ERROR_FT_WRITE_FAILURE
+Windows.Win32.Foundation.ERROR_FT_WRITE_RECOVERY
+Windows.Win32.Foundation.ERROR_FULLSCREEN_MODE
+Windows.Win32.Foundation.ERROR_FUNCTION_FAILED
+Windows.Win32.Foundation.ERROR_FUNCTION_NOT_CALLED
+Windows.Win32.Foundation.ERROR_GDI_HANDLE_LEAK
+Windows.Win32.Foundation.ERROR_GEN_FAILURE
+Windows.Win32.Foundation.ERROR_GENERIC_NOT_MAPPED
+Windows.Win32.Foundation.ERROR_GLOBAL_ONLY_HOOK
+Windows.Win32.Foundation.ERROR_GRACEFUL_DISCONNECT
+Windows.Win32.Foundation.ERROR_GROUP_EXISTS
+Windows.Win32.Foundation.ERROR_GUID_SUBSTITUTION_MADE
+Windows.Win32.Foundation.ERROR_HANDLE_DISK_FULL
+Windows.Win32.Foundation.ERROR_HANDLE_EOF
+Windows.Win32.Foundation.ERROR_HANDLE_REVOKED
+Windows.Win32.Foundation.ERROR_HANDLES_CLOSED
+Windows.Win32.Foundation.ERROR_HAS_SYSTEM_CRITICAL_FILES
+Windows.Win32.Foundation.ERROR_HIBERNATED
+Windows.Win32.Foundation.ERROR_HIBERNATION_FAILURE
+Windows.Win32.Foundation.ERROR_HOOK_NEEDS_HMOD
+Windows.Win32.Foundation.ERROR_HOOK_NOT_INSTALLED
+Windows.Win32.Foundation.ERROR_HOOK_TYPE_NOT_ALLOWED
+Windows.Win32.Foundation.ERROR_HOST_DOWN
+Windows.Win32.Foundation.ERROR_HOST_UNREACHABLE
+Windows.Win32.Foundation.ERROR_HOTKEY_ALREADY_REGISTERED
+Windows.Win32.Foundation.ERROR_HOTKEY_NOT_REGISTERED
+Windows.Win32.Foundation.ERROR_HWNDS_HAVE_DIFF_PARENT
+Windows.Win32.Foundation.ERROR_ILL_FORMED_PASSWORD
+Windows.Win32.Foundation.ERROR_ILLEGAL_CHARACTER
+Windows.Win32.Foundation.ERROR_ILLEGAL_DLL_RELOCATION
+Windows.Win32.Foundation.ERROR_ILLEGAL_ELEMENT_ADDRESS
+Windows.Win32.Foundation.ERROR_ILLEGAL_FLOAT_CONTEXT
+Windows.Win32.Foundation.ERROR_IMAGE_AT_DIFFERENT_BASE
+Windows.Win32.Foundation.ERROR_IMAGE_MACHINE_TYPE_MISMATCH
+Windows.Win32.Foundation.ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE
+Windows.Win32.Foundation.ERROR_IMAGE_NOT_AT_BASE
+Windows.Win32.Foundation.ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT
+Windows.Win32.Foundation.ERROR_IMPLEMENTATION_LIMIT
+Windows.Win32.Foundation.ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE
+Windows.Win32.Foundation.ERROR_INCOMPATIBLE_SERVICE_SID_TYPE
+Windows.Win32.Foundation.ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING
+Windows.Win32.Foundation.ERROR_INCORRECT_ACCOUNT_TYPE
+Windows.Win32.Foundation.ERROR_INCORRECT_ADDRESS
+Windows.Win32.Foundation.ERROR_INCORRECT_SIZE
+Windows.Win32.Foundation.ERROR_INDEX_ABSENT
+Windows.Win32.Foundation.ERROR_INDEX_OUT_OF_BOUNDS
+Windows.Win32.Foundation.ERROR_INFLOOP_IN_RELOC_CHAIN
+Windows.Win32.Foundation.ERROR_INSTALL_ALREADY_RUNNING
+Windows.Win32.Foundation.ERROR_INSTALL_FAILURE
+Windows.Win32.Foundation.ERROR_INSTALL_LANGUAGE_UNSUPPORTED
+Windows.Win32.Foundation.ERROR_INSTALL_LOG_FAILURE
+Windows.Win32.Foundation.ERROR_INSTALL_NOTUSED
+Windows.Win32.Foundation.ERROR_INSTALL_PACKAGE_INVALID
+Windows.Win32.Foundation.ERROR_INSTALL_PACKAGE_OPEN_FAILED
+Windows.Win32.Foundation.ERROR_INSTALL_PACKAGE_REJECTED
+Windows.Win32.Foundation.ERROR_INSTALL_PACKAGE_VERSION
+Windows.Win32.Foundation.ERROR_INSTALL_PLATFORM_UNSUPPORTED
+Windows.Win32.Foundation.ERROR_INSTALL_REJECTED
+Windows.Win32.Foundation.ERROR_INSTALL_REMOTE_DISALLOWED
+Windows.Win32.Foundation.ERROR_INSTALL_REMOTE_PROHIBITED
+Windows.Win32.Foundation.ERROR_INSTALL_SERVICE_FAILURE
+Windows.Win32.Foundation.ERROR_INSTALL_SERVICE_SAFEBOOT
+Windows.Win32.Foundation.ERROR_INSTALL_SOURCE_ABSENT
+Windows.Win32.Foundation.ERROR_INSTALL_SUSPEND
+Windows.Win32.Foundation.ERROR_INSTALL_TEMP_UNWRITABLE
+Windows.Win32.Foundation.ERROR_INSTALL_TRANSFORM_FAILURE
+Windows.Win32.Foundation.ERROR_INSTALL_TRANSFORM_REJECTED
+Windows.Win32.Foundation.ERROR_INSTALL_UI_FAILURE
+Windows.Win32.Foundation.ERROR_INSTALL_USEREXIT
+Windows.Win32.Foundation.ERROR_INSTRUCTION_MISALIGNMENT
+Windows.Win32.Foundation.ERROR_INSUFFICIENT_BUFFER
+Windows.Win32.Foundation.ERROR_INSUFFICIENT_LOGON_INFO
+Windows.Win32.Foundation.ERROR_INSUFFICIENT_POWER
+Windows.Win32.Foundation.ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE
+Windows.Win32.Foundation.ERROR_INSUFFICIENT_VIRTUAL_ADDR_RESOURCES
+Windows.Win32.Foundation.ERROR_INTERMIXED_KERNEL_EA_OPERATION
+Windows.Win32.Foundation.ERROR_INTERNAL_DB_CORRUPTION
+Windows.Win32.Foundation.ERROR_INTERNAL_DB_ERROR
+Windows.Win32.Foundation.ERROR_INTERNAL_ERROR
+Windows.Win32.Foundation.ERROR_INTERRUPT_STILL_CONNECTED
+Windows.Win32.Foundation.ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED
+Windows.Win32.Foundation.ERROR_INVALID_ACCEL_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_ACCESS
+Windows.Win32.Foundation.ERROR_INVALID_ACCOUNT_NAME
+Windows.Win32.Foundation.ERROR_INVALID_ACE_CONDITION
+Windows.Win32.Foundation.ERROR_INVALID_ACL
+Windows.Win32.Foundation.ERROR_INVALID_ADDRESS
+Windows.Win32.Foundation.ERROR_INVALID_AT_INTERRUPT_TIME
+Windows.Win32.Foundation.ERROR_INVALID_BLOCK
+Windows.Win32.Foundation.ERROR_INVALID_BLOCK_LENGTH
+Windows.Win32.Foundation.ERROR_INVALID_CAP
+Windows.Win32.Foundation.ERROR_INVALID_CATEGORY
+Windows.Win32.Foundation.ERROR_INVALID_COMBOBOX_MESSAGE
+Windows.Win32.Foundation.ERROR_INVALID_COMMAND_LINE
+Windows.Win32.Foundation.ERROR_INVALID_COMPUTERNAME
+Windows.Win32.Foundation.ERROR_INVALID_CRUNTIME_PARAMETER
+Windows.Win32.Foundation.ERROR_INVALID_CURSOR_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_DATA
+Windows.Win32.Foundation.ERROR_INVALID_DATATYPE
+Windows.Win32.Foundation.ERROR_INVALID_DEVICE_OBJECT_PARAMETER
+Windows.Win32.Foundation.ERROR_INVALID_DLL
+Windows.Win32.Foundation.ERROR_INVALID_DOMAIN_ROLE
+Windows.Win32.Foundation.ERROR_INVALID_DOMAIN_STATE
+Windows.Win32.Foundation.ERROR_INVALID_DOMAINNAME
+Windows.Win32.Foundation.ERROR_INVALID_DRIVE
+Windows.Win32.Foundation.ERROR_INVALID_DWP_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_EA_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_EA_NAME
+Windows.Win32.Foundation.ERROR_INVALID_EDIT_HEIGHT
+Windows.Win32.Foundation.ERROR_INVALID_ENVIRONMENT
+Windows.Win32.Foundation.ERROR_INVALID_EVENT_COUNT
+Windows.Win32.Foundation.ERROR_INVALID_EVENTNAME
+Windows.Win32.Foundation.ERROR_INVALID_EXCEPTION_HANDLER
+Windows.Win32.Foundation.ERROR_INVALID_EXE_SIGNATURE
+Windows.Win32.Foundation.ERROR_INVALID_FIELD
+Windows.Win32.Foundation.ERROR_INVALID_FIELD_IN_PARAMETER_LIST
+Windows.Win32.Foundation.ERROR_INVALID_FILTER_PROC
+Windows.Win32.Foundation.ERROR_INVALID_FLAG_NUMBER
+Windows.Win32.Foundation.ERROR_INVALID_FLAGS
+Windows.Win32.Foundation.ERROR_INVALID_FORM_NAME
+Windows.Win32.Foundation.ERROR_INVALID_FORM_SIZE
+Windows.Win32.Foundation.ERROR_INVALID_FUNCTION
+Windows.Win32.Foundation.ERROR_INVALID_GROUP_ATTRIBUTES
+Windows.Win32.Foundation.ERROR_INVALID_GROUPNAME
+Windows.Win32.Foundation.ERROR_INVALID_GW_COMMAND
+Windows.Win32.Foundation.ERROR_INVALID_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_HANDLE_STATE
+Windows.Win32.Foundation.ERROR_INVALID_HOOK_FILTER
+Windows.Win32.Foundation.ERROR_INVALID_HOOK_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_HW_PROFILE
+Windows.Win32.Foundation.ERROR_INVALID_ICON_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_ID_AUTHORITY
+Windows.Win32.Foundation.ERROR_INVALID_IMAGE_HASH
+Windows.Win32.Foundation.ERROR_INVALID_IMPORT_OF_NON_DLL
+Windows.Win32.Foundation.ERROR_INVALID_INDEX
+Windows.Win32.Foundation.ERROR_INVALID_KERNEL_INFO_VERSION
+Windows.Win32.Foundation.ERROR_INVALID_KEYBOARD_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_LABEL
+Windows.Win32.Foundation.ERROR_INVALID_LB_MESSAGE
+Windows.Win32.Foundation.ERROR_INVALID_LDT_DESCRIPTOR
+Windows.Win32.Foundation.ERROR_INVALID_LDT_OFFSET
+Windows.Win32.Foundation.ERROR_INVALID_LDT_SIZE
+Windows.Win32.Foundation.ERROR_INVALID_LEVEL
+Windows.Win32.Foundation.ERROR_INVALID_LIST_FORMAT
+Windows.Win32.Foundation.ERROR_INVALID_LOCK_RANGE
+Windows.Win32.Foundation.ERROR_INVALID_LOGON_HOURS
+Windows.Win32.Foundation.ERROR_INVALID_LOGON_TYPE
+Windows.Win32.Foundation.ERROR_INVALID_MEMBER
+Windows.Win32.Foundation.ERROR_INVALID_MENU_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_MESSAGE
+Windows.Win32.Foundation.ERROR_INVALID_MESSAGEDEST
+Windows.Win32.Foundation.ERROR_INVALID_MESSAGENAME
+Windows.Win32.Foundation.ERROR_INVALID_MINALLOCSIZE
+Windows.Win32.Foundation.ERROR_INVALID_MODULETYPE
+Windows.Win32.Foundation.ERROR_INVALID_MONITOR_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_MSGBOX_STYLE
+Windows.Win32.Foundation.ERROR_INVALID_NAME
+Windows.Win32.Foundation.ERROR_INVALID_NETNAME
+Windows.Win32.Foundation.ERROR_INVALID_OPLOCK_PROTOCOL
+Windows.Win32.Foundation.ERROR_INVALID_ORDINAL
+Windows.Win32.Foundation.ERROR_INVALID_OWNER
+Windows.Win32.Foundation.ERROR_INVALID_PACKAGE_SID_LENGTH
+Windows.Win32.Foundation.ERROR_INVALID_PARAMETER
+Windows.Win32.Foundation.ERROR_INVALID_PASSWORD
+Windows.Win32.Foundation.ERROR_INVALID_PASSWORDNAME
+Windows.Win32.Foundation.ERROR_INVALID_PATCH_XML
+Windows.Win32.Foundation.ERROR_INVALID_PEP_INFO_VERSION
+Windows.Win32.Foundation.ERROR_INVALID_PLUGPLAY_DEVICE_PATH
+Windows.Win32.Foundation.ERROR_INVALID_PORT_ATTRIBUTES
+Windows.Win32.Foundation.ERROR_INVALID_PRIMARY_GROUP
+Windows.Win32.Foundation.ERROR_INVALID_PRINTER_COMMAND
+Windows.Win32.Foundation.ERROR_INVALID_PRINTER_NAME
+Windows.Win32.Foundation.ERROR_INVALID_PRINTER_STATE
+Windows.Win32.Foundation.ERROR_INVALID_PRIORITY
+Windows.Win32.Foundation.ERROR_INVALID_QUOTA_LOWER
+Windows.Win32.Foundation.ERROR_INVALID_REPARSE_DATA
+Windows.Win32.Foundation.ERROR_INVALID_SCROLLBAR_RANGE
+Windows.Win32.Foundation.ERROR_INVALID_SECURITY_DESCR
+Windows.Win32.Foundation.ERROR_INVALID_SEGDPL
+Windows.Win32.Foundation.ERROR_INVALID_SEGMENT_NUMBER
+Windows.Win32.Foundation.ERROR_INVALID_SEPARATOR_FILE
+Windows.Win32.Foundation.ERROR_INVALID_SERVER_STATE
+Windows.Win32.Foundation.ERROR_INVALID_SERVICE_ACCOUNT
+Windows.Win32.Foundation.ERROR_INVALID_SERVICE_CONTROL
+Windows.Win32.Foundation.ERROR_INVALID_SERVICE_LOCK
+Windows.Win32.Foundation.ERROR_INVALID_SERVICENAME
+Windows.Win32.Foundation.ERROR_INVALID_SHARENAME
+Windows.Win32.Foundation.ERROR_INVALID_SHOWWIN_COMMAND
+Windows.Win32.Foundation.ERROR_INVALID_SID
+Windows.Win32.Foundation.ERROR_INVALID_SIGNAL_NUMBER
+Windows.Win32.Foundation.ERROR_INVALID_SPI_VALUE
+Windows.Win32.Foundation.ERROR_INVALID_STACKSEG
+Windows.Win32.Foundation.ERROR_INVALID_STARTING_CODESEG
+Windows.Win32.Foundation.ERROR_INVALID_SUB_AUTHORITY
+Windows.Win32.Foundation.ERROR_INVALID_TABLE
+Windows.Win32.Foundation.ERROR_INVALID_TARGET_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_TASK_INDEX
+Windows.Win32.Foundation.ERROR_INVALID_TASK_NAME
+Windows.Win32.Foundation.ERROR_INVALID_THREAD_ID
+Windows.Win32.Foundation.ERROR_INVALID_TIME
+Windows.Win32.Foundation.ERROR_INVALID_TOKEN
+Windows.Win32.Foundation.ERROR_INVALID_UNWIND_TARGET
+Windows.Win32.Foundation.ERROR_INVALID_USER_BUFFER
+Windows.Win32.Foundation.ERROR_INVALID_USER_PRINCIPAL_NAME
+Windows.Win32.Foundation.ERROR_INVALID_VARIANT
+Windows.Win32.Foundation.ERROR_INVALID_VERIFY_SWITCH
+Windows.Win32.Foundation.ERROR_INVALID_WINDOW_HANDLE
+Windows.Win32.Foundation.ERROR_INVALID_WORKSTATION
+Windows.Win32.Foundation.ERROR_IO_DEVICE
+Windows.Win32.Foundation.ERROR_IO_INCOMPLETE
+Windows.Win32.Foundation.ERROR_IO_PENDING
+Windows.Win32.Foundation.ERROR_IO_PRIVILEGE_FAILED
+Windows.Win32.Foundation.ERROR_IO_REISSUE_AS_CACHED
+Windows.Win32.Foundation.ERROR_IOPL_NOT_ENABLED
+Windows.Win32.Foundation.ERROR_IP_ADDRESS_CONFLICT1
+Windows.Win32.Foundation.ERROR_IP_ADDRESS_CONFLICT2
+Windows.Win32.Foundation.ERROR_IPSEC_IKE_TIMED_OUT
+Windows.Win32.Foundation.ERROR_IRQ_BUSY
+Windows.Win32.Foundation.ERROR_IS_JOIN_PATH
+Windows.Win32.Foundation.ERROR_IS_JOIN_TARGET
+Windows.Win32.Foundation.ERROR_IS_JOINED
+Windows.Win32.Foundation.ERROR_IS_SUBST_PATH
+Windows.Win32.Foundation.ERROR_IS_SUBST_TARGET
+Windows.Win32.Foundation.ERROR_IS_SUBSTED
+Windows.Win32.Foundation.ERROR_ITERATED_DATA_EXCEEDS_64k
+Windows.Win32.Foundation.ERROR_JOB_NO_CONTAINER
+Windows.Win32.Foundation.ERROR_JOIN_TO_JOIN
+Windows.Win32.Foundation.ERROR_JOIN_TO_SUBST
+Windows.Win32.Foundation.ERROR_JOURNAL_DELETE_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_JOURNAL_ENTRY_DELETED
+Windows.Win32.Foundation.ERROR_JOURNAL_HOOK_SET
+Windows.Win32.Foundation.ERROR_JOURNAL_NOT_ACTIVE
+Windows.Win32.Foundation.ERROR_KERNEL_APC
+Windows.Win32.Foundation.ERROR_KEY_DELETED
+Windows.Win32.Foundation.ERROR_KEY_HAS_CHILDREN
+Windows.Win32.Foundation.ERROR_KM_DRIVER_BLOCKED
+Windows.Win32.Foundation.ERROR_LABEL_TOO_LONG
+Windows.Win32.Foundation.ERROR_LAST_ADMIN
+Windows.Win32.Foundation.ERROR_LB_WITHOUT_TABSTOPS
+Windows.Win32.Foundation.ERROR_LICENSE_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_LINUX_SUBSYSTEM_NOT_PRESENT
+Windows.Win32.Foundation.ERROR_LINUX_SUBSYSTEM_UPDATE_REQUIRED
+Windows.Win32.Foundation.ERROR_LISTBOX_ID_NOT_FOUND
+Windows.Win32.Foundation.ERROR_LM_CROSS_ENCRYPTION_REQUIRED
+Windows.Win32.Foundation.ERROR_LOCAL_POLICY_MODIFICATION_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_LOCAL_USER_SESSION_KEY
+Windows.Win32.Foundation.ERROR_LOCK_FAILED
+Windows.Win32.Foundation.ERROR_LOCK_VIOLATION
+Windows.Win32.Foundation.ERROR_LOCKED
+Windows.Win32.Foundation.ERROR_LOG_FILE_FULL
+Windows.Win32.Foundation.ERROR_LOG_HARD_ERROR
+Windows.Win32.Foundation.ERROR_LOGIN_TIME_RESTRICTION
+Windows.Win32.Foundation.ERROR_LOGIN_WKSTA_RESTRICTION
+Windows.Win32.Foundation.ERROR_LOGON_FAILURE
+Windows.Win32.Foundation.ERROR_LOGON_NOT_GRANTED
+Windows.Win32.Foundation.ERROR_LOGON_SERVER_CONFLICT
+Windows.Win32.Foundation.ERROR_LOGON_SESSION_COLLISION
+Windows.Win32.Foundation.ERROR_LOGON_SESSION_EXISTS
+Windows.Win32.Foundation.ERROR_LOGON_TYPE_NOT_GRANTED
+Windows.Win32.Foundation.ERROR_LONGJUMP
+Windows.Win32.Foundation.ERROR_LOST_MODE_LOGON_RESTRICTION
+Windows.Win32.Foundation.ERROR_LOST_WRITEBEHIND_DATA
+Windows.Win32.Foundation.ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR
+Windows.Win32.Foundation.ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED
+Windows.Win32.Foundation.ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR
+Windows.Win32.Foundation.ERROR_LUIDS_EXHAUSTED
+Windows.Win32.Foundation.ERROR_MACHINE_LOCKED
+Windows.Win32.Foundation.ERROR_MAGAZINE_NOT_PRESENT
+Windows.Win32.Foundation.ERROR_MAPPED_ALIGNMENT
+Windows.Win32.Foundation.ERROR_MARKED_TO_DISALLOW_WRITES
+Windows.Win32.Foundation.ERROR_MARSHALL_OVERFLOW
+Windows.Win32.Foundation.ERROR_MAX_SESSIONS_REACHED
+Windows.Win32.Foundation.ERROR_MAX_THRDS_REACHED
+Windows.Win32.Foundation.ERROR_MCA_EXCEPTION
+Windows.Win32.Foundation.ERROR_MCA_OCCURED
+Windows.Win32.Foundation.ERROR_MEDIA_CHANGED
+Windows.Win32.Foundation.ERROR_MEDIA_CHECK
+Windows.Win32.Foundation.ERROR_MEMBER_IN_ALIAS
+Windows.Win32.Foundation.ERROR_MEMBER_IN_GROUP
+Windows.Win32.Foundation.ERROR_MEMBER_NOT_IN_ALIAS
+Windows.Win32.Foundation.ERROR_MEMBER_NOT_IN_GROUP
+Windows.Win32.Foundation.ERROR_MEMBERS_PRIMARY_GROUP
+Windows.Win32.Foundation.ERROR_MEMORY_HARDWARE
+Windows.Win32.Foundation.ERROR_MENU_ITEM_NOT_FOUND
+Windows.Win32.Foundation.ERROR_MESSAGE_SYNC_ONLY
+Windows.Win32.Foundation.ERROR_META_EXPANSION_TOO_LONG
+Windows.Win32.Foundation.ERROR_MISSING_SYSTEMFILE
+Windows.Win32.Foundation.ERROR_MOD_NOT_FOUND
+Windows.Win32.Foundation.ERROR_MORE_DATA
+Windows.Win32.Foundation.ERROR_MORE_WRITES
+Windows.Win32.Foundation.ERROR_MOUNT_POINT_NOT_RESOLVED
+Windows.Win32.Foundation.ERROR_MP_PROCESSOR_MISMATCH
+Windows.Win32.Foundation.ERROR_MR_MID_NOT_FOUND
+Windows.Win32.Foundation.ERROR_MULTIPLE_FAULT_VIOLATION
+Windows.Win32.Foundation.ERROR_MUTANT_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_MUTUAL_AUTH_FAILED
+Windows.Win32.Foundation.ERROR_NEGATIVE_SEEK
+Windows.Win32.Foundation.ERROR_NESTING_NOT_ALLOWED
+Windows.Win32.Foundation.ERROR_NET_OPEN_FAILED
+Windows.Win32.Foundation.ERROR_NET_WRITE_FAULT
+Windows.Win32.Foundation.ERROR_NETLOGON_NOT_STARTED
+Windows.Win32.Foundation.ERROR_NETNAME_DELETED
+Windows.Win32.Foundation.ERROR_NETWORK_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_NETWORK_ACCESS_DENIED_EDP
+Windows.Win32.Foundation.ERROR_NETWORK_BUSY
+Windows.Win32.Foundation.ERROR_NETWORK_UNREACHABLE
+Windows.Win32.Foundation.ERROR_NO_ACE_CONDITION
+Windows.Win32.Foundation.ERROR_NO_ASSOCIATION
+Windows.Win32.Foundation.ERROR_NO_BYPASSIO_DRIVER_SUPPORT
+Windows.Win32.Foundation.ERROR_NO_CALLBACK_ACTIVE
+Windows.Win32.Foundation.ERROR_NO_DATA
+Windows.Win32.Foundation.ERROR_NO_DATA_DETECTED
+Windows.Win32.Foundation.ERROR_NO_EFS
+Windows.Win32.Foundation.ERROR_NO_EVENT_PAIR
+Windows.Win32.Foundation.ERROR_NO_GUID_TRANSLATION
+Windows.Win32.Foundation.ERROR_NO_IMPERSONATION_TOKEN
+Windows.Win32.Foundation.ERROR_NO_INHERITANCE
+Windows.Win32.Foundation.ERROR_NO_LOG_SPACE
+Windows.Win32.Foundation.ERROR_NO_LOGON_SERVERS
+Windows.Win32.Foundation.ERROR_NO_MATCH
+Windows.Win32.Foundation.ERROR_NO_MEDIA_IN_DRIVE
+Windows.Win32.Foundation.ERROR_NO_MORE_DEVICES
+Windows.Win32.Foundation.ERROR_NO_MORE_FILES
+Windows.Win32.Foundation.ERROR_NO_MORE_ITEMS
+Windows.Win32.Foundation.ERROR_NO_MORE_MATCHES
+Windows.Win32.Foundation.ERROR_NO_MORE_SEARCH_HANDLES
+Windows.Win32.Foundation.ERROR_NO_MORE_USER_HANDLES
+Windows.Win32.Foundation.ERROR_NO_NET_OR_BAD_PATH
+Windows.Win32.Foundation.ERROR_NO_NETWORK
+Windows.Win32.Foundation.ERROR_NO_NVRAM_RESOURCES
+Windows.Win32.Foundation.ERROR_NO_PAGEFILE
+Windows.Win32.Foundation.ERROR_NO_PHYSICALLY_ALIGNED_FREE_SPACE_FOUND
+Windows.Win32.Foundation.ERROR_NO_PROC_SLOTS
+Windows.Win32.Foundation.ERROR_NO_PROMOTION_ACTIVE
+Windows.Win32.Foundation.ERROR_NO_QUOTAS_FOR_ACCOUNT
+Windows.Win32.Foundation.ERROR_NO_RANGES_PROCESSED
+Windows.Win32.Foundation.ERROR_NO_RECOVERY_POLICY
+Windows.Win32.Foundation.ERROR_NO_RECOVERY_PROGRAM
+Windows.Win32.Foundation.ERROR_NO_SCROLLBARS
+Windows.Win32.Foundation.ERROR_NO_SECRETS
+Windows.Win32.Foundation.ERROR_NO_SECURITY_ON_OBJECT
+Windows.Win32.Foundation.ERROR_NO_SHUTDOWN_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_NO_SIGNAL_SENT
+Windows.Win32.Foundation.ERROR_NO_SITE_SETTINGS_OBJECT
+Windows.Win32.Foundation.ERROR_NO_SITENAME
+Windows.Win32.Foundation.ERROR_NO_SPOOL_SPACE
+Windows.Win32.Foundation.ERROR_NO_SUCH_ALIAS
+Windows.Win32.Foundation.ERROR_NO_SUCH_DEVICE
+Windows.Win32.Foundation.ERROR_NO_SUCH_DOMAIN
+Windows.Win32.Foundation.ERROR_NO_SUCH_GROUP
+Windows.Win32.Foundation.ERROR_NO_SUCH_LOGON_SESSION
+Windows.Win32.Foundation.ERROR_NO_SUCH_MEMBER
+Windows.Win32.Foundation.ERROR_NO_SUCH_PACKAGE
+Windows.Win32.Foundation.ERROR_NO_SUCH_PRIVILEGE
+Windows.Win32.Foundation.ERROR_NO_SUCH_SITE
+Windows.Win32.Foundation.ERROR_NO_SUCH_USER
+Windows.Win32.Foundation.ERROR_NO_SYSTEM_MENU
+Windows.Win32.Foundation.ERROR_NO_SYSTEM_RESOURCES
+Windows.Win32.Foundation.ERROR_NO_TASK_QUEUE
+Windows.Win32.Foundation.ERROR_NO_TOKEN
+Windows.Win32.Foundation.ERROR_NO_TRACKING_SERVICE
+Windows.Win32.Foundation.ERROR_NO_TRUST_LSA_SECRET
+Windows.Win32.Foundation.ERROR_NO_TRUST_SAM_ACCOUNT
+Windows.Win32.Foundation.ERROR_NO_UNICODE_TRANSLATION
+Windows.Win32.Foundation.ERROR_NO_USER_KEYS
+Windows.Win32.Foundation.ERROR_NO_USER_SESSION_KEY
+Windows.Win32.Foundation.ERROR_NO_VOLUME_ID
+Windows.Win32.Foundation.ERROR_NO_VOLUME_LABEL
+Windows.Win32.Foundation.ERROR_NO_WILDCARD_CHARACTERS
+Windows.Win32.Foundation.ERROR_NO_WORK_DONE
+Windows.Win32.Foundation.ERROR_NO_WRITABLE_DC_FOUND
+Windows.Win32.Foundation.ERROR_NO_YIELD_PERFORMED
+Windows.Win32.Foundation.ERROR_NOACCESS
+Windows.Win32.Foundation.ERROR_NOINTERFACE
+Windows.Win32.Foundation.ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT
+Windows.Win32.Foundation.ERROR_NOLOGON_SERVER_TRUST_ACCOUNT
+Windows.Win32.Foundation.ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT
+Windows.Win32.Foundation.ERROR_NON_ACCOUNT_SID
+Windows.Win32.Foundation.ERROR_NON_DOMAIN_SID
+Windows.Win32.Foundation.ERROR_NON_MDICHILD_WINDOW
+Windows.Win32.Foundation.ERROR_NONE_MAPPED
+Windows.Win32.Foundation.ERROR_NONPAGED_SYSTEM_RESOURCES
+Windows.Win32.Foundation.ERROR_NOT_A_CLOUD_FILE
+Windows.Win32.Foundation.ERROR_NOT_A_CLOUD_SYNC_ROOT
+Windows.Win32.Foundation.ERROR_NOT_A_DAX_VOLUME
+Windows.Win32.Foundation.ERROR_NOT_A_REPARSE_POINT
+Windows.Win32.Foundation.ERROR_NOT_ALL_ASSIGNED
+Windows.Win32.Foundation.ERROR_NOT_ALLOWED_ON_SYSTEM_FILE
+Windows.Win32.Foundation.ERROR_NOT_APPCONTAINER
+Windows.Win32.Foundation.ERROR_NOT_AUTHENTICATED
+Windows.Win32.Foundation.ERROR_NOT_CAPABLE
+Windows.Win32.Foundation.ERROR_NOT_CHILD_WINDOW
+Windows.Win32.Foundation.ERROR_NOT_CONNECTED
+Windows.Win32.Foundation.ERROR_NOT_CONTAINER
+Windows.Win32.Foundation.ERROR_NOT_DAX_MAPPABLE
+Windows.Win32.Foundation.ERROR_NOT_DOS_DISK
+Windows.Win32.Foundation.ERROR_NOT_ENOUGH_MEMORY
+Windows.Win32.Foundation.ERROR_NOT_ENOUGH_QUOTA
+Windows.Win32.Foundation.ERROR_NOT_ENOUGH_SERVER_MEMORY
+Windows.Win32.Foundation.ERROR_NOT_EXPORT_FORMAT
+Windows.Win32.Foundation.ERROR_NOT_FOUND
+Windows.Win32.Foundation.ERROR_NOT_GUI_PROCESS
+Windows.Win32.Foundation.ERROR_NOT_JOINED
+Windows.Win32.Foundation.ERROR_NOT_LOCKED
+Windows.Win32.Foundation.ERROR_NOT_LOGGED_ON
+Windows.Win32.Foundation.ERROR_NOT_LOGON_PROCESS
+Windows.Win32.Foundation.ERROR_NOT_OWNER
+Windows.Win32.Foundation.ERROR_NOT_READ_FROM_COPY
+Windows.Win32.Foundation.ERROR_NOT_READY
+Windows.Win32.Foundation.ERROR_NOT_REDUNDANT_STORAGE
+Windows.Win32.Foundation.ERROR_NOT_REGISTRY_FILE
+Windows.Win32.Foundation.ERROR_NOT_SAFE_MODE_DRIVER
+Windows.Win32.Foundation.ERROR_NOT_SAFEBOOT_SERVICE
+Windows.Win32.Foundation.ERROR_NOT_SAME_DEVICE
+Windows.Win32.Foundation.ERROR_NOT_SAME_OBJECT
+Windows.Win32.Foundation.ERROR_NOT_SUBSTED
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_IN_APPCONTAINER
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_ON_DAX
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_ON_SBS
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_AUDITING
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_BTT
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_BYPASSIO
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_CACHED_HANDLE
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_COMPRESSION
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_DEDUPLICATION
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_ENCRYPTION
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_MONITORING
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_REPLICATION
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_SNAPSHOT
+Windows.Win32.Foundation.ERROR_NOT_SUPPORTED_WITH_VIRTUALIZATION
+Windows.Win32.Foundation.ERROR_NOT_TINY_STREAM
+Windows.Win32.Foundation.ERROR_NOTHING_TO_TERMINATE
+Windows.Win32.Foundation.ERROR_NOTIFICATION_GUID_ALREADY_DEFINED
+Windows.Win32.Foundation.ERROR_NOTIFY_CLEANUP
+Windows.Win32.Foundation.ERROR_NOTIFY_ENUM_DIR
+Windows.Win32.Foundation.ERROR_NT_CROSS_ENCRYPTION_REQUIRED
+Windows.Win32.Foundation.ERROR_NTLM_BLOCKED
+Windows.Win32.Foundation.ERROR_NULL_LM_PASSWORD
+Windows.Win32.Foundation.ERROR_OBJECT_IS_IMMUTABLE
+Windows.Win32.Foundation.ERROR_OBJECT_NAME_EXISTS
+Windows.Win32.Foundation.ERROR_OBJECT_NOT_EXTERNALLY_BACKED
+Windows.Win32.Foundation.ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_OFFSET_ALIGNMENT_VIOLATION
+Windows.Win32.Foundation.ERROR_OLD_WIN_VERSION
+Windows.Win32.Foundation.ERROR_ONLY_IF_CONNECTED
+Windows.Win32.Foundation.ERROR_OPEN_FAILED
+Windows.Win32.Foundation.ERROR_OPEN_FILES
+Windows.Win32.Foundation.ERROR_OPERATION_ABORTED
+Windows.Win32.Foundation.ERROR_OPERATION_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_OPLOCK_BREAK_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_OPLOCK_HANDLE_CLOSED
+Windows.Win32.Foundation.ERROR_OPLOCK_NOT_GRANTED
+Windows.Win32.Foundation.ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
+Windows.Win32.Foundation.ERROR_ORPHAN_NAME_EXHAUSTED
+Windows.Win32.Foundation.ERROR_OUT_OF_PAPER
+Windows.Win32.Foundation.ERROR_OUT_OF_STRUCTURES
+Windows.Win32.Foundation.ERROR_OUTOFMEMORY
+Windows.Win32.Foundation.ERROR_OVERRIDE_NOCHANGES
+Windows.Win32.Foundation.ERROR_PAGE_FAULT_COPY_ON_WRITE
+Windows.Win32.Foundation.ERROR_PAGE_FAULT_DEMAND_ZERO
+Windows.Win32.Foundation.ERROR_PAGE_FAULT_GUARD_PAGE
+Windows.Win32.Foundation.ERROR_PAGE_FAULT_PAGING_FILE
+Windows.Win32.Foundation.ERROR_PAGE_FAULT_TRANSITION
+Windows.Win32.Foundation.ERROR_PAGED_SYSTEM_RESOURCES
+Windows.Win32.Foundation.ERROR_PAGEFILE_CREATE_FAILED
+Windows.Win32.Foundation.ERROR_PAGEFILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_PAGEFILE_QUOTA
+Windows.Win32.Foundation.ERROR_PAGEFILE_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_PARAMETER_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_PARTIAL_COPY
+Windows.Win32.Foundation.ERROR_PARTITION_FAILURE
+Windows.Win32.Foundation.ERROR_PARTITION_TERMINATING
+Windows.Win32.Foundation.ERROR_PASSWORD_CHANGE_REQUIRED
+Windows.Win32.Foundation.ERROR_PASSWORD_EXPIRED
+Windows.Win32.Foundation.ERROR_PASSWORD_MUST_CHANGE
+Windows.Win32.Foundation.ERROR_PASSWORD_RESTRICTION
+Windows.Win32.Foundation.ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT
+Windows.Win32.Foundation.ERROR_PATCH_NO_SEQUENCE
+Windows.Win32.Foundation.ERROR_PATCH_PACKAGE_INVALID
+Windows.Win32.Foundation.ERROR_PATCH_PACKAGE_OPEN_FAILED
+Windows.Win32.Foundation.ERROR_PATCH_PACKAGE_REJECTED
+Windows.Win32.Foundation.ERROR_PATCH_PACKAGE_UNSUPPORTED
+Windows.Win32.Foundation.ERROR_PATCH_REMOVAL_DISALLOWED
+Windows.Win32.Foundation.ERROR_PATCH_REMOVAL_UNSUPPORTED
+Windows.Win32.Foundation.ERROR_PATCH_TARGET_NOT_FOUND
+Windows.Win32.Foundation.ERROR_PATH_BUSY
+Windows.Win32.Foundation.ERROR_PATH_NOT_FOUND
+Windows.Win32.Foundation.ERROR_PER_USER_TRUST_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_PIPE_BUSY
+Windows.Win32.Foundation.ERROR_PIPE_CONNECTED
+Windows.Win32.Foundation.ERROR_PIPE_LISTENING
+Windows.Win32.Foundation.ERROR_PIPE_LOCAL
+Windows.Win32.Foundation.ERROR_PIPE_NOT_CONNECTED
+Windows.Win32.Foundation.ERROR_PKINIT_FAILURE
+Windows.Win32.Foundation.ERROR_PLUGPLAY_QUERY_VETOED
+Windows.Win32.Foundation.ERROR_PNP_BAD_MPS_TABLE
+Windows.Win32.Foundation.ERROR_PNP_INVALID_ID
+Windows.Win32.Foundation.ERROR_PNP_IRQ_TRANSLATION_FAILED
+Windows.Win32.Foundation.ERROR_PNP_QUERY_REMOVE_DEVICE_TIMEOUT
+Windows.Win32.Foundation.ERROR_PNP_QUERY_REMOVE_RELATED_DEVICE_TIMEOUT
+Windows.Win32.Foundation.ERROR_PNP_QUERY_REMOVE_UNRELATED_DEVICE_TIMEOUT
+Windows.Win32.Foundation.ERROR_PNP_REBOOT_REQUIRED
+Windows.Win32.Foundation.ERROR_PNP_RESTART_ENUMERATION
+Windows.Win32.Foundation.ERROR_PNP_TRANSLATION_FAILED
+Windows.Win32.Foundation.ERROR_POINT_NOT_FOUND
+Windows.Win32.Foundation.ERROR_POLICY_OBJECT_NOT_FOUND
+Windows.Win32.Foundation.ERROR_POLICY_ONLY_IN_DS
+Windows.Win32.Foundation.ERROR_POPUP_ALREADY_ACTIVE
+Windows.Win32.Foundation.ERROR_PORT_MESSAGE_TOO_LONG
+Windows.Win32.Foundation.ERROR_PORT_NOT_SET
+Windows.Win32.Foundation.ERROR_PORT_UNREACHABLE
+Windows.Win32.Foundation.ERROR_POSSIBLE_DEADLOCK
+Windows.Win32.Foundation.ERROR_POTENTIAL_FILE_FOUND
+Windows.Win32.Foundation.ERROR_PREDEFINED_HANDLE
+Windows.Win32.Foundation.ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED
+Windows.Win32.Foundation.ERROR_PRINT_CANCELLED
+Windows.Win32.Foundation.ERROR_PRINTER_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_PRINTER_DELETED
+Windows.Win32.Foundation.ERROR_PRINTER_DRIVER_ALREADY_INSTALLED
+Windows.Win32.Foundation.ERROR_PRINTQ_FULL
+Windows.Win32.Foundation.ERROR_PRIVATE_DIALOG_INDEX
+Windows.Win32.Foundation.ERROR_PRIVILEGE_NOT_HELD
+Windows.Win32.Foundation.ERROR_PROC_NOT_FOUND
+Windows.Win32.Foundation.ERROR_PROCESS_ABORTED
+Windows.Win32.Foundation.ERROR_PROCESS_IN_JOB
+Windows.Win32.Foundation.ERROR_PROCESS_IS_PROTECTED
+Windows.Win32.Foundation.ERROR_PROCESS_MODE_ALREADY_BACKGROUND
+Windows.Win32.Foundation.ERROR_PROCESS_MODE_NOT_BACKGROUND
+Windows.Win32.Foundation.ERROR_PROCESS_NOT_IN_JOB
+Windows.Win32.Foundation.ERROR_PRODUCT_UNINSTALLED
+Windows.Win32.Foundation.ERROR_PRODUCT_VERSION
+Windows.Win32.Foundation.ERROR_PROFILING_AT_LIMIT
+Windows.Win32.Foundation.ERROR_PROFILING_NOT_STARTED
+Windows.Win32.Foundation.ERROR_PROFILING_NOT_STOPPED
+Windows.Win32.Foundation.ERROR_PROMOTION_ACTIVE
+Windows.Win32.Foundation.ERROR_PROTOCOL_UNREACHABLE
+Windows.Win32.Foundation.ERROR_PWD_HISTORY_CONFLICT
+Windows.Win32.Foundation.ERROR_PWD_TOO_LONG
+Windows.Win32.Foundation.ERROR_PWD_TOO_RECENT
+Windows.Win32.Foundation.ERROR_PWD_TOO_SHORT
+Windows.Win32.Foundation.ERROR_QUOTA_ACTIVITY
+Windows.Win32.Foundation.ERROR_QUOTA_LIST_INCONSISTENT
+Windows.Win32.Foundation.ERROR_RANGE_LIST_CONFLICT
+Windows.Win32.Foundation.ERROR_RANGE_NOT_FOUND
+Windows.Win32.Foundation.ERROR_READ_FAULT
+Windows.Win32.Foundation.ERROR_RECEIVE_EXPEDITED
+Windows.Win32.Foundation.ERROR_RECEIVE_PARTIAL
+Windows.Win32.Foundation.ERROR_RECEIVE_PARTIAL_EXPEDITED
+Windows.Win32.Foundation.ERROR_RECOVERY_FAILURE
+Windows.Win32.Foundation.ERROR_REDIR_PAUSED
+Windows.Win32.Foundation.ERROR_REDIRECTOR_HAS_OPEN_HANDLES
+Windows.Win32.Foundation.ERROR_REG_NAT_CONSUMPTION
+Windows.Win32.Foundation.ERROR_REGISTRY_CORRUPT
+Windows.Win32.Foundation.ERROR_REGISTRY_HIVE_RECOVERED
+Windows.Win32.Foundation.ERROR_REGISTRY_IO_FAILED
+Windows.Win32.Foundation.ERROR_REGISTRY_QUOTA_LIMIT
+Windows.Win32.Foundation.ERROR_REGISTRY_RECOVERED
+Windows.Win32.Foundation.ERROR_RELOC_CHAIN_XEEDS_SEGLIM
+Windows.Win32.Foundation.ERROR_REM_NOT_LIST
+Windows.Win32.Foundation.ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED
+Windows.Win32.Foundation.ERROR_REMOTE_SESSION_LIMIT_EXCEEDED
+Windows.Win32.Foundation.ERROR_REMOTE_STORAGE_MEDIA_ERROR
+Windows.Win32.Foundation.ERROR_REMOTE_STORAGE_NOT_ACTIVE
+Windows.Win32.Foundation.ERROR_REPARSE
+Windows.Win32.Foundation.ERROR_REPARSE_ATTRIBUTE_CONFLICT
+Windows.Win32.Foundation.ERROR_REPARSE_OBJECT
+Windows.Win32.Foundation.ERROR_REPARSE_POINT_ENCOUNTERED
+Windows.Win32.Foundation.ERROR_REPARSE_TAG_INVALID
+Windows.Win32.Foundation.ERROR_REPARSE_TAG_MISMATCH
+Windows.Win32.Foundation.ERROR_REPLY_MESSAGE_MISMATCH
+Windows.Win32.Foundation.ERROR_REQ_NOT_ACCEP
+Windows.Win32.Foundation.ERROR_REQUEST_ABORTED
+Windows.Win32.Foundation.ERROR_REQUEST_OUT_OF_SEQUENCE
+Windows.Win32.Foundation.ERROR_REQUEST_PAUSED
+Windows.Win32.Foundation.ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
+Windows.Win32.Foundation.ERROR_RESIDENT_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_RESOURCE_CALL_TIMED_OUT
+Windows.Win32.Foundation.ERROR_RESOURCE_DATA_NOT_FOUND
+Windows.Win32.Foundation.ERROR_RESOURCE_LANG_NOT_FOUND
+Windows.Win32.Foundation.ERROR_RESOURCE_NAME_NOT_FOUND
+Windows.Win32.Foundation.ERROR_RESOURCE_REQUIREMENTS_CHANGED
+Windows.Win32.Foundation.ERROR_RESOURCE_TYPE_NOT_FOUND
+Windows.Win32.Foundation.ERROR_RESTART_APPLICATION
+Windows.Win32.Foundation.ERROR_RESUME_HIBERNATION
+Windows.Win32.Foundation.ERROR_RETRY
+Windows.Win32.Foundation.ERROR_RETURN_ADDRESS_HIJACK_ATTEMPT
+Windows.Win32.Foundation.ERROR_REVISION_MISMATCH
+Windows.Win32.Foundation.ERROR_RING2_STACK_IN_USE
+Windows.Win32.Foundation.ERROR_RING2SEG_MUST_BE_MOVABLE
+Windows.Win32.Foundation.ERROR_RMODE_APP
+Windows.Win32.Foundation.ERROR_ROWSNOTRELEASED
+Windows.Win32.Foundation.ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT
+Windows.Win32.Foundation.ERROR_RUNLEVEL_SWITCH_TIMEOUT
+Windows.Win32.Foundation.ERROR_RWRAW_ENCRYPTED_FILE_NOT_ENCRYPTED
+Windows.Win32.Foundation.ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILEOFFSET
+Windows.Win32.Foundation.ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILERANGE
+Windows.Win32.Foundation.ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_PARAMETER
+Windows.Win32.Foundation.ERROR_RXACT_COMMIT_FAILURE
+Windows.Win32.Foundation.ERROR_RXACT_COMMIT_NECESSARY
+Windows.Win32.Foundation.ERROR_RXACT_COMMITTED
+Windows.Win32.Foundation.ERROR_RXACT_INVALID_STATE
+Windows.Win32.Foundation.ERROR_RXACT_STATE_CREATED
+Windows.Win32.Foundation.ERROR_SAM_INIT_FAILURE
+Windows.Win32.Foundation.ERROR_SAME_DRIVE
+Windows.Win32.Foundation.ERROR_SCOPE_NOT_FOUND
+Windows.Win32.Foundation.ERROR_SCREEN_ALREADY_LOCKED
+Windows.Win32.Foundation.ERROR_SCRUB_DATA_DISABLED
+Windows.Win32.Foundation.ERROR_SECRET_TOO_LONG
+Windows.Win32.Foundation.ERROR_SECTION_DIRECT_MAP_ONLY
+Windows.Win32.Foundation.ERROR_SECTOR_NOT_FOUND
+Windows.Win32.Foundation.ERROR_SECURITY_DENIES_OPERATION
+Windows.Win32.Foundation.ERROR_SECURITY_STREAM_IS_INCONSISTENT
+Windows.Win32.Foundation.ERROR_SEEK
+Windows.Win32.Foundation.ERROR_SEEK_ON_DEVICE
+Windows.Win32.Foundation.ERROR_SEGMENT_NOTIFICATION
+Windows.Win32.Foundation.ERROR_SEM_IS_SET
+Windows.Win32.Foundation.ERROR_SEM_NOT_FOUND
+Windows.Win32.Foundation.ERROR_SEM_OWNER_DIED
+Windows.Win32.Foundation.ERROR_SEM_TIMEOUT
+Windows.Win32.Foundation.ERROR_SEM_USER_LIMIT
+Windows.Win32.Foundation.ERROR_SERIAL_NO_DEVICE
+Windows.Win32.Foundation.ERROR_SERVER_DISABLED
+Windows.Win32.Foundation.ERROR_SERVER_HAS_OPEN_HANDLES
+Windows.Win32.Foundation.ERROR_SERVER_NOT_DISABLED
+Windows.Win32.Foundation.ERROR_SERVER_SHUTDOWN_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_SERVER_SID_MISMATCH
+Windows.Win32.Foundation.ERROR_SERVER_TRANSPORT_CONFLICT
+Windows.Win32.Foundation.ERROR_SERVICE_ALREADY_RUNNING
+Windows.Win32.Foundation.ERROR_SERVICE_CANNOT_ACCEPT_CTRL
+Windows.Win32.Foundation.ERROR_SERVICE_DATABASE_LOCKED
+Windows.Win32.Foundation.ERROR_SERVICE_DEPENDENCY_DELETED
+Windows.Win32.Foundation.ERROR_SERVICE_DEPENDENCY_FAIL
+Windows.Win32.Foundation.ERROR_SERVICE_DISABLED
+Windows.Win32.Foundation.ERROR_SERVICE_DOES_NOT_EXIST
+Windows.Win32.Foundation.ERROR_SERVICE_EXISTS
+Windows.Win32.Foundation.ERROR_SERVICE_LOGON_FAILED
+Windows.Win32.Foundation.ERROR_SERVICE_MARKED_FOR_DELETE
+Windows.Win32.Foundation.ERROR_SERVICE_NEVER_STARTED
+Windows.Win32.Foundation.ERROR_SERVICE_NO_THREAD
+Windows.Win32.Foundation.ERROR_SERVICE_NOT_ACTIVE
+Windows.Win32.Foundation.ERROR_SERVICE_NOT_FOUND
+Windows.Win32.Foundation.ERROR_SERVICE_NOT_IN_EXE
+Windows.Win32.Foundation.ERROR_SERVICE_NOTIFICATION
+Windows.Win32.Foundation.ERROR_SERVICE_NOTIFY_CLIENT_LAGGING
+Windows.Win32.Foundation.ERROR_SERVICE_REQUEST_TIMEOUT
+Windows.Win32.Foundation.ERROR_SERVICE_SPECIFIC_ERROR
+Windows.Win32.Foundation.ERROR_SERVICE_START_HANG
+Windows.Win32.Foundation.ERROR_SESSION_CREDENTIAL_CONFLICT
+Windows.Win32.Foundation.ERROR_SESSION_KEY_TOO_SHORT
+Windows.Win32.Foundation.ERROR_SET_CONTEXT_DENIED
+Windows.Win32.Foundation.ERROR_SET_NOT_FOUND
+Windows.Win32.Foundation.ERROR_SET_POWER_STATE_FAILED
+Windows.Win32.Foundation.ERROR_SET_POWER_STATE_VETOED
+Windows.Win32.Foundation.ERROR_SETCOUNT_ON_BAD_LB
+Windows.Win32.Foundation.ERROR_SETMARK_DETECTED
+Windows.Win32.Foundation.ERROR_SHARED_POLICY
+Windows.Win32.Foundation.ERROR_SHARING_BUFFER_EXCEEDED
+Windows.Win32.Foundation.ERROR_SHARING_PAUSED
+Windows.Win32.Foundation.ERROR_SHARING_VIOLATION
+Windows.Win32.Foundation.ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME
+Windows.Win32.Foundation.ERROR_SHUTDOWN_DISKS_NOT_IN_MAINTENANCE_MODE
+Windows.Win32.Foundation.ERROR_SHUTDOWN_IN_PROGRESS
+Windows.Win32.Foundation.ERROR_SHUTDOWN_IS_SCHEDULED
+Windows.Win32.Foundation.ERROR_SHUTDOWN_USERS_LOGGED_ON
+Windows.Win32.Foundation.ERROR_SIGNAL_PENDING
+Windows.Win32.Foundation.ERROR_SIGNAL_REFUSED
+Windows.Win32.Foundation.ERROR_SINGLE_INSTANCE_APP
+Windows.Win32.Foundation.ERROR_SMARTCARD_SUBSYSTEM_FAILURE
+Windows.Win32.Foundation.ERROR_SMB1_NOT_AVAILABLE
+Windows.Win32.Foundation.ERROR_SMB_GUEST_LOGON_BLOCKED
+Windows.Win32.Foundation.ERROR_SMR_GARBAGE_COLLECTION_REQUIRED
+Windows.Win32.Foundation.ERROR_SOME_NOT_MAPPED
+Windows.Win32.Foundation.ERROR_SOURCE_ELEMENT_EMPTY
+Windows.Win32.Foundation.ERROR_SPARSE_FILE_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_SPECIAL_ACCOUNT
+Windows.Win32.Foundation.ERROR_SPECIAL_GROUP
+Windows.Win32.Foundation.ERROR_SPECIAL_USER
+Windows.Win32.Foundation.ERROR_SRC_SRV_DLL_LOAD_FAILED
+Windows.Win32.Foundation.ERROR_STACK_BUFFER_OVERRUN
+Windows.Win32.Foundation.ERROR_STACK_OVERFLOW
+Windows.Win32.Foundation.ERROR_STACK_OVERFLOW_READ
+Windows.Win32.Foundation.ERROR_STOPPED_ON_SYMLINK
+Windows.Win32.Foundation.ERROR_STORAGE_LOST_DATA_PERSISTENCE
+Windows.Win32.Foundation.ERROR_STORAGE_RESERVE_ALREADY_EXISTS
+Windows.Win32.Foundation.ERROR_STORAGE_RESERVE_DOES_NOT_EXIST
+Windows.Win32.Foundation.ERROR_STORAGE_RESERVE_ID_INVALID
+Windows.Win32.Foundation.ERROR_STORAGE_RESERVE_NOT_EMPTY
+Windows.Win32.Foundation.ERROR_STORAGE_STACK_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_STORAGE_TOPOLOGY_ID_MISMATCH
+Windows.Win32.Foundation.ERROR_STRICT_CFG_VIOLATION
+Windows.Win32.Foundation.ERROR_SUBST_TO_JOIN
+Windows.Win32.Foundation.ERROR_SUBST_TO_SUBST
+Windows.Win32.Foundation.ERROR_SUCCESS
+Windows.Win32.Foundation.ERROR_SUCCESS_REBOOT_INITIATED
+Windows.Win32.Foundation.ERROR_SWAPERROR
+Windows.Win32.Foundation.ERROR_SYMLINK_CLASS_DISABLED
+Windows.Win32.Foundation.ERROR_SYMLINK_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED
+Windows.Win32.Foundation.ERROR_SYNCHRONIZATION_REQUIRED
+Windows.Win32.Foundation.ERROR_SYSTEM_HIVE_TOO_LARGE
+Windows.Win32.Foundation.ERROR_SYSTEM_IMAGE_BAD_SIGNATURE
+Windows.Win32.Foundation.ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION
+Windows.Win32.Foundation.ERROR_SYSTEM_POWERSTATE_TRANSITION
+Windows.Win32.Foundation.ERROR_SYSTEM_PROCESS_TERMINATED
+Windows.Win32.Foundation.ERROR_SYSTEM_SHUTDOWN
+Windows.Win32.Foundation.ERROR_SYSTEM_TRACE
+Windows.Win32.Foundation.ERROR_THREAD_1_INACTIVE
+Windows.Win32.Foundation.ERROR_THREAD_ALREADY_IN_TASK
+Windows.Win32.Foundation.ERROR_THREAD_MODE_ALREADY_BACKGROUND
+Windows.Win32.Foundation.ERROR_THREAD_MODE_NOT_BACKGROUND
+Windows.Win32.Foundation.ERROR_THREAD_NOT_IN_PROCESS
+Windows.Win32.Foundation.ERROR_THREAD_WAS_SUSPENDED
+Windows.Win32.Foundation.ERROR_TIME_SENSITIVE_THREAD
+Windows.Win32.Foundation.ERROR_TIME_SKEW
+Windows.Win32.Foundation.ERROR_TIMEOUT
+Windows.Win32.Foundation.ERROR_TIMER_NOT_CANCELED
+Windows.Win32.Foundation.ERROR_TIMER_RESOLUTION_NOT_SET
+Windows.Win32.Foundation.ERROR_TIMER_RESUME_IGNORED
+Windows.Win32.Foundation.ERROR_TLW_WITH_WSCHILD
+Windows.Win32.Foundation.ERROR_TOKEN_ALREADY_IN_USE
+Windows.Win32.Foundation.ERROR_TOO_MANY_CMDS
+Windows.Win32.Foundation.ERROR_TOO_MANY_CONTEXT_IDS
+Windows.Win32.Foundation.ERROR_TOO_MANY_DESCRIPTORS
+Windows.Win32.Foundation.ERROR_TOO_MANY_LINKS
+Windows.Win32.Foundation.ERROR_TOO_MANY_LUIDS_REQUESTED
+Windows.Win32.Foundation.ERROR_TOO_MANY_MODULES
+Windows.Win32.Foundation.ERROR_TOO_MANY_MUXWAITERS
+Windows.Win32.Foundation.ERROR_TOO_MANY_NAMES
+Windows.Win32.Foundation.ERROR_TOO_MANY_OPEN_FILES
+Windows.Win32.Foundation.ERROR_TOO_MANY_POSTS
+Windows.Win32.Foundation.ERROR_TOO_MANY_SECRETS
+Windows.Win32.Foundation.ERROR_TOO_MANY_SEM_REQUESTS
+Windows.Win32.Foundation.ERROR_TOO_MANY_SEMAPHORES
+Windows.Win32.Foundation.ERROR_TOO_MANY_SESS
+Windows.Win32.Foundation.ERROR_TOO_MANY_SIDS
+Windows.Win32.Foundation.ERROR_TOO_MANY_TCBS
+Windows.Win32.Foundation.ERROR_TOO_MANY_THREADS
+Windows.Win32.Foundation.ERROR_TRANSLATION_COMPLETE
+Windows.Win32.Foundation.ERROR_TRUST_FAILURE
+Windows.Win32.Foundation.ERROR_TRUSTED_DOMAIN_FAILURE
+Windows.Win32.Foundation.ERROR_TRUSTED_RELATIONSHIP_FAILURE
+Windows.Win32.Foundation.ERROR_UNABLE_TO_LOCK_MEDIA
+Windows.Win32.Foundation.ERROR_UNABLE_TO_MOVE_REPLACEMENT
+Windows.Win32.Foundation.ERROR_UNABLE_TO_MOVE_REPLACEMENT_2
+Windows.Win32.Foundation.ERROR_UNABLE_TO_REMOVE_REPLACED
+Windows.Win32.Foundation.ERROR_UNABLE_TO_UNLOAD_MEDIA
+Windows.Win32.Foundation.ERROR_UNDEFINED_CHARACTER
+Windows.Win32.Foundation.ERROR_UNDEFINED_SCOPE
+Windows.Win32.Foundation.ERROR_UNEXP_NET_ERR
+Windows.Win32.Foundation.ERROR_UNEXPECTED_MM_CREATE_ERR
+Windows.Win32.Foundation.ERROR_UNEXPECTED_MM_EXTEND_ERR
+Windows.Win32.Foundation.ERROR_UNEXPECTED_MM_MAP_ERROR
+Windows.Win32.Foundation.ERROR_UNEXPECTED_NTCACHEMANAGER_ERROR
+Windows.Win32.Foundation.ERROR_UNHANDLED_EXCEPTION
+Windows.Win32.Foundation.ERROR_UNIDENTIFIED_ERROR
+Windows.Win32.Foundation.ERROR_UNKNOWN_COMPONENT
+Windows.Win32.Foundation.ERROR_UNKNOWN_FEATURE
+Windows.Win32.Foundation.ERROR_UNKNOWN_PATCH
+Windows.Win32.Foundation.ERROR_UNKNOWN_PORT
+Windows.Win32.Foundation.ERROR_UNKNOWN_PRINTER_DRIVER
+Windows.Win32.Foundation.ERROR_UNKNOWN_PRINTPROCESSOR
+Windows.Win32.Foundation.ERROR_UNKNOWN_PRODUCT
+Windows.Win32.Foundation.ERROR_UNKNOWN_PROPERTY
+Windows.Win32.Foundation.ERROR_UNKNOWN_REVISION
+Windows.Win32.Foundation.ERROR_UNRECOGNIZED_MEDIA
+Windows.Win32.Foundation.ERROR_UNRECOGNIZED_VOLUME
+Windows.Win32.Foundation.ERROR_UNSATISFIED_DEPENDENCIES
+Windows.Win32.Foundation.ERROR_UNSUPPORTED_COMPRESSION
+Windows.Win32.Foundation.ERROR_UNSUPPORTED_TYPE
+Windows.Win32.Foundation.ERROR_UNTRUSTED_MOUNT_POINT
+Windows.Win32.Foundation.ERROR_UNWIND
+Windows.Win32.Foundation.ERROR_UNWIND_CONSOLIDATE
+Windows.Win32.Foundation.ERROR_USER_APC
+Windows.Win32.Foundation.ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED
+Windows.Win32.Foundation.ERROR_USER_EXISTS
+Windows.Win32.Foundation.ERROR_USER_MAPPED_FILE
+Windows.Win32.Foundation.ERROR_USER_PROFILE_LOAD
+Windows.Win32.Foundation.ERROR_VALIDATE_CONTINUE
+Windows.Win32.Foundation.ERROR_VC_DISCONNECTED
+Windows.Win32.Foundation.ERROR_VDM_DISALLOWED
+Windows.Win32.Foundation.ERROR_VDM_HARD_ERROR
+Windows.Win32.Foundation.ERROR_VERIFIER_STOP
+Windows.Win32.Foundation.ERROR_VERSION_PARSE_ERROR
+Windows.Win32.Foundation.ERROR_VIRUS_DELETED
+Windows.Win32.Foundation.ERROR_VIRUS_INFECTED
+Windows.Win32.Foundation.ERROR_VOLSNAP_HIBERNATE_READY
+Windows.Win32.Foundation.ERROR_VOLSNAP_PREPARE_HIBERNATE
+Windows.Win32.Foundation.ERROR_VOLUME_MOUNTED
+Windows.Win32.Foundation.ERROR_VOLUME_NOT_CLUSTER_ALIGNED
+Windows.Win32.Foundation.ERROR_VOLUME_NOT_SIS_ENABLED
+Windows.Win32.Foundation.ERROR_VOLUME_NOT_SUPPORT_EFS
+Windows.Win32.Foundation.ERROR_VOLUME_NOT_SUPPORTED
+Windows.Win32.Foundation.ERROR_VOLUME_WRITE_ACCESS_DENIED
+Windows.Win32.Foundation.ERROR_WAIT_1
+Windows.Win32.Foundation.ERROR_WAIT_2
+Windows.Win32.Foundation.ERROR_WAIT_3
+Windows.Win32.Foundation.ERROR_WAIT_63
+Windows.Win32.Foundation.ERROR_WAIT_FOR_OPLOCK
+Windows.Win32.Foundation.ERROR_WAIT_NO_CHILDREN
+Windows.Win32.Foundation.ERROR_WAKE_SYSTEM
+Windows.Win32.Foundation.ERROR_WAKE_SYSTEM_DEBUGGER
+Windows.Win32.Foundation.ERROR_WAS_LOCKED
+Windows.Win32.Foundation.ERROR_WAS_UNLOCKED
+Windows.Win32.Foundation.ERROR_WEAK_WHFBKEY_BLOCKED
+Windows.Win32.Foundation.ERROR_WINDOW_NOT_COMBOBOX
+Windows.Win32.Foundation.ERROR_WINDOW_NOT_DIALOG
+Windows.Win32.Foundation.ERROR_WINDOW_OF_OTHER_THREAD
+Windows.Win32.Foundation.ERROR_WIP_ENCRYPTION_FAILED
+Windows.Win32.Foundation.ERROR_WOF_FILE_RESOURCE_TABLE_CORRUPT
+Windows.Win32.Foundation.ERROR_WOF_WIM_HEADER_CORRUPT
+Windows.Win32.Foundation.ERROR_WOF_WIM_RESOURCE_TABLE_CORRUPT
+Windows.Win32.Foundation.ERROR_WORKING_SET_QUOTA
+Windows.Win32.Foundation.ERROR_WOW_ASSERTION
+Windows.Win32.Foundation.ERROR_WRITE_FAULT
+Windows.Win32.Foundation.ERROR_WRITE_PROTECT
+Windows.Win32.Foundation.ERROR_WRONG_COMPARTMENT
+Windows.Win32.Foundation.ERROR_WRONG_DISK
+Windows.Win32.Foundation.ERROR_WRONG_EFS
+Windows.Win32.Foundation.ERROR_WRONG_PASSWORD
+Windows.Win32.Foundation.ERROR_WRONG_TARGET_NAME
+Windows.Win32.Foundation.ERROR_WX86_ERROR
+Windows.Win32.Foundation.ERROR_WX86_WARNING
+Windows.Win32.Foundation.ERROR_XML_PARSE_ERROR
+Windows.Win32.Foundation.ERROR_XMLDSIG_ERROR
+Windows.Win32.Foundation.EXCEPTION_STACK_OVERFLOW
+Windows.Win32.Foundation.FALSE
+Windows.Win32.Foundation.FARPROC
+Windows.Win32.Foundation.FILETIME
+Windows.Win32.Foundation.FRS_ERR_SYSVOL_POPULATE_TIMEOUT
+Windows.Win32.Foundation.GENERIC_ACCESS_RIGHTS
+Windows.Win32.Foundation.GENERIC_ALL
+Windows.Win32.Foundation.GENERIC_EXECUTE
+Windows.Win32.Foundation.GENERIC_READ
+Windows.Win32.Foundation.GENERIC_WRITE
+Windows.Win32.Foundation.GetLastError
+Windows.Win32.Foundation.HANDLE
+Windows.Win32.Foundation.HANDLE_FLAG_INHERIT
+Windows.Win32.Foundation.HANDLE_FLAG_PROTECT_FROM_CLOSE
+Windows.Win32.Foundation.HANDLE_FLAGS
+Windows.Win32.Foundation.HMODULE
+Windows.Win32.Foundation.INVALID_HANDLE_VALUE
+Windows.Win32.Foundation.MAX_PATH
+Windows.Win32.Foundation.NO_ERROR
+Windows.Win32.Foundation.NTSTATUS
+Windows.Win32.Foundation.RtlNtStatusToDosError
+Windows.Win32.Foundation.SetHandleInformation
+Windows.Win32.Foundation.SetLastError
+Windows.Win32.Foundation.STATUS_DELETE_PENDING
+Windows.Win32.Foundation.STATUS_END_OF_FILE
+Windows.Win32.Foundation.STATUS_INVALID_PARAMETER
+Windows.Win32.Foundation.STATUS_PENDING
+Windows.Win32.Foundation.STATUS_SUCCESS
+Windows.Win32.Foundation.TRUE
+Windows.Win32.Foundation.UNICODE_STRING
+Windows.Win32.Foundation.WAIT_ABANDONED
+Windows.Win32.Foundation.WAIT_ABANDONED_0
+Windows.Win32.Foundation.WAIT_FAILED
+Windows.Win32.Foundation.WAIT_IO_COMPLETION
+Windows.Win32.Foundation.WAIT_OBJECT_0
+Windows.Win32.Foundation.WAIT_TIMEOUT
+Windows.Win32.Foundation.WIN32_ERROR
+Windows.Win32.Globalization.COMPARESTRING_RESULT
+Windows.Win32.Globalization.CompareStringOrdinal
+Windows.Win32.Globalization.CP_UTF8
+Windows.Win32.Globalization.CSTR_EQUAL
+Windows.Win32.Globalization.CSTR_GREATER_THAN
+Windows.Win32.Globalization.CSTR_LESS_THAN
+Windows.Win32.Globalization.MB_COMPOSITE
+Windows.Win32.Globalization.MB_ERR_INVALID_CHARS
+Windows.Win32.Globalization.MB_PRECOMPOSED
+Windows.Win32.Globalization.MB_USEGLYPHCHARS
+Windows.Win32.Globalization.MULTI_BYTE_TO_WIDE_CHAR_FLAGS
+Windows.Win32.Globalization.MultiByteToWideChar
+Windows.Win32.Globalization.WC_ERR_INVALID_CHARS
+Windows.Win32.Globalization.WideCharToMultiByte
+Windows.Win32.Networking.WinSock.accept
+Windows.Win32.Networking.WinSock.ADDRESS_FAMILY
+Windows.Win32.Networking.WinSock.ADDRINFOA
+Windows.Win32.Networking.WinSock.AF_INET
+Windows.Win32.Networking.WinSock.AF_INET6
+Windows.Win32.Networking.WinSock.AF_UNSPEC
+Windows.Win32.Networking.WinSock.bind
+Windows.Win32.Networking.WinSock.closesocket
+Windows.Win32.Networking.WinSock.connect
+Windows.Win32.Networking.WinSock.FD_SET
+Windows.Win32.Networking.WinSock.FIONBIO
+Windows.Win32.Networking.WinSock.freeaddrinfo
+Windows.Win32.Networking.WinSock.getaddrinfo
+Windows.Win32.Networking.WinSock.getpeername
+Windows.Win32.Networking.WinSock.getsockname
+Windows.Win32.Networking.WinSock.getsockopt
+Windows.Win32.Networking.WinSock.IN6_ADDR
+Windows.Win32.Networking.WinSock.IN_ADDR
+Windows.Win32.Networking.WinSock.INVALID_SOCKET
+Windows.Win32.Networking.WinSock.ioctlsocket
+Windows.Win32.Networking.WinSock.IP_ADD_MEMBERSHIP
+Windows.Win32.Networking.WinSock.IP_DROP_MEMBERSHIP
+Windows.Win32.Networking.WinSock.IP_MREQ
+Windows.Win32.Networking.WinSock.IP_MULTICAST_LOOP
+Windows.Win32.Networking.WinSock.IP_MULTICAST_TTL
+Windows.Win32.Networking.WinSock.IP_TTL
+Windows.Win32.Networking.WinSock.IPPROTO
+Windows.Win32.Networking.WinSock.IPPROTO_AH
+Windows.Win32.Networking.WinSock.IPPROTO_CBT
+Windows.Win32.Networking.WinSock.IPPROTO_DSTOPTS
+Windows.Win32.Networking.WinSock.IPPROTO_EGP
+Windows.Win32.Networking.WinSock.IPPROTO_ESP
+Windows.Win32.Networking.WinSock.IPPROTO_FRAGMENT
+Windows.Win32.Networking.WinSock.IPPROTO_GGP
+Windows.Win32.Networking.WinSock.IPPROTO_HOPOPTS
+Windows.Win32.Networking.WinSock.IPPROTO_ICLFXBM
+Windows.Win32.Networking.WinSock.IPPROTO_ICMP
+Windows.Win32.Networking.WinSock.IPPROTO_ICMPV6
+Windows.Win32.Networking.WinSock.IPPROTO_IDP
+Windows.Win32.Networking.WinSock.IPPROTO_IGMP
+Windows.Win32.Networking.WinSock.IPPROTO_IGP
+Windows.Win32.Networking.WinSock.IPPROTO_IP
+Windows.Win32.Networking.WinSock.IPPROTO_IPV4
+Windows.Win32.Networking.WinSock.IPPROTO_IPV6
+Windows.Win32.Networking.WinSock.IPPROTO_L2TP
+Windows.Win32.Networking.WinSock.IPPROTO_MAX
+Windows.Win32.Networking.WinSock.IPPROTO_ND
+Windows.Win32.Networking.WinSock.IPPROTO_NONE
+Windows.Win32.Networking.WinSock.IPPROTO_PGM
+Windows.Win32.Networking.WinSock.IPPROTO_PIM
+Windows.Win32.Networking.WinSock.IPPROTO_PUP
+Windows.Win32.Networking.WinSock.IPPROTO_RAW
+Windows.Win32.Networking.WinSock.IPPROTO_RDP
+Windows.Win32.Networking.WinSock.IPPROTO_RESERVED_IPSEC
+Windows.Win32.Networking.WinSock.IPPROTO_RESERVED_IPSECOFFLOAD
+Windows.Win32.Networking.WinSock.IPPROTO_RESERVED_MAX
+Windows.Win32.Networking.WinSock.IPPROTO_RESERVED_RAW
+Windows.Win32.Networking.WinSock.IPPROTO_RESERVED_WNV
+Windows.Win32.Networking.WinSock.IPPROTO_RM
+Windows.Win32.Networking.WinSock.IPPROTO_ROUTING
+Windows.Win32.Networking.WinSock.IPPROTO_SCTP
+Windows.Win32.Networking.WinSock.IPPROTO_ST
+Windows.Win32.Networking.WinSock.IPPROTO_TCP
+Windows.Win32.Networking.WinSock.IPPROTO_UDP
+Windows.Win32.Networking.WinSock.IPV6_ADD_MEMBERSHIP
+Windows.Win32.Networking.WinSock.IPV6_DROP_MEMBERSHIP
+Windows.Win32.Networking.WinSock.IPV6_MREQ
+Windows.Win32.Networking.WinSock.IPV6_MULTICAST_LOOP
+Windows.Win32.Networking.WinSock.IPV6_V6ONLY
+Windows.Win32.Networking.WinSock.LINGER
+Windows.Win32.Networking.WinSock.listen
+Windows.Win32.Networking.WinSock.LPWSAOVERLAPPED_COMPLETION_ROUTINE
+Windows.Win32.Networking.WinSock.MSG_DONTROUTE
+Windows.Win32.Networking.WinSock.MSG_OOB
+Windows.Win32.Networking.WinSock.MSG_PEEK
+Windows.Win32.Networking.WinSock.MSG_PUSH_IMMEDIATE
+Windows.Win32.Networking.WinSock.MSG_WAITALL
+Windows.Win32.Networking.WinSock.recv
+Windows.Win32.Networking.WinSock.recvfrom
+Windows.Win32.Networking.WinSock.SD_BOTH
+Windows.Win32.Networking.WinSock.SD_RECEIVE
+Windows.Win32.Networking.WinSock.SD_SEND
+Windows.Win32.Networking.WinSock.select
+Windows.Win32.Networking.WinSock.send
+Windows.Win32.Networking.WinSock.SEND_RECV_FLAGS
+Windows.Win32.Networking.WinSock.sendto
+Windows.Win32.Networking.WinSock.setsockopt
+Windows.Win32.Networking.WinSock.shutdown
+Windows.Win32.Networking.WinSock.SO_BROADCAST
+Windows.Win32.Networking.WinSock.SO_ERROR
+Windows.Win32.Networking.WinSock.SO_LINGER
+Windows.Win32.Networking.WinSock.SO_RCVTIMEO
+Windows.Win32.Networking.WinSock.SO_SNDTIMEO
+Windows.Win32.Networking.WinSock.SOCK_DGRAM
+Windows.Win32.Networking.WinSock.SOCK_RAW
+Windows.Win32.Networking.WinSock.SOCK_RDM
+Windows.Win32.Networking.WinSock.SOCK_SEQPACKET
+Windows.Win32.Networking.WinSock.SOCK_STREAM
+Windows.Win32.Networking.WinSock.SOCKADDR
+Windows.Win32.Networking.WinSock.SOCKET
+Windows.Win32.Networking.WinSock.SOCKET_ERROR
+Windows.Win32.Networking.WinSock.SOL_SOCKET
+Windows.Win32.Networking.WinSock.TCP_NODELAY
+Windows.Win32.Networking.WinSock.TIMEVAL
+Windows.Win32.Networking.WinSock.WINSOCK_SHUTDOWN_HOW
+Windows.Win32.Networking.WinSock.WINSOCK_SOCKET_TYPE
+Windows.Win32.Networking.WinSock.WSA_E_CANCELLED
+Windows.Win32.Networking.WinSock.WSA_E_NO_MORE
+Windows.Win32.Networking.WinSock.WSA_ERROR
+Windows.Win32.Networking.WinSock.WSA_FLAG_NO_HANDLE_INHERIT
+Windows.Win32.Networking.WinSock.WSA_FLAG_OVERLAPPED
+Windows.Win32.Networking.WinSock.WSA_INVALID_HANDLE
+Windows.Win32.Networking.WinSock.WSA_INVALID_PARAMETER
+Windows.Win32.Networking.WinSock.WSA_IO_INCOMPLETE
+Windows.Win32.Networking.WinSock.WSA_IO_PENDING
+Windows.Win32.Networking.WinSock.WSA_IPSEC_NAME_POLICY_ERROR
+Windows.Win32.Networking.WinSock.WSA_NOT_ENOUGH_MEMORY
+Windows.Win32.Networking.WinSock.WSA_OPERATION_ABORTED
+Windows.Win32.Networking.WinSock.WSA_QOS_ADMISSION_FAILURE
+Windows.Win32.Networking.WinSock.WSA_QOS_BAD_OBJECT
+Windows.Win32.Networking.WinSock.WSA_QOS_BAD_STYLE
+Windows.Win32.Networking.WinSock.WSA_QOS_EFILTERCOUNT
+Windows.Win32.Networking.WinSock.WSA_QOS_EFILTERSTYLE
+Windows.Win32.Networking.WinSock.WSA_QOS_EFILTERTYPE
+Windows.Win32.Networking.WinSock.WSA_QOS_EFLOWCOUNT
+Windows.Win32.Networking.WinSock.WSA_QOS_EFLOWDESC
+Windows.Win32.Networking.WinSock.WSA_QOS_EFLOWSPEC
+Windows.Win32.Networking.WinSock.WSA_QOS_EOBJLENGTH
+Windows.Win32.Networking.WinSock.WSA_QOS_EPOLICYOBJ
+Windows.Win32.Networking.WinSock.WSA_QOS_EPROVSPECBUF
+Windows.Win32.Networking.WinSock.WSA_QOS_EPSFILTERSPEC
+Windows.Win32.Networking.WinSock.WSA_QOS_EPSFLOWSPEC
+Windows.Win32.Networking.WinSock.WSA_QOS_ESDMODEOBJ
+Windows.Win32.Networking.WinSock.WSA_QOS_ESERVICETYPE
+Windows.Win32.Networking.WinSock.WSA_QOS_ESHAPERATEOBJ
+Windows.Win32.Networking.WinSock.WSA_QOS_EUNKOWNPSOBJ
+Windows.Win32.Networking.WinSock.WSA_QOS_GENERIC_ERROR
+Windows.Win32.Networking.WinSock.WSA_QOS_NO_RECEIVERS
+Windows.Win32.Networking.WinSock.WSA_QOS_NO_SENDERS
+Windows.Win32.Networking.WinSock.WSA_QOS_POLICY_FAILURE
+Windows.Win32.Networking.WinSock.WSA_QOS_RECEIVERS
+Windows.Win32.Networking.WinSock.WSA_QOS_REQUEST_CONFIRMED
+Windows.Win32.Networking.WinSock.WSA_QOS_RESERVED_PETYPE
+Windows.Win32.Networking.WinSock.WSA_QOS_SENDERS
+Windows.Win32.Networking.WinSock.WSA_QOS_TRAFFIC_CTRL_ERROR
+Windows.Win32.Networking.WinSock.WSA_SECURE_HOST_NOT_FOUND
+Windows.Win32.Networking.WinSock.WSA_WAIT_EVENT_0
+Windows.Win32.Networking.WinSock.WSA_WAIT_IO_COMPLETION
+Windows.Win32.Networking.WinSock.WSABASEERR
+Windows.Win32.Networking.WinSock.WSABUF
+Windows.Win32.Networking.WinSock.WSACleanup
+Windows.Win32.Networking.WinSock.WSADATA
+Windows.Win32.Networking.WinSock.WSADATA
+Windows.Win32.Networking.WinSock.WSADuplicateSocketW
+Windows.Win32.Networking.WinSock.WSAEACCES
+Windows.Win32.Networking.WinSock.WSAEADDRINUSE
+Windows.Win32.Networking.WinSock.WSAEADDRNOTAVAIL
+Windows.Win32.Networking.WinSock.WSAEAFNOSUPPORT
+Windows.Win32.Networking.WinSock.WSAEALREADY
+Windows.Win32.Networking.WinSock.WSAEBADF
+Windows.Win32.Networking.WinSock.WSAECANCELLED
+Windows.Win32.Networking.WinSock.WSAECONNABORTED
+Windows.Win32.Networking.WinSock.WSAECONNREFUSED
+Windows.Win32.Networking.WinSock.WSAECONNRESET
+Windows.Win32.Networking.WinSock.WSAEDESTADDRREQ
+Windows.Win32.Networking.WinSock.WSAEDISCON
+Windows.Win32.Networking.WinSock.WSAEDQUOT
+Windows.Win32.Networking.WinSock.WSAEFAULT
+Windows.Win32.Networking.WinSock.WSAEHOSTDOWN
+Windows.Win32.Networking.WinSock.WSAEHOSTUNREACH
+Windows.Win32.Networking.WinSock.WSAEINPROGRESS
+Windows.Win32.Networking.WinSock.WSAEINTR
+Windows.Win32.Networking.WinSock.WSAEINVAL
+Windows.Win32.Networking.WinSock.WSAEINVALIDPROCTABLE
+Windows.Win32.Networking.WinSock.WSAEINVALIDPROVIDER
+Windows.Win32.Networking.WinSock.WSAEISCONN
+Windows.Win32.Networking.WinSock.WSAELOOP
+Windows.Win32.Networking.WinSock.WSAEMFILE
+Windows.Win32.Networking.WinSock.WSAEMSGSIZE
+Windows.Win32.Networking.WinSock.WSAENAMETOOLONG
+Windows.Win32.Networking.WinSock.WSAENETDOWN
+Windows.Win32.Networking.WinSock.WSAENETRESET
+Windows.Win32.Networking.WinSock.WSAENETUNREACH
+Windows.Win32.Networking.WinSock.WSAENOBUFS
+Windows.Win32.Networking.WinSock.WSAENOMORE
+Windows.Win32.Networking.WinSock.WSAENOPROTOOPT
+Windows.Win32.Networking.WinSock.WSAENOTCONN
+Windows.Win32.Networking.WinSock.WSAENOTEMPTY
+Windows.Win32.Networking.WinSock.WSAENOTSOCK
+Windows.Win32.Networking.WinSock.WSAEOPNOTSUPP
+Windows.Win32.Networking.WinSock.WSAEPFNOSUPPORT
+Windows.Win32.Networking.WinSock.WSAEPROCLIM
+Windows.Win32.Networking.WinSock.WSAEPROTONOSUPPORT
+Windows.Win32.Networking.WinSock.WSAEPROTOTYPE
+Windows.Win32.Networking.WinSock.WSAEPROVIDERFAILEDINIT
+Windows.Win32.Networking.WinSock.WSAEREFUSED
+Windows.Win32.Networking.WinSock.WSAEREMOTE
+Windows.Win32.Networking.WinSock.WSAESHUTDOWN
+Windows.Win32.Networking.WinSock.WSAESOCKTNOSUPPORT
+Windows.Win32.Networking.WinSock.WSAESTALE
+Windows.Win32.Networking.WinSock.WSAETIMEDOUT
+Windows.Win32.Networking.WinSock.WSAETOOMANYREFS
+Windows.Win32.Networking.WinSock.WSAEUSERS
+Windows.Win32.Networking.WinSock.WSAEWOULDBLOCK
+Windows.Win32.Networking.WinSock.WSAGetLastError
+Windows.Win32.Networking.WinSock.WSAHOST_NOT_FOUND
+Windows.Win32.Networking.WinSock.WSANO_DATA
+Windows.Win32.Networking.WinSock.WSANO_RECOVERY
+Windows.Win32.Networking.WinSock.WSANOTINITIALISED
+Windows.Win32.Networking.WinSock.WSAPROTOCOL_INFOW
+Windows.Win32.Networking.WinSock.WSAPROTOCOLCHAIN
+Windows.Win32.Networking.WinSock.WSARecv
+Windows.Win32.Networking.WinSock.WSASend
+Windows.Win32.Networking.WinSock.WSASERVICE_NOT_FOUND
+Windows.Win32.Networking.WinSock.WSASocketW
+Windows.Win32.Networking.WinSock.WSAStartup
+Windows.Win32.Networking.WinSock.WSASYSCALLFAILURE
+Windows.Win32.Networking.WinSock.WSASYSNOTREADY
+Windows.Win32.Networking.WinSock.WSATRY_AGAIN
+Windows.Win32.Networking.WinSock.WSATYPE_NOT_FOUND
+Windows.Win32.Networking.WinSock.WSAVERNOTSUPPORTED
+Windows.Win32.Security.Authentication.Identity.RtlGenRandom
+Windows.Win32.Security.Cryptography.BCRYPT_ALG_HANDLE
+Windows.Win32.Security.Cryptography.BCRYPT_USE_SYSTEM_PREFERRED_RNG
+Windows.Win32.Security.Cryptography.BCryptGenRandom
+Windows.Win32.Security.Cryptography.BCRYPTGENRANDOM_FLAGS
+Windows.Win32.Security.SECURITY_ATTRIBUTES
+Windows.Win32.Security.TOKEN_ACCESS_MASK
+Windows.Win32.Security.TOKEN_ACCESS_PSEUDO_HANDLE
+Windows.Win32.Security.TOKEN_ACCESS_PSEUDO_HANDLE_WIN8
+Windows.Win32.Security.TOKEN_ACCESS_SYSTEM_SECURITY
+Windows.Win32.Security.TOKEN_ADJUST_DEFAULT
+Windows.Win32.Security.TOKEN_ADJUST_GROUPS
+Windows.Win32.Security.TOKEN_ADJUST_PRIVILEGES
+Windows.Win32.Security.TOKEN_ADJUST_SESSIONID
+Windows.Win32.Security.TOKEN_ALL_ACCESS
+Windows.Win32.Security.TOKEN_ASSIGN_PRIMARY
+Windows.Win32.Security.TOKEN_DELETE
+Windows.Win32.Security.TOKEN_DUPLICATE
+Windows.Win32.Security.TOKEN_EXECUTE
+Windows.Win32.Security.TOKEN_IMPERSONATE
+Windows.Win32.Security.TOKEN_QUERY
+Windows.Win32.Security.TOKEN_QUERY_SOURCE
+Windows.Win32.Security.TOKEN_READ
+Windows.Win32.Security.TOKEN_READ_CONTROL
+Windows.Win32.Security.TOKEN_TRUST_CONSTRAINT_MASK
+Windows.Win32.Security.TOKEN_WRITE
+Windows.Win32.Security.TOKEN_WRITE_DAC
+Windows.Win32.Security.TOKEN_WRITE_OWNER
+Windows.Win32.Storage.FileSystem.BY_HANDLE_FILE_INFORMATION
+Windows.Win32.Storage.FileSystem.CALLBACK_CHUNK_FINISHED
+Windows.Win32.Storage.FileSystem.CALLBACK_STREAM_SWITCH
+Windows.Win32.Storage.FileSystem.CopyFileExW
+Windows.Win32.Storage.FileSystem.CREATE_ALWAYS
+Windows.Win32.Storage.FileSystem.CREATE_NEW
+Windows.Win32.Storage.FileSystem.CreateDirectoryW
+Windows.Win32.Storage.FileSystem.CreateFileW
+Windows.Win32.Storage.FileSystem.CreateHardLinkW
+Windows.Win32.Storage.FileSystem.CreateSymbolicLinkW
+Windows.Win32.Storage.FileSystem.DELETE
+Windows.Win32.Storage.FileSystem.DeleteFileW
+Windows.Win32.Storage.FileSystem.FILE_ACCESS_RIGHTS
+Windows.Win32.Storage.FileSystem.FILE_ADD_FILE
+Windows.Win32.Storage.FileSystem.FILE_ADD_SUBDIRECTORY
+Windows.Win32.Storage.FileSystem.FILE_ALL_ACCESS
+Windows.Win32.Storage.FileSystem.FILE_APPEND_DATA
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_ARCHIVE
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_COMPRESSED
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_DEVICE
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_DIRECTORY
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_EA
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_ENCRYPTED
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_HIDDEN
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_INTEGRITY_STREAM
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_NO_SCRUB_DATA
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_NORMAL
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_OFFLINE
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_PINNED
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_READONLY
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_RECALL_ON_OPEN
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_REPARSE_POINT
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_SPARSE_FILE
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_SYSTEM
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_TAG_INFO
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_TEMPORARY
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_UNPINNED
+Windows.Win32.Storage.FileSystem.FILE_ATTRIBUTE_VIRTUAL
+Windows.Win32.Storage.FileSystem.FILE_BASIC_INFO
+Windows.Win32.Storage.FileSystem.FILE_BEGIN
+Windows.Win32.Storage.FileSystem.FILE_CREATE_PIPE_INSTANCE
+Windows.Win32.Storage.FileSystem.FILE_CREATION_DISPOSITION
+Windows.Win32.Storage.FileSystem.FILE_CURRENT
+Windows.Win32.Storage.FileSystem.FILE_DELETE_CHILD
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_DELETE
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_DO_NOT_DELETE
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_FORCE_IMAGE_SECTION_CHECK
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_IGNORE_READONLY_ATTRIBUTE
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_ON_CLOSE
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_FLAG_POSIX_SEMANTICS
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_INFO
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_INFO_EX
+Windows.Win32.Storage.FileSystem.FILE_DISPOSITION_INFO_EX_FLAGS
+Windows.Win32.Storage.FileSystem.FILE_END
+Windows.Win32.Storage.FileSystem.FILE_END_OF_FILE_INFO
+Windows.Win32.Storage.FileSystem.FILE_EXECUTE
+Windows.Win32.Storage.FileSystem.FILE_FLAG_BACKUP_SEMANTICS
+Windows.Win32.Storage.FileSystem.FILE_FLAG_DELETE_ON_CLOSE
+Windows.Win32.Storage.FileSystem.FILE_FLAG_FIRST_PIPE_INSTANCE
+Windows.Win32.Storage.FileSystem.FILE_FLAG_NO_BUFFERING
+Windows.Win32.Storage.FileSystem.FILE_FLAG_OPEN_NO_RECALL
+Windows.Win32.Storage.FileSystem.FILE_FLAG_OPEN_REPARSE_POINT
+Windows.Win32.Storage.FileSystem.FILE_FLAG_OVERLAPPED
+Windows.Win32.Storage.FileSystem.FILE_FLAG_POSIX_SEMANTICS
+Windows.Win32.Storage.FileSystem.FILE_FLAG_RANDOM_ACCESS
+Windows.Win32.Storage.FileSystem.FILE_FLAG_SEQUENTIAL_SCAN
+Windows.Win32.Storage.FileSystem.FILE_FLAG_SESSION_AWARE
+Windows.Win32.Storage.FileSystem.FILE_FLAG_WRITE_THROUGH
+Windows.Win32.Storage.FileSystem.FILE_FLAGS_AND_ATTRIBUTES
+Windows.Win32.Storage.FileSystem.FILE_GENERIC_EXECUTE
+Windows.Win32.Storage.FileSystem.FILE_GENERIC_READ
+Windows.Win32.Storage.FileSystem.FILE_GENERIC_WRITE
+Windows.Win32.Storage.FileSystem.FILE_ID_BOTH_DIR_INFO
+Windows.Win32.Storage.FileSystem.FILE_INFO_BY_HANDLE_CLASS
+Windows.Win32.Storage.FileSystem.FILE_LIST_DIRECTORY
+Windows.Win32.Storage.FileSystem.FILE_NAME_NORMALIZED
+Windows.Win32.Storage.FileSystem.FILE_NAME_OPENED
+Windows.Win32.Storage.FileSystem.FILE_READ_ATTRIBUTES
+Windows.Win32.Storage.FileSystem.FILE_READ_DATA
+Windows.Win32.Storage.FileSystem.FILE_READ_EA
+Windows.Win32.Storage.FileSystem.FILE_SHARE_DELETE
+Windows.Win32.Storage.FileSystem.FILE_SHARE_MODE
+Windows.Win32.Storage.FileSystem.FILE_SHARE_NONE
+Windows.Win32.Storage.FileSystem.FILE_SHARE_READ
+Windows.Win32.Storage.FileSystem.FILE_SHARE_WRITE
+Windows.Win32.Storage.FileSystem.FILE_STANDARD_INFO
+Windows.Win32.Storage.FileSystem.FILE_TRAVERSE
+Windows.Win32.Storage.FileSystem.FILE_TYPE
+Windows.Win32.Storage.FileSystem.FILE_TYPE_CHAR
+Windows.Win32.Storage.FileSystem.FILE_TYPE_DISK
+Windows.Win32.Storage.FileSystem.FILE_TYPE_PIPE
+Windows.Win32.Storage.FileSystem.FILE_TYPE_REMOTE
+Windows.Win32.Storage.FileSystem.FILE_TYPE_UNKNOWN
+Windows.Win32.Storage.FileSystem.FILE_WRITE_ATTRIBUTES
+Windows.Win32.Storage.FileSystem.FILE_WRITE_DATA
+Windows.Win32.Storage.FileSystem.FILE_WRITE_EA
+Windows.Win32.Storage.FileSystem.FileAlignmentInfo
+Windows.Win32.Storage.FileSystem.FileAllocationInfo
+Windows.Win32.Storage.FileSystem.FileAttributeTagInfo
+Windows.Win32.Storage.FileSystem.FileBasicInfo
+Windows.Win32.Storage.FileSystem.FileCaseSensitiveInfo
+Windows.Win32.Storage.FileSystem.FileCompressionInfo
+Windows.Win32.Storage.FileSystem.FileDispositionInfo
+Windows.Win32.Storage.FileSystem.FileDispositionInfoEx
+Windows.Win32.Storage.FileSystem.FileEndOfFileInfo
+Windows.Win32.Storage.FileSystem.FileFullDirectoryInfo
+Windows.Win32.Storage.FileSystem.FileFullDirectoryRestartInfo
+Windows.Win32.Storage.FileSystem.FileIdBothDirectoryInfo
+Windows.Win32.Storage.FileSystem.FileIdBothDirectoryRestartInfo
+Windows.Win32.Storage.FileSystem.FileIdExtdDirectoryInfo
+Windows.Win32.Storage.FileSystem.FileIdExtdDirectoryRestartInfo
+Windows.Win32.Storage.FileSystem.FileIdInfo
+Windows.Win32.Storage.FileSystem.FileIoPriorityHintInfo
+Windows.Win32.Storage.FileSystem.FileNameInfo
+Windows.Win32.Storage.FileSystem.FileNormalizedNameInfo
+Windows.Win32.Storage.FileSystem.FileRemoteProtocolInfo
+Windows.Win32.Storage.FileSystem.FileRenameInfo
+Windows.Win32.Storage.FileSystem.FileRenameInfoEx
+Windows.Win32.Storage.FileSystem.FileStandardInfo
+Windows.Win32.Storage.FileSystem.FileStorageInfo
+Windows.Win32.Storage.FileSystem.FileStreamInfo
+Windows.Win32.Storage.FileSystem.FindClose
+Windows.Win32.Storage.FileSystem.FindFileHandle
+Windows.Win32.Storage.FileSystem.FindFirstFileW
+Windows.Win32.Storage.FileSystem.FindNextFileW
+Windows.Win32.Storage.FileSystem.FlushFileBuffers
+Windows.Win32.Storage.FileSystem.GetFileAttributesW
+Windows.Win32.Storage.FileSystem.GetFileInformationByHandle
+Windows.Win32.Storage.FileSystem.GetFileInformationByHandleEx
+Windows.Win32.Storage.FileSystem.GetFileType
+Windows.Win32.Storage.FileSystem.GETFINALPATHNAMEBYHANDLE_FLAGS
+Windows.Win32.Storage.FileSystem.GetFinalPathNameByHandleW
+Windows.Win32.Storage.FileSystem.GetFullPathNameW
+Windows.Win32.Storage.FileSystem.GetTempPathW
+Windows.Win32.Storage.FileSystem.INVALID_FILE_ATTRIBUTES
+Windows.Win32.Storage.FileSystem.LPPROGRESS_ROUTINE
+Windows.Win32.Storage.FileSystem.LPPROGRESS_ROUTINE_CALLBACK_REASON
+Windows.Win32.Storage.FileSystem.MAXIMUM_REPARSE_DATA_BUFFER_SIZE
+Windows.Win32.Storage.FileSystem.MaximumFileInfoByHandleClass
+Windows.Win32.Storage.FileSystem.MOVE_FILE_FLAGS
+Windows.Win32.Storage.FileSystem.MOVEFILE_COPY_ALLOWED
+Windows.Win32.Storage.FileSystem.MOVEFILE_CREATE_HARDLINK
+Windows.Win32.Storage.FileSystem.MOVEFILE_DELAY_UNTIL_REBOOT
+Windows.Win32.Storage.FileSystem.MOVEFILE_FAIL_IF_NOT_TRACKABLE
+Windows.Win32.Storage.FileSystem.MOVEFILE_REPLACE_EXISTING
+Windows.Win32.Storage.FileSystem.MOVEFILE_WRITE_THROUGH
+Windows.Win32.Storage.FileSystem.MoveFileExW
+Windows.Win32.Storage.FileSystem.OPEN_ALWAYS
+Windows.Win32.Storage.FileSystem.OPEN_EXISTING
+Windows.Win32.Storage.FileSystem.PIPE_ACCESS_DUPLEX
+Windows.Win32.Storage.FileSystem.PIPE_ACCESS_INBOUND
+Windows.Win32.Storage.FileSystem.PIPE_ACCESS_OUTBOUND
+Windows.Win32.Storage.FileSystem.READ_CONTROL
+Windows.Win32.Storage.FileSystem.ReadFile
+Windows.Win32.Storage.FileSystem.ReadFileEx
+Windows.Win32.Storage.FileSystem.RemoveDirectoryW
+Windows.Win32.Storage.FileSystem.SECURITY_ANONYMOUS
+Windows.Win32.Storage.FileSystem.SECURITY_CONTEXT_TRACKING
+Windows.Win32.Storage.FileSystem.SECURITY_DELEGATION
+Windows.Win32.Storage.FileSystem.SECURITY_EFFECTIVE_ONLY
+Windows.Win32.Storage.FileSystem.SECURITY_IDENTIFICATION
+Windows.Win32.Storage.FileSystem.SECURITY_IMPERSONATION
+Windows.Win32.Storage.FileSystem.SECURITY_SQOS_PRESENT
+Windows.Win32.Storage.FileSystem.SECURITY_VALID_SQOS_FLAGS
+Windows.Win32.Storage.FileSystem.SET_FILE_POINTER_MOVE_METHOD
+Windows.Win32.Storage.FileSystem.SetFileAttributesW
+Windows.Win32.Storage.FileSystem.SetFileInformationByHandle
+Windows.Win32.Storage.FileSystem.SetFilePointerEx
+Windows.Win32.Storage.FileSystem.SetFileTime
+Windows.Win32.Storage.FileSystem.SPECIFIC_RIGHTS_ALL
+Windows.Win32.Storage.FileSystem.STANDARD_RIGHTS_ALL
+Windows.Win32.Storage.FileSystem.STANDARD_RIGHTS_EXECUTE
+Windows.Win32.Storage.FileSystem.STANDARD_RIGHTS_READ
+Windows.Win32.Storage.FileSystem.STANDARD_RIGHTS_REQUIRED
+Windows.Win32.Storage.FileSystem.STANDARD_RIGHTS_WRITE
+Windows.Win32.Storage.FileSystem.SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
+Windows.Win32.Storage.FileSystem.SYMBOLIC_LINK_FLAG_DIRECTORY
+Windows.Win32.Storage.FileSystem.SYMBOLIC_LINK_FLAGS
+Windows.Win32.Storage.FileSystem.SYNCHRONIZE
+Windows.Win32.Storage.FileSystem.TRUNCATE_EXISTING
+Windows.Win32.Storage.FileSystem.VOLUME_NAME_DOS
+Windows.Win32.Storage.FileSystem.VOLUME_NAME_GUID
+Windows.Win32.Storage.FileSystem.VOLUME_NAME_NONE
+Windows.Win32.Storage.FileSystem.WIN32_FIND_DATAW
+Windows.Win32.Storage.FileSystem.WRITE_DAC
+Windows.Win32.Storage.FileSystem.WRITE_OWNER
+Windows.Win32.Storage.FileSystem.WriteFileEx
+Windows.Win32.System.Console.CONSOLE_MODE
+Windows.Win32.System.Console.CONSOLE_READCONSOLE_CONTROL
+Windows.Win32.System.Console.DISABLE_NEWLINE_AUTO_RETURN
+Windows.Win32.System.Console.ENABLE_AUTO_POSITION
+Windows.Win32.System.Console.ENABLE_ECHO_INPUT
+Windows.Win32.System.Console.ENABLE_EXTENDED_FLAGS
+Windows.Win32.System.Console.ENABLE_INSERT_MODE
+Windows.Win32.System.Console.ENABLE_LINE_INPUT
+Windows.Win32.System.Console.ENABLE_LVB_GRID_WORLDWIDE
+Windows.Win32.System.Console.ENABLE_MOUSE_INPUT
+Windows.Win32.System.Console.ENABLE_PROCESSED_INPUT
+Windows.Win32.System.Console.ENABLE_PROCESSED_OUTPUT
+Windows.Win32.System.Console.ENABLE_QUICK_EDIT_MODE
+Windows.Win32.System.Console.ENABLE_VIRTUAL_TERMINAL_INPUT
+Windows.Win32.System.Console.ENABLE_VIRTUAL_TERMINAL_PROCESSING
+Windows.Win32.System.Console.ENABLE_WINDOW_INPUT
+Windows.Win32.System.Console.ENABLE_WRAP_AT_EOL_OUTPUT
+Windows.Win32.System.Console.GetConsoleMode
+Windows.Win32.System.Console.GetStdHandle
+Windows.Win32.System.Console.ReadConsoleW
+Windows.Win32.System.Console.STD_ERROR_HANDLE
+Windows.Win32.System.Console.STD_HANDLE
+Windows.Win32.System.Console.STD_INPUT_HANDLE
+Windows.Win32.System.Console.STD_OUTPUT_HANDLE
+Windows.Win32.System.Console.WriteConsoleW
+Windows.Win32.System.Diagnostics.Debug.AddVectoredExceptionHandler
+Windows.Win32.System.Diagnostics.Debug.ARM64_NT_NEON128
+Windows.Win32.System.Diagnostics.Debug.CONTEXT
+Windows.Win32.System.Diagnostics.Debug.CONTEXT
+Windows.Win32.System.Diagnostics.Debug.CONTEXT
+Windows.Win32.System.Diagnostics.Debug.EXCEPTION_POINTERS
+Windows.Win32.System.Diagnostics.Debug.EXCEPTION_RECORD
+Windows.Win32.System.Diagnostics.Debug.FACILITY_CODE
+Windows.Win32.System.Diagnostics.Debug.FACILITY_NT_BIT
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_ALLOCATE_BUFFER
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_ARGUMENT_ARRAY
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_FROM_HMODULE
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_FROM_STRING
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_FROM_SYSTEM
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_IGNORE_INSERTS
+Windows.Win32.System.Diagnostics.Debug.FORMAT_MESSAGE_OPTIONS
+Windows.Win32.System.Diagnostics.Debug.FormatMessageW
+Windows.Win32.System.Diagnostics.Debug.M128A
+Windows.Win32.System.Diagnostics.Debug.PVECTORED_EXCEPTION_HANDLER
+Windows.Win32.System.Diagnostics.Debug.XSAVE_FORMAT
+Windows.Win32.System.Diagnostics.Debug.XSAVE_FORMAT
+Windows.Win32.System.Environment.FreeEnvironmentStringsW
+Windows.Win32.System.Environment.GetCommandLineW
+Windows.Win32.System.Environment.GetCurrentDirectoryW
+Windows.Win32.System.Environment.GetEnvironmentStringsW
+Windows.Win32.System.Environment.GetEnvironmentVariableW
+Windows.Win32.System.Environment.SetCurrentDirectoryW
+Windows.Win32.System.Environment.SetEnvironmentVariableW
+Windows.Win32.System.IO.CancelIo
+Windows.Win32.System.IO.DeviceIoControl
+Windows.Win32.System.IO.GetOverlappedResult
+Windows.Win32.System.IO.LPOVERLAPPED_COMPLETION_ROUTINE
+Windows.Win32.System.IO.OVERLAPPED
+Windows.Win32.System.Ioctl.FSCTL_GET_REPARSE_POINT
+Windows.Win32.System.Ioctl.FSCTL_SET_REPARSE_POINT
+Windows.Win32.System.Kernel.EXCEPTION_DISPOSITION
+Windows.Win32.System.Kernel.ExceptionCollidedUnwind
+Windows.Win32.System.Kernel.ExceptionContinueExecution
+Windows.Win32.System.Kernel.ExceptionContinueSearch
+Windows.Win32.System.Kernel.ExceptionNestedException
+Windows.Win32.System.Kernel.FLOATING_SAVE_AREA
+Windows.Win32.System.Kernel.FLOATING_SAVE_AREA
+Windows.Win32.System.Kernel.OBJ_DONT_REPARSE
+Windows.Win32.System.LibraryLoader.GetModuleFileNameW
+Windows.Win32.System.LibraryLoader.GetModuleHandleA
+Windows.Win32.System.LibraryLoader.GetModuleHandleW
+Windows.Win32.System.LibraryLoader.GetProcAddress
+Windows.Win32.System.Performance.QueryPerformanceCounter
+Windows.Win32.System.Performance.QueryPerformanceFrequency
+Windows.Win32.System.Pipes.CreateNamedPipeW
+Windows.Win32.System.Pipes.NAMED_PIPE_MODE
+Windows.Win32.System.Pipes.PIPE_ACCEPT_REMOTE_CLIENTS
+Windows.Win32.System.Pipes.PIPE_CLIENT_END
+Windows.Win32.System.Pipes.PIPE_NOWAIT
+Windows.Win32.System.Pipes.PIPE_READMODE_BYTE
+Windows.Win32.System.Pipes.PIPE_READMODE_MESSAGE
+Windows.Win32.System.Pipes.PIPE_REJECT_REMOTE_CLIENTS
+Windows.Win32.System.Pipes.PIPE_SERVER_END
+Windows.Win32.System.Pipes.PIPE_TYPE_BYTE
+Windows.Win32.System.Pipes.PIPE_TYPE_MESSAGE
+Windows.Win32.System.Pipes.PIPE_WAIT
+Windows.Win32.System.SystemInformation.GetSystemDirectoryW
+Windows.Win32.System.SystemInformation.GetSystemInfo
+Windows.Win32.System.SystemInformation.GetSystemTimeAsFileTime
+Windows.Win32.System.SystemInformation.GetWindowsDirectoryW
+Windows.Win32.System.SystemInformation.PROCESSOR_ARCHITECTURE
+Windows.Win32.System.SystemInformation.SYSTEM_INFO
+Windows.Win32.System.SystemServices.DLL_PROCESS_DETACH
+Windows.Win32.System.SystemServices.DLL_THREAD_DETACH
+Windows.Win32.System.SystemServices.EXCEPTION_MAXIMUM_PARAMETERS
+Windows.Win32.System.SystemServices.IO_REPARSE_TAG_MOUNT_POINT
+Windows.Win32.System.SystemServices.IO_REPARSE_TAG_SYMLINK
+Windows.Win32.System.Threading.ABOVE_NORMAL_PRIORITY_CLASS
+Windows.Win32.System.Threading.AcquireSRWLockExclusive
+Windows.Win32.System.Threading.AcquireSRWLockShared
+Windows.Win32.System.Threading.BELOW_NORMAL_PRIORITY_CLASS
+Windows.Win32.System.Threading.CREATE_BREAKAWAY_FROM_JOB
+Windows.Win32.System.Threading.CREATE_DEFAULT_ERROR_MODE
+Windows.Win32.System.Threading.CREATE_FORCEDOS
+Windows.Win32.System.Threading.CREATE_IGNORE_SYSTEM_DEFAULT
+Windows.Win32.System.Threading.CREATE_NEW_CONSOLE
+Windows.Win32.System.Threading.CREATE_NEW_PROCESS_GROUP
+Windows.Win32.System.Threading.CREATE_NO_WINDOW
+Windows.Win32.System.Threading.CREATE_PRESERVE_CODE_AUTHZ_LEVEL
+Windows.Win32.System.Threading.CREATE_PROTECTED_PROCESS
+Windows.Win32.System.Threading.CREATE_SECURE_PROCESS
+Windows.Win32.System.Threading.CREATE_SEPARATE_WOW_VDM
+Windows.Win32.System.Threading.CREATE_SHARED_WOW_VDM
+Windows.Win32.System.Threading.CREATE_SUSPENDED
+Windows.Win32.System.Threading.CREATE_UNICODE_ENVIRONMENT
+Windows.Win32.System.Threading.CreateEventW
+Windows.Win32.System.Threading.CreateProcessW
+Windows.Win32.System.Threading.CreateThread
+Windows.Win32.System.Threading.DEBUG_ONLY_THIS_PROCESS
+Windows.Win32.System.Threading.DEBUG_PROCESS
+Windows.Win32.System.Threading.DETACHED_PROCESS
+Windows.Win32.System.Threading.ExitProcess
+Windows.Win32.System.Threading.EXTENDED_STARTUPINFO_PRESENT
+Windows.Win32.System.Threading.GetCurrentProcess
+Windows.Win32.System.Threading.GetCurrentProcessId
+Windows.Win32.System.Threading.GetCurrentThread
+Windows.Win32.System.Threading.GetExitCodeProcess
+Windows.Win32.System.Threading.GetProcessId
+Windows.Win32.System.Threading.HIGH_PRIORITY_CLASS
+Windows.Win32.System.Threading.IDLE_PRIORITY_CLASS
+Windows.Win32.System.Threading.INFINITE
+Windows.Win32.System.Threading.INHERIT_CALLER_PRIORITY
+Windows.Win32.System.Threading.INHERIT_PARENT_AFFINITY
+Windows.Win32.System.Threading.INIT_ONCE_INIT_FAILED
+Windows.Win32.System.Threading.InitOnceBeginInitialize
+Windows.Win32.System.Threading.InitOnceComplete
+Windows.Win32.System.Threading.LPTHREAD_START_ROUTINE
+Windows.Win32.System.Threading.NORMAL_PRIORITY_CLASS
+Windows.Win32.System.Threading.OpenProcessToken
+Windows.Win32.System.Threading.PROCESS_CREATION_FLAGS
+Windows.Win32.System.Threading.PROCESS_INFORMATION
+Windows.Win32.System.Threading.PROCESS_MODE_BACKGROUND_BEGIN
+Windows.Win32.System.Threading.PROCESS_MODE_BACKGROUND_END
+Windows.Win32.System.Threading.PROFILE_KERNEL
+Windows.Win32.System.Threading.PROFILE_SERVER
+Windows.Win32.System.Threading.PROFILE_USER
+Windows.Win32.System.Threading.REALTIME_PRIORITY_CLASS
+Windows.Win32.System.Threading.ReleaseSRWLockExclusive
+Windows.Win32.System.Threading.ReleaseSRWLockShared
+Windows.Win32.System.Threading.RTL_CONDITION_VARIABLE
+Windows.Win32.System.Threading.RTL_RUN_ONCE
+Windows.Win32.System.Threading.RTL_SRWLOCK
+Windows.Win32.System.Threading.SetThreadStackGuarantee
+Windows.Win32.System.Threading.Sleep
+Windows.Win32.System.Threading.SleepConditionVariableSRW
+Windows.Win32.System.Threading.SleepEx
+Windows.Win32.System.Threading.STACK_SIZE_PARAM_IS_A_RESERVATION
+Windows.Win32.System.Threading.STARTF_FORCEOFFFEEDBACK
+Windows.Win32.System.Threading.STARTF_FORCEONFEEDBACK
+Windows.Win32.System.Threading.STARTF_PREVENTPINNING
+Windows.Win32.System.Threading.STARTF_RUNFULLSCREEN
+Windows.Win32.System.Threading.STARTF_TITLEISAPPID
+Windows.Win32.System.Threading.STARTF_TITLEISLINKNAME
+Windows.Win32.System.Threading.STARTF_UNTRUSTEDSOURCE
+Windows.Win32.System.Threading.STARTF_USECOUNTCHARS
+Windows.Win32.System.Threading.STARTF_USEFILLATTRIBUTE
+Windows.Win32.System.Threading.STARTF_USEHOTKEY
+Windows.Win32.System.Threading.STARTF_USEPOSITION
+Windows.Win32.System.Threading.STARTF_USESHOWWINDOW
+Windows.Win32.System.Threading.STARTF_USESIZE
+Windows.Win32.System.Threading.STARTF_USESTDHANDLES
+Windows.Win32.System.Threading.STARTUPINFOW
+Windows.Win32.System.Threading.STARTUPINFOW_FLAGS
+Windows.Win32.System.Threading.SwitchToThread
+Windows.Win32.System.Threading.TerminateProcess
+Windows.Win32.System.Threading.THREAD_CREATE_RUN_IMMEDIATELY
+Windows.Win32.System.Threading.THREAD_CREATE_SUSPENDED
+Windows.Win32.System.Threading.THREAD_CREATION_FLAGS
+Windows.Win32.System.Threading.TLS_OUT_OF_INDEXES
+Windows.Win32.System.Threading.TlsAlloc
+Windows.Win32.System.Threading.TlsFree
+Windows.Win32.System.Threading.TlsGetValue
+Windows.Win32.System.Threading.TlsSetValue
+Windows.Win32.System.Threading.TryAcquireSRWLockExclusive
+Windows.Win32.System.Threading.TryAcquireSRWLockShared
+Windows.Win32.System.Threading.WaitForMultipleObjects
+Windows.Win32.System.Threading.WaitForSingleObject
+Windows.Win32.System.Threading.WakeAllConditionVariable
+Windows.Win32.System.Threading.WakeConditionVariable
+Windows.Win32.System.WindowsProgramming.IO_STATUS_BLOCK
+Windows.Win32.System.WindowsProgramming.OBJECT_ATTRIBUTES
+Windows.Win32.System.WindowsProgramming.PROGRESS_CONTINUE
+Windows.Win32.UI.Shell.GetUserProfileDirectoryW
+// tidy-alphabetical-end
+
diff --git a/library/std/src/sys/windows/c/windows_sys.rs b/library/std/src/sys/windows/c/windows_sys.rs
new file mode 100644
index 0000000..36a30f6
--- /dev/null
+++ b/library/std/src/sys/windows/c/windows_sys.rs
@@ -0,0 +1,4276 @@
+// This file is autogenerated.
+//
+// To add bindings, edit windows_sys.lst then use `./x run generate-windows-sys` to
+// regenerate the bindings.
+//
+// ignore-tidy-filelength
+// Bindings generated by `windows-bindgen` 0.49.0
+
+#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
+#[link(name = "advapi32")]
+extern "system" {
+ pub fn OpenProcessToken(
+ processhandle: HANDLE,
+ desiredaccess: TOKEN_ACCESS_MASK,
+ tokenhandle: *mut HANDLE,
+ ) -> BOOL;
+}
+#[link(name = "advapi32")]
+extern "system" {
+ #[link_name = "SystemFunction036"]
+ pub fn RtlGenRandom(randombuffer: *mut ::core::ffi::c_void, randombufferlength: u32)
+ -> BOOLEAN;
+}
+#[link(name = "bcrypt")]
+extern "system" {
+ pub fn BCryptGenRandom(
+ halgorithm: BCRYPT_ALG_HANDLE,
+ pbbuffer: *mut u8,
+ cbbuffer: u32,
+ dwflags: BCRYPTGENRANDOM_FLAGS,
+ ) -> NTSTATUS;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn AcquireSRWLockExclusive(srwlock: *mut RTL_SRWLOCK) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn AcquireSRWLockShared(srwlock: *mut RTL_SRWLOCK) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn AddVectoredExceptionHandler(
+ first: u32,
+ handler: PVECTORED_EXCEPTION_HANDLER,
+ ) -> *mut ::core::ffi::c_void;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CancelIo(hfile: HANDLE) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CloseHandle(hobject: HANDLE) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CompareStringOrdinal(
+ lpstring1: PCWSTR,
+ cchcount1: i32,
+ lpstring2: PCWSTR,
+ cchcount2: i32,
+ bignorecase: BOOL,
+ ) -> COMPARESTRING_RESULT;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CopyFileExW(
+ lpexistingfilename: PCWSTR,
+ lpnewfilename: PCWSTR,
+ lpprogressroutine: LPPROGRESS_ROUTINE,
+ lpdata: *const ::core::ffi::c_void,
+ pbcancel: *mut i32,
+ dwcopyflags: u32,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateDirectoryW(
+ lppathname: PCWSTR,
+ lpsecurityattributes: *const SECURITY_ATTRIBUTES,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateEventW(
+ lpeventattributes: *const SECURITY_ATTRIBUTES,
+ bmanualreset: BOOL,
+ binitialstate: BOOL,
+ lpname: PCWSTR,
+ ) -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateFileW(
+ lpfilename: PCWSTR,
+ dwdesiredaccess: u32,
+ dwsharemode: FILE_SHARE_MODE,
+ lpsecurityattributes: *const SECURITY_ATTRIBUTES,
+ dwcreationdisposition: FILE_CREATION_DISPOSITION,
+ dwflagsandattributes: FILE_FLAGS_AND_ATTRIBUTES,
+ htemplatefile: HANDLE,
+ ) -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateHardLinkW(
+ lpfilename: PCWSTR,
+ lpexistingfilename: PCWSTR,
+ lpsecurityattributes: *const SECURITY_ATTRIBUTES,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateNamedPipeW(
+ lpname: PCWSTR,
+ dwopenmode: FILE_FLAGS_AND_ATTRIBUTES,
+ dwpipemode: NAMED_PIPE_MODE,
+ nmaxinstances: u32,
+ noutbuffersize: u32,
+ ninbuffersize: u32,
+ ndefaulttimeout: u32,
+ lpsecurityattributes: *const SECURITY_ATTRIBUTES,
+ ) -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateProcessW(
+ lpapplicationname: PCWSTR,
+ lpcommandline: PWSTR,
+ lpprocessattributes: *const SECURITY_ATTRIBUTES,
+ lpthreadattributes: *const SECURITY_ATTRIBUTES,
+ binherithandles: BOOL,
+ dwcreationflags: PROCESS_CREATION_FLAGS,
+ lpenvironment: *const ::core::ffi::c_void,
+ lpcurrentdirectory: PCWSTR,
+ lpstartupinfo: *const STARTUPINFOW,
+ lpprocessinformation: *mut PROCESS_INFORMATION,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateSymbolicLinkW(
+ lpsymlinkfilename: PCWSTR,
+ lptargetfilename: PCWSTR,
+ dwflags: SYMBOLIC_LINK_FLAGS,
+ ) -> BOOLEAN;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn CreateThread(
+ lpthreadattributes: *const SECURITY_ATTRIBUTES,
+ dwstacksize: usize,
+ lpstartaddress: LPTHREAD_START_ROUTINE,
+ lpparameter: *const ::core::ffi::c_void,
+ dwcreationflags: THREAD_CREATION_FLAGS,
+ lpthreadid: *mut u32,
+ ) -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn DeleteFileW(lpfilename: PCWSTR) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn DeviceIoControl(
+ hdevice: HANDLE,
+ dwiocontrolcode: u32,
+ lpinbuffer: *const ::core::ffi::c_void,
+ ninbuffersize: u32,
+ lpoutbuffer: *mut ::core::ffi::c_void,
+ noutbuffersize: u32,
+ lpbytesreturned: *mut u32,
+ lpoverlapped: *mut OVERLAPPED,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn DuplicateHandle(
+ hsourceprocesshandle: HANDLE,
+ hsourcehandle: HANDLE,
+ htargetprocesshandle: HANDLE,
+ lptargethandle: *mut HANDLE,
+ dwdesiredaccess: u32,
+ binherithandle: BOOL,
+ dwoptions: DUPLICATE_HANDLE_OPTIONS,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ExitProcess(uexitcode: u32) -> !;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FindClose(hfindfile: FindFileHandle) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FindFirstFileW(
+ lpfilename: PCWSTR,
+ lpfindfiledata: *mut WIN32_FIND_DATAW,
+ ) -> FindFileHandle;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FindNextFileW(hfindfile: FindFileHandle, lpfindfiledata: *mut WIN32_FIND_DATAW) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FlushFileBuffers(hfile: HANDLE) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FormatMessageW(
+ dwflags: FORMAT_MESSAGE_OPTIONS,
+ lpsource: *const ::core::ffi::c_void,
+ dwmessageid: u32,
+ dwlanguageid: u32,
+ lpbuffer: PWSTR,
+ nsize: u32,
+ arguments: *const *const i8,
+ ) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn FreeEnvironmentStringsW(penv: PCWSTR) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetCommandLineW() -> PCWSTR;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetConsoleMode(hconsolehandle: HANDLE, lpmode: *mut CONSOLE_MODE) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetCurrentDirectoryW(nbufferlength: u32, lpbuffer: PWSTR) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetCurrentProcess() -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetCurrentProcessId() -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetCurrentThread() -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetEnvironmentStringsW() -> PWSTR;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetEnvironmentVariableW(lpname: PCWSTR, lpbuffer: PWSTR, nsize: u32) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetExitCodeProcess(hprocess: HANDLE, lpexitcode: *mut u32) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFileAttributesW(lpfilename: PCWSTR) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFileInformationByHandle(
+ hfile: HANDLE,
+ lpfileinformation: *mut BY_HANDLE_FILE_INFORMATION,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFileInformationByHandleEx(
+ hfile: HANDLE,
+ fileinformationclass: FILE_INFO_BY_HANDLE_CLASS,
+ lpfileinformation: *mut ::core::ffi::c_void,
+ dwbuffersize: u32,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFileType(hfile: HANDLE) -> FILE_TYPE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFinalPathNameByHandleW(
+ hfile: HANDLE,
+ lpszfilepath: PWSTR,
+ cchfilepath: u32,
+ dwflags: GETFINALPATHNAMEBYHANDLE_FLAGS,
+ ) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetFullPathNameW(
+ lpfilename: PCWSTR,
+ nbufferlength: u32,
+ lpbuffer: PWSTR,
+ lpfilepart: *mut PWSTR,
+ ) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetLastError() -> WIN32_ERROR;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetModuleFileNameW(hmodule: HMODULE, lpfilename: PWSTR, nsize: u32) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetModuleHandleA(lpmodulename: PCSTR) -> HMODULE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetModuleHandleW(lpmodulename: PCWSTR) -> HMODULE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetOverlappedResult(
+ hfile: HANDLE,
+ lpoverlapped: *const OVERLAPPED,
+ lpnumberofbytestransferred: *mut u32,
+ bwait: BOOL,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetProcAddress(hmodule: HMODULE, lpprocname: PCSTR) -> FARPROC;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetProcessId(process: HANDLE) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetStdHandle(nstdhandle: STD_HANDLE) -> HANDLE;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetSystemDirectoryW(lpbuffer: PWSTR, usize: u32) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetSystemInfo(lpsysteminfo: *mut SYSTEM_INFO) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetSystemTimeAsFileTime(lpsystemtimeasfiletime: *mut FILETIME) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetTempPathW(nbufferlength: u32, lpbuffer: PWSTR) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn GetWindowsDirectoryW(lpbuffer: PWSTR, usize: u32) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn InitOnceBeginInitialize(
+ lpinitonce: *mut RTL_RUN_ONCE,
+ dwflags: u32,
+ fpending: *mut BOOL,
+ lpcontext: *mut *mut ::core::ffi::c_void,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn InitOnceComplete(
+ lpinitonce: *mut RTL_RUN_ONCE,
+ dwflags: u32,
+ lpcontext: *const ::core::ffi::c_void,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn MoveFileExW(
+ lpexistingfilename: PCWSTR,
+ lpnewfilename: PCWSTR,
+ dwflags: MOVE_FILE_FLAGS,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn MultiByteToWideChar(
+ codepage: u32,
+ dwflags: MULTI_BYTE_TO_WIDE_CHAR_FLAGS,
+ lpmultibytestr: PCSTR,
+ cbmultibyte: i32,
+ lpwidecharstr: PWSTR,
+ cchwidechar: i32,
+ ) -> i32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn QueryPerformanceCounter(lpperformancecount: *mut i64) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn QueryPerformanceFrequency(lpfrequency: *mut i64) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ReadConsoleW(
+ hconsoleinput: HANDLE,
+ lpbuffer: *mut ::core::ffi::c_void,
+ nnumberofcharstoread: u32,
+ lpnumberofcharsread: *mut u32,
+ pinputcontrol: *const CONSOLE_READCONSOLE_CONTROL,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ReadFile(
+ hfile: HANDLE,
+ lpbuffer: *mut ::core::ffi::c_void,
+ nnumberofbytestoread: u32,
+ lpnumberofbytesread: *mut u32,
+ lpoverlapped: *mut OVERLAPPED,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ReadFileEx(
+ hfile: HANDLE,
+ lpbuffer: *mut ::core::ffi::c_void,
+ nnumberofbytestoread: u32,
+ lpoverlapped: *mut OVERLAPPED,
+ lpcompletionroutine: LPOVERLAPPED_COMPLETION_ROUTINE,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ReleaseSRWLockExclusive(srwlock: *mut RTL_SRWLOCK) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn ReleaseSRWLockShared(srwlock: *mut RTL_SRWLOCK) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn RemoveDirectoryW(lppathname: PCWSTR) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetCurrentDirectoryW(lppathname: PCWSTR) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetEnvironmentVariableW(lpname: PCWSTR, lpvalue: PCWSTR) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetFileAttributesW(
+ lpfilename: PCWSTR,
+ dwfileattributes: FILE_FLAGS_AND_ATTRIBUTES,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetFileInformationByHandle(
+ hfile: HANDLE,
+ fileinformationclass: FILE_INFO_BY_HANDLE_CLASS,
+ lpfileinformation: *const ::core::ffi::c_void,
+ dwbuffersize: u32,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetFilePointerEx(
+ hfile: HANDLE,
+ lidistancetomove: i64,
+ lpnewfilepointer: *mut i64,
+ dwmovemethod: SET_FILE_POINTER_MOVE_METHOD,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetFileTime(
+ hfile: HANDLE,
+ lpcreationtime: *const FILETIME,
+ lplastaccesstime: *const FILETIME,
+ lplastwritetime: *const FILETIME,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetHandleInformation(hobject: HANDLE, dwmask: u32, dwflags: HANDLE_FLAGS) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetLastError(dwerrcode: WIN32_ERROR) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SetThreadStackGuarantee(stacksizeinbytes: *mut u32) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn Sleep(dwmilliseconds: u32) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SleepConditionVariableSRW(
+ conditionvariable: *mut RTL_CONDITION_VARIABLE,
+ srwlock: *mut RTL_SRWLOCK,
+ dwmilliseconds: u32,
+ flags: u32,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SleepEx(dwmilliseconds: u32, balertable: BOOL) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn SwitchToThread() -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TerminateProcess(hprocess: HANDLE, uexitcode: u32) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TlsAlloc() -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TlsFree(dwtlsindex: u32) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TlsGetValue(dwtlsindex: u32) -> *mut ::core::ffi::c_void;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TlsSetValue(dwtlsindex: u32, lptlsvalue: *const ::core::ffi::c_void) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TryAcquireSRWLockExclusive(srwlock: *mut RTL_SRWLOCK) -> BOOLEAN;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn TryAcquireSRWLockShared(srwlock: *mut RTL_SRWLOCK) -> BOOLEAN;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WaitForMultipleObjects(
+ ncount: u32,
+ lphandles: *const HANDLE,
+ bwaitall: BOOL,
+ dwmilliseconds: u32,
+ ) -> WIN32_ERROR;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WaitForSingleObject(hhandle: HANDLE, dwmilliseconds: u32) -> WIN32_ERROR;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WakeAllConditionVariable(conditionvariable: *mut RTL_CONDITION_VARIABLE) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WakeConditionVariable(conditionvariable: *mut RTL_CONDITION_VARIABLE) -> ();
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WideCharToMultiByte(
+ codepage: u32,
+ dwflags: u32,
+ lpwidecharstr: PCWSTR,
+ cchwidechar: i32,
+ lpmultibytestr: PSTR,
+ cbmultibyte: i32,
+ lpdefaultchar: PCSTR,
+ lpuseddefaultchar: *mut i32,
+ ) -> i32;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WriteConsoleW(
+ hconsoleoutput: HANDLE,
+ lpbuffer: *const ::core::ffi::c_void,
+ nnumberofcharstowrite: u32,
+ lpnumberofcharswritten: *mut u32,
+ lpreserved: *const ::core::ffi::c_void,
+ ) -> BOOL;
+}
+#[link(name = "kernel32")]
+extern "system" {
+ pub fn WriteFileEx(
+ hfile: HANDLE,
+ lpbuffer: *const u8,
+ nnumberofbytestowrite: u32,
+ lpoverlapped: *mut OVERLAPPED,
+ lpcompletionroutine: LPOVERLAPPED_COMPLETION_ROUTINE,
+ ) -> BOOL;
+}
+#[link(name = "ntdll")]
+extern "system" {
+ pub fn NtCreateFile(
+ filehandle: *mut HANDLE,
+ desiredaccess: FILE_ACCESS_RIGHTS,
+ objectattributes: *const OBJECT_ATTRIBUTES,
+ iostatusblock: *mut IO_STATUS_BLOCK,
+ allocationsize: *const i64,
+ fileattributes: FILE_FLAGS_AND_ATTRIBUTES,
+ shareaccess: FILE_SHARE_MODE,
+ createdisposition: NTCREATEFILE_CREATE_DISPOSITION,
+ createoptions: NTCREATEFILE_CREATE_OPTIONS,
+ eabuffer: *const ::core::ffi::c_void,
+ ealength: u32,
+ ) -> NTSTATUS;
+}
+#[link(name = "ntdll")]
+extern "system" {
+ pub fn NtReadFile(
+ filehandle: HANDLE,
+ event: HANDLE,
+ apcroutine: PIO_APC_ROUTINE,
+ apccontext: *const ::core::ffi::c_void,
+ iostatusblock: *mut IO_STATUS_BLOCK,
+ buffer: *mut ::core::ffi::c_void,
+ length: u32,
+ byteoffset: *const i64,
+ key: *const u32,
+ ) -> NTSTATUS;
+}
+#[link(name = "ntdll")]
+extern "system" {
+ pub fn NtWriteFile(
+ filehandle: HANDLE,
+ event: HANDLE,
+ apcroutine: PIO_APC_ROUTINE,
+ apccontext: *const ::core::ffi::c_void,
+ iostatusblock: *mut IO_STATUS_BLOCK,
+ buffer: *const ::core::ffi::c_void,
+ length: u32,
+ byteoffset: *const i64,
+ key: *const u32,
+ ) -> NTSTATUS;
+}
+#[link(name = "ntdll")]
+extern "system" {
+ pub fn RtlNtStatusToDosError(status: NTSTATUS) -> u32;
+}
+#[link(name = "userenv")]
+extern "system" {
+ pub fn GetUserProfileDirectoryW(
+ htoken: HANDLE,
+ lpprofiledir: PWSTR,
+ lpcchsize: *mut u32,
+ ) -> BOOL;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSACleanup() -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSADuplicateSocketW(
+ s: SOCKET,
+ dwprocessid: u32,
+ lpprotocolinfo: *mut WSAPROTOCOL_INFOW,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSAGetLastError() -> WSA_ERROR;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSARecv(
+ s: SOCKET,
+ lpbuffers: *const WSABUF,
+ dwbuffercount: u32,
+ lpnumberofbytesrecvd: *mut u32,
+ lpflags: *mut u32,
+ lpoverlapped: *mut OVERLAPPED,
+ lpcompletionroutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSASend(
+ s: SOCKET,
+ lpbuffers: *const WSABUF,
+ dwbuffercount: u32,
+ lpnumberofbytessent: *mut u32,
+ dwflags: u32,
+ lpoverlapped: *mut OVERLAPPED,
+ lpcompletionroutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSASocketW(
+ af: i32,
+ r#type: i32,
+ protocol: i32,
+ lpprotocolinfo: *const WSAPROTOCOL_INFOW,
+ g: u32,
+ dwflags: u32,
+ ) -> SOCKET;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn accept(s: SOCKET, addr: *mut SOCKADDR, addrlen: *mut i32) -> SOCKET;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn bind(s: SOCKET, name: *const SOCKADDR, namelen: i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn closesocket(s: SOCKET) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn connect(s: SOCKET, name: *const SOCKADDR, namelen: i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn freeaddrinfo(paddrinfo: *const ADDRINFOA) -> ();
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn getaddrinfo(
+ pnodename: PCSTR,
+ pservicename: PCSTR,
+ phints: *const ADDRINFOA,
+ ppresult: *mut *mut ADDRINFOA,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn getpeername(s: SOCKET, name: *mut SOCKADDR, namelen: *mut i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn getsockname(s: SOCKET, name: *mut SOCKADDR, namelen: *mut i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn getsockopt(s: SOCKET, level: i32, optname: i32, optval: PSTR, optlen: *mut i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn ioctlsocket(s: SOCKET, cmd: i32, argp: *mut u32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn listen(s: SOCKET, backlog: i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn recv(s: SOCKET, buf: PSTR, len: i32, flags: SEND_RECV_FLAGS) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn recvfrom(
+ s: SOCKET,
+ buf: PSTR,
+ len: i32,
+ flags: i32,
+ from: *mut SOCKADDR,
+ fromlen: *mut i32,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn select(
+ nfds: i32,
+ readfds: *mut FD_SET,
+ writefds: *mut FD_SET,
+ exceptfds: *mut FD_SET,
+ timeout: *const TIMEVAL,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn send(s: SOCKET, buf: PCSTR, len: i32, flags: SEND_RECV_FLAGS) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn sendto(
+ s: SOCKET,
+ buf: PCSTR,
+ len: i32,
+ flags: i32,
+ to: *const SOCKADDR,
+ tolen: i32,
+ ) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn setsockopt(s: SOCKET, level: i32, optname: i32, optval: PCSTR, optlen: i32) -> i32;
+}
+#[link(name = "ws2_32")]
+extern "system" {
+ pub fn shutdown(s: SOCKET, how: WINSOCK_SHUTDOWN_HOW) -> i32;
+}
+pub const ABOVE_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 32768u32;
+pub type ADDRESS_FAMILY = u16;
+#[repr(C)]
+pub struct ADDRINFOA {
+ pub ai_flags: i32,
+ pub ai_family: i32,
+ pub ai_socktype: i32,
+ pub ai_protocol: i32,
+ pub ai_addrlen: usize,
+ pub ai_canonname: PSTR,
+ pub ai_addr: *mut SOCKADDR,
+ pub ai_next: *mut ADDRINFOA,
+}
+impl ::core::marker::Copy for ADDRINFOA {}
+impl ::core::clone::Clone for ADDRINFOA {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const AF_INET: ADDRESS_FAMILY = 2u16;
+pub const AF_INET6: ADDRESS_FAMILY = 23u16;
+pub const AF_UNSPEC: ADDRESS_FAMILY = 0u16;
+#[repr(C)]
+pub union ARM64_NT_NEON128 {
+ pub Anonymous: ARM64_NT_NEON128_0,
+ pub D: [f64; 2],
+ pub S: [f32; 4],
+ pub H: [u16; 8],
+ pub B: [u8; 16],
+}
+impl ::core::marker::Copy for ARM64_NT_NEON128 {}
+impl ::core::clone::Clone for ARM64_NT_NEON128 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct ARM64_NT_NEON128_0 {
+ pub Low: u64,
+ pub High: i64,
+}
+impl ::core::marker::Copy for ARM64_NT_NEON128_0 {}
+impl ::core::clone::Clone for ARM64_NT_NEON128_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type BCRYPTGENRANDOM_FLAGS = u32;
+pub type BCRYPT_ALG_HANDLE = *mut ::core::ffi::c_void;
+pub const BCRYPT_USE_SYSTEM_PREFERRED_RNG: BCRYPTGENRANDOM_FLAGS = 2u32;
+pub const BELOW_NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 16384u32;
+pub type BOOL = i32;
+pub type BOOLEAN = u8;
+#[repr(C)]
+pub struct BY_HANDLE_FILE_INFORMATION {
+ pub dwFileAttributes: u32,
+ pub ftCreationTime: FILETIME,
+ pub ftLastAccessTime: FILETIME,
+ pub ftLastWriteTime: FILETIME,
+ pub dwVolumeSerialNumber: u32,
+ pub nFileSizeHigh: u32,
+ pub nFileSizeLow: u32,
+ pub nNumberOfLinks: u32,
+ pub nFileIndexHigh: u32,
+ pub nFileIndexLow: u32,
+}
+impl ::core::marker::Copy for BY_HANDLE_FILE_INFORMATION {}
+impl ::core::clone::Clone for BY_HANDLE_FILE_INFORMATION {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const CALLBACK_CHUNK_FINISHED: LPPROGRESS_ROUTINE_CALLBACK_REASON = 0u32;
+pub const CALLBACK_STREAM_SWITCH: LPPROGRESS_ROUTINE_CALLBACK_REASON = 1u32;
+pub type COMPARESTRING_RESULT = u32;
+pub type CONSOLE_MODE = u32;
+#[repr(C)]
+pub struct CONSOLE_READCONSOLE_CONTROL {
+ pub nLength: u32,
+ pub nInitialChars: u32,
+ pub dwCtrlWakeupMask: u32,
+ pub dwControlKeyState: u32,
+}
+impl ::core::marker::Copy for CONSOLE_READCONSOLE_CONTROL {}
+impl ::core::clone::Clone for CONSOLE_READCONSOLE_CONTROL {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "aarch64")]
+pub struct CONTEXT {
+ pub ContextFlags: u32,
+ pub Cpsr: u32,
+ pub Anonymous: CONTEXT_0,
+ pub Sp: u64,
+ pub Pc: u64,
+ pub V: [ARM64_NT_NEON128; 32],
+ pub Fpcr: u32,
+ pub Fpsr: u32,
+ pub Bcr: [u32; 8],
+ pub Bvr: [u64; 8],
+ pub Wcr: [u32; 2],
+ pub Wvr: [u64; 2],
+}
+#[cfg(target_arch = "aarch64")]
+impl ::core::marker::Copy for CONTEXT {}
+#[cfg(target_arch = "aarch64")]
+impl ::core::clone::Clone for CONTEXT {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "aarch64")]
+pub union CONTEXT_0 {
+ pub Anonymous: CONTEXT_0_0,
+ pub X: [u64; 31],
+}
+#[cfg(target_arch = "aarch64")]
+impl ::core::marker::Copy for CONTEXT_0 {}
+#[cfg(target_arch = "aarch64")]
+impl ::core::clone::Clone for CONTEXT_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "aarch64")]
+pub struct CONTEXT_0_0 {
+ pub X0: u64,
+ pub X1: u64,
+ pub X2: u64,
+ pub X3: u64,
+ pub X4: u64,
+ pub X5: u64,
+ pub X6: u64,
+ pub X7: u64,
+ pub X8: u64,
+ pub X9: u64,
+ pub X10: u64,
+ pub X11: u64,
+ pub X12: u64,
+ pub X13: u64,
+ pub X14: u64,
+ pub X15: u64,
+ pub X16: u64,
+ pub X17: u64,
+ pub X18: u64,
+ pub X19: u64,
+ pub X20: u64,
+ pub X21: u64,
+ pub X22: u64,
+ pub X23: u64,
+ pub X24: u64,
+ pub X25: u64,
+ pub X26: u64,
+ pub X27: u64,
+ pub X28: u64,
+ pub Fp: u64,
+ pub Lr: u64,
+}
+#[cfg(target_arch = "aarch64")]
+impl ::core::marker::Copy for CONTEXT_0_0 {}
+#[cfg(target_arch = "aarch64")]
+impl ::core::clone::Clone for CONTEXT_0_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86_64")]
+pub struct CONTEXT {
+ pub P1Home: u64,
+ pub P2Home: u64,
+ pub P3Home: u64,
+ pub P4Home: u64,
+ pub P5Home: u64,
+ pub P6Home: u64,
+ pub ContextFlags: u32,
+ pub MxCsr: u32,
+ pub SegCs: u16,
+ pub SegDs: u16,
+ pub SegEs: u16,
+ pub SegFs: u16,
+ pub SegGs: u16,
+ pub SegSs: u16,
+ pub EFlags: u32,
+ pub Dr0: u64,
+ pub Dr1: u64,
+ pub Dr2: u64,
+ pub Dr3: u64,
+ pub Dr6: u64,
+ pub Dr7: u64,
+ pub Rax: u64,
+ pub Rcx: u64,
+ pub Rdx: u64,
+ pub Rbx: u64,
+ pub Rsp: u64,
+ pub Rbp: u64,
+ pub Rsi: u64,
+ pub Rdi: u64,
+ pub R8: u64,
+ pub R9: u64,
+ pub R10: u64,
+ pub R11: u64,
+ pub R12: u64,
+ pub R13: u64,
+ pub R14: u64,
+ pub R15: u64,
+ pub Rip: u64,
+ pub Anonymous: CONTEXT_0,
+ pub VectorRegister: [M128A; 26],
+ pub VectorControl: u64,
+ pub DebugControl: u64,
+ pub LastBranchToRip: u64,
+ pub LastBranchFromRip: u64,
+ pub LastExceptionToRip: u64,
+ pub LastExceptionFromRip: u64,
+}
+#[cfg(target_arch = "x86_64")]
+impl ::core::marker::Copy for CONTEXT {}
+#[cfg(target_arch = "x86_64")]
+impl ::core::clone::Clone for CONTEXT {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86_64")]
+pub union CONTEXT_0 {
+ pub FltSave: XSAVE_FORMAT,
+ pub Anonymous: CONTEXT_0_0,
+}
+#[cfg(target_arch = "x86_64")]
+impl ::core::marker::Copy for CONTEXT_0 {}
+#[cfg(target_arch = "x86_64")]
+impl ::core::clone::Clone for CONTEXT_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86_64")]
+pub struct CONTEXT_0_0 {
+ pub Header: [M128A; 2],
+ pub Legacy: [M128A; 8],
+ pub Xmm0: M128A,
+ pub Xmm1: M128A,
+ pub Xmm2: M128A,
+ pub Xmm3: M128A,
+ pub Xmm4: M128A,
+ pub Xmm5: M128A,
+ pub Xmm6: M128A,
+ pub Xmm7: M128A,
+ pub Xmm8: M128A,
+ pub Xmm9: M128A,
+ pub Xmm10: M128A,
+ pub Xmm11: M128A,
+ pub Xmm12: M128A,
+ pub Xmm13: M128A,
+ pub Xmm14: M128A,
+ pub Xmm15: M128A,
+}
+#[cfg(target_arch = "x86_64")]
+impl ::core::marker::Copy for CONTEXT_0_0 {}
+#[cfg(target_arch = "x86_64")]
+impl ::core::clone::Clone for CONTEXT_0_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86")]
+pub struct CONTEXT {
+ pub ContextFlags: u32,
+ pub Dr0: u32,
+ pub Dr1: u32,
+ pub Dr2: u32,
+ pub Dr3: u32,
+ pub Dr6: u32,
+ pub Dr7: u32,
+ pub FloatSave: FLOATING_SAVE_AREA,
+ pub SegGs: u32,
+ pub SegFs: u32,
+ pub SegEs: u32,
+ pub SegDs: u32,
+ pub Edi: u32,
+ pub Esi: u32,
+ pub Ebx: u32,
+ pub Edx: u32,
+ pub Ecx: u32,
+ pub Eax: u32,
+ pub Ebp: u32,
+ pub Eip: u32,
+ pub SegCs: u32,
+ pub EFlags: u32,
+ pub Esp: u32,
+ pub SegSs: u32,
+ pub ExtendedRegisters: [u8; 512],
+}
+#[cfg(target_arch = "x86")]
+impl ::core::marker::Copy for CONTEXT {}
+#[cfg(target_arch = "x86")]
+impl ::core::clone::Clone for CONTEXT {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const CP_UTF8: u32 = 65001u32;
+pub const CREATE_ALWAYS: FILE_CREATION_DISPOSITION = 2u32;
+pub const CREATE_BREAKAWAY_FROM_JOB: PROCESS_CREATION_FLAGS = 16777216u32;
+pub const CREATE_DEFAULT_ERROR_MODE: PROCESS_CREATION_FLAGS = 67108864u32;
+pub const CREATE_FORCEDOS: PROCESS_CREATION_FLAGS = 8192u32;
+pub const CREATE_IGNORE_SYSTEM_DEFAULT: PROCESS_CREATION_FLAGS = 2147483648u32;
+pub const CREATE_NEW: FILE_CREATION_DISPOSITION = 1u32;
+pub const CREATE_NEW_CONSOLE: PROCESS_CREATION_FLAGS = 16u32;
+pub const CREATE_NEW_PROCESS_GROUP: PROCESS_CREATION_FLAGS = 512u32;
+pub const CREATE_NO_WINDOW: PROCESS_CREATION_FLAGS = 134217728u32;
+pub const CREATE_PRESERVE_CODE_AUTHZ_LEVEL: PROCESS_CREATION_FLAGS = 33554432u32;
+pub const CREATE_PROTECTED_PROCESS: PROCESS_CREATION_FLAGS = 262144u32;
+pub const CREATE_SECURE_PROCESS: PROCESS_CREATION_FLAGS = 4194304u32;
+pub const CREATE_SEPARATE_WOW_VDM: PROCESS_CREATION_FLAGS = 2048u32;
+pub const CREATE_SHARED_WOW_VDM: PROCESS_CREATION_FLAGS = 4096u32;
+pub const CREATE_SUSPENDED: PROCESS_CREATION_FLAGS = 4u32;
+pub const CREATE_UNICODE_ENVIRONMENT: PROCESS_CREATION_FLAGS = 1024u32;
+pub const CSTR_EQUAL: COMPARESTRING_RESULT = 2u32;
+pub const CSTR_GREATER_THAN: COMPARESTRING_RESULT = 3u32;
+pub const CSTR_LESS_THAN: COMPARESTRING_RESULT = 1u32;
+pub const DEBUG_ONLY_THIS_PROCESS: PROCESS_CREATION_FLAGS = 2u32;
+pub const DEBUG_PROCESS: PROCESS_CREATION_FLAGS = 1u32;
+pub const DELETE: FILE_ACCESS_RIGHTS = 65536u32;
+pub const DETACHED_PROCESS: PROCESS_CREATION_FLAGS = 8u32;
+pub const DISABLE_NEWLINE_AUTO_RETURN: CONSOLE_MODE = 8u32;
+pub const DLL_PROCESS_DETACH: u32 = 0u32;
+pub const DLL_THREAD_DETACH: u32 = 3u32;
+pub const DNS_ERROR_ADDRESS_REQUIRED: WIN32_ERROR = 9573u32;
+pub const DNS_ERROR_ALIAS_LOOP: WIN32_ERROR = 9722u32;
+pub const DNS_ERROR_AUTOZONE_ALREADY_EXISTS: WIN32_ERROR = 9610u32;
+pub const DNS_ERROR_AXFR: WIN32_ERROR = 9752u32;
+pub const DNS_ERROR_BACKGROUND_LOADING: WIN32_ERROR = 9568u32;
+pub const DNS_ERROR_BAD_KEYMASTER: WIN32_ERROR = 9122u32;
+pub const DNS_ERROR_BAD_PACKET: WIN32_ERROR = 9502u32;
+pub const DNS_ERROR_CANNOT_FIND_ROOT_HINTS: WIN32_ERROR = 9564u32;
+pub const DNS_ERROR_CLIENT_SUBNET_ALREADY_EXISTS: WIN32_ERROR = 9977u32;
+pub const DNS_ERROR_CLIENT_SUBNET_DOES_NOT_EXIST: WIN32_ERROR = 9976u32;
+pub const DNS_ERROR_CLIENT_SUBNET_IS_ACCESSED: WIN32_ERROR = 9975u32;
+pub const DNS_ERROR_CNAME_COLLISION: WIN32_ERROR = 9709u32;
+pub const DNS_ERROR_CNAME_LOOP: WIN32_ERROR = 9707u32;
+pub const DNS_ERROR_DATAFILE_OPEN_FAILURE: WIN32_ERROR = 9653u32;
+pub const DNS_ERROR_DATAFILE_PARSING: WIN32_ERROR = 9655u32;
+pub const DNS_ERROR_DEFAULT_SCOPE: WIN32_ERROR = 9960u32;
+pub const DNS_ERROR_DEFAULT_VIRTUALIZATION_INSTANCE: WIN32_ERROR = 9925u32;
+pub const DNS_ERROR_DEFAULT_ZONESCOPE: WIN32_ERROR = 9953u32;
+pub const DNS_ERROR_DELEGATION_REQUIRED: WIN32_ERROR = 9571u32;
+pub const DNS_ERROR_DNAME_COLLISION: WIN32_ERROR = 9721u32;
+pub const DNS_ERROR_DNSSEC_IS_DISABLED: WIN32_ERROR = 9125u32;
+pub const DNS_ERROR_DP_ALREADY_ENLISTED: WIN32_ERROR = 9904u32;
+pub const DNS_ERROR_DP_ALREADY_EXISTS: WIN32_ERROR = 9902u32;
+pub const DNS_ERROR_DP_DOES_NOT_EXIST: WIN32_ERROR = 9901u32;
+pub const DNS_ERROR_DP_FSMO_ERROR: WIN32_ERROR = 9906u32;
+pub const DNS_ERROR_DP_NOT_AVAILABLE: WIN32_ERROR = 9905u32;
+pub const DNS_ERROR_DP_NOT_ENLISTED: WIN32_ERROR = 9903u32;
+pub const DNS_ERROR_DS_UNAVAILABLE: WIN32_ERROR = 9717u32;
+pub const DNS_ERROR_DS_ZONE_ALREADY_EXISTS: WIN32_ERROR = 9718u32;
+pub const DNS_ERROR_DWORD_VALUE_TOO_LARGE: WIN32_ERROR = 9567u32;
+pub const DNS_ERROR_DWORD_VALUE_TOO_SMALL: WIN32_ERROR = 9566u32;
+pub const DNS_ERROR_FILE_WRITEBACK_FAILED: WIN32_ERROR = 9654u32;
+pub const DNS_ERROR_FORWARDER_ALREADY_EXISTS: WIN32_ERROR = 9619u32;
+pub const DNS_ERROR_INCONSISTENT_ROOT_HINTS: WIN32_ERROR = 9565u32;
+pub const DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME: WIN32_ERROR = 9924u32;
+pub const DNS_ERROR_INVALID_CLIENT_SUBNET_NAME: WIN32_ERROR = 9984u32;
+pub const DNS_ERROR_INVALID_DATA: WIN32_ERROR = 13u32;
+pub const DNS_ERROR_INVALID_DATAFILE_NAME: WIN32_ERROR = 9652u32;
+pub const DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET: WIN32_ERROR = 9115u32;
+pub const DNS_ERROR_INVALID_IP_ADDRESS: WIN32_ERROR = 9552u32;
+pub const DNS_ERROR_INVALID_KEY_SIZE: WIN32_ERROR = 9106u32;
+pub const DNS_ERROR_INVALID_NAME: WIN32_ERROR = 123u32;
+pub const DNS_ERROR_INVALID_NAME_CHAR: WIN32_ERROR = 9560u32;
+pub const DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT: WIN32_ERROR = 9124u32;
+pub const DNS_ERROR_INVALID_POLICY_TABLE: WIN32_ERROR = 9572u32;
+pub const DNS_ERROR_INVALID_PROPERTY: WIN32_ERROR = 9553u32;
+pub const DNS_ERROR_INVALID_ROLLOVER_PERIOD: WIN32_ERROR = 9114u32;
+pub const DNS_ERROR_INVALID_SCOPE_NAME: WIN32_ERROR = 9958u32;
+pub const DNS_ERROR_INVALID_SCOPE_OPERATION: WIN32_ERROR = 9961u32;
+pub const DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD: WIN32_ERROR = 9123u32;
+pub const DNS_ERROR_INVALID_TYPE: WIN32_ERROR = 9551u32;
+pub const DNS_ERROR_INVALID_XML: WIN32_ERROR = 9126u32;
+pub const DNS_ERROR_INVALID_ZONESCOPE_NAME: WIN32_ERROR = 9954u32;
+pub const DNS_ERROR_INVALID_ZONE_OPERATION: WIN32_ERROR = 9603u32;
+pub const DNS_ERROR_INVALID_ZONE_TYPE: WIN32_ERROR = 9611u32;
+pub const DNS_ERROR_KEYMASTER_REQUIRED: WIN32_ERROR = 9101u32;
+pub const DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION: WIN32_ERROR = 9108u32;
+pub const DNS_ERROR_KSP_NOT_ACCESSIBLE: WIN32_ERROR = 9112u32;
+pub const DNS_ERROR_LOAD_ZONESCOPE_FAILED: WIN32_ERROR = 9956u32;
+pub const DNS_ERROR_NAME_DOES_NOT_EXIST: WIN32_ERROR = 9714u32;
+pub const DNS_ERROR_NAME_NOT_IN_ZONE: WIN32_ERROR = 9706u32;
+pub const DNS_ERROR_NBSTAT_INIT_FAILED: WIN32_ERROR = 9617u32;
+pub const DNS_ERROR_NEED_SECONDARY_ADDRESSES: WIN32_ERROR = 9614u32;
+pub const DNS_ERROR_NEED_WINS_SERVERS: WIN32_ERROR = 9616u32;
+pub const DNS_ERROR_NODE_CREATION_FAILED: WIN32_ERROR = 9703u32;
+pub const DNS_ERROR_NODE_IS_CNAME: WIN32_ERROR = 9708u32;
+pub const DNS_ERROR_NODE_IS_DNAME: WIN32_ERROR = 9720u32;
+pub const DNS_ERROR_NON_RFC_NAME: WIN32_ERROR = 9556u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD: WIN32_ERROR = 9119u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_RODC: WIN32_ERROR = 9569u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER: WIN32_ERROR = 9562u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE: WIN32_ERROR = 9102u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE: WIN32_ERROR = 9121u32;
+pub const DNS_ERROR_NOT_ALLOWED_ON_ZSK: WIN32_ERROR = 9118u32;
+pub const DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION: WIN32_ERROR = 9563u32;
+pub const DNS_ERROR_NOT_ALLOWED_UNDER_DNAME: WIN32_ERROR = 9570u32;
+pub const DNS_ERROR_NOT_ALLOWED_WITH_ZONESCOPES: WIN32_ERROR = 9955u32;
+pub const DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS: WIN32_ERROR = 9104u32;
+pub const DNS_ERROR_NOT_UNIQUE: WIN32_ERROR = 9555u32;
+pub const DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE: WIN32_ERROR = 9719u32;
+pub const DNS_ERROR_NO_CREATE_CACHE_DATA: WIN32_ERROR = 9713u32;
+pub const DNS_ERROR_NO_DNS_SERVERS: WIN32_ERROR = 9852u32;
+pub const DNS_ERROR_NO_MEMORY: WIN32_ERROR = 14u32;
+pub const DNS_ERROR_NO_PACKET: WIN32_ERROR = 9503u32;
+pub const DNS_ERROR_NO_TCPIP: WIN32_ERROR = 9851u32;
+pub const DNS_ERROR_NO_VALID_TRUST_ANCHORS: WIN32_ERROR = 9127u32;
+pub const DNS_ERROR_NO_ZONE_INFO: WIN32_ERROR = 9602u32;
+pub const DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1: WIN32_ERROR = 9103u32;
+pub const DNS_ERROR_NSEC3_NAME_COLLISION: WIN32_ERROR = 9129u32;
+pub const DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1: WIN32_ERROR = 9130u32;
+pub const DNS_ERROR_NUMERIC_NAME: WIN32_ERROR = 9561u32;
+pub const DNS_ERROR_POLICY_ALREADY_EXISTS: WIN32_ERROR = 9971u32;
+pub const DNS_ERROR_POLICY_DOES_NOT_EXIST: WIN32_ERROR = 9972u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA: WIN32_ERROR = 9973u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_CLIENT_SUBNET: WIN32_ERROR = 9990u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_FQDN: WIN32_ERROR = 9994u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_INTERFACE: WIN32_ERROR = 9993u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_NETWORK_PROTOCOL: WIN32_ERROR = 9992u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_QUERY_TYPE: WIN32_ERROR = 9995u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_TIME_OF_DAY: WIN32_ERROR = 9996u32;
+pub const DNS_ERROR_POLICY_INVALID_CRITERIA_TRANSPORT_PROTOCOL: WIN32_ERROR = 9991u32;
+pub const DNS_ERROR_POLICY_INVALID_NAME: WIN32_ERROR = 9982u32;
+pub const DNS_ERROR_POLICY_INVALID_SETTINGS: WIN32_ERROR = 9974u32;
+pub const DNS_ERROR_POLICY_INVALID_WEIGHT: WIN32_ERROR = 9981u32;
+pub const DNS_ERROR_POLICY_LOCKED: WIN32_ERROR = 9980u32;
+pub const DNS_ERROR_POLICY_MISSING_CRITERIA: WIN32_ERROR = 9983u32;
+pub const DNS_ERROR_POLICY_PROCESSING_ORDER_INVALID: WIN32_ERROR = 9985u32;
+pub const DNS_ERROR_POLICY_SCOPE_MISSING: WIN32_ERROR = 9986u32;
+pub const DNS_ERROR_POLICY_SCOPE_NOT_ALLOWED: WIN32_ERROR = 9987u32;
+pub const DNS_ERROR_PRIMARY_REQUIRES_DATAFILE: WIN32_ERROR = 9651u32;
+pub const DNS_ERROR_RCODE: WIN32_ERROR = 9504u32;
+pub const DNS_ERROR_RCODE_BADKEY: WIN32_ERROR = 9017u32;
+pub const DNS_ERROR_RCODE_BADSIG: WIN32_ERROR = 9016u32;
+pub const DNS_ERROR_RCODE_BADTIME: WIN32_ERROR = 9018u32;
+pub const DNS_ERROR_RCODE_FORMAT_ERROR: WIN32_ERROR = 9001u32;
+pub const DNS_ERROR_RCODE_NAME_ERROR: WIN32_ERROR = 9003u32;
+pub const DNS_ERROR_RCODE_NOTAUTH: WIN32_ERROR = 9009u32;
+pub const DNS_ERROR_RCODE_NOTZONE: WIN32_ERROR = 9010u32;
+pub const DNS_ERROR_RCODE_NOT_IMPLEMENTED: WIN32_ERROR = 9004u32;
+pub const DNS_ERROR_RCODE_NXRRSET: WIN32_ERROR = 9008u32;
+pub const DNS_ERROR_RCODE_REFUSED: WIN32_ERROR = 9005u32;
+pub const DNS_ERROR_RCODE_SERVER_FAILURE: WIN32_ERROR = 9002u32;
+pub const DNS_ERROR_RCODE_YXDOMAIN: WIN32_ERROR = 9006u32;
+pub const DNS_ERROR_RCODE_YXRRSET: WIN32_ERROR = 9007u32;
+pub const DNS_ERROR_RECORD_ALREADY_EXISTS: WIN32_ERROR = 9711u32;
+pub const DNS_ERROR_RECORD_DOES_NOT_EXIST: WIN32_ERROR = 9701u32;
+pub const DNS_ERROR_RECORD_FORMAT: WIN32_ERROR = 9702u32;
+pub const DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT: WIN32_ERROR = 9710u32;
+pub const DNS_ERROR_RECORD_TIMED_OUT: WIN32_ERROR = 9705u32;
+pub const DNS_ERROR_ROLLOVER_ALREADY_QUEUED: WIN32_ERROR = 9120u32;
+pub const DNS_ERROR_ROLLOVER_IN_PROGRESS: WIN32_ERROR = 9116u32;
+pub const DNS_ERROR_ROLLOVER_NOT_POKEABLE: WIN32_ERROR = 9128u32;
+pub const DNS_ERROR_RRL_INVALID_IPV4_PREFIX: WIN32_ERROR = 9913u32;
+pub const DNS_ERROR_RRL_INVALID_IPV6_PREFIX: WIN32_ERROR = 9914u32;
+pub const DNS_ERROR_RRL_INVALID_LEAK_RATE: WIN32_ERROR = 9916u32;
+pub const DNS_ERROR_RRL_INVALID_TC_RATE: WIN32_ERROR = 9915u32;
+pub const DNS_ERROR_RRL_INVALID_WINDOW_SIZE: WIN32_ERROR = 9912u32;
+pub const DNS_ERROR_RRL_LEAK_RATE_LESSTHAN_TC_RATE: WIN32_ERROR = 9917u32;
+pub const DNS_ERROR_RRL_NOT_ENABLED: WIN32_ERROR = 9911u32;
+pub const DNS_ERROR_SCOPE_ALREADY_EXISTS: WIN32_ERROR = 9963u32;
+pub const DNS_ERROR_SCOPE_DOES_NOT_EXIST: WIN32_ERROR = 9959u32;
+pub const DNS_ERROR_SCOPE_LOCKED: WIN32_ERROR = 9962u32;
+pub const DNS_ERROR_SECONDARY_DATA: WIN32_ERROR = 9712u32;
+pub const DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP: WIN32_ERROR = 9612u32;
+pub const DNS_ERROR_SERVERSCOPE_IS_REFERENCED: WIN32_ERROR = 9988u32;
+pub const DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE: WIN32_ERROR = 9107u32;
+pub const DNS_ERROR_SOA_DELETE_INVALID: WIN32_ERROR = 9618u32;
+pub const DNS_ERROR_STANDBY_KEY_NOT_PRESENT: WIN32_ERROR = 9117u32;
+pub const DNS_ERROR_SUBNET_ALREADY_EXISTS: WIN32_ERROR = 9979u32;
+pub const DNS_ERROR_SUBNET_DOES_NOT_EXIST: WIN32_ERROR = 9978u32;
+pub const DNS_ERROR_TOO_MANY_SKDS: WIN32_ERROR = 9113u32;
+pub const DNS_ERROR_TRY_AGAIN_LATER: WIN32_ERROR = 9554u32;
+pub const DNS_ERROR_UNEXPECTED_CNG_ERROR: WIN32_ERROR = 9110u32;
+pub const DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR: WIN32_ERROR = 9109u32;
+pub const DNS_ERROR_UNKNOWN_RECORD_TYPE: WIN32_ERROR = 9704u32;
+pub const DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION: WIN32_ERROR = 9111u32;
+pub const DNS_ERROR_UNSECURE_PACKET: WIN32_ERROR = 9505u32;
+pub const DNS_ERROR_UNSUPPORTED_ALGORITHM: WIN32_ERROR = 9105u32;
+pub const DNS_ERROR_VIRTUALIZATION_INSTANCE_ALREADY_EXISTS: WIN32_ERROR = 9921u32;
+pub const DNS_ERROR_VIRTUALIZATION_INSTANCE_DOES_NOT_EXIST: WIN32_ERROR = 9922u32;
+pub const DNS_ERROR_VIRTUALIZATION_TREE_LOCKED: WIN32_ERROR = 9923u32;
+pub const DNS_ERROR_WINS_INIT_FAILED: WIN32_ERROR = 9615u32;
+pub const DNS_ERROR_ZONESCOPE_ALREADY_EXISTS: WIN32_ERROR = 9951u32;
+pub const DNS_ERROR_ZONESCOPE_DOES_NOT_EXIST: WIN32_ERROR = 9952u32;
+pub const DNS_ERROR_ZONESCOPE_FILE_WRITEBACK_FAILED: WIN32_ERROR = 9957u32;
+pub const DNS_ERROR_ZONESCOPE_IS_REFERENCED: WIN32_ERROR = 9989u32;
+pub const DNS_ERROR_ZONE_ALREADY_EXISTS: WIN32_ERROR = 9609u32;
+pub const DNS_ERROR_ZONE_CONFIGURATION_ERROR: WIN32_ERROR = 9604u32;
+pub const DNS_ERROR_ZONE_CREATION_FAILED: WIN32_ERROR = 9608u32;
+pub const DNS_ERROR_ZONE_DOES_NOT_EXIST: WIN32_ERROR = 9601u32;
+pub const DNS_ERROR_ZONE_HAS_NO_NS_RECORDS: WIN32_ERROR = 9606u32;
+pub const DNS_ERROR_ZONE_HAS_NO_SOA_RECORD: WIN32_ERROR = 9605u32;
+pub const DNS_ERROR_ZONE_IS_SHUTDOWN: WIN32_ERROR = 9621u32;
+pub const DNS_ERROR_ZONE_LOCKED: WIN32_ERROR = 9607u32;
+pub const DNS_ERROR_ZONE_LOCKED_FOR_SIGNING: WIN32_ERROR = 9622u32;
+pub const DNS_ERROR_ZONE_NOT_SECONDARY: WIN32_ERROR = 9613u32;
+pub const DNS_ERROR_ZONE_REQUIRES_MASTER_IP: WIN32_ERROR = 9620u32;
+pub const DUPLICATE_CLOSE_SOURCE: DUPLICATE_HANDLE_OPTIONS = 1u32;
+pub type DUPLICATE_HANDLE_OPTIONS = u32;
+pub const DUPLICATE_SAME_ACCESS: DUPLICATE_HANDLE_OPTIONS = 2u32;
+pub const ENABLE_AUTO_POSITION: CONSOLE_MODE = 256u32;
+pub const ENABLE_ECHO_INPUT: CONSOLE_MODE = 4u32;
+pub const ENABLE_EXTENDED_FLAGS: CONSOLE_MODE = 128u32;
+pub const ENABLE_INSERT_MODE: CONSOLE_MODE = 32u32;
+pub const ENABLE_LINE_INPUT: CONSOLE_MODE = 2u32;
+pub const ENABLE_LVB_GRID_WORLDWIDE: CONSOLE_MODE = 16u32;
+pub const ENABLE_MOUSE_INPUT: CONSOLE_MODE = 16u32;
+pub const ENABLE_PROCESSED_INPUT: CONSOLE_MODE = 1u32;
+pub const ENABLE_PROCESSED_OUTPUT: CONSOLE_MODE = 1u32;
+pub const ENABLE_QUICK_EDIT_MODE: CONSOLE_MODE = 64u32;
+pub const ENABLE_VIRTUAL_TERMINAL_INPUT: CONSOLE_MODE = 512u32;
+pub const ENABLE_VIRTUAL_TERMINAL_PROCESSING: CONSOLE_MODE = 4u32;
+pub const ENABLE_WINDOW_INPUT: CONSOLE_MODE = 8u32;
+pub const ENABLE_WRAP_AT_EOL_OUTPUT: CONSOLE_MODE = 2u32;
+pub const ERROR_ABANDONED_WAIT_0: WIN32_ERROR = 735u32;
+pub const ERROR_ABANDONED_WAIT_63: WIN32_ERROR = 736u32;
+pub const ERROR_ABANDON_HIBERFILE: WIN32_ERROR = 787u32;
+pub const ERROR_ABIOS_ERROR: WIN32_ERROR = 538u32;
+pub const ERROR_ACCESS_AUDIT_BY_POLICY: WIN32_ERROR = 785u32;
+pub const ERROR_ACCESS_DENIED: WIN32_ERROR = 5u32;
+pub const ERROR_ACCESS_DENIED_APPDATA: WIN32_ERROR = 502u32;
+pub const ERROR_ACCESS_DISABLED_BY_POLICY: WIN32_ERROR = 1260u32;
+pub const ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY: WIN32_ERROR = 786u32;
+pub const ERROR_ACCESS_DISABLED_WEBBLADE: WIN32_ERROR = 1277u32;
+pub const ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER: WIN32_ERROR = 1278u32;
+pub const ERROR_ACCOUNT_DISABLED: WIN32_ERROR = 1331u32;
+pub const ERROR_ACCOUNT_EXPIRED: WIN32_ERROR = 1793u32;
+pub const ERROR_ACCOUNT_LOCKED_OUT: WIN32_ERROR = 1909u32;
+pub const ERROR_ACCOUNT_RESTRICTION: WIN32_ERROR = 1327u32;
+pub const ERROR_ACPI_ERROR: WIN32_ERROR = 669u32;
+pub const ERROR_ACTIVE_CONNECTIONS: WIN32_ERROR = 2402u32;
+pub const ERROR_ADAP_HDW_ERR: WIN32_ERROR = 57u32;
+pub const ERROR_ADDRESS_ALREADY_ASSOCIATED: WIN32_ERROR = 1227u32;
+pub const ERROR_ADDRESS_NOT_ASSOCIATED: WIN32_ERROR = 1228u32;
+pub const ERROR_ALERTED: WIN32_ERROR = 739u32;
+pub const ERROR_ALIAS_EXISTS: WIN32_ERROR = 1379u32;
+pub const ERROR_ALLOCATE_BUCKET: WIN32_ERROR = 602u32;
+pub const ERROR_ALLOTTED_SPACE_EXCEEDED: WIN32_ERROR = 1344u32;
+pub const ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED: WIN32_ERROR = 1933u32;
+pub const ERROR_ALREADY_ASSIGNED: WIN32_ERROR = 85u32;
+pub const ERROR_ALREADY_EXISTS: WIN32_ERROR = 183u32;
+pub const ERROR_ALREADY_FIBER: WIN32_ERROR = 1280u32;
+pub const ERROR_ALREADY_HAS_STREAM_ID: WIN32_ERROR = 4444u32;
+pub const ERROR_ALREADY_INITIALIZED: WIN32_ERROR = 1247u32;
+pub const ERROR_ALREADY_REGISTERED: WIN32_ERROR = 1242u32;
+pub const ERROR_ALREADY_RUNNING_LKG: WIN32_ERROR = 1074u32;
+pub const ERROR_ALREADY_THREAD: WIN32_ERROR = 1281u32;
+pub const ERROR_ALREADY_WAITING: WIN32_ERROR = 1904u32;
+pub const ERROR_ALREADY_WIN32: WIN32_ERROR = 719u32;
+pub const ERROR_API_UNAVAILABLE: WIN32_ERROR = 15841u32;
+pub const ERROR_APPCONTAINER_REQUIRED: WIN32_ERROR = 4251u32;
+pub const ERROR_APPEXEC_APP_COMPAT_BLOCK: WIN32_ERROR = 3068u32;
+pub const ERROR_APPEXEC_CALLER_WAIT_TIMEOUT: WIN32_ERROR = 3069u32;
+pub const ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_LICENSING: WIN32_ERROR = 3071u32;
+pub const ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_RESOURCES: WIN32_ERROR = 3072u32;
+pub const ERROR_APPEXEC_CALLER_WAIT_TIMEOUT_TERMINATION: WIN32_ERROR = 3070u32;
+pub const ERROR_APPEXEC_CONDITION_NOT_SATISFIED: WIN32_ERROR = 3060u32;
+pub const ERROR_APPEXEC_HANDLE_INVALIDATED: WIN32_ERROR = 3061u32;
+pub const ERROR_APPEXEC_HOST_ID_MISMATCH: WIN32_ERROR = 3066u32;
+pub const ERROR_APPEXEC_INVALID_HOST_GENERATION: WIN32_ERROR = 3062u32;
+pub const ERROR_APPEXEC_INVALID_HOST_STATE: WIN32_ERROR = 3064u32;
+pub const ERROR_APPEXEC_NO_DONOR: WIN32_ERROR = 3065u32;
+pub const ERROR_APPEXEC_UNEXPECTED_PROCESS_REGISTRATION: WIN32_ERROR = 3063u32;
+pub const ERROR_APPEXEC_UNKNOWN_USER: WIN32_ERROR = 3067u32;
+pub const ERROR_APPHELP_BLOCK: WIN32_ERROR = 1259u32;
+pub const ERROR_APPX_FILE_NOT_ENCRYPTED: WIN32_ERROR = 409u32;
+pub const ERROR_APP_HANG: WIN32_ERROR = 1298u32;
+pub const ERROR_APP_INIT_FAILURE: WIN32_ERROR = 575u32;
+pub const ERROR_APP_WRONG_OS: WIN32_ERROR = 1151u32;
+pub const ERROR_ARBITRATION_UNHANDLED: WIN32_ERROR = 723u32;
+pub const ERROR_ARENA_TRASHED: WIN32_ERROR = 7u32;
+pub const ERROR_ARITHMETIC_OVERFLOW: WIN32_ERROR = 534u32;
+pub const ERROR_ASSERTION_FAILURE: WIN32_ERROR = 668u32;
+pub const ERROR_ATOMIC_LOCKS_NOT_SUPPORTED: WIN32_ERROR = 174u32;
+pub const ERROR_AUDIT_FAILED: WIN32_ERROR = 606u32;
+pub const ERROR_AUTHENTICATION_FIREWALL_FAILED: WIN32_ERROR = 1935u32;
+pub const ERROR_AUTHIP_FAILURE: WIN32_ERROR = 1469u32;
+pub const ERROR_AUTODATASEG_EXCEEDS_64k: WIN32_ERROR = 199u32;
+pub const ERROR_BACKUP_CONTROLLER: WIN32_ERROR = 586u32;
+pub const ERROR_BADDB: WIN32_ERROR = 1009u32;
+pub const ERROR_BADKEY: WIN32_ERROR = 1010u32;
+pub const ERROR_BADSTARTPOSITION: WIN32_ERROR = 778u32;
+pub const ERROR_BAD_ACCESSOR_FLAGS: WIN32_ERROR = 773u32;
+pub const ERROR_BAD_ARGUMENTS: WIN32_ERROR = 160u32;
+pub const ERROR_BAD_COMMAND: WIN32_ERROR = 22u32;
+pub const ERROR_BAD_COMPRESSION_BUFFER: WIN32_ERROR = 605u32;
+pub const ERROR_BAD_CONFIGURATION: WIN32_ERROR = 1610u32;
+pub const ERROR_BAD_CURRENT_DIRECTORY: WIN32_ERROR = 703u32;
+pub const ERROR_BAD_DESCRIPTOR_FORMAT: WIN32_ERROR = 1361u32;
+pub const ERROR_BAD_DEVICE: WIN32_ERROR = 1200u32;
+pub const ERROR_BAD_DEVICE_PATH: WIN32_ERROR = 330u32;
+pub const ERROR_BAD_DEV_TYPE: WIN32_ERROR = 66u32;
+pub const ERROR_BAD_DLL_ENTRYPOINT: WIN32_ERROR = 609u32;
+pub const ERROR_BAD_DRIVER_LEVEL: WIN32_ERROR = 119u32;
+pub const ERROR_BAD_ENVIRONMENT: WIN32_ERROR = 10u32;
+pub const ERROR_BAD_EXE_FORMAT: WIN32_ERROR = 193u32;
+pub const ERROR_BAD_FILE_TYPE: WIN32_ERROR = 222u32;
+pub const ERROR_BAD_FORMAT: WIN32_ERROR = 11u32;
+pub const ERROR_BAD_FUNCTION_TABLE: WIN32_ERROR = 559u32;
+pub const ERROR_BAD_IMPERSONATION_LEVEL: WIN32_ERROR = 1346u32;
+pub const ERROR_BAD_INHERITANCE_ACL: WIN32_ERROR = 1340u32;
+pub const ERROR_BAD_LENGTH: WIN32_ERROR = 24u32;
+pub const ERROR_BAD_LOGON_SESSION_STATE: WIN32_ERROR = 1365u32;
+pub const ERROR_BAD_MCFG_TABLE: WIN32_ERROR = 791u32;
+pub const ERROR_BAD_NETPATH: WIN32_ERROR = 53u32;
+pub const ERROR_BAD_NET_NAME: WIN32_ERROR = 67u32;
+pub const ERROR_BAD_NET_RESP: WIN32_ERROR = 58u32;
+pub const ERROR_BAD_PATHNAME: WIN32_ERROR = 161u32;
+pub const ERROR_BAD_PIPE: WIN32_ERROR = 230u32;
+pub const ERROR_BAD_PROFILE: WIN32_ERROR = 1206u32;
+pub const ERROR_BAD_PROVIDER: WIN32_ERROR = 1204u32;
+pub const ERROR_BAD_QUERY_SYNTAX: WIN32_ERROR = 1615u32;
+pub const ERROR_BAD_RECOVERY_POLICY: WIN32_ERROR = 6012u32;
+pub const ERROR_BAD_REM_ADAP: WIN32_ERROR = 60u32;
+pub const ERROR_BAD_SERVICE_ENTRYPOINT: WIN32_ERROR = 610u32;
+pub const ERROR_BAD_STACK: WIN32_ERROR = 543u32;
+pub const ERROR_BAD_THREADID_ADDR: WIN32_ERROR = 159u32;
+pub const ERROR_BAD_TOKEN_TYPE: WIN32_ERROR = 1349u32;
+pub const ERROR_BAD_UNIT: WIN32_ERROR = 20u32;
+pub const ERROR_BAD_USERNAME: WIN32_ERROR = 2202u32;
+pub const ERROR_BAD_USER_PROFILE: WIN32_ERROR = 1253u32;
+pub const ERROR_BAD_VALIDATION_CLASS: WIN32_ERROR = 1348u32;
+pub const ERROR_BEGINNING_OF_MEDIA: WIN32_ERROR = 1102u32;
+pub const ERROR_BEYOND_VDL: WIN32_ERROR = 1289u32;
+pub const ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT: WIN32_ERROR = 585u32;
+pub const ERROR_BLOCKED_BY_PARENTAL_CONTROLS: WIN32_ERROR = 346u32;
+pub const ERROR_BLOCK_SHARED: WIN32_ERROR = 514u32;
+pub const ERROR_BLOCK_SOURCE_WEAK_REFERENCE_INVALID: WIN32_ERROR = 512u32;
+pub const ERROR_BLOCK_TARGET_WEAK_REFERENCE_INVALID: WIN32_ERROR = 513u32;
+pub const ERROR_BLOCK_TOO_MANY_REFERENCES: WIN32_ERROR = 347u32;
+pub const ERROR_BLOCK_WEAK_REFERENCE_INVALID: WIN32_ERROR = 511u32;
+pub const ERROR_BOOT_ALREADY_ACCEPTED: WIN32_ERROR = 1076u32;
+pub const ERROR_BROKEN_PIPE: WIN32_ERROR = 109u32;
+pub const ERROR_BUFFER_ALL_ZEROS: WIN32_ERROR = 754u32;
+pub const ERROR_BUFFER_OVERFLOW: WIN32_ERROR = 111u32;
+pub const ERROR_BUSY: WIN32_ERROR = 170u32;
+pub const ERROR_BUSY_DRIVE: WIN32_ERROR = 142u32;
+pub const ERROR_BUS_RESET: WIN32_ERROR = 1111u32;
+pub const ERROR_BYPASSIO_FLT_NOT_SUPPORTED: WIN32_ERROR = 506u32;
+pub const ERROR_CACHE_PAGE_LOCKED: WIN32_ERROR = 752u32;
+pub const ERROR_CALLBACK_INVOKE_INLINE: WIN32_ERROR = 812u32;
+pub const ERROR_CALLBACK_POP_STACK: WIN32_ERROR = 768u32;
+pub const ERROR_CALLBACK_SUPPLIED_INVALID_DATA: WIN32_ERROR = 1273u32;
+pub const ERROR_CALL_NOT_IMPLEMENTED: WIN32_ERROR = 120u32;
+pub const ERROR_CANCELLED: WIN32_ERROR = 1223u32;
+pub const ERROR_CANCEL_VIOLATION: WIN32_ERROR = 173u32;
+pub const ERROR_CANNOT_BREAK_OPLOCK: WIN32_ERROR = 802u32;
+pub const ERROR_CANNOT_COPY: WIN32_ERROR = 266u32;
+pub const ERROR_CANNOT_DETECT_DRIVER_FAILURE: WIN32_ERROR = 1080u32;
+pub const ERROR_CANNOT_DETECT_PROCESS_ABORT: WIN32_ERROR = 1081u32;
+pub const ERROR_CANNOT_FIND_WND_CLASS: WIN32_ERROR = 1407u32;
+pub const ERROR_CANNOT_GRANT_REQUESTED_OPLOCK: WIN32_ERROR = 801u32;
+pub const ERROR_CANNOT_IMPERSONATE: WIN32_ERROR = 1368u32;
+pub const ERROR_CANNOT_LOAD_REGISTRY_FILE: WIN32_ERROR = 589u32;
+pub const ERROR_CANNOT_MAKE: WIN32_ERROR = 82u32;
+pub const ERROR_CANNOT_OPEN_PROFILE: WIN32_ERROR = 1205u32;
+pub const ERROR_CANTFETCHBACKWARDS: WIN32_ERROR = 770u32;
+pub const ERROR_CANTOPEN: WIN32_ERROR = 1011u32;
+pub const ERROR_CANTREAD: WIN32_ERROR = 1012u32;
+pub const ERROR_CANTSCROLLBACKWARDS: WIN32_ERROR = 771u32;
+pub const ERROR_CANTWRITE: WIN32_ERROR = 1013u32;
+pub const ERROR_CANT_ACCESS_DOMAIN_INFO: WIN32_ERROR = 1351u32;
+pub const ERROR_CANT_ACCESS_FILE: WIN32_ERROR = 1920u32;
+pub const ERROR_CANT_CLEAR_ENCRYPTION_FLAG: WIN32_ERROR = 432u32;
+pub const ERROR_CANT_DISABLE_MANDATORY: WIN32_ERROR = 1310u32;
+pub const ERROR_CANT_ENABLE_DENY_ONLY: WIN32_ERROR = 629u32;
+pub const ERROR_CANT_OPEN_ANONYMOUS: WIN32_ERROR = 1347u32;
+pub const ERROR_CANT_RESOLVE_FILENAME: WIN32_ERROR = 1921u32;
+pub const ERROR_CANT_TERMINATE_SELF: WIN32_ERROR = 555u32;
+pub const ERROR_CANT_WAIT: WIN32_ERROR = 554u32;
+pub const ERROR_CAN_NOT_COMPLETE: WIN32_ERROR = 1003u32;
+pub const ERROR_CAPAUTHZ_CHANGE_TYPE: WIN32_ERROR = 451u32;
+pub const ERROR_CAPAUTHZ_DB_CORRUPTED: WIN32_ERROR = 455u32;
+pub const ERROR_CAPAUTHZ_NOT_AUTHORIZED: WIN32_ERROR = 453u32;
+pub const ERROR_CAPAUTHZ_NOT_DEVUNLOCKED: WIN32_ERROR = 450u32;
+pub const ERROR_CAPAUTHZ_NOT_PROVISIONED: WIN32_ERROR = 452u32;
+pub const ERROR_CAPAUTHZ_NO_POLICY: WIN32_ERROR = 454u32;
+pub const ERROR_CAPAUTHZ_SCCD_DEV_MODE_REQUIRED: WIN32_ERROR = 459u32;
+pub const ERROR_CAPAUTHZ_SCCD_INVALID_CATALOG: WIN32_ERROR = 456u32;
+pub const ERROR_CAPAUTHZ_SCCD_NO_AUTH_ENTITY: WIN32_ERROR = 457u32;
+pub const ERROR_CAPAUTHZ_SCCD_NO_CAPABILITY_MATCH: WIN32_ERROR = 460u32;
+pub const ERROR_CAPAUTHZ_SCCD_PARSE_ERROR: WIN32_ERROR = 458u32;
+pub const ERROR_CARDBUS_NOT_SUPPORTED: WIN32_ERROR = 724u32;
+pub const ERROR_CASE_DIFFERING_NAMES_IN_DIR: WIN32_ERROR = 424u32;
+pub const ERROR_CASE_SENSITIVE_PATH: WIN32_ERROR = 442u32;
+pub const ERROR_CERTIFICATE_VALIDATION_PREFERENCE_CONFLICT: WIN32_ERROR = 817u32;
+pub const ERROR_CHECKING_FILE_SYSTEM: WIN32_ERROR = 712u32;
+pub const ERROR_CHECKOUT_REQUIRED: WIN32_ERROR = 221u32;
+pub const ERROR_CHILD_MUST_BE_VOLATILE: WIN32_ERROR = 1021u32;
+pub const ERROR_CHILD_NOT_COMPLETE: WIN32_ERROR = 129u32;
+pub const ERROR_CHILD_PROCESS_BLOCKED: WIN32_ERROR = 367u32;
+pub const ERROR_CHILD_WINDOW_MENU: WIN32_ERROR = 1436u32;
+pub const ERROR_CIMFS_IMAGE_CORRUPT: WIN32_ERROR = 470u32;
+pub const ERROR_CIMFS_IMAGE_VERSION_NOT_SUPPORTED: WIN32_ERROR = 471u32;
+pub const ERROR_CIRCULAR_DEPENDENCY: WIN32_ERROR = 1059u32;
+pub const ERROR_CLASS_ALREADY_EXISTS: WIN32_ERROR = 1410u32;
+pub const ERROR_CLASS_DOES_NOT_EXIST: WIN32_ERROR = 1411u32;
+pub const ERROR_CLASS_HAS_WINDOWS: WIN32_ERROR = 1412u32;
+pub const ERROR_CLIENT_SERVER_PARAMETERS_INVALID: WIN32_ERROR = 597u32;
+pub const ERROR_CLIPBOARD_NOT_OPEN: WIN32_ERROR = 1418u32;
+pub const ERROR_CLOUD_FILE_ACCESS_DENIED: WIN32_ERROR = 395u32;
+pub const ERROR_CLOUD_FILE_ALREADY_CONNECTED: WIN32_ERROR = 378u32;
+pub const ERROR_CLOUD_FILE_AUTHENTICATION_FAILED: WIN32_ERROR = 386u32;
+pub const ERROR_CLOUD_FILE_CONNECTED_PROVIDER_ONLY: WIN32_ERROR = 382u32;
+pub const ERROR_CLOUD_FILE_DEHYDRATION_DISALLOWED: WIN32_ERROR = 434u32;
+pub const ERROR_CLOUD_FILE_INCOMPATIBLE_HARDLINKS: WIN32_ERROR = 396u32;
+pub const ERROR_CLOUD_FILE_INSUFFICIENT_RESOURCES: WIN32_ERROR = 387u32;
+pub const ERROR_CLOUD_FILE_INVALID_REQUEST: WIN32_ERROR = 380u32;
+pub const ERROR_CLOUD_FILE_IN_USE: WIN32_ERROR = 391u32;
+pub const ERROR_CLOUD_FILE_METADATA_CORRUPT: WIN32_ERROR = 363u32;
+pub const ERROR_CLOUD_FILE_METADATA_TOO_LARGE: WIN32_ERROR = 364u32;
+pub const ERROR_CLOUD_FILE_NETWORK_UNAVAILABLE: WIN32_ERROR = 388u32;
+pub const ERROR_CLOUD_FILE_NOT_IN_SYNC: WIN32_ERROR = 377u32;
+pub const ERROR_CLOUD_FILE_NOT_SUPPORTED: WIN32_ERROR = 379u32;
+pub const ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT: WIN32_ERROR = 390u32;
+pub const ERROR_CLOUD_FILE_PINNED: WIN32_ERROR = 392u32;
+pub const ERROR_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH: WIN32_ERROR = 366u32;
+pub const ERROR_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE: WIN32_ERROR = 365u32;
+pub const ERROR_CLOUD_FILE_PROPERTY_CORRUPT: WIN32_ERROR = 394u32;
+pub const ERROR_CLOUD_FILE_PROPERTY_LOCK_CONFLICT: WIN32_ERROR = 397u32;
+pub const ERROR_CLOUD_FILE_PROPERTY_VERSION_NOT_SUPPORTED: WIN32_ERROR = 375u32;
+pub const ERROR_CLOUD_FILE_PROVIDER_NOT_RUNNING: WIN32_ERROR = 362u32;
+pub const ERROR_CLOUD_FILE_PROVIDER_TERMINATED: WIN32_ERROR = 404u32;
+pub const ERROR_CLOUD_FILE_READ_ONLY_VOLUME: WIN32_ERROR = 381u32;
+pub const ERROR_CLOUD_FILE_REQUEST_ABORTED: WIN32_ERROR = 393u32;
+pub const ERROR_CLOUD_FILE_REQUEST_CANCELED: WIN32_ERROR = 398u32;
+pub const ERROR_CLOUD_FILE_REQUEST_TIMEOUT: WIN32_ERROR = 426u32;
+pub const ERROR_CLOUD_FILE_SYNC_ROOT_METADATA_CORRUPT: WIN32_ERROR = 358u32;
+pub const ERROR_CLOUD_FILE_TOO_MANY_PROPERTY_BLOBS: WIN32_ERROR = 374u32;
+pub const ERROR_CLOUD_FILE_UNSUCCESSFUL: WIN32_ERROR = 389u32;
+pub const ERROR_CLOUD_FILE_US_MESSAGE_TIMEOUT: WIN32_ERROR = 475u32;
+pub const ERROR_CLOUD_FILE_VALIDATION_FAILED: WIN32_ERROR = 383u32;
+pub const ERROR_COMMITMENT_LIMIT: WIN32_ERROR = 1455u32;
+pub const ERROR_COMMITMENT_MINIMUM: WIN32_ERROR = 635u32;
+pub const ERROR_COMPRESSED_FILE_NOT_SUPPORTED: WIN32_ERROR = 335u32;
+pub const ERROR_COMPRESSION_DISABLED: WIN32_ERROR = 769u32;
+pub const ERROR_COMPRESSION_NOT_BENEFICIAL: WIN32_ERROR = 344u32;
+pub const ERROR_CONNECTED_OTHER_PASSWORD: WIN32_ERROR = 2108u32;
+pub const ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT: WIN32_ERROR = 2109u32;
+pub const ERROR_CONNECTION_ABORTED: WIN32_ERROR = 1236u32;
+pub const ERROR_CONNECTION_ACTIVE: WIN32_ERROR = 1230u32;
+pub const ERROR_CONNECTION_COUNT_LIMIT: WIN32_ERROR = 1238u32;
+pub const ERROR_CONNECTION_INVALID: WIN32_ERROR = 1229u32;
+pub const ERROR_CONNECTION_REFUSED: WIN32_ERROR = 1225u32;
+pub const ERROR_CONNECTION_UNAVAIL: WIN32_ERROR = 1201u32;
+pub const ERROR_CONTAINER_ASSIGNED: WIN32_ERROR = 1504u32;
+pub const ERROR_CONTENT_BLOCKED: WIN32_ERROR = 1296u32;
+pub const ERROR_CONTEXT_EXPIRED: WIN32_ERROR = 1931u32;
+pub const ERROR_CONTINUE: WIN32_ERROR = 1246u32;
+pub const ERROR_CONTROL_C_EXIT: WIN32_ERROR = 572u32;
+pub const ERROR_CONTROL_ID_NOT_FOUND: WIN32_ERROR = 1421u32;
+pub const ERROR_CONVERT_TO_LARGE: WIN32_ERROR = 600u32;
+pub const ERROR_CORRUPT_LOG_CLEARED: WIN32_ERROR = 798u32;
+pub const ERROR_CORRUPT_LOG_CORRUPTED: WIN32_ERROR = 795u32;
+pub const ERROR_CORRUPT_LOG_DELETED_FULL: WIN32_ERROR = 797u32;
+pub const ERROR_CORRUPT_LOG_OVERFULL: WIN32_ERROR = 794u32;
+pub const ERROR_CORRUPT_LOG_UNAVAILABLE: WIN32_ERROR = 796u32;
+pub const ERROR_CORRUPT_SYSTEM_FILE: WIN32_ERROR = 634u32;
+pub const ERROR_COULD_NOT_INTERPRET: WIN32_ERROR = 552u32;
+pub const ERROR_COUNTER_TIMEOUT: WIN32_ERROR = 1121u32;
+pub const ERROR_CPU_SET_INVALID: WIN32_ERROR = 813u32;
+pub const ERROR_CRASH_DUMP: WIN32_ERROR = 753u32;
+pub const ERROR_CRC: WIN32_ERROR = 23u32;
+pub const ERROR_CREATE_FAILED: WIN32_ERROR = 1631u32;
+pub const ERROR_CROSS_PARTITION_VIOLATION: WIN32_ERROR = 1661u32;
+pub const ERROR_CSCSHARE_OFFLINE: WIN32_ERROR = 1262u32;
+pub const ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE: WIN32_ERROR = 6019u32;
+pub const ERROR_CS_ENCRYPTION_FILE_NOT_CSE: WIN32_ERROR = 6021u32;
+pub const ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE: WIN32_ERROR = 6017u32;
+pub const ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE: WIN32_ERROR = 6020u32;
+pub const ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER: WIN32_ERROR = 6018u32;
+pub const ERROR_CTX_CLIENT_QUERY_TIMEOUT: WIN32_ERROR = 7040u32;
+pub const ERROR_CTX_MODEM_RESPONSE_TIMEOUT: WIN32_ERROR = 7012u32;
+pub const ERROR_CURRENT_DIRECTORY: WIN32_ERROR = 16u32;
+pub const ERROR_CURRENT_DOMAIN_NOT_ALLOWED: WIN32_ERROR = 1399u32;
+pub const ERROR_DATABASE_DOES_NOT_EXIST: WIN32_ERROR = 1065u32;
+pub const ERROR_DATATYPE_MISMATCH: WIN32_ERROR = 1629u32;
+pub const ERROR_DATA_CHECKSUM_ERROR: WIN32_ERROR = 323u32;
+pub const ERROR_DATA_NOT_ACCEPTED: WIN32_ERROR = 592u32;
+pub const ERROR_DAX_MAPPING_EXISTS: WIN32_ERROR = 361u32;
+pub const ERROR_DBG_COMMAND_EXCEPTION: WIN32_ERROR = 697u32;
+pub const ERROR_DBG_CONTINUE: WIN32_ERROR = 767u32;
+pub const ERROR_DBG_CONTROL_BREAK: WIN32_ERROR = 696u32;
+pub const ERROR_DBG_CONTROL_C: WIN32_ERROR = 693u32;
+pub const ERROR_DBG_EXCEPTION_HANDLED: WIN32_ERROR = 766u32;
+pub const ERROR_DBG_EXCEPTION_NOT_HANDLED: WIN32_ERROR = 688u32;
+pub const ERROR_DBG_PRINTEXCEPTION_C: WIN32_ERROR = 694u32;
+pub const ERROR_DBG_REPLY_LATER: WIN32_ERROR = 689u32;
+pub const ERROR_DBG_RIPEXCEPTION: WIN32_ERROR = 695u32;
+pub const ERROR_DBG_TERMINATE_PROCESS: WIN32_ERROR = 692u32;
+pub const ERROR_DBG_TERMINATE_THREAD: WIN32_ERROR = 691u32;
+pub const ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE: WIN32_ERROR = 690u32;
+pub const ERROR_DC_NOT_FOUND: WIN32_ERROR = 1425u32;
+pub const ERROR_DDE_FAIL: WIN32_ERROR = 1156u32;
+pub const ERROR_DEBUGGER_INACTIVE: WIN32_ERROR = 1284u32;
+pub const ERROR_DEBUG_ATTACH_FAILED: WIN32_ERROR = 590u32;
+pub const ERROR_DECRYPTION_FAILED: WIN32_ERROR = 6001u32;
+pub const ERROR_DELAY_LOAD_FAILED: WIN32_ERROR = 1285u32;
+pub const ERROR_DELETE_PENDING: WIN32_ERROR = 303u32;
+pub const ERROR_DEPENDENT_SERVICES_RUNNING: WIN32_ERROR = 1051u32;
+pub const ERROR_DESTINATION_ELEMENT_FULL: WIN32_ERROR = 1161u32;
+pub const ERROR_DESTROY_OBJECT_OF_OTHER_THREAD: WIN32_ERROR = 1435u32;
+pub const ERROR_DEVICE_ALREADY_ATTACHED: WIN32_ERROR = 548u32;
+pub const ERROR_DEVICE_ALREADY_REMEMBERED: WIN32_ERROR = 1202u32;
+pub const ERROR_DEVICE_DOOR_OPEN: WIN32_ERROR = 1166u32;
+pub const ERROR_DEVICE_ENUMERATION_ERROR: WIN32_ERROR = 648u32;
+pub const ERROR_DEVICE_FEATURE_NOT_SUPPORTED: WIN32_ERROR = 316u32;
+pub const ERROR_DEVICE_HARDWARE_ERROR: WIN32_ERROR = 483u32;
+pub const ERROR_DEVICE_HINT_NAME_BUFFER_TOO_SMALL: WIN32_ERROR = 355u32;
+pub const ERROR_DEVICE_IN_MAINTENANCE: WIN32_ERROR = 359u32;
+pub const ERROR_DEVICE_IN_USE: WIN32_ERROR = 2404u32;
+pub const ERROR_DEVICE_NOT_CONNECTED: WIN32_ERROR = 1167u32;
+pub const ERROR_DEVICE_NOT_PARTITIONED: WIN32_ERROR = 1107u32;
+pub const ERROR_DEVICE_NO_RESOURCES: WIN32_ERROR = 322u32;
+pub const ERROR_DEVICE_REINITIALIZATION_NEEDED: WIN32_ERROR = 1164u32;
+pub const ERROR_DEVICE_REMOVED: WIN32_ERROR = 1617u32;
+pub const ERROR_DEVICE_REQUIRES_CLEANING: WIN32_ERROR = 1165u32;
+pub const ERROR_DEVICE_RESET_REQUIRED: WIN32_ERROR = 507u32;
+pub const ERROR_DEVICE_SUPPORT_IN_PROGRESS: WIN32_ERROR = 171u32;
+pub const ERROR_DEVICE_UNREACHABLE: WIN32_ERROR = 321u32;
+pub const ERROR_DEV_NOT_EXIST: WIN32_ERROR = 55u32;
+pub const ERROR_DHCP_ADDRESS_CONFLICT: WIN32_ERROR = 4100u32;
+pub const ERROR_DIFFERENT_SERVICE_ACCOUNT: WIN32_ERROR = 1079u32;
+pub const ERROR_DIRECTORY: WIN32_ERROR = 267u32;
+pub const ERROR_DIRECTORY_NOT_SUPPORTED: WIN32_ERROR = 336u32;
+pub const ERROR_DIRECT_ACCESS_HANDLE: WIN32_ERROR = 130u32;
+pub const ERROR_DIR_EFS_DISALLOWED: WIN32_ERROR = 6010u32;
+pub const ERROR_DIR_NOT_EMPTY: WIN32_ERROR = 145u32;
+pub const ERROR_DIR_NOT_ROOT: WIN32_ERROR = 144u32;
+pub const ERROR_DISCARDED: WIN32_ERROR = 157u32;
+pub const ERROR_DISK_CHANGE: WIN32_ERROR = 107u32;
+pub const ERROR_DISK_CORRUPT: WIN32_ERROR = 1393u32;
+pub const ERROR_DISK_FULL: WIN32_ERROR = 112u32;
+pub const ERROR_DISK_OPERATION_FAILED: WIN32_ERROR = 1127u32;
+pub const ERROR_DISK_QUOTA_EXCEEDED: WIN32_ERROR = 1295u32;
+pub const ERROR_DISK_RECALIBRATE_FAILED: WIN32_ERROR = 1126u32;
+pub const ERROR_DISK_REPAIR_DISABLED: WIN32_ERROR = 780u32;
+pub const ERROR_DISK_REPAIR_REDIRECTED: WIN32_ERROR = 792u32;
+pub const ERROR_DISK_REPAIR_UNSUCCESSFUL: WIN32_ERROR = 793u32;
+pub const ERROR_DISK_RESET_FAILED: WIN32_ERROR = 1128u32;
+pub const ERROR_DISK_RESOURCES_EXHAUSTED: WIN32_ERROR = 314u32;
+pub const ERROR_DISK_TOO_FRAGMENTED: WIN32_ERROR = 302u32;
+pub const ERROR_DLL_INIT_FAILED: WIN32_ERROR = 1114u32;
+pub const ERROR_DLL_INIT_FAILED_LOGOFF: WIN32_ERROR = 624u32;
+pub const ERROR_DLL_MIGHT_BE_INCOMPATIBLE: WIN32_ERROR = 687u32;
+pub const ERROR_DLL_MIGHT_BE_INSECURE: WIN32_ERROR = 686u32;
+pub const ERROR_DLL_NOT_FOUND: WIN32_ERROR = 1157u32;
+pub const ERROR_DLP_POLICY_DENIES_OPERATION: WIN32_ERROR = 446u32;
+pub const ERROR_DLP_POLICY_SILENTLY_FAIL: WIN32_ERROR = 449u32;
+pub const ERROR_DLP_POLICY_WARNS_AGAINST_OPERATION: WIN32_ERROR = 445u32;
+pub const ERROR_DOMAIN_CONTROLLER_EXISTS: WIN32_ERROR = 1250u32;
+pub const ERROR_DOMAIN_CONTROLLER_NOT_FOUND: WIN32_ERROR = 1908u32;
+pub const ERROR_DOMAIN_CTRLR_CONFIG_ERROR: WIN32_ERROR = 581u32;
+pub const ERROR_DOMAIN_EXISTS: WIN32_ERROR = 1356u32;
+pub const ERROR_DOMAIN_LIMIT_EXCEEDED: WIN32_ERROR = 1357u32;
+pub const ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION: WIN32_ERROR = 8644u32;
+pub const ERROR_DOMAIN_TRUST_INCONSISTENT: WIN32_ERROR = 1810u32;
+pub const ERROR_DOWNGRADE_DETECTED: WIN32_ERROR = 1265u32;
+pub const ERROR_DPL_NOT_SUPPORTED_FOR_USER: WIN32_ERROR = 423u32;
+pub const ERROR_DRIVERS_LEAKING_LOCKED_PAGES: WIN32_ERROR = 729u32;
+pub const ERROR_DRIVER_BLOCKED: WIN32_ERROR = 1275u32;
+pub const ERROR_DRIVER_CANCEL_TIMEOUT: WIN32_ERROR = 594u32;
+pub const ERROR_DRIVER_DATABASE_ERROR: WIN32_ERROR = 652u32;
+pub const ERROR_DRIVER_FAILED_PRIOR_UNLOAD: WIN32_ERROR = 654u32;
+pub const ERROR_DRIVER_FAILED_SLEEP: WIN32_ERROR = 633u32;
+pub const ERROR_DRIVER_PROCESS_TERMINATED: WIN32_ERROR = 1291u32;
+pub const ERROR_DRIVE_LOCKED: WIN32_ERROR = 108u32;
+pub const ERROR_DS_ADD_REPLICA_INHIBITED: WIN32_ERROR = 8302u32;
+pub const ERROR_DS_ADMIN_LIMIT_EXCEEDED: WIN32_ERROR = 8228u32;
+pub const ERROR_DS_AFFECTS_MULTIPLE_DSAS: WIN32_ERROR = 8249u32;
+pub const ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER: WIN32_ERROR = 8578u32;
+pub const ERROR_DS_ALIASED_OBJ_MISSING: WIN32_ERROR = 8334u32;
+pub const ERROR_DS_ALIAS_DEREF_PROBLEM: WIN32_ERROR = 8244u32;
+pub const ERROR_DS_ALIAS_POINTS_TO_ALIAS: WIN32_ERROR = 8336u32;
+pub const ERROR_DS_ALIAS_PROBLEM: WIN32_ERROR = 8241u32;
+pub const ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS: WIN32_ERROR = 8205u32;
+pub const ERROR_DS_ATTRIBUTE_OWNED_BY_SAM: WIN32_ERROR = 8346u32;
+pub const ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED: WIN32_ERROR = 8204u32;
+pub const ERROR_DS_ATT_ALREADY_EXISTS: WIN32_ERROR = 8318u32;
+pub const ERROR_DS_ATT_IS_NOT_ON_OBJ: WIN32_ERROR = 8310u32;
+pub const ERROR_DS_ATT_NOT_DEF_FOR_CLASS: WIN32_ERROR = 8317u32;
+pub const ERROR_DS_ATT_NOT_DEF_IN_SCHEMA: WIN32_ERROR = 8303u32;
+pub const ERROR_DS_ATT_SCHEMA_REQ_ID: WIN32_ERROR = 8399u32;
+pub const ERROR_DS_ATT_SCHEMA_REQ_SYNTAX: WIN32_ERROR = 8416u32;
+pub const ERROR_DS_ATT_VAL_ALREADY_EXISTS: WIN32_ERROR = 8323u32;
+pub const ERROR_DS_AUDIT_FAILURE: WIN32_ERROR = 8625u32;
+pub const ERROR_DS_AUTHORIZATION_FAILED: WIN32_ERROR = 8599u32;
+pub const ERROR_DS_AUTH_METHOD_NOT_SUPPORTED: WIN32_ERROR = 8231u32;
+pub const ERROR_DS_AUTH_UNKNOWN: WIN32_ERROR = 8234u32;
+pub const ERROR_DS_AUX_CLS_TEST_FAIL: WIN32_ERROR = 8389u32;
+pub const ERROR_DS_BACKLINK_WITHOUT_LINK: WIN32_ERROR = 8482u32;
+pub const ERROR_DS_BAD_ATT_SCHEMA_SYNTAX: WIN32_ERROR = 8400u32;
+pub const ERROR_DS_BAD_HIERARCHY_FILE: WIN32_ERROR = 8425u32;
+pub const ERROR_DS_BAD_INSTANCE_TYPE: WIN32_ERROR = 8313u32;
+pub const ERROR_DS_BAD_NAME_SYNTAX: WIN32_ERROR = 8335u32;
+pub const ERROR_DS_BAD_RDN_ATT_ID_SYNTAX: WIN32_ERROR = 8392u32;
+pub const ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED: WIN32_ERROR = 8426u32;
+pub const ERROR_DS_BUSY: WIN32_ERROR = 8206u32;
+pub const ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD: WIN32_ERROR = 8585u32;
+pub const ERROR_DS_CANT_ADD_ATT_VALUES: WIN32_ERROR = 8320u32;
+pub const ERROR_DS_CANT_ADD_SYSTEM_ONLY: WIN32_ERROR = 8358u32;
+pub const ERROR_DS_CANT_ADD_TO_GC: WIN32_ERROR = 8550u32;
+pub const ERROR_DS_CANT_CACHE_ATT: WIN32_ERROR = 8401u32;
+pub const ERROR_DS_CANT_CACHE_CLASS: WIN32_ERROR = 8402u32;
+pub const ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC: WIN32_ERROR = 8553u32;
+pub const ERROR_DS_CANT_CREATE_UNDER_SCHEMA: WIN32_ERROR = 8510u32;
+pub const ERROR_DS_CANT_DELETE: WIN32_ERROR = 8398u32;
+pub const ERROR_DS_CANT_DELETE_DSA_OBJ: WIN32_ERROR = 8340u32;
+pub const ERROR_DS_CANT_DEL_MASTER_CROSSREF: WIN32_ERROR = 8375u32;
+pub const ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC: WIN32_ERROR = 8604u32;
+pub const ERROR_DS_CANT_DEREF_ALIAS: WIN32_ERROR = 8337u32;
+pub const ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN: WIN32_ERROR = 8603u32;
+pub const ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF: WIN32_ERROR = 8589u32;
+pub const ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN: WIN32_ERROR = 8537u32;
+pub const ERROR_DS_CANT_FIND_DSA_OBJ: WIN32_ERROR = 8419u32;
+pub const ERROR_DS_CANT_FIND_EXPECTED_NC: WIN32_ERROR = 8420u32;
+pub const ERROR_DS_CANT_FIND_NC_IN_CACHE: WIN32_ERROR = 8421u32;
+pub const ERROR_DS_CANT_MIX_MASTER_AND_REPS: WIN32_ERROR = 8331u32;
+pub const ERROR_DS_CANT_MOD_OBJ_CLASS: WIN32_ERROR = 8215u32;
+pub const ERROR_DS_CANT_MOD_PRIMARYGROUPID: WIN32_ERROR = 8506u32;
+pub const ERROR_DS_CANT_MOD_SYSTEM_ONLY: WIN32_ERROR = 8369u32;
+pub const ERROR_DS_CANT_MOVE_ACCOUNT_GROUP: WIN32_ERROR = 8498u32;
+pub const ERROR_DS_CANT_MOVE_APP_BASIC_GROUP: WIN32_ERROR = 8608u32;
+pub const ERROR_DS_CANT_MOVE_APP_QUERY_GROUP: WIN32_ERROR = 8609u32;
+pub const ERROR_DS_CANT_MOVE_DELETED_OBJECT: WIN32_ERROR = 8489u32;
+pub const ERROR_DS_CANT_MOVE_RESOURCE_GROUP: WIN32_ERROR = 8499u32;
+pub const ERROR_DS_CANT_ON_NON_LEAF: WIN32_ERROR = 8213u32;
+pub const ERROR_DS_CANT_ON_RDN: WIN32_ERROR = 8214u32;
+pub const ERROR_DS_CANT_REMOVE_ATT_CACHE: WIN32_ERROR = 8403u32;
+pub const ERROR_DS_CANT_REMOVE_CLASS_CACHE: WIN32_ERROR = 8404u32;
+pub const ERROR_DS_CANT_REM_MISSING_ATT: WIN32_ERROR = 8324u32;
+pub const ERROR_DS_CANT_REM_MISSING_ATT_VAL: WIN32_ERROR = 8325u32;
+pub const ERROR_DS_CANT_REPLACE_HIDDEN_REC: WIN32_ERROR = 8424u32;
+pub const ERROR_DS_CANT_RETRIEVE_ATTS: WIN32_ERROR = 8481u32;
+pub const ERROR_DS_CANT_RETRIEVE_CHILD: WIN32_ERROR = 8422u32;
+pub const ERROR_DS_CANT_RETRIEVE_DN: WIN32_ERROR = 8405u32;
+pub const ERROR_DS_CANT_RETRIEVE_INSTANCE: WIN32_ERROR = 8407u32;
+pub const ERROR_DS_CANT_RETRIEVE_SD: WIN32_ERROR = 8526u32;
+pub const ERROR_DS_CANT_START: WIN32_ERROR = 8531u32;
+pub const ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ: WIN32_ERROR = 8560u32;
+pub const ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS: WIN32_ERROR = 8493u32;
+pub const ERROR_DS_CHILDREN_EXIST: WIN32_ERROR = 8332u32;
+pub const ERROR_DS_CLASS_MUST_BE_CONCRETE: WIN32_ERROR = 8359u32;
+pub const ERROR_DS_CLASS_NOT_DSA: WIN32_ERROR = 8343u32;
+pub const ERROR_DS_CLIENT_LOOP: WIN32_ERROR = 8259u32;
+pub const ERROR_DS_CODE_INCONSISTENCY: WIN32_ERROR = 8408u32;
+pub const ERROR_DS_COMPARE_FALSE: WIN32_ERROR = 8229u32;
+pub const ERROR_DS_COMPARE_TRUE: WIN32_ERROR = 8230u32;
+pub const ERROR_DS_CONFIDENTIALITY_REQUIRED: WIN32_ERROR = 8237u32;
+pub const ERROR_DS_CONFIG_PARAM_MISSING: WIN32_ERROR = 8427u32;
+pub const ERROR_DS_CONSTRAINT_VIOLATION: WIN32_ERROR = 8239u32;
+pub const ERROR_DS_CONSTRUCTED_ATT_MOD: WIN32_ERROR = 8475u32;
+pub const ERROR_DS_CONTROL_NOT_FOUND: WIN32_ERROR = 8258u32;
+pub const ERROR_DS_COULDNT_CONTACT_FSMO: WIN32_ERROR = 8367u32;
+pub const ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE: WIN32_ERROR = 8503u32;
+pub const ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE: WIN32_ERROR = 8502u32;
+pub const ERROR_DS_COULDNT_UPDATE_SPNS: WIN32_ERROR = 8525u32;
+pub const ERROR_DS_COUNTING_AB_INDICES_FAILED: WIN32_ERROR = 8428u32;
+pub const ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD: WIN32_ERROR = 8491u32;
+pub const ERROR_DS_CROSS_DOM_MOVE_ERROR: WIN32_ERROR = 8216u32;
+pub const ERROR_DS_CROSS_NC_DN_RENAME: WIN32_ERROR = 8368u32;
+pub const ERROR_DS_CROSS_REF_BUSY: WIN32_ERROR = 8602u32;
+pub const ERROR_DS_CROSS_REF_EXISTS: WIN32_ERROR = 8374u32;
+pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE: WIN32_ERROR = 8495u32;
+pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2: WIN32_ERROR = 8586u32;
+pub const ERROR_DS_DATABASE_ERROR: WIN32_ERROR = 8409u32;
+pub const ERROR_DS_DECODING_ERROR: WIN32_ERROR = 8253u32;
+pub const ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED: WIN32_ERROR = 8536u32;
+pub const ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST: WIN32_ERROR = 8535u32;
+pub const ERROR_DS_DIFFERENT_REPL_EPOCHS: WIN32_ERROR = 8593u32;
+pub const ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER: WIN32_ERROR = 8615u32;
+pub const ERROR_DS_DISALLOWED_NC_REDIRECT: WIN32_ERROR = 8640u32;
+pub const ERROR_DS_DNS_LOOKUP_FAILURE: WIN32_ERROR = 8524u32;
+pub const ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST: WIN32_ERROR = 8634u32;
+pub const ERROR_DS_DOMAIN_RENAME_IN_PROGRESS: WIN32_ERROR = 8612u32;
+pub const ERROR_DS_DOMAIN_VERSION_TOO_HIGH: WIN32_ERROR = 8564u32;
+pub const ERROR_DS_DOMAIN_VERSION_TOO_LOW: WIN32_ERROR = 8566u32;
+pub const ERROR_DS_DRA_ABANDON_SYNC: WIN32_ERROR = 8462u32;
+pub const ERROR_DS_DRA_ACCESS_DENIED: WIN32_ERROR = 8453u32;
+pub const ERROR_DS_DRA_BAD_DN: WIN32_ERROR = 8439u32;
+pub const ERROR_DS_DRA_BAD_INSTANCE_TYPE: WIN32_ERROR = 8445u32;
+pub const ERROR_DS_DRA_BAD_NC: WIN32_ERROR = 8440u32;
+pub const ERROR_DS_DRA_BUSY: WIN32_ERROR = 8438u32;
+pub const ERROR_DS_DRA_CONNECTION_FAILED: WIN32_ERROR = 8444u32;
+pub const ERROR_DS_DRA_CORRUPT_UTD_VECTOR: WIN32_ERROR = 8629u32;
+pub const ERROR_DS_DRA_DB_ERROR: WIN32_ERROR = 8451u32;
+pub const ERROR_DS_DRA_DN_EXISTS: WIN32_ERROR = 8441u32;
+pub const ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT: WIN32_ERROR = 8544u32;
+pub const ERROR_DS_DRA_EXTN_CONNECTION_FAILED: WIN32_ERROR = 8466u32;
+pub const ERROR_DS_DRA_GENERIC: WIN32_ERROR = 8436u32;
+pub const ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET: WIN32_ERROR = 8464u32;
+pub const ERROR_DS_DRA_INCONSISTENT_DIT: WIN32_ERROR = 8443u32;
+pub const ERROR_DS_DRA_INTERNAL_ERROR: WIN32_ERROR = 8442u32;
+pub const ERROR_DS_DRA_INVALID_PARAMETER: WIN32_ERROR = 8437u32;
+pub const ERROR_DS_DRA_MAIL_PROBLEM: WIN32_ERROR = 8447u32;
+pub const ERROR_DS_DRA_MISSING_KRBTGT_SECRET: WIN32_ERROR = 8633u32;
+pub const ERROR_DS_DRA_MISSING_PARENT: WIN32_ERROR = 8460u32;
+pub const ERROR_DS_DRA_NAME_COLLISION: WIN32_ERROR = 8458u32;
+pub const ERROR_DS_DRA_NOT_SUPPORTED: WIN32_ERROR = 8454u32;
+pub const ERROR_DS_DRA_NO_REPLICA: WIN32_ERROR = 8452u32;
+pub const ERROR_DS_DRA_OBJ_IS_REP_SOURCE: WIN32_ERROR = 8450u32;
+pub const ERROR_DS_DRA_OBJ_NC_MISMATCH: WIN32_ERROR = 8545u32;
+pub const ERROR_DS_DRA_OUT_OF_MEM: WIN32_ERROR = 8446u32;
+pub const ERROR_DS_DRA_OUT_SCHEDULE_WINDOW: WIN32_ERROR = 8617u32;
+pub const ERROR_DS_DRA_PREEMPTED: WIN32_ERROR = 8461u32;
+pub const ERROR_DS_DRA_RECYCLED_TARGET: WIN32_ERROR = 8639u32;
+pub const ERROR_DS_DRA_REF_ALREADY_EXISTS: WIN32_ERROR = 8448u32;
+pub const ERROR_DS_DRA_REF_NOT_FOUND: WIN32_ERROR = 8449u32;
+pub const ERROR_DS_DRA_REPL_PENDING: WIN32_ERROR = 8477u32;
+pub const ERROR_DS_DRA_RPC_CANCELLED: WIN32_ERROR = 8455u32;
+pub const ERROR_DS_DRA_SCHEMA_CONFLICT: WIN32_ERROR = 8543u32;
+pub const ERROR_DS_DRA_SCHEMA_INFO_SHIP: WIN32_ERROR = 8542u32;
+pub const ERROR_DS_DRA_SCHEMA_MISMATCH: WIN32_ERROR = 8418u32;
+pub const ERROR_DS_DRA_SECRETS_DENIED: WIN32_ERROR = 8630u32;
+pub const ERROR_DS_DRA_SHUTDOWN: WIN32_ERROR = 8463u32;
+pub const ERROR_DS_DRA_SINK_DISABLED: WIN32_ERROR = 8457u32;
+pub const ERROR_DS_DRA_SOURCE_DISABLED: WIN32_ERROR = 8456u32;
+pub const ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA: WIN32_ERROR = 8465u32;
+pub const ERROR_DS_DRA_SOURCE_REINSTALLED: WIN32_ERROR = 8459u32;
+pub const ERROR_DS_DRS_EXTENSIONS_CHANGED: WIN32_ERROR = 8594u32;
+pub const ERROR_DS_DSA_MUST_BE_INT_MASTER: WIN32_ERROR = 8342u32;
+pub const ERROR_DS_DST_DOMAIN_NOT_NATIVE: WIN32_ERROR = 8496u32;
+pub const ERROR_DS_DST_NC_MISMATCH: WIN32_ERROR = 8486u32;
+pub const ERROR_DS_DS_REQUIRED: WIN32_ERROR = 8478u32;
+pub const ERROR_DS_DUPLICATE_ID_FOUND: WIN32_ERROR = 8605u32;
+pub const ERROR_DS_DUP_LDAP_DISPLAY_NAME: WIN32_ERROR = 8382u32;
+pub const ERROR_DS_DUP_LINK_ID: WIN32_ERROR = 8468u32;
+pub const ERROR_DS_DUP_MAPI_ID: WIN32_ERROR = 8380u32;
+pub const ERROR_DS_DUP_MSDS_INTID: WIN32_ERROR = 8597u32;
+pub const ERROR_DS_DUP_OID: WIN32_ERROR = 8379u32;
+pub const ERROR_DS_DUP_RDN: WIN32_ERROR = 8378u32;
+pub const ERROR_DS_DUP_SCHEMA_ID_GUID: WIN32_ERROR = 8381u32;
+pub const ERROR_DS_ENCODING_ERROR: WIN32_ERROR = 8252u32;
+pub const ERROR_DS_EPOCH_MISMATCH: WIN32_ERROR = 8483u32;
+pub const ERROR_DS_EXISTING_AD_CHILD_NC: WIN32_ERROR = 8613u32;
+pub const ERROR_DS_EXISTS_IN_AUX_CLS: WIN32_ERROR = 8393u32;
+pub const ERROR_DS_EXISTS_IN_MAY_HAVE: WIN32_ERROR = 8386u32;
+pub const ERROR_DS_EXISTS_IN_MUST_HAVE: WIN32_ERROR = 8385u32;
+pub const ERROR_DS_EXISTS_IN_POSS_SUP: WIN32_ERROR = 8395u32;
+pub const ERROR_DS_EXISTS_IN_RDNATTID: WIN32_ERROR = 8598u32;
+pub const ERROR_DS_EXISTS_IN_SUB_CLS: WIN32_ERROR = 8394u32;
+pub const ERROR_DS_FILTER_UNKNOWN: WIN32_ERROR = 8254u32;
+pub const ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS: WIN32_ERROR = 8555u32;
+pub const ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST: WIN32_ERROR = 8635u32;
+pub const ERROR_DS_FOREST_VERSION_TOO_HIGH: WIN32_ERROR = 8563u32;
+pub const ERROR_DS_FOREST_VERSION_TOO_LOW: WIN32_ERROR = 8565u32;
+pub const ERROR_DS_GCVERIFY_ERROR: WIN32_ERROR = 8417u32;
+pub const ERROR_DS_GC_NOT_AVAILABLE: WIN32_ERROR = 8217u32;
+pub const ERROR_DS_GC_REQUIRED: WIN32_ERROR = 8547u32;
+pub const ERROR_DS_GENERIC_ERROR: WIN32_ERROR = 8341u32;
+pub const ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER: WIN32_ERROR = 8519u32;
+pub const ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER: WIN32_ERROR = 8516u32;
+pub const ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER: WIN32_ERROR = 8517u32;
+pub const ERROR_DS_GOVERNSID_MISSING: WIN32_ERROR = 8410u32;
+pub const ERROR_DS_GROUP_CONVERSION_ERROR: WIN32_ERROR = 8607u32;
+pub const ERROR_DS_HAVE_PRIMARY_MEMBERS: WIN32_ERROR = 8521u32;
+pub const ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED: WIN32_ERROR = 8429u32;
+pub const ERROR_DS_HIERARCHY_TABLE_TOO_DEEP: WIN32_ERROR = 8628u32;
+pub const ERROR_DS_HIGH_ADLDS_FFL: WIN32_ERROR = 8641u32;
+pub const ERROR_DS_HIGH_DSA_VERSION: WIN32_ERROR = 8642u32;
+pub const ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD: WIN32_ERROR = 8507u32;
+pub const ERROR_DS_ILLEGAL_MOD_OPERATION: WIN32_ERROR = 8311u32;
+pub const ERROR_DS_ILLEGAL_SUPERIOR: WIN32_ERROR = 8345u32;
+pub const ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION: WIN32_ERROR = 8492u32;
+pub const ERROR_DS_INAPPROPRIATE_AUTH: WIN32_ERROR = 8233u32;
+pub const ERROR_DS_INAPPROPRIATE_MATCHING: WIN32_ERROR = 8238u32;
+pub const ERROR_DS_INCOMPATIBLE_CONTROLS_USED: WIN32_ERROR = 8574u32;
+pub const ERROR_DS_INCOMPATIBLE_VERSION: WIN32_ERROR = 8567u32;
+pub const ERROR_DS_INCORRECT_ROLE_OWNER: WIN32_ERROR = 8210u32;
+pub const ERROR_DS_INIT_FAILURE: WIN32_ERROR = 8532u32;
+pub const ERROR_DS_INIT_FAILURE_CONSOLE: WIN32_ERROR = 8561u32;
+pub const ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE: WIN32_ERROR = 8512u32;
+pub const ERROR_DS_INSTALL_NO_SRC_SCH_VERSION: WIN32_ERROR = 8511u32;
+pub const ERROR_DS_INSTALL_SCHEMA_MISMATCH: WIN32_ERROR = 8467u32;
+pub const ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT: WIN32_ERROR = 8606u32;
+pub const ERROR_DS_INSUFF_ACCESS_RIGHTS: WIN32_ERROR = 8344u32;
+pub const ERROR_DS_INTERNAL_FAILURE: WIN32_ERROR = 8430u32;
+pub const ERROR_DS_INVALID_ATTRIBUTE_SYNTAX: WIN32_ERROR = 8203u32;
+pub const ERROR_DS_INVALID_DMD: WIN32_ERROR = 8360u32;
+pub const ERROR_DS_INVALID_DN_SYNTAX: WIN32_ERROR = 8242u32;
+pub const ERROR_DS_INVALID_GROUP_TYPE: WIN32_ERROR = 8513u32;
+pub const ERROR_DS_INVALID_LDAP_DISPLAY_NAME: WIN32_ERROR = 8479u32;
+pub const ERROR_DS_INVALID_NAME_FOR_SPN: WIN32_ERROR = 8554u32;
+pub const ERROR_DS_INVALID_ROLE_OWNER: WIN32_ERROR = 8366u32;
+pub const ERROR_DS_INVALID_SCRIPT: WIN32_ERROR = 8600u32;
+pub const ERROR_DS_INVALID_SEARCH_FLAG: WIN32_ERROR = 8500u32;
+pub const ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE: WIN32_ERROR = 8626u32;
+pub const ERROR_DS_INVALID_SEARCH_FLAG_TUPLE: WIN32_ERROR = 8627u32;
+pub const ERROR_DS_IS_LEAF: WIN32_ERROR = 8243u32;
+pub const ERROR_DS_KEY_NOT_UNIQUE: WIN32_ERROR = 8527u32;
+pub const ERROR_DS_LDAP_SEND_QUEUE_FULL: WIN32_ERROR = 8616u32;
+pub const ERROR_DS_LINK_ID_NOT_AVAILABLE: WIN32_ERROR = 8577u32;
+pub const ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER: WIN32_ERROR = 8520u32;
+pub const ERROR_DS_LOCAL_ERROR: WIN32_ERROR = 8251u32;
+pub const ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY: WIN32_ERROR = 8548u32;
+pub const ERROR_DS_LOOP_DETECT: WIN32_ERROR = 8246u32;
+pub const ERROR_DS_LOW_ADLDS_FFL: WIN32_ERROR = 8643u32;
+pub const ERROR_DS_LOW_DSA_VERSION: WIN32_ERROR = 8568u32;
+pub const ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4: WIN32_ERROR = 8572u32;
+pub const ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED: WIN32_ERROR = 8557u32;
+pub const ERROR_DS_MAPI_ID_NOT_AVAILABLE: WIN32_ERROR = 8632u32;
+pub const ERROR_DS_MASTERDSA_REQUIRED: WIN32_ERROR = 8314u32;
+pub const ERROR_DS_MAX_OBJ_SIZE_EXCEEDED: WIN32_ERROR = 8304u32;
+pub const ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY: WIN32_ERROR = 8201u32;
+pub const ERROR_DS_MISSING_EXPECTED_ATT: WIN32_ERROR = 8411u32;
+pub const ERROR_DS_MISSING_FOREST_TRUST: WIN32_ERROR = 8649u32;
+pub const ERROR_DS_MISSING_FSMO_SETTINGS: WIN32_ERROR = 8434u32;
+pub const ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER: WIN32_ERROR = 8497u32;
+pub const ERROR_DS_MISSING_REQUIRED_ATT: WIN32_ERROR = 8316u32;
+pub const ERROR_DS_MISSING_SUPREF: WIN32_ERROR = 8406u32;
+pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG: WIN32_ERROR = 8581u32;
+pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE: WIN32_ERROR = 8579u32;
+pub const ERROR_DS_MODIFYDN_WRONG_GRANDPARENT: WIN32_ERROR = 8582u32;
+pub const ERROR_DS_MUST_BE_RUN_ON_DST_DC: WIN32_ERROR = 8558u32;
+pub const ERROR_DS_NAME_ERROR_DOMAIN_ONLY: WIN32_ERROR = 8473u32;
+pub const ERROR_DS_NAME_ERROR_NOT_FOUND: WIN32_ERROR = 8470u32;
+pub const ERROR_DS_NAME_ERROR_NOT_UNIQUE: WIN32_ERROR = 8471u32;
+pub const ERROR_DS_NAME_ERROR_NO_MAPPING: WIN32_ERROR = 8472u32;
+pub const ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING: WIN32_ERROR = 8474u32;
+pub const ERROR_DS_NAME_ERROR_RESOLVING: WIN32_ERROR = 8469u32;
+pub const ERROR_DS_NAME_ERROR_TRUST_REFERRAL: WIN32_ERROR = 8583u32;
+pub const ERROR_DS_NAME_NOT_UNIQUE: WIN32_ERROR = 8571u32;
+pub const ERROR_DS_NAME_REFERENCE_INVALID: WIN32_ERROR = 8373u32;
+pub const ERROR_DS_NAME_TOO_LONG: WIN32_ERROR = 8348u32;
+pub const ERROR_DS_NAME_TOO_MANY_PARTS: WIN32_ERROR = 8347u32;
+pub const ERROR_DS_NAME_TYPE_UNKNOWN: WIN32_ERROR = 8351u32;
+pub const ERROR_DS_NAME_UNPARSEABLE: WIN32_ERROR = 8350u32;
+pub const ERROR_DS_NAME_VALUE_TOO_LONG: WIN32_ERROR = 8349u32;
+pub const ERROR_DS_NAMING_MASTER_GC: WIN32_ERROR = 8523u32;
+pub const ERROR_DS_NAMING_VIOLATION: WIN32_ERROR = 8247u32;
+pub const ERROR_DS_NCNAME_MISSING_CR_REF: WIN32_ERROR = 8412u32;
+pub const ERROR_DS_NCNAME_MUST_BE_NC: WIN32_ERROR = 8357u32;
+pub const ERROR_DS_NC_MUST_HAVE_NC_PARENT: WIN32_ERROR = 8494u32;
+pub const ERROR_DS_NC_STILL_HAS_DSAS: WIN32_ERROR = 8546u32;
+pub const ERROR_DS_NONEXISTENT_MAY_HAVE: WIN32_ERROR = 8387u32;
+pub const ERROR_DS_NONEXISTENT_MUST_HAVE: WIN32_ERROR = 8388u32;
+pub const ERROR_DS_NONEXISTENT_POSS_SUP: WIN32_ERROR = 8390u32;
+pub const ERROR_DS_NONSAFE_SCHEMA_CHANGE: WIN32_ERROR = 8508u32;
+pub const ERROR_DS_NON_ASQ_SEARCH: WIN32_ERROR = 8624u32;
+pub const ERROR_DS_NON_BASE_SEARCH: WIN32_ERROR = 8480u32;
+pub const ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX: WIN32_ERROR = 8377u32;
+pub const ERROR_DS_NOT_AN_OBJECT: WIN32_ERROR = 8352u32;
+pub const ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC: WIN32_ERROR = 8487u32;
+pub const ERROR_DS_NOT_CLOSEST: WIN32_ERROR = 8588u32;
+pub const ERROR_DS_NOT_INSTALLED: WIN32_ERROR = 8200u32;
+pub const ERROR_DS_NOT_ON_BACKLINK: WIN32_ERROR = 8362u32;
+pub const ERROR_DS_NOT_SUPPORTED: WIN32_ERROR = 8256u32;
+pub const ERROR_DS_NOT_SUPPORTED_SORT_ORDER: WIN32_ERROR = 8570u32;
+pub const ERROR_DS_NO_ATTRIBUTE_OR_VALUE: WIN32_ERROR = 8202u32;
+pub const ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN: WIN32_ERROR = 8569u32;
+pub const ERROR_DS_NO_CHAINED_EVAL: WIN32_ERROR = 8328u32;
+pub const ERROR_DS_NO_CHAINING: WIN32_ERROR = 8327u32;
+pub const ERROR_DS_NO_CHECKPOINT_WITH_PDC: WIN32_ERROR = 8551u32;
+pub const ERROR_DS_NO_CROSSREF_FOR_NC: WIN32_ERROR = 8363u32;
+pub const ERROR_DS_NO_DELETED_NAME: WIN32_ERROR = 8355u32;
+pub const ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS: WIN32_ERROR = 8549u32;
+pub const ERROR_DS_NO_MORE_RIDS: WIN32_ERROR = 8209u32;
+pub const ERROR_DS_NO_MSDS_INTID: WIN32_ERROR = 8596u32;
+pub const ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN: WIN32_ERROR = 8514u32;
+pub const ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN: WIN32_ERROR = 8515u32;
+pub const ERROR_DS_NO_NTDSA_OBJECT: WIN32_ERROR = 8623u32;
+pub const ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC: WIN32_ERROR = 8580u32;
+pub const ERROR_DS_NO_PARENT_OBJECT: WIN32_ERROR = 8329u32;
+pub const ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION: WIN32_ERROR = 8533u32;
+pub const ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA: WIN32_ERROR = 8306u32;
+pub const ERROR_DS_NO_REF_DOMAIN: WIN32_ERROR = 8575u32;
+pub const ERROR_DS_NO_REQUESTED_ATTS_FOUND: WIN32_ERROR = 8308u32;
+pub const ERROR_DS_NO_RESULTS_RETURNED: WIN32_ERROR = 8257u32;
+pub const ERROR_DS_NO_RIDS_ALLOCATED: WIN32_ERROR = 8208u32;
+pub const ERROR_DS_NO_SERVER_OBJECT: WIN32_ERROR = 8622u32;
+pub const ERROR_DS_NO_SUCH_OBJECT: WIN32_ERROR = 8240u32;
+pub const ERROR_DS_NO_TREE_DELETE_ABOVE_NC: WIN32_ERROR = 8501u32;
+pub const ERROR_DS_NTDSCRIPT_PROCESS_ERROR: WIN32_ERROR = 8592u32;
+pub const ERROR_DS_NTDSCRIPT_SYNTAX_ERROR: WIN32_ERROR = 8591u32;
+pub const ERROR_DS_OBJECT_BEING_REMOVED: WIN32_ERROR = 8339u32;
+pub const ERROR_DS_OBJECT_CLASS_REQUIRED: WIN32_ERROR = 8315u32;
+pub const ERROR_DS_OBJECT_RESULTS_TOO_LARGE: WIN32_ERROR = 8248u32;
+pub const ERROR_DS_OBJ_CLASS_NOT_DEFINED: WIN32_ERROR = 8371u32;
+pub const ERROR_DS_OBJ_CLASS_NOT_SUBCLASS: WIN32_ERROR = 8372u32;
+pub const ERROR_DS_OBJ_CLASS_VIOLATION: WIN32_ERROR = 8212u32;
+pub const ERROR_DS_OBJ_GUID_EXISTS: WIN32_ERROR = 8361u32;
+pub const ERROR_DS_OBJ_NOT_FOUND: WIN32_ERROR = 8333u32;
+pub const ERROR_DS_OBJ_STRING_NAME_EXISTS: WIN32_ERROR = 8305u32;
+pub const ERROR_DS_OBJ_TOO_LARGE: WIN32_ERROR = 8312u32;
+pub const ERROR_DS_OFFSET_RANGE_ERROR: WIN32_ERROR = 8262u32;
+pub const ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS: WIN32_ERROR = 8637u32;
+pub const ERROR_DS_OID_NOT_FOUND: WIN32_ERROR = 8638u32;
+pub const ERROR_DS_OPERATIONS_ERROR: WIN32_ERROR = 8224u32;
+pub const ERROR_DS_OUT_OF_SCOPE: WIN32_ERROR = 8338u32;
+pub const ERROR_DS_OUT_OF_VERSION_STORE: WIN32_ERROR = 8573u32;
+pub const ERROR_DS_PARAM_ERROR: WIN32_ERROR = 8255u32;
+pub const ERROR_DS_PARENT_IS_AN_ALIAS: WIN32_ERROR = 8330u32;
+pub const ERROR_DS_PDC_OPERATION_IN_PROGRESS: WIN32_ERROR = 8490u32;
+pub const ERROR_DS_PER_ATTRIBUTE_AUTHZ_FAILED_DURING_ADD: WIN32_ERROR = 8652u32;
+pub const ERROR_DS_POLICY_NOT_KNOWN: WIN32_ERROR = 8618u32;
+pub const ERROR_DS_PROTOCOL_ERROR: WIN32_ERROR = 8225u32;
+pub const ERROR_DS_RANGE_CONSTRAINT: WIN32_ERROR = 8322u32;
+pub const ERROR_DS_RDN_DOESNT_MATCH_SCHEMA: WIN32_ERROR = 8307u32;
+pub const ERROR_DS_RECALCSCHEMA_FAILED: WIN32_ERROR = 8396u32;
+pub const ERROR_DS_REFERRAL: WIN32_ERROR = 8235u32;
+pub const ERROR_DS_REFERRAL_LIMIT_EXCEEDED: WIN32_ERROR = 8260u32;
+pub const ERROR_DS_REFUSING_FSMO_ROLES: WIN32_ERROR = 8433u32;
+pub const ERROR_DS_REMOTE_CROSSREF_OP_FAILED: WIN32_ERROR = 8601u32;
+pub const ERROR_DS_REPLICATOR_ONLY: WIN32_ERROR = 8370u32;
+pub const ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR: WIN32_ERROR = 8595u32;
+pub const ERROR_DS_REPL_LIFETIME_EXCEEDED: WIN32_ERROR = 8614u32;
+pub const ERROR_DS_RESERVED_LINK_ID: WIN32_ERROR = 8576u32;
+pub const ERROR_DS_RESERVED_MAPI_ID: WIN32_ERROR = 8631u32;
+pub const ERROR_DS_RIDMGR_DISABLED: WIN32_ERROR = 8263u32;
+pub const ERROR_DS_RIDMGR_INIT_ERROR: WIN32_ERROR = 8211u32;
+pub const ERROR_DS_ROLE_NOT_VERIFIED: WIN32_ERROR = 8610u32;
+pub const ERROR_DS_ROOT_CANT_BE_SUBREF: WIN32_ERROR = 8326u32;
+pub const ERROR_DS_ROOT_MUST_BE_NC: WIN32_ERROR = 8301u32;
+pub const ERROR_DS_ROOT_REQUIRES_CLASS_TOP: WIN32_ERROR = 8432u32;
+pub const ERROR_DS_SAM_INIT_FAILURE: WIN32_ERROR = 8504u32;
+pub const ERROR_DS_SAM_INIT_FAILURE_CONSOLE: WIN32_ERROR = 8562u32;
+pub const ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY: WIN32_ERROR = 8530u32;
+pub const ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD: WIN32_ERROR = 8529u32;
+pub const ERROR_DS_SCHEMA_ALLOC_FAILED: WIN32_ERROR = 8415u32;
+pub const ERROR_DS_SCHEMA_NOT_LOADED: WIN32_ERROR = 8414u32;
+pub const ERROR_DS_SCHEMA_UPDATE_DISALLOWED: WIN32_ERROR = 8509u32;
+pub const ERROR_DS_SECURITY_CHECKING_ERROR: WIN32_ERROR = 8413u32;
+pub const ERROR_DS_SECURITY_ILLEGAL_MODIFY: WIN32_ERROR = 8423u32;
+pub const ERROR_DS_SEC_DESC_INVALID: WIN32_ERROR = 8354u32;
+pub const ERROR_DS_SEC_DESC_TOO_SHORT: WIN32_ERROR = 8353u32;
+pub const ERROR_DS_SEMANTIC_ATT_TEST: WIN32_ERROR = 8383u32;
+pub const ERROR_DS_SENSITIVE_GROUP_VIOLATION: WIN32_ERROR = 8505u32;
+pub const ERROR_DS_SERVER_DOWN: WIN32_ERROR = 8250u32;
+pub const ERROR_DS_SHUTTING_DOWN: WIN32_ERROR = 8364u32;
+pub const ERROR_DS_SINGLE_USER_MODE_FAILED: WIN32_ERROR = 8590u32;
+pub const ERROR_DS_SINGLE_VALUE_CONSTRAINT: WIN32_ERROR = 8321u32;
+pub const ERROR_DS_SIZELIMIT_EXCEEDED: WIN32_ERROR = 8227u32;
+pub const ERROR_DS_SORT_CONTROL_MISSING: WIN32_ERROR = 8261u32;
+pub const ERROR_DS_SOURCE_AUDITING_NOT_ENABLED: WIN32_ERROR = 8552u32;
+pub const ERROR_DS_SOURCE_DOMAIN_IN_FOREST: WIN32_ERROR = 8534u32;
+pub const ERROR_DS_SPN_VALUE_NOT_UNIQUE_IN_FOREST: WIN32_ERROR = 8647u32;
+pub const ERROR_DS_SRC_AND_DST_NC_IDENTICAL: WIN32_ERROR = 8485u32;
+pub const ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH: WIN32_ERROR = 8540u32;
+pub const ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER: WIN32_ERROR = 8559u32;
+pub const ERROR_DS_SRC_GUID_MISMATCH: WIN32_ERROR = 8488u32;
+pub const ERROR_DS_SRC_NAME_MISMATCH: WIN32_ERROR = 8484u32;
+pub const ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER: WIN32_ERROR = 8538u32;
+pub const ERROR_DS_SRC_SID_EXISTS_IN_FOREST: WIN32_ERROR = 8539u32;
+pub const ERROR_DS_STRING_SD_CONVERSION_FAILED: WIN32_ERROR = 8522u32;
+pub const ERROR_DS_STRONG_AUTH_REQUIRED: WIN32_ERROR = 8232u32;
+pub const ERROR_DS_SUBREF_MUST_HAVE_PARENT: WIN32_ERROR = 8356u32;
+pub const ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD: WIN32_ERROR = 8376u32;
+pub const ERROR_DS_SUB_CLS_TEST_FAIL: WIN32_ERROR = 8391u32;
+pub const ERROR_DS_SYNTAX_MISMATCH: WIN32_ERROR = 8384u32;
+pub const ERROR_DS_THREAD_LIMIT_EXCEEDED: WIN32_ERROR = 8587u32;
+pub const ERROR_DS_TIMELIMIT_EXCEEDED: WIN32_ERROR = 8226u32;
+pub const ERROR_DS_TREE_DELETE_NOT_FINISHED: WIN32_ERROR = 8397u32;
+pub const ERROR_DS_UNABLE_TO_SURRENDER_ROLES: WIN32_ERROR = 8435u32;
+pub const ERROR_DS_UNAVAILABLE: WIN32_ERROR = 8207u32;
+pub const ERROR_DS_UNAVAILABLE_CRIT_EXTENSION: WIN32_ERROR = 8236u32;
+pub const ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED: WIN32_ERROR = 8645u32;
+pub const ERROR_DS_UNICODEPWD_NOT_IN_QUOTES: WIN32_ERROR = 8556u32;
+pub const ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER: WIN32_ERROR = 8518u32;
+pub const ERROR_DS_UNKNOWN_ERROR: WIN32_ERROR = 8431u32;
+pub const ERROR_DS_UNKNOWN_OPERATION: WIN32_ERROR = 8365u32;
+pub const ERROR_DS_UNWILLING_TO_PERFORM: WIN32_ERROR = 8245u32;
+pub const ERROR_DS_UPN_VALUE_NOT_UNIQUE_IN_FOREST: WIN32_ERROR = 8648u32;
+pub const ERROR_DS_USER_BUFFER_TO_SMALL: WIN32_ERROR = 8309u32;
+pub const ERROR_DS_VALUE_KEY_NOT_UNIQUE: WIN32_ERROR = 8650u32;
+pub const ERROR_DS_VERSION_CHECK_FAILURE: WIN32_ERROR = 643u32;
+pub const ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL: WIN32_ERROR = 8611u32;
+pub const ERROR_DS_WRONG_LINKED_ATT_SYNTAX: WIN32_ERROR = 8528u32;
+pub const ERROR_DS_WRONG_OM_OBJ_CLASS: WIN32_ERROR = 8476u32;
+pub const ERROR_DUPLICATE_PRIVILEGES: WIN32_ERROR = 311u32;
+pub const ERROR_DUPLICATE_SERVICE_NAME: WIN32_ERROR = 1078u32;
+pub const ERROR_DUP_DOMAINNAME: WIN32_ERROR = 1221u32;
+pub const ERROR_DUP_NAME: WIN32_ERROR = 52u32;
+pub const ERROR_DYNAMIC_CODE_BLOCKED: WIN32_ERROR = 1655u32;
+pub const ERROR_DYNLINK_FROM_INVALID_RING: WIN32_ERROR = 196u32;
+pub const ERROR_EAS_DIDNT_FIT: WIN32_ERROR = 275u32;
+pub const ERROR_EAS_NOT_SUPPORTED: WIN32_ERROR = 282u32;
+pub const ERROR_EA_ACCESS_DENIED: WIN32_ERROR = 994u32;
+pub const ERROR_EA_FILE_CORRUPT: WIN32_ERROR = 276u32;
+pub const ERROR_EA_LIST_INCONSISTENT: WIN32_ERROR = 255u32;
+pub const ERROR_EA_TABLE_FULL: WIN32_ERROR = 277u32;
+pub const ERROR_EDP_DPL_POLICY_CANT_BE_SATISFIED: WIN32_ERROR = 357u32;
+pub const ERROR_EDP_POLICY_DENIES_OPERATION: WIN32_ERROR = 356u32;
+pub const ERROR_EFS_ALG_BLOB_TOO_BIG: WIN32_ERROR = 6013u32;
+pub const ERROR_EFS_DISABLED: WIN32_ERROR = 6015u32;
+pub const ERROR_EFS_SERVER_NOT_TRUSTED: WIN32_ERROR = 6011u32;
+pub const ERROR_EFS_VERSION_NOT_SUPPORT: WIN32_ERROR = 6016u32;
+pub const ERROR_ELEVATION_REQUIRED: WIN32_ERROR = 740u32;
+pub const ERROR_ENCLAVE_FAILURE: WIN32_ERROR = 349u32;
+pub const ERROR_ENCLAVE_NOT_TERMINATED: WIN32_ERROR = 814u32;
+pub const ERROR_ENCLAVE_VIOLATION: WIN32_ERROR = 815u32;
+pub const ERROR_ENCRYPTED_FILE_NOT_SUPPORTED: WIN32_ERROR = 489u32;
+pub const ERROR_ENCRYPTED_IO_NOT_POSSIBLE: WIN32_ERROR = 808u32;
+pub const ERROR_ENCRYPTING_METADATA_DISALLOWED: WIN32_ERROR = 431u32;
+pub const ERROR_ENCRYPTION_DISABLED: WIN32_ERROR = 430u32;
+pub const ERROR_ENCRYPTION_FAILED: WIN32_ERROR = 6000u32;
+pub const ERROR_ENCRYPTION_POLICY_DENIES_OPERATION: WIN32_ERROR = 6022u32;
+pub const ERROR_END_OF_MEDIA: WIN32_ERROR = 1100u32;
+pub const ERROR_ENVVAR_NOT_FOUND: WIN32_ERROR = 203u32;
+pub const ERROR_EOM_OVERFLOW: WIN32_ERROR = 1129u32;
+pub const ERROR_ERRORS_ENCOUNTERED: WIN32_ERROR = 774u32;
+pub const ERROR_EVALUATION_EXPIRATION: WIN32_ERROR = 622u32;
+pub const ERROR_EVENTLOG_CANT_START: WIN32_ERROR = 1501u32;
+pub const ERROR_EVENTLOG_FILE_CHANGED: WIN32_ERROR = 1503u32;
+pub const ERROR_EVENTLOG_FILE_CORRUPT: WIN32_ERROR = 1500u32;
+pub const ERROR_EVENT_DONE: WIN32_ERROR = 710u32;
+pub const ERROR_EVENT_PENDING: WIN32_ERROR = 711u32;
+pub const ERROR_EXCEPTION_IN_SERVICE: WIN32_ERROR = 1064u32;
+pub const ERROR_EXCL_SEM_ALREADY_OWNED: WIN32_ERROR = 101u32;
+pub const ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY: WIN32_ERROR = 217u32;
+pub const ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY: WIN32_ERROR = 218u32;
+pub const ERROR_EXE_MACHINE_TYPE_MISMATCH: WIN32_ERROR = 216u32;
+pub const ERROR_EXE_MARKED_INVALID: WIN32_ERROR = 192u32;
+pub const ERROR_EXTENDED_ERROR: WIN32_ERROR = 1208u32;
+pub const ERROR_EXTERNAL_BACKING_PROVIDER_UNKNOWN: WIN32_ERROR = 343u32;
+pub const ERROR_EXTERNAL_SYSKEY_NOT_SUPPORTED: WIN32_ERROR = 399u32;
+pub const ERROR_EXTRANEOUS_INFORMATION: WIN32_ERROR = 677u32;
+pub const ERROR_FAILED_DRIVER_ENTRY: WIN32_ERROR = 647u32;
+pub const ERROR_FAILED_SERVICE_CONTROLLER_CONNECT: WIN32_ERROR = 1063u32;
+pub const ERROR_FAIL_FAST_EXCEPTION: WIN32_ERROR = 1653u32;
+pub const ERROR_FAIL_I24: WIN32_ERROR = 83u32;
+pub const ERROR_FAIL_NOACTION_REBOOT: WIN32_ERROR = 350u32;
+pub const ERROR_FAIL_RESTART: WIN32_ERROR = 352u32;
+pub const ERROR_FAIL_SHUTDOWN: WIN32_ERROR = 351u32;
+pub const ERROR_FATAL_APP_EXIT: WIN32_ERROR = 713u32;
+pub const ERROR_FILEMARK_DETECTED: WIN32_ERROR = 1101u32;
+pub const ERROR_FILENAME_EXCED_RANGE: WIN32_ERROR = 206u32;
+pub const ERROR_FILE_CHECKED_OUT: WIN32_ERROR = 220u32;
+pub const ERROR_FILE_CORRUPT: WIN32_ERROR = 1392u32;
+pub const ERROR_FILE_ENCRYPTED: WIN32_ERROR = 6002u32;
+pub const ERROR_FILE_EXISTS: WIN32_ERROR = 80u32;
+pub const ERROR_FILE_HANDLE_REVOKED: WIN32_ERROR = 806u32;
+pub const ERROR_FILE_INVALID: WIN32_ERROR = 1006u32;
+pub const ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED: WIN32_ERROR = 326u32;
+pub const ERROR_FILE_METADATA_OPTIMIZATION_IN_PROGRESS: WIN32_ERROR = 809u32;
+pub const ERROR_FILE_NOT_ENCRYPTED: WIN32_ERROR = 6007u32;
+pub const ERROR_FILE_NOT_FOUND: WIN32_ERROR = 2u32;
+pub const ERROR_FILE_NOT_SUPPORTED: WIN32_ERROR = 425u32;
+pub const ERROR_FILE_OFFLINE: WIN32_ERROR = 4350u32;
+pub const ERROR_FILE_PROTECTED_UNDER_DPL: WIN32_ERROR = 406u32;
+pub const ERROR_FILE_READ_ONLY: WIN32_ERROR = 6009u32;
+pub const ERROR_FILE_SNAP_INVALID_PARAMETER: WIN32_ERROR = 440u32;
+pub const ERROR_FILE_SNAP_IN_PROGRESS: WIN32_ERROR = 435u32;
+pub const ERROR_FILE_SNAP_IO_NOT_COORDINATED: WIN32_ERROR = 438u32;
+pub const ERROR_FILE_SNAP_MODIFY_NOT_SUPPORTED: WIN32_ERROR = 437u32;
+pub const ERROR_FILE_SNAP_UNEXPECTED_ERROR: WIN32_ERROR = 439u32;
+pub const ERROR_FILE_SNAP_USER_SECTION_NOT_SUPPORTED: WIN32_ERROR = 436u32;
+pub const ERROR_FILE_SYSTEM_LIMITATION: WIN32_ERROR = 665u32;
+pub const ERROR_FILE_SYSTEM_VIRTUALIZATION_BUSY: WIN32_ERROR = 371u32;
+pub const ERROR_FILE_SYSTEM_VIRTUALIZATION_INVALID_OPERATION: WIN32_ERROR = 385u32;
+pub const ERROR_FILE_SYSTEM_VIRTUALIZATION_METADATA_CORRUPT: WIN32_ERROR = 370u32;
+pub const ERROR_FILE_SYSTEM_VIRTUALIZATION_PROVIDER_UNKNOWN: WIN32_ERROR = 372u32;
+pub const ERROR_FILE_SYSTEM_VIRTUALIZATION_UNAVAILABLE: WIN32_ERROR = 369u32;
+pub const ERROR_FILE_TOO_LARGE: WIN32_ERROR = 223u32;
+pub const ERROR_FIRMWARE_UPDATED: WIN32_ERROR = 728u32;
+pub const ERROR_FLOAT_MULTIPLE_FAULTS: WIN32_ERROR = 630u32;
+pub const ERROR_FLOAT_MULTIPLE_TRAPS: WIN32_ERROR = 631u32;
+pub const ERROR_FLOPPY_BAD_REGISTERS: WIN32_ERROR = 1125u32;
+pub const ERROR_FLOPPY_ID_MARK_NOT_FOUND: WIN32_ERROR = 1122u32;
+pub const ERROR_FLOPPY_UNKNOWN_ERROR: WIN32_ERROR = 1124u32;
+pub const ERROR_FLOPPY_VOLUME: WIN32_ERROR = 584u32;
+pub const ERROR_FLOPPY_WRONG_CYLINDER: WIN32_ERROR = 1123u32;
+pub const ERROR_FORMS_AUTH_REQUIRED: WIN32_ERROR = 224u32;
+pub const ERROR_FOUND_OUT_OF_SCOPE: WIN32_ERROR = 601u32;
+pub const ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY: WIN32_ERROR = 762u32;
+pub const ERROR_FS_DRIVER_REQUIRED: WIN32_ERROR = 588u32;
+pub const ERROR_FS_METADATA_INCONSISTENT: WIN32_ERROR = 510u32;
+pub const ERROR_FT_DI_SCAN_REQUIRED: WIN32_ERROR = 339u32;
+pub const ERROR_FT_READ_FAILURE: WIN32_ERROR = 415u32;
+pub const ERROR_FT_READ_FROM_COPY_FAILURE: WIN32_ERROR = 818u32;
+pub const ERROR_FT_READ_RECOVERY_FROM_BACKUP: WIN32_ERROR = 704u32;
+pub const ERROR_FT_WRITE_FAILURE: WIN32_ERROR = 338u32;
+pub const ERROR_FT_WRITE_RECOVERY: WIN32_ERROR = 705u32;
+pub const ERROR_FULLSCREEN_MODE: WIN32_ERROR = 1007u32;
+pub const ERROR_FUNCTION_FAILED: WIN32_ERROR = 1627u32;
+pub const ERROR_FUNCTION_NOT_CALLED: WIN32_ERROR = 1626u32;
+pub const ERROR_GDI_HANDLE_LEAK: WIN32_ERROR = 373u32;
+pub const ERROR_GENERIC_NOT_MAPPED: WIN32_ERROR = 1360u32;
+pub const ERROR_GEN_FAILURE: WIN32_ERROR = 31u32;
+pub const ERROR_GLOBAL_ONLY_HOOK: WIN32_ERROR = 1429u32;
+pub const ERROR_GRACEFUL_DISCONNECT: WIN32_ERROR = 1226u32;
+pub const ERROR_GROUP_EXISTS: WIN32_ERROR = 1318u32;
+pub const ERROR_GUID_SUBSTITUTION_MADE: WIN32_ERROR = 680u32;
+pub const ERROR_HANDLES_CLOSED: WIN32_ERROR = 676u32;
+pub const ERROR_HANDLE_DISK_FULL: WIN32_ERROR = 39u32;
+pub const ERROR_HANDLE_EOF: WIN32_ERROR = 38u32;
+pub const ERROR_HANDLE_REVOKED: WIN32_ERROR = 811u32;
+pub const ERROR_HAS_SYSTEM_CRITICAL_FILES: WIN32_ERROR = 488u32;
+pub const ERROR_HIBERNATED: WIN32_ERROR = 726u32;
+pub const ERROR_HIBERNATION_FAILURE: WIN32_ERROR = 656u32;
+pub const ERROR_HOOK_NEEDS_HMOD: WIN32_ERROR = 1428u32;
+pub const ERROR_HOOK_NOT_INSTALLED: WIN32_ERROR = 1431u32;
+pub const ERROR_HOOK_TYPE_NOT_ALLOWED: WIN32_ERROR = 1458u32;
+pub const ERROR_HOST_DOWN: WIN32_ERROR = 1256u32;
+pub const ERROR_HOST_UNREACHABLE: WIN32_ERROR = 1232u32;
+pub const ERROR_HOTKEY_ALREADY_REGISTERED: WIN32_ERROR = 1409u32;
+pub const ERROR_HOTKEY_NOT_REGISTERED: WIN32_ERROR = 1419u32;
+pub const ERROR_HWNDS_HAVE_DIFF_PARENT: WIN32_ERROR = 1441u32;
+pub const ERROR_ILLEGAL_CHARACTER: WIN32_ERROR = 582u32;
+pub const ERROR_ILLEGAL_DLL_RELOCATION: WIN32_ERROR = 623u32;
+pub const ERROR_ILLEGAL_ELEMENT_ADDRESS: WIN32_ERROR = 1162u32;
+pub const ERROR_ILLEGAL_FLOAT_CONTEXT: WIN32_ERROR = 579u32;
+pub const ERROR_ILL_FORMED_PASSWORD: WIN32_ERROR = 1324u32;
+pub const ERROR_IMAGE_AT_DIFFERENT_BASE: WIN32_ERROR = 807u32;
+pub const ERROR_IMAGE_MACHINE_TYPE_MISMATCH: WIN32_ERROR = 706u32;
+pub const ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE: WIN32_ERROR = 720u32;
+pub const ERROR_IMAGE_NOT_AT_BASE: WIN32_ERROR = 700u32;
+pub const ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT: WIN32_ERROR = 308u32;
+pub const ERROR_IMPLEMENTATION_LIMIT: WIN32_ERROR = 1292u32;
+pub const ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE: WIN32_ERROR = 1297u32;
+pub const ERROR_INCOMPATIBLE_SERVICE_SID_TYPE: WIN32_ERROR = 1290u32;
+pub const ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING: WIN32_ERROR = 304u32;
+pub const ERROR_INCORRECT_ACCOUNT_TYPE: WIN32_ERROR = 8646u32;
+pub const ERROR_INCORRECT_ADDRESS: WIN32_ERROR = 1241u32;
+pub const ERROR_INCORRECT_SIZE: WIN32_ERROR = 1462u32;
+pub const ERROR_INDEX_ABSENT: WIN32_ERROR = 1611u32;
+pub const ERROR_INDEX_OUT_OF_BOUNDS: WIN32_ERROR = 474u32;
+pub const ERROR_INFLOOP_IN_RELOC_CHAIN: WIN32_ERROR = 202u32;
+pub const ERROR_INSTALL_ALREADY_RUNNING: WIN32_ERROR = 1618u32;
+pub const ERROR_INSTALL_FAILURE: WIN32_ERROR = 1603u32;
+pub const ERROR_INSTALL_LANGUAGE_UNSUPPORTED: WIN32_ERROR = 1623u32;
+pub const ERROR_INSTALL_LOG_FAILURE: WIN32_ERROR = 1622u32;
+pub const ERROR_INSTALL_NOTUSED: WIN32_ERROR = 1634u32;
+pub const ERROR_INSTALL_PACKAGE_INVALID: WIN32_ERROR = 1620u32;
+pub const ERROR_INSTALL_PACKAGE_OPEN_FAILED: WIN32_ERROR = 1619u32;
+pub const ERROR_INSTALL_PACKAGE_REJECTED: WIN32_ERROR = 1625u32;
+pub const ERROR_INSTALL_PACKAGE_VERSION: WIN32_ERROR = 1613u32;
+pub const ERROR_INSTALL_PLATFORM_UNSUPPORTED: WIN32_ERROR = 1633u32;
+pub const ERROR_INSTALL_REJECTED: WIN32_ERROR = 1654u32;
+pub const ERROR_INSTALL_REMOTE_DISALLOWED: WIN32_ERROR = 1640u32;
+pub const ERROR_INSTALL_REMOTE_PROHIBITED: WIN32_ERROR = 1645u32;
+pub const ERROR_INSTALL_SERVICE_FAILURE: WIN32_ERROR = 1601u32;
+pub const ERROR_INSTALL_SERVICE_SAFEBOOT: WIN32_ERROR = 1652u32;
+pub const ERROR_INSTALL_SOURCE_ABSENT: WIN32_ERROR = 1612u32;
+pub const ERROR_INSTALL_SUSPEND: WIN32_ERROR = 1604u32;
+pub const ERROR_INSTALL_TEMP_UNWRITABLE: WIN32_ERROR = 1632u32;
+pub const ERROR_INSTALL_TRANSFORM_FAILURE: WIN32_ERROR = 1624u32;
+pub const ERROR_INSTALL_TRANSFORM_REJECTED: WIN32_ERROR = 1644u32;
+pub const ERROR_INSTALL_UI_FAILURE: WIN32_ERROR = 1621u32;
+pub const ERROR_INSTALL_USEREXIT: WIN32_ERROR = 1602u32;
+pub const ERROR_INSTRUCTION_MISALIGNMENT: WIN32_ERROR = 549u32;
+pub const ERROR_INSUFFICIENT_BUFFER: WIN32_ERROR = 122u32;
+pub const ERROR_INSUFFICIENT_LOGON_INFO: WIN32_ERROR = 608u32;
+pub const ERROR_INSUFFICIENT_POWER: WIN32_ERROR = 639u32;
+pub const ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE: WIN32_ERROR = 781u32;
+pub const ERROR_INSUFFICIENT_VIRTUAL_ADDR_RESOURCES: WIN32_ERROR = 473u32;
+pub const ERROR_INTERMIXED_KERNEL_EA_OPERATION: WIN32_ERROR = 324u32;
+pub const ERROR_INTERNAL_DB_CORRUPTION: WIN32_ERROR = 1358u32;
+pub const ERROR_INTERNAL_DB_ERROR: WIN32_ERROR = 1383u32;
+pub const ERROR_INTERNAL_ERROR: WIN32_ERROR = 1359u32;
+pub const ERROR_INTERRUPT_STILL_CONNECTED: WIN32_ERROR = 764u32;
+pub const ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED: WIN32_ERROR = 763u32;
+pub const ERROR_INVALID_ACCEL_HANDLE: WIN32_ERROR = 1403u32;
+pub const ERROR_INVALID_ACCESS: WIN32_ERROR = 12u32;
+pub const ERROR_INVALID_ACCOUNT_NAME: WIN32_ERROR = 1315u32;
+pub const ERROR_INVALID_ACE_CONDITION: WIN32_ERROR = 805u32;
+pub const ERROR_INVALID_ACL: WIN32_ERROR = 1336u32;
+pub const ERROR_INVALID_ADDRESS: WIN32_ERROR = 487u32;
+pub const ERROR_INVALID_AT_INTERRUPT_TIME: WIN32_ERROR = 104u32;
+pub const ERROR_INVALID_BLOCK: WIN32_ERROR = 9u32;
+pub const ERROR_INVALID_BLOCK_LENGTH: WIN32_ERROR = 1106u32;
+pub const ERROR_INVALID_CAP: WIN32_ERROR = 320u32;
+pub const ERROR_INVALID_CATEGORY: WIN32_ERROR = 117u32;
+pub const ERROR_INVALID_COMBOBOX_MESSAGE: WIN32_ERROR = 1422u32;
+pub const ERROR_INVALID_COMMAND_LINE: WIN32_ERROR = 1639u32;
+pub const ERROR_INVALID_COMPUTERNAME: WIN32_ERROR = 1210u32;
+pub const ERROR_INVALID_CRUNTIME_PARAMETER: WIN32_ERROR = 1288u32;
+pub const ERROR_INVALID_CURSOR_HANDLE: WIN32_ERROR = 1402u32;
+pub const ERROR_INVALID_DATA: WIN32_ERROR = 13u32;
+pub const ERROR_INVALID_DATATYPE: WIN32_ERROR = 1804u32;
+pub const ERROR_INVALID_DEVICE_OBJECT_PARAMETER: WIN32_ERROR = 650u32;
+pub const ERROR_INVALID_DLL: WIN32_ERROR = 1154u32;
+pub const ERROR_INVALID_DOMAINNAME: WIN32_ERROR = 1212u32;
+pub const ERROR_INVALID_DOMAIN_ROLE: WIN32_ERROR = 1354u32;
+pub const ERROR_INVALID_DOMAIN_STATE: WIN32_ERROR = 1353u32;
+pub const ERROR_INVALID_DRIVE: WIN32_ERROR = 15u32;
+pub const ERROR_INVALID_DWP_HANDLE: WIN32_ERROR = 1405u32;
+pub const ERROR_INVALID_EA_HANDLE: WIN32_ERROR = 278u32;
+pub const ERROR_INVALID_EA_NAME: WIN32_ERROR = 254u32;
+pub const ERROR_INVALID_EDIT_HEIGHT: WIN32_ERROR = 1424u32;
+pub const ERROR_INVALID_ENVIRONMENT: WIN32_ERROR = 1805u32;
+pub const ERROR_INVALID_EVENTNAME: WIN32_ERROR = 1211u32;
+pub const ERROR_INVALID_EVENT_COUNT: WIN32_ERROR = 151u32;
+pub const ERROR_INVALID_EXCEPTION_HANDLER: WIN32_ERROR = 310u32;
+pub const ERROR_INVALID_EXE_SIGNATURE: WIN32_ERROR = 191u32;
+pub const ERROR_INVALID_FIELD: WIN32_ERROR = 1616u32;
+pub const ERROR_INVALID_FIELD_IN_PARAMETER_LIST: WIN32_ERROR = 328u32;
+pub const ERROR_INVALID_FILTER_PROC: WIN32_ERROR = 1427u32;
+pub const ERROR_INVALID_FLAGS: WIN32_ERROR = 1004u32;
+pub const ERROR_INVALID_FLAG_NUMBER: WIN32_ERROR = 186u32;
+pub const ERROR_INVALID_FORM_NAME: WIN32_ERROR = 1902u32;
+pub const ERROR_INVALID_FORM_SIZE: WIN32_ERROR = 1903u32;
+pub const ERROR_INVALID_FUNCTION: WIN32_ERROR = 1u32;
+pub const ERROR_INVALID_GROUPNAME: WIN32_ERROR = 1209u32;
+pub const ERROR_INVALID_GROUP_ATTRIBUTES: WIN32_ERROR = 1345u32;
+pub const ERROR_INVALID_GW_COMMAND: WIN32_ERROR = 1443u32;
+pub const ERROR_INVALID_HANDLE: WIN32_ERROR = 6u32;
+pub const ERROR_INVALID_HANDLE_STATE: WIN32_ERROR = 1609u32;
+pub const ERROR_INVALID_HOOK_FILTER: WIN32_ERROR = 1426u32;
+pub const ERROR_INVALID_HOOK_HANDLE: WIN32_ERROR = 1404u32;
+pub const ERROR_INVALID_HW_PROFILE: WIN32_ERROR = 619u32;
+pub const ERROR_INVALID_ICON_HANDLE: WIN32_ERROR = 1414u32;
+pub const ERROR_INVALID_ID_AUTHORITY: WIN32_ERROR = 1343u32;
+pub const ERROR_INVALID_IMAGE_HASH: WIN32_ERROR = 577u32;
+pub const ERROR_INVALID_IMPORT_OF_NON_DLL: WIN32_ERROR = 1276u32;
+pub const ERROR_INVALID_INDEX: WIN32_ERROR = 1413u32;
+pub const ERROR_INVALID_KERNEL_INFO_VERSION: WIN32_ERROR = 340u32;
+pub const ERROR_INVALID_KEYBOARD_HANDLE: WIN32_ERROR = 1457u32;
+pub const ERROR_INVALID_LABEL: WIN32_ERROR = 1299u32;
+pub const ERROR_INVALID_LB_MESSAGE: WIN32_ERROR = 1432u32;
+pub const ERROR_INVALID_LDT_DESCRIPTOR: WIN32_ERROR = 564u32;
+pub const ERROR_INVALID_LDT_OFFSET: WIN32_ERROR = 563u32;
+pub const ERROR_INVALID_LDT_SIZE: WIN32_ERROR = 561u32;
+pub const ERROR_INVALID_LEVEL: WIN32_ERROR = 124u32;
+pub const ERROR_INVALID_LIST_FORMAT: WIN32_ERROR = 153u32;
+pub const ERROR_INVALID_LOCK_RANGE: WIN32_ERROR = 307u32;
+pub const ERROR_INVALID_LOGON_HOURS: WIN32_ERROR = 1328u32;
+pub const ERROR_INVALID_LOGON_TYPE: WIN32_ERROR = 1367u32;
+pub const ERROR_INVALID_MEMBER: WIN32_ERROR = 1388u32;
+pub const ERROR_INVALID_MENU_HANDLE: WIN32_ERROR = 1401u32;
+pub const ERROR_INVALID_MESSAGE: WIN32_ERROR = 1002u32;
+pub const ERROR_INVALID_MESSAGEDEST: WIN32_ERROR = 1218u32;
+pub const ERROR_INVALID_MESSAGENAME: WIN32_ERROR = 1217u32;
+pub const ERROR_INVALID_MINALLOCSIZE: WIN32_ERROR = 195u32;
+pub const ERROR_INVALID_MODULETYPE: WIN32_ERROR = 190u32;
+pub const ERROR_INVALID_MONITOR_HANDLE: WIN32_ERROR = 1461u32;
+pub const ERROR_INVALID_MSGBOX_STYLE: WIN32_ERROR = 1438u32;
+pub const ERROR_INVALID_NAME: WIN32_ERROR = 123u32;
+pub const ERROR_INVALID_NETNAME: WIN32_ERROR = 1214u32;
+pub const ERROR_INVALID_OPLOCK_PROTOCOL: WIN32_ERROR = 301u32;
+pub const ERROR_INVALID_ORDINAL: WIN32_ERROR = 182u32;
+pub const ERROR_INVALID_OWNER: WIN32_ERROR = 1307u32;
+pub const ERROR_INVALID_PACKAGE_SID_LENGTH: WIN32_ERROR = 4253u32;
+pub const ERROR_INVALID_PARAMETER: WIN32_ERROR = 87u32;
+pub const ERROR_INVALID_PASSWORD: WIN32_ERROR = 86u32;
+pub const ERROR_INVALID_PASSWORDNAME: WIN32_ERROR = 1216u32;
+pub const ERROR_INVALID_PATCH_XML: WIN32_ERROR = 1650u32;
+pub const ERROR_INVALID_PEP_INFO_VERSION: WIN32_ERROR = 341u32;
+pub const ERROR_INVALID_PLUGPLAY_DEVICE_PATH: WIN32_ERROR = 620u32;
+pub const ERROR_INVALID_PORT_ATTRIBUTES: WIN32_ERROR = 545u32;
+pub const ERROR_INVALID_PRIMARY_GROUP: WIN32_ERROR = 1308u32;
+pub const ERROR_INVALID_PRINTER_COMMAND: WIN32_ERROR = 1803u32;
+pub const ERROR_INVALID_PRINTER_NAME: WIN32_ERROR = 1801u32;
+pub const ERROR_INVALID_PRINTER_STATE: WIN32_ERROR = 1906u32;
+pub const ERROR_INVALID_PRIORITY: WIN32_ERROR = 1800u32;
+pub const ERROR_INVALID_QUOTA_LOWER: WIN32_ERROR = 547u32;
+pub const ERROR_INVALID_REPARSE_DATA: WIN32_ERROR = 4392u32;
+pub const ERROR_INVALID_SCROLLBAR_RANGE: WIN32_ERROR = 1448u32;
+pub const ERROR_INVALID_SECURITY_DESCR: WIN32_ERROR = 1338u32;
+pub const ERROR_INVALID_SEGDPL: WIN32_ERROR = 198u32;
+pub const ERROR_INVALID_SEGMENT_NUMBER: WIN32_ERROR = 180u32;
+pub const ERROR_INVALID_SEPARATOR_FILE: WIN32_ERROR = 1799u32;
+pub const ERROR_INVALID_SERVER_STATE: WIN32_ERROR = 1352u32;
+pub const ERROR_INVALID_SERVICENAME: WIN32_ERROR = 1213u32;
+pub const ERROR_INVALID_SERVICE_ACCOUNT: WIN32_ERROR = 1057u32;
+pub const ERROR_INVALID_SERVICE_CONTROL: WIN32_ERROR = 1052u32;
+pub const ERROR_INVALID_SERVICE_LOCK: WIN32_ERROR = 1071u32;
+pub const ERROR_INVALID_SHARENAME: WIN32_ERROR = 1215u32;
+pub const ERROR_INVALID_SHOWWIN_COMMAND: WIN32_ERROR = 1449u32;
+pub const ERROR_INVALID_SID: WIN32_ERROR = 1337u32;
+pub const ERROR_INVALID_SIGNAL_NUMBER: WIN32_ERROR = 209u32;
+pub const ERROR_INVALID_SPI_VALUE: WIN32_ERROR = 1439u32;
+pub const ERROR_INVALID_STACKSEG: WIN32_ERROR = 189u32;
+pub const ERROR_INVALID_STARTING_CODESEG: WIN32_ERROR = 188u32;
+pub const ERROR_INVALID_SUB_AUTHORITY: WIN32_ERROR = 1335u32;
+pub const ERROR_INVALID_TABLE: WIN32_ERROR = 1628u32;
+pub const ERROR_INVALID_TARGET_HANDLE: WIN32_ERROR = 114u32;
+pub const ERROR_INVALID_TASK_INDEX: WIN32_ERROR = 1551u32;
+pub const ERROR_INVALID_TASK_NAME: WIN32_ERROR = 1550u32;
+pub const ERROR_INVALID_THREAD_ID: WIN32_ERROR = 1444u32;
+pub const ERROR_INVALID_TIME: WIN32_ERROR = 1901u32;
+pub const ERROR_INVALID_TOKEN: WIN32_ERROR = 315u32;
+pub const ERROR_INVALID_UNWIND_TARGET: WIN32_ERROR = 544u32;
+pub const ERROR_INVALID_USER_BUFFER: WIN32_ERROR = 1784u32;
+pub const ERROR_INVALID_USER_PRINCIPAL_NAME: WIN32_ERROR = 8636u32;
+pub const ERROR_INVALID_VARIANT: WIN32_ERROR = 604u32;
+pub const ERROR_INVALID_VERIFY_SWITCH: WIN32_ERROR = 118u32;
+pub const ERROR_INVALID_WINDOW_HANDLE: WIN32_ERROR = 1400u32;
+pub const ERROR_INVALID_WORKSTATION: WIN32_ERROR = 1329u32;
+pub const ERROR_IOPL_NOT_ENABLED: WIN32_ERROR = 197u32;
+pub const ERROR_IO_DEVICE: WIN32_ERROR = 1117u32;
+pub const ERROR_IO_INCOMPLETE: WIN32_ERROR = 996u32;
+pub const ERROR_IO_PENDING: WIN32_ERROR = 997u32;
+pub const ERROR_IO_PRIVILEGE_FAILED: WIN32_ERROR = 571u32;
+pub const ERROR_IO_REISSUE_AS_CACHED: WIN32_ERROR = 3950u32;
+pub const ERROR_IPSEC_IKE_TIMED_OUT: WIN32_ERROR = 13805u32;
+pub const ERROR_IP_ADDRESS_CONFLICT1: WIN32_ERROR = 611u32;
+pub const ERROR_IP_ADDRESS_CONFLICT2: WIN32_ERROR = 612u32;
+pub const ERROR_IRQ_BUSY: WIN32_ERROR = 1119u32;
+pub const ERROR_IS_JOINED: WIN32_ERROR = 134u32;
+pub const ERROR_IS_JOIN_PATH: WIN32_ERROR = 147u32;
+pub const ERROR_IS_JOIN_TARGET: WIN32_ERROR = 133u32;
+pub const ERROR_IS_SUBSTED: WIN32_ERROR = 135u32;
+pub const ERROR_IS_SUBST_PATH: WIN32_ERROR = 146u32;
+pub const ERROR_IS_SUBST_TARGET: WIN32_ERROR = 149u32;
+pub const ERROR_ITERATED_DATA_EXCEEDS_64k: WIN32_ERROR = 194u32;
+pub const ERROR_JOB_NO_CONTAINER: WIN32_ERROR = 1505u32;
+pub const ERROR_JOIN_TO_JOIN: WIN32_ERROR = 138u32;
+pub const ERROR_JOIN_TO_SUBST: WIN32_ERROR = 140u32;
+pub const ERROR_JOURNAL_DELETE_IN_PROGRESS: WIN32_ERROR = 1178u32;
+pub const ERROR_JOURNAL_ENTRY_DELETED: WIN32_ERROR = 1181u32;
+pub const ERROR_JOURNAL_HOOK_SET: WIN32_ERROR = 1430u32;
+pub const ERROR_JOURNAL_NOT_ACTIVE: WIN32_ERROR = 1179u32;
+pub const ERROR_KERNEL_APC: WIN32_ERROR = 738u32;
+pub const ERROR_KEY_DELETED: WIN32_ERROR = 1018u32;
+pub const ERROR_KEY_HAS_CHILDREN: WIN32_ERROR = 1020u32;
+pub const ERROR_KM_DRIVER_BLOCKED: WIN32_ERROR = 1930u32;
+pub const ERROR_LABEL_TOO_LONG: WIN32_ERROR = 154u32;
+pub const ERROR_LAST_ADMIN: WIN32_ERROR = 1322u32;
+pub const ERROR_LB_WITHOUT_TABSTOPS: WIN32_ERROR = 1434u32;
+pub const ERROR_LICENSE_QUOTA_EXCEEDED: WIN32_ERROR = 1395u32;
+pub const ERROR_LINUX_SUBSYSTEM_NOT_PRESENT: WIN32_ERROR = 414u32;
+pub const ERROR_LINUX_SUBSYSTEM_UPDATE_REQUIRED: WIN32_ERROR = 444u32;
+pub const ERROR_LISTBOX_ID_NOT_FOUND: WIN32_ERROR = 1416u32;
+pub const ERROR_LM_CROSS_ENCRYPTION_REQUIRED: WIN32_ERROR = 1390u32;
+pub const ERROR_LOCAL_POLICY_MODIFICATION_NOT_SUPPORTED: WIN32_ERROR = 8653u32;
+pub const ERROR_LOCAL_USER_SESSION_KEY: WIN32_ERROR = 1303u32;
+pub const ERROR_LOCKED: WIN32_ERROR = 212u32;
+pub const ERROR_LOCK_FAILED: WIN32_ERROR = 167u32;
+pub const ERROR_LOCK_VIOLATION: WIN32_ERROR = 33u32;
+pub const ERROR_LOGIN_TIME_RESTRICTION: WIN32_ERROR = 1239u32;
+pub const ERROR_LOGIN_WKSTA_RESTRICTION: WIN32_ERROR = 1240u32;
+pub const ERROR_LOGON_FAILURE: WIN32_ERROR = 1326u32;
+pub const ERROR_LOGON_NOT_GRANTED: WIN32_ERROR = 1380u32;
+pub const ERROR_LOGON_SERVER_CONFLICT: WIN32_ERROR = 568u32;
+pub const ERROR_LOGON_SESSION_COLLISION: WIN32_ERROR = 1366u32;
+pub const ERROR_LOGON_SESSION_EXISTS: WIN32_ERROR = 1363u32;
+pub const ERROR_LOGON_TYPE_NOT_GRANTED: WIN32_ERROR = 1385u32;
+pub const ERROR_LOG_FILE_FULL: WIN32_ERROR = 1502u32;
+pub const ERROR_LOG_HARD_ERROR: WIN32_ERROR = 718u32;
+pub const ERROR_LONGJUMP: WIN32_ERROR = 682u32;
+pub const ERROR_LOST_MODE_LOGON_RESTRICTION: WIN32_ERROR = 1939u32;
+pub const ERROR_LOST_WRITEBEHIND_DATA: WIN32_ERROR = 596u32;
+pub const ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR: WIN32_ERROR = 790u32;
+pub const ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED: WIN32_ERROR = 788u32;
+pub const ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR: WIN32_ERROR = 789u32;
+pub const ERROR_LUIDS_EXHAUSTED: WIN32_ERROR = 1334u32;
+pub const ERROR_MACHINE_LOCKED: WIN32_ERROR = 1271u32;
+pub const ERROR_MAGAZINE_NOT_PRESENT: WIN32_ERROR = 1163u32;
+pub const ERROR_MAPPED_ALIGNMENT: WIN32_ERROR = 1132u32;
+pub const ERROR_MARKED_TO_DISALLOW_WRITES: WIN32_ERROR = 348u32;
+pub const ERROR_MARSHALL_OVERFLOW: WIN32_ERROR = 603u32;
+pub const ERROR_MAX_SESSIONS_REACHED: WIN32_ERROR = 353u32;
+pub const ERROR_MAX_THRDS_REACHED: WIN32_ERROR = 164u32;
+pub const ERROR_MCA_EXCEPTION: WIN32_ERROR = 784u32;
+pub const ERROR_MCA_OCCURED: WIN32_ERROR = 651u32;
+pub const ERROR_MEDIA_CHANGED: WIN32_ERROR = 1110u32;
+pub const ERROR_MEDIA_CHECK: WIN32_ERROR = 679u32;
+pub const ERROR_MEMBERS_PRIMARY_GROUP: WIN32_ERROR = 1374u32;
+pub const ERROR_MEMBER_IN_ALIAS: WIN32_ERROR = 1378u32;
+pub const ERROR_MEMBER_IN_GROUP: WIN32_ERROR = 1320u32;
+pub const ERROR_MEMBER_NOT_IN_ALIAS: WIN32_ERROR = 1377u32;
+pub const ERROR_MEMBER_NOT_IN_GROUP: WIN32_ERROR = 1321u32;
+pub const ERROR_MEMORY_HARDWARE: WIN32_ERROR = 779u32;
+pub const ERROR_MENU_ITEM_NOT_FOUND: WIN32_ERROR = 1456u32;
+pub const ERROR_MESSAGE_SYNC_ONLY: WIN32_ERROR = 1159u32;
+pub const ERROR_META_EXPANSION_TOO_LONG: WIN32_ERROR = 208u32;
+pub const ERROR_MISSING_SYSTEMFILE: WIN32_ERROR = 573u32;
+pub const ERROR_MOD_NOT_FOUND: WIN32_ERROR = 126u32;
+pub const ERROR_MORE_DATA: WIN32_ERROR = 234u32;
+pub const ERROR_MORE_WRITES: WIN32_ERROR = 1120u32;
+pub const ERROR_MOUNT_POINT_NOT_RESOLVED: WIN32_ERROR = 649u32;
+pub const ERROR_MP_PROCESSOR_MISMATCH: WIN32_ERROR = 725u32;
+pub const ERROR_MR_MID_NOT_FOUND: WIN32_ERROR = 317u32;
+pub const ERROR_MULTIPLE_FAULT_VIOLATION: WIN32_ERROR = 640u32;
+pub const ERROR_MUTANT_LIMIT_EXCEEDED: WIN32_ERROR = 587u32;
+pub const ERROR_MUTUAL_AUTH_FAILED: WIN32_ERROR = 1397u32;
+pub const ERROR_NEGATIVE_SEEK: WIN32_ERROR = 131u32;
+pub const ERROR_NESTING_NOT_ALLOWED: WIN32_ERROR = 215u32;
+pub const ERROR_NETLOGON_NOT_STARTED: WIN32_ERROR = 1792u32;
+pub const ERROR_NETNAME_DELETED: WIN32_ERROR = 64u32;
+pub const ERROR_NETWORK_ACCESS_DENIED: WIN32_ERROR = 65u32;
+pub const ERROR_NETWORK_ACCESS_DENIED_EDP: WIN32_ERROR = 354u32;
+pub const ERROR_NETWORK_BUSY: WIN32_ERROR = 54u32;
+pub const ERROR_NETWORK_UNREACHABLE: WIN32_ERROR = 1231u32;
+pub const ERROR_NET_OPEN_FAILED: WIN32_ERROR = 570u32;
+pub const ERROR_NET_WRITE_FAULT: WIN32_ERROR = 88u32;
+pub const ERROR_NOACCESS: WIN32_ERROR = 998u32;
+pub const ERROR_NOINTERFACE: WIN32_ERROR = 632u32;
+pub const ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT: WIN32_ERROR = 1807u32;
+pub const ERROR_NOLOGON_SERVER_TRUST_ACCOUNT: WIN32_ERROR = 1809u32;
+pub const ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT: WIN32_ERROR = 1808u32;
+pub const ERROR_NONE_MAPPED: WIN32_ERROR = 1332u32;
+pub const ERROR_NONPAGED_SYSTEM_RESOURCES: WIN32_ERROR = 1451u32;
+pub const ERROR_NON_ACCOUNT_SID: WIN32_ERROR = 1257u32;
+pub const ERROR_NON_DOMAIN_SID: WIN32_ERROR = 1258u32;
+pub const ERROR_NON_MDICHILD_WINDOW: WIN32_ERROR = 1445u32;
+pub const ERROR_NOTHING_TO_TERMINATE: WIN32_ERROR = 758u32;
+pub const ERROR_NOTIFICATION_GUID_ALREADY_DEFINED: WIN32_ERROR = 309u32;
+pub const ERROR_NOTIFY_CLEANUP: WIN32_ERROR = 745u32;
+pub const ERROR_NOTIFY_ENUM_DIR: WIN32_ERROR = 1022u32;
+pub const ERROR_NOT_ALLOWED_ON_SYSTEM_FILE: WIN32_ERROR = 313u32;
+pub const ERROR_NOT_ALL_ASSIGNED: WIN32_ERROR = 1300u32;
+pub const ERROR_NOT_APPCONTAINER: WIN32_ERROR = 4250u32;
+pub const ERROR_NOT_AUTHENTICATED: WIN32_ERROR = 1244u32;
+pub const ERROR_NOT_A_CLOUD_FILE: WIN32_ERROR = 376u32;
+pub const ERROR_NOT_A_CLOUD_SYNC_ROOT: WIN32_ERROR = 405u32;
+pub const ERROR_NOT_A_DAX_VOLUME: WIN32_ERROR = 420u32;
+pub const ERROR_NOT_A_REPARSE_POINT: WIN32_ERROR = 4390u32;
+pub const ERROR_NOT_CAPABLE: WIN32_ERROR = 775u32;
+pub const ERROR_NOT_CHILD_WINDOW: WIN32_ERROR = 1442u32;
+pub const ERROR_NOT_CONNECTED: WIN32_ERROR = 2250u32;
+pub const ERROR_NOT_CONTAINER: WIN32_ERROR = 1207u32;
+pub const ERROR_NOT_DAX_MAPPABLE: WIN32_ERROR = 421u32;
+pub const ERROR_NOT_DOS_DISK: WIN32_ERROR = 26u32;
+pub const ERROR_NOT_ENOUGH_MEMORY: WIN32_ERROR = 8u32;
+pub const ERROR_NOT_ENOUGH_QUOTA: WIN32_ERROR = 1816u32;
+pub const ERROR_NOT_ENOUGH_SERVER_MEMORY: WIN32_ERROR = 1130u32;
+pub const ERROR_NOT_EXPORT_FORMAT: WIN32_ERROR = 6008u32;
+pub const ERROR_NOT_FOUND: WIN32_ERROR = 1168u32;
+pub const ERROR_NOT_GUI_PROCESS: WIN32_ERROR = 1471u32;
+pub const ERROR_NOT_JOINED: WIN32_ERROR = 136u32;
+pub const ERROR_NOT_LOCKED: WIN32_ERROR = 158u32;
+pub const ERROR_NOT_LOGGED_ON: WIN32_ERROR = 1245u32;
+pub const ERROR_NOT_LOGON_PROCESS: WIN32_ERROR = 1362u32;
+pub const ERROR_NOT_OWNER: WIN32_ERROR = 288u32;
+pub const ERROR_NOT_READY: WIN32_ERROR = 21u32;
+pub const ERROR_NOT_READ_FROM_COPY: WIN32_ERROR = 337u32;
+pub const ERROR_NOT_REDUNDANT_STORAGE: WIN32_ERROR = 333u32;
+pub const ERROR_NOT_REGISTRY_FILE: WIN32_ERROR = 1017u32;
+pub const ERROR_NOT_SAFEBOOT_SERVICE: WIN32_ERROR = 1084u32;
+pub const ERROR_NOT_SAFE_MODE_DRIVER: WIN32_ERROR = 646u32;
+pub const ERROR_NOT_SAME_DEVICE: WIN32_ERROR = 17u32;
+pub const ERROR_NOT_SAME_OBJECT: WIN32_ERROR = 1656u32;
+pub const ERROR_NOT_SUBSTED: WIN32_ERROR = 137u32;
+pub const ERROR_NOT_SUPPORTED: WIN32_ERROR = 50u32;
+pub const ERROR_NOT_SUPPORTED_IN_APPCONTAINER: WIN32_ERROR = 4252u32;
+pub const ERROR_NOT_SUPPORTED_ON_DAX: WIN32_ERROR = 360u32;
+pub const ERROR_NOT_SUPPORTED_ON_SBS: WIN32_ERROR = 1254u32;
+pub const ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER: WIN32_ERROR = 8584u32;
+pub const ERROR_NOT_SUPPORTED_WITH_AUDITING: WIN32_ERROR = 499u32;
+pub const ERROR_NOT_SUPPORTED_WITH_BTT: WIN32_ERROR = 429u32;
+pub const ERROR_NOT_SUPPORTED_WITH_BYPASSIO: WIN32_ERROR = 493u32;
+pub const ERROR_NOT_SUPPORTED_WITH_CACHED_HANDLE: WIN32_ERROR = 509u32;
+pub const ERROR_NOT_SUPPORTED_WITH_COMPRESSION: WIN32_ERROR = 496u32;
+pub const ERROR_NOT_SUPPORTED_WITH_DEDUPLICATION: WIN32_ERROR = 498u32;
+pub const ERROR_NOT_SUPPORTED_WITH_ENCRYPTION: WIN32_ERROR = 495u32;
+pub const ERROR_NOT_SUPPORTED_WITH_MONITORING: WIN32_ERROR = 503u32;
+pub const ERROR_NOT_SUPPORTED_WITH_REPLICATION: WIN32_ERROR = 497u32;
+pub const ERROR_NOT_SUPPORTED_WITH_SNAPSHOT: WIN32_ERROR = 504u32;
+pub const ERROR_NOT_SUPPORTED_WITH_VIRTUALIZATION: WIN32_ERROR = 505u32;
+pub const ERROR_NOT_TINY_STREAM: WIN32_ERROR = 598u32;
+pub const ERROR_NO_ACE_CONDITION: WIN32_ERROR = 804u32;
+pub const ERROR_NO_ASSOCIATION: WIN32_ERROR = 1155u32;
+pub const ERROR_NO_BYPASSIO_DRIVER_SUPPORT: WIN32_ERROR = 494u32;
+pub const ERROR_NO_CALLBACK_ACTIVE: WIN32_ERROR = 614u32;
+pub const ERROR_NO_DATA: WIN32_ERROR = 232u32;
+pub const ERROR_NO_DATA_DETECTED: WIN32_ERROR = 1104u32;
+pub const ERROR_NO_EFS: WIN32_ERROR = 6004u32;
+pub const ERROR_NO_EVENT_PAIR: WIN32_ERROR = 580u32;
+pub const ERROR_NO_GUID_TRANSLATION: WIN32_ERROR = 560u32;
+pub const ERROR_NO_IMPERSONATION_TOKEN: WIN32_ERROR = 1309u32;
+pub const ERROR_NO_INHERITANCE: WIN32_ERROR = 1391u32;
+pub const ERROR_NO_LOGON_SERVERS: WIN32_ERROR = 1311u32;
+pub const ERROR_NO_LOG_SPACE: WIN32_ERROR = 1019u32;
+pub const ERROR_NO_MATCH: WIN32_ERROR = 1169u32;
+pub const ERROR_NO_MEDIA_IN_DRIVE: WIN32_ERROR = 1112u32;
+pub const ERROR_NO_MORE_DEVICES: WIN32_ERROR = 1248u32;
+pub const ERROR_NO_MORE_FILES: WIN32_ERROR = 18u32;
+pub const ERROR_NO_MORE_ITEMS: WIN32_ERROR = 259u32;
+pub const ERROR_NO_MORE_MATCHES: WIN32_ERROR = 626u32;
+pub const ERROR_NO_MORE_SEARCH_HANDLES: WIN32_ERROR = 113u32;
+pub const ERROR_NO_MORE_USER_HANDLES: WIN32_ERROR = 1158u32;
+pub const ERROR_NO_NETWORK: WIN32_ERROR = 1222u32;
+pub const ERROR_NO_NET_OR_BAD_PATH: WIN32_ERROR = 1203u32;
+pub const ERROR_NO_NVRAM_RESOURCES: WIN32_ERROR = 1470u32;
+pub const ERROR_NO_PAGEFILE: WIN32_ERROR = 578u32;
+pub const ERROR_NO_PHYSICALLY_ALIGNED_FREE_SPACE_FOUND: WIN32_ERROR = 408u32;
+pub const ERROR_NO_PROC_SLOTS: WIN32_ERROR = 89u32;
+pub const ERROR_NO_PROMOTION_ACTIVE: WIN32_ERROR = 8222u32;
+pub const ERROR_NO_QUOTAS_FOR_ACCOUNT: WIN32_ERROR = 1302u32;
+pub const ERROR_NO_RANGES_PROCESSED: WIN32_ERROR = 312u32;
+pub const ERROR_NO_RECOVERY_POLICY: WIN32_ERROR = 6003u32;
+pub const ERROR_NO_RECOVERY_PROGRAM: WIN32_ERROR = 1082u32;
+pub const ERROR_NO_SCROLLBARS: WIN32_ERROR = 1447u32;
+pub const ERROR_NO_SECRETS: WIN32_ERROR = 8620u32;
+pub const ERROR_NO_SECURITY_ON_OBJECT: WIN32_ERROR = 1350u32;
+pub const ERROR_NO_SHUTDOWN_IN_PROGRESS: WIN32_ERROR = 1116u32;
+pub const ERROR_NO_SIGNAL_SENT: WIN32_ERROR = 205u32;
+pub const ERROR_NO_SITENAME: WIN32_ERROR = 1919u32;
+pub const ERROR_NO_SITE_SETTINGS_OBJECT: WIN32_ERROR = 8619u32;
+pub const ERROR_NO_SPOOL_SPACE: WIN32_ERROR = 62u32;
+pub const ERROR_NO_SUCH_ALIAS: WIN32_ERROR = 1376u32;
+pub const ERROR_NO_SUCH_DEVICE: WIN32_ERROR = 433u32;
+pub const ERROR_NO_SUCH_DOMAIN: WIN32_ERROR = 1355u32;
+pub const ERROR_NO_SUCH_GROUP: WIN32_ERROR = 1319u32;
+pub const ERROR_NO_SUCH_LOGON_SESSION: WIN32_ERROR = 1312u32;
+pub const ERROR_NO_SUCH_MEMBER: WIN32_ERROR = 1387u32;
+pub const ERROR_NO_SUCH_PACKAGE: WIN32_ERROR = 1364u32;
+pub const ERROR_NO_SUCH_PRIVILEGE: WIN32_ERROR = 1313u32;
+pub const ERROR_NO_SUCH_SITE: WIN32_ERROR = 1249u32;
+pub const ERROR_NO_SUCH_USER: WIN32_ERROR = 1317u32;
+pub const ERROR_NO_SYSTEM_MENU: WIN32_ERROR = 1437u32;
+pub const ERROR_NO_SYSTEM_RESOURCES: WIN32_ERROR = 1450u32;
+pub const ERROR_NO_TASK_QUEUE: WIN32_ERROR = 427u32;
+pub const ERROR_NO_TOKEN: WIN32_ERROR = 1008u32;
+pub const ERROR_NO_TRACKING_SERVICE: WIN32_ERROR = 1172u32;
+pub const ERROR_NO_TRUST_LSA_SECRET: WIN32_ERROR = 1786u32;
+pub const ERROR_NO_TRUST_SAM_ACCOUNT: WIN32_ERROR = 1787u32;
+pub const ERROR_NO_UNICODE_TRANSLATION: WIN32_ERROR = 1113u32;
+pub const ERROR_NO_USER_KEYS: WIN32_ERROR = 6006u32;
+pub const ERROR_NO_USER_SESSION_KEY: WIN32_ERROR = 1394u32;
+pub const ERROR_NO_VOLUME_ID: WIN32_ERROR = 1173u32;
+pub const ERROR_NO_VOLUME_LABEL: WIN32_ERROR = 125u32;
+pub const ERROR_NO_WILDCARD_CHARACTERS: WIN32_ERROR = 1417u32;
+pub const ERROR_NO_WORK_DONE: WIN32_ERROR = 235u32;
+pub const ERROR_NO_WRITABLE_DC_FOUND: WIN32_ERROR = 8621u32;
+pub const ERROR_NO_YIELD_PERFORMED: WIN32_ERROR = 721u32;
+pub const ERROR_NTLM_BLOCKED: WIN32_ERROR = 1937u32;
+pub const ERROR_NT_CROSS_ENCRYPTION_REQUIRED: WIN32_ERROR = 1386u32;
+pub const ERROR_NULL_LM_PASSWORD: WIN32_ERROR = 1304u32;
+pub const ERROR_OBJECT_IS_IMMUTABLE: WIN32_ERROR = 4449u32;
+pub const ERROR_OBJECT_NAME_EXISTS: WIN32_ERROR = 698u32;
+pub const ERROR_OBJECT_NOT_EXTERNALLY_BACKED: WIN32_ERROR = 342u32;
+pub const ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED: WIN32_ERROR = 4442u32;
+pub const ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED: WIN32_ERROR = 4440u32;
+pub const ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED: WIN32_ERROR = 4443u32;
+pub const ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED: WIN32_ERROR = 4441u32;
+pub const ERROR_OFFSET_ALIGNMENT_VIOLATION: WIN32_ERROR = 327u32;
+pub const ERROR_OLD_WIN_VERSION: WIN32_ERROR = 1150u32;
+pub const ERROR_ONLY_IF_CONNECTED: WIN32_ERROR = 1251u32;
+pub const ERROR_OPEN_FAILED: WIN32_ERROR = 110u32;
+pub const ERROR_OPEN_FILES: WIN32_ERROR = 2401u32;
+pub const ERROR_OPERATION_ABORTED: WIN32_ERROR = 995u32;
+pub const ERROR_OPERATION_IN_PROGRESS: WIN32_ERROR = 329u32;
+pub const ERROR_OPLOCK_BREAK_IN_PROGRESS: WIN32_ERROR = 742u32;
+pub const ERROR_OPLOCK_HANDLE_CLOSED: WIN32_ERROR = 803u32;
+pub const ERROR_OPLOCK_NOT_GRANTED: WIN32_ERROR = 300u32;
+pub const ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE: WIN32_ERROR = 800u32;
+pub const ERROR_ORPHAN_NAME_EXHAUSTED: WIN32_ERROR = 799u32;
+pub const ERROR_OUTOFMEMORY: WIN32_ERROR = 14u32;
+pub const ERROR_OUT_OF_PAPER: WIN32_ERROR = 28u32;
+pub const ERROR_OUT_OF_STRUCTURES: WIN32_ERROR = 84u32;
+pub const ERROR_OVERRIDE_NOCHANGES: WIN32_ERROR = 1252u32;
+pub const ERROR_PAGED_SYSTEM_RESOURCES: WIN32_ERROR = 1452u32;
+pub const ERROR_PAGEFILE_CREATE_FAILED: WIN32_ERROR = 576u32;
+pub const ERROR_PAGEFILE_NOT_SUPPORTED: WIN32_ERROR = 491u32;
+pub const ERROR_PAGEFILE_QUOTA: WIN32_ERROR = 1454u32;
+pub const ERROR_PAGEFILE_QUOTA_EXCEEDED: WIN32_ERROR = 567u32;
+pub const ERROR_PAGE_FAULT_COPY_ON_WRITE: WIN32_ERROR = 749u32;
+pub const ERROR_PAGE_FAULT_DEMAND_ZERO: WIN32_ERROR = 748u32;
+pub const ERROR_PAGE_FAULT_GUARD_PAGE: WIN32_ERROR = 750u32;
+pub const ERROR_PAGE_FAULT_PAGING_FILE: WIN32_ERROR = 751u32;
+pub const ERROR_PAGE_FAULT_TRANSITION: WIN32_ERROR = 747u32;
+pub const ERROR_PARAMETER_QUOTA_EXCEEDED: WIN32_ERROR = 1283u32;
+pub const ERROR_PARTIAL_COPY: WIN32_ERROR = 299u32;
+pub const ERROR_PARTITION_FAILURE: WIN32_ERROR = 1105u32;
+pub const ERROR_PARTITION_TERMINATING: WIN32_ERROR = 1184u32;
+pub const ERROR_PASSWORD_CHANGE_REQUIRED: WIN32_ERROR = 1938u32;
+pub const ERROR_PASSWORD_EXPIRED: WIN32_ERROR = 1330u32;
+pub const ERROR_PASSWORD_MUST_CHANGE: WIN32_ERROR = 1907u32;
+pub const ERROR_PASSWORD_RESTRICTION: WIN32_ERROR = 1325u32;
+pub const ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT: WIN32_ERROR = 1651u32;
+pub const ERROR_PATCH_NO_SEQUENCE: WIN32_ERROR = 1648u32;
+pub const ERROR_PATCH_PACKAGE_INVALID: WIN32_ERROR = 1636u32;
+pub const ERROR_PATCH_PACKAGE_OPEN_FAILED: WIN32_ERROR = 1635u32;
+pub const ERROR_PATCH_PACKAGE_REJECTED: WIN32_ERROR = 1643u32;
+pub const ERROR_PATCH_PACKAGE_UNSUPPORTED: WIN32_ERROR = 1637u32;
+pub const ERROR_PATCH_REMOVAL_DISALLOWED: WIN32_ERROR = 1649u32;
+pub const ERROR_PATCH_REMOVAL_UNSUPPORTED: WIN32_ERROR = 1646u32;
+pub const ERROR_PATCH_TARGET_NOT_FOUND: WIN32_ERROR = 1642u32;
+pub const ERROR_PATH_BUSY: WIN32_ERROR = 148u32;
+pub const ERROR_PATH_NOT_FOUND: WIN32_ERROR = 3u32;
+pub const ERROR_PER_USER_TRUST_QUOTA_EXCEEDED: WIN32_ERROR = 1932u32;
+pub const ERROR_PIPE_BUSY: WIN32_ERROR = 231u32;
+pub const ERROR_PIPE_CONNECTED: WIN32_ERROR = 535u32;
+pub const ERROR_PIPE_LISTENING: WIN32_ERROR = 536u32;
+pub const ERROR_PIPE_LOCAL: WIN32_ERROR = 229u32;
+pub const ERROR_PIPE_NOT_CONNECTED: WIN32_ERROR = 233u32;
+pub const ERROR_PKINIT_FAILURE: WIN32_ERROR = 1263u32;
+pub const ERROR_PLUGPLAY_QUERY_VETOED: WIN32_ERROR = 683u32;
+pub const ERROR_PNP_BAD_MPS_TABLE: WIN32_ERROR = 671u32;
+pub const ERROR_PNP_INVALID_ID: WIN32_ERROR = 674u32;
+pub const ERROR_PNP_IRQ_TRANSLATION_FAILED: WIN32_ERROR = 673u32;
+pub const ERROR_PNP_QUERY_REMOVE_DEVICE_TIMEOUT: WIN32_ERROR = 480u32;
+pub const ERROR_PNP_QUERY_REMOVE_RELATED_DEVICE_TIMEOUT: WIN32_ERROR = 481u32;
+pub const ERROR_PNP_QUERY_REMOVE_UNRELATED_DEVICE_TIMEOUT: WIN32_ERROR = 482u32;
+pub const ERROR_PNP_REBOOT_REQUIRED: WIN32_ERROR = 638u32;
+pub const ERROR_PNP_RESTART_ENUMERATION: WIN32_ERROR = 636u32;
+pub const ERROR_PNP_TRANSLATION_FAILED: WIN32_ERROR = 672u32;
+pub const ERROR_POINT_NOT_FOUND: WIN32_ERROR = 1171u32;
+pub const ERROR_POLICY_OBJECT_NOT_FOUND: WIN32_ERROR = 8219u32;
+pub const ERROR_POLICY_ONLY_IN_DS: WIN32_ERROR = 8220u32;
+pub const ERROR_POPUP_ALREADY_ACTIVE: WIN32_ERROR = 1446u32;
+pub const ERROR_PORT_MESSAGE_TOO_LONG: WIN32_ERROR = 546u32;
+pub const ERROR_PORT_NOT_SET: WIN32_ERROR = 642u32;
+pub const ERROR_PORT_UNREACHABLE: WIN32_ERROR = 1234u32;
+pub const ERROR_POSSIBLE_DEADLOCK: WIN32_ERROR = 1131u32;
+pub const ERROR_POTENTIAL_FILE_FOUND: WIN32_ERROR = 1180u32;
+pub const ERROR_PREDEFINED_HANDLE: WIN32_ERROR = 714u32;
+pub const ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED: WIN32_ERROR = 746u32;
+pub const ERROR_PRINTER_ALREADY_EXISTS: WIN32_ERROR = 1802u32;
+pub const ERROR_PRINTER_DELETED: WIN32_ERROR = 1905u32;
+pub const ERROR_PRINTER_DRIVER_ALREADY_INSTALLED: WIN32_ERROR = 1795u32;
+pub const ERROR_PRINTQ_FULL: WIN32_ERROR = 61u32;
+pub const ERROR_PRINT_CANCELLED: WIN32_ERROR = 63u32;
+pub const ERROR_PRIVATE_DIALOG_INDEX: WIN32_ERROR = 1415u32;
+pub const ERROR_PRIVILEGE_NOT_HELD: WIN32_ERROR = 1314u32;
+pub const ERROR_PROCESS_ABORTED: WIN32_ERROR = 1067u32;
+pub const ERROR_PROCESS_IN_JOB: WIN32_ERROR = 760u32;
+pub const ERROR_PROCESS_IS_PROTECTED: WIN32_ERROR = 1293u32;
+pub const ERROR_PROCESS_MODE_ALREADY_BACKGROUND: WIN32_ERROR = 402u32;
+pub const ERROR_PROCESS_MODE_NOT_BACKGROUND: WIN32_ERROR = 403u32;
+pub const ERROR_PROCESS_NOT_IN_JOB: WIN32_ERROR = 759u32;
+pub const ERROR_PROC_NOT_FOUND: WIN32_ERROR = 127u32;
+pub const ERROR_PRODUCT_UNINSTALLED: WIN32_ERROR = 1614u32;
+pub const ERROR_PRODUCT_VERSION: WIN32_ERROR = 1638u32;
+pub const ERROR_PROFILING_AT_LIMIT: WIN32_ERROR = 553u32;
+pub const ERROR_PROFILING_NOT_STARTED: WIN32_ERROR = 550u32;
+pub const ERROR_PROFILING_NOT_STOPPED: WIN32_ERROR = 551u32;
+pub const ERROR_PROMOTION_ACTIVE: WIN32_ERROR = 8221u32;
+pub const ERROR_PROTOCOL_UNREACHABLE: WIN32_ERROR = 1233u32;
+pub const ERROR_PWD_HISTORY_CONFLICT: WIN32_ERROR = 617u32;
+pub const ERROR_PWD_TOO_LONG: WIN32_ERROR = 657u32;
+pub const ERROR_PWD_TOO_RECENT: WIN32_ERROR = 616u32;
+pub const ERROR_PWD_TOO_SHORT: WIN32_ERROR = 615u32;
+pub const ERROR_QUOTA_ACTIVITY: WIN32_ERROR = 810u32;
+pub const ERROR_QUOTA_LIST_INCONSISTENT: WIN32_ERROR = 621u32;
+pub const ERROR_RANGE_LIST_CONFLICT: WIN32_ERROR = 627u32;
+pub const ERROR_RANGE_NOT_FOUND: WIN32_ERROR = 644u32;
+pub const ERROR_READ_FAULT: WIN32_ERROR = 30u32;
+pub const ERROR_RECEIVE_EXPEDITED: WIN32_ERROR = 708u32;
+pub const ERROR_RECEIVE_PARTIAL: WIN32_ERROR = 707u32;
+pub const ERROR_RECEIVE_PARTIAL_EXPEDITED: WIN32_ERROR = 709u32;
+pub const ERROR_RECOVERY_FAILURE: WIN32_ERROR = 1279u32;
+pub const ERROR_REDIRECTOR_HAS_OPEN_HANDLES: WIN32_ERROR = 1794u32;
+pub const ERROR_REDIR_PAUSED: WIN32_ERROR = 72u32;
+pub const ERROR_REGISTRY_CORRUPT: WIN32_ERROR = 1015u32;
+pub const ERROR_REGISTRY_HIVE_RECOVERED: WIN32_ERROR = 685u32;
+pub const ERROR_REGISTRY_IO_FAILED: WIN32_ERROR = 1016u32;
+pub const ERROR_REGISTRY_QUOTA_LIMIT: WIN32_ERROR = 613u32;
+pub const ERROR_REGISTRY_RECOVERED: WIN32_ERROR = 1014u32;
+pub const ERROR_REG_NAT_CONSUMPTION: WIN32_ERROR = 1261u32;
+pub const ERROR_RELOC_CHAIN_XEEDS_SEGLIM: WIN32_ERROR = 201u32;
+pub const ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED: WIN32_ERROR = 1936u32;
+pub const ERROR_REMOTE_SESSION_LIMIT_EXCEEDED: WIN32_ERROR = 1220u32;
+pub const ERROR_REMOTE_STORAGE_MEDIA_ERROR: WIN32_ERROR = 4352u32;
+pub const ERROR_REMOTE_STORAGE_NOT_ACTIVE: WIN32_ERROR = 4351u32;
+pub const ERROR_REM_NOT_LIST: WIN32_ERROR = 51u32;
+pub const ERROR_REPARSE: WIN32_ERROR = 741u32;
+pub const ERROR_REPARSE_ATTRIBUTE_CONFLICT: WIN32_ERROR = 4391u32;
+pub const ERROR_REPARSE_OBJECT: WIN32_ERROR = 755u32;
+pub const ERROR_REPARSE_POINT_ENCOUNTERED: WIN32_ERROR = 4395u32;
+pub const ERROR_REPARSE_TAG_INVALID: WIN32_ERROR = 4393u32;
+pub const ERROR_REPARSE_TAG_MISMATCH: WIN32_ERROR = 4394u32;
+pub const ERROR_REPLY_MESSAGE_MISMATCH: WIN32_ERROR = 595u32;
+pub const ERROR_REQUEST_ABORTED: WIN32_ERROR = 1235u32;
+pub const ERROR_REQUEST_OUT_OF_SEQUENCE: WIN32_ERROR = 776u32;
+pub const ERROR_REQUEST_PAUSED: WIN32_ERROR = 3050u32;
+pub const ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION: WIN32_ERROR = 1459u32;
+pub const ERROR_REQ_NOT_ACCEP: WIN32_ERROR = 71u32;
+pub const ERROR_RESIDENT_FILE_NOT_SUPPORTED: WIN32_ERROR = 334u32;
+pub const ERROR_RESOURCE_CALL_TIMED_OUT: WIN32_ERROR = 5910u32;
+pub const ERROR_RESOURCE_DATA_NOT_FOUND: WIN32_ERROR = 1812u32;
+pub const ERROR_RESOURCE_LANG_NOT_FOUND: WIN32_ERROR = 1815u32;
+pub const ERROR_RESOURCE_NAME_NOT_FOUND: WIN32_ERROR = 1814u32;
+pub const ERROR_RESOURCE_REQUIREMENTS_CHANGED: WIN32_ERROR = 756u32;
+pub const ERROR_RESOURCE_TYPE_NOT_FOUND: WIN32_ERROR = 1813u32;
+pub const ERROR_RESTART_APPLICATION: WIN32_ERROR = 1467u32;
+pub const ERROR_RESUME_HIBERNATION: WIN32_ERROR = 727u32;
+pub const ERROR_RETRY: WIN32_ERROR = 1237u32;
+pub const ERROR_RETURN_ADDRESS_HIJACK_ATTEMPT: WIN32_ERROR = 1662u32;
+pub const ERROR_REVISION_MISMATCH: WIN32_ERROR = 1306u32;
+pub const ERROR_RING2SEG_MUST_BE_MOVABLE: WIN32_ERROR = 200u32;
+pub const ERROR_RING2_STACK_IN_USE: WIN32_ERROR = 207u32;
+pub const ERROR_RMODE_APP: WIN32_ERROR = 1153u32;
+pub const ERROR_ROWSNOTRELEASED: WIN32_ERROR = 772u32;
+pub const ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT: WIN32_ERROR = 15403u32;
+pub const ERROR_RUNLEVEL_SWITCH_TIMEOUT: WIN32_ERROR = 15402u32;
+pub const ERROR_RWRAW_ENCRYPTED_FILE_NOT_ENCRYPTED: WIN32_ERROR = 410u32;
+pub const ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILEOFFSET: WIN32_ERROR = 411u32;
+pub const ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILERANGE: WIN32_ERROR = 412u32;
+pub const ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_PARAMETER: WIN32_ERROR = 413u32;
+pub const ERROR_RXACT_COMMITTED: WIN32_ERROR = 744u32;
+pub const ERROR_RXACT_COMMIT_FAILURE: WIN32_ERROR = 1370u32;
+pub const ERROR_RXACT_COMMIT_NECESSARY: WIN32_ERROR = 678u32;
+pub const ERROR_RXACT_INVALID_STATE: WIN32_ERROR = 1369u32;
+pub const ERROR_RXACT_STATE_CREATED: WIN32_ERROR = 701u32;
+pub const ERROR_SAME_DRIVE: WIN32_ERROR = 143u32;
+pub const ERROR_SAM_INIT_FAILURE: WIN32_ERROR = 8541u32;
+pub const ERROR_SCOPE_NOT_FOUND: WIN32_ERROR = 318u32;
+pub const ERROR_SCREEN_ALREADY_LOCKED: WIN32_ERROR = 1440u32;
+pub const ERROR_SCRUB_DATA_DISABLED: WIN32_ERROR = 332u32;
+pub const ERROR_SECRET_TOO_LONG: WIN32_ERROR = 1382u32;
+pub const ERROR_SECTION_DIRECT_MAP_ONLY: WIN32_ERROR = 819u32;
+pub const ERROR_SECTOR_NOT_FOUND: WIN32_ERROR = 27u32;
+pub const ERROR_SECURITY_DENIES_OPERATION: WIN32_ERROR = 447u32;
+pub const ERROR_SECURITY_STREAM_IS_INCONSISTENT: WIN32_ERROR = 306u32;
+pub const ERROR_SEEK: WIN32_ERROR = 25u32;
+pub const ERROR_SEEK_ON_DEVICE: WIN32_ERROR = 132u32;
+pub const ERROR_SEGMENT_NOTIFICATION: WIN32_ERROR = 702u32;
+pub const ERROR_SEM_IS_SET: WIN32_ERROR = 102u32;
+pub const ERROR_SEM_NOT_FOUND: WIN32_ERROR = 187u32;
+pub const ERROR_SEM_OWNER_DIED: WIN32_ERROR = 105u32;
+pub const ERROR_SEM_TIMEOUT: WIN32_ERROR = 121u32;
+pub const ERROR_SEM_USER_LIMIT: WIN32_ERROR = 106u32;
+pub const ERROR_SERIAL_NO_DEVICE: WIN32_ERROR = 1118u32;
+pub const ERROR_SERVER_DISABLED: WIN32_ERROR = 1341u32;
+pub const ERROR_SERVER_HAS_OPEN_HANDLES: WIN32_ERROR = 1811u32;
+pub const ERROR_SERVER_NOT_DISABLED: WIN32_ERROR = 1342u32;
+pub const ERROR_SERVER_SHUTDOWN_IN_PROGRESS: WIN32_ERROR = 1255u32;
+pub const ERROR_SERVER_SID_MISMATCH: WIN32_ERROR = 628u32;
+pub const ERROR_SERVER_TRANSPORT_CONFLICT: WIN32_ERROR = 816u32;
+pub const ERROR_SERVICE_ALREADY_RUNNING: WIN32_ERROR = 1056u32;
+pub const ERROR_SERVICE_CANNOT_ACCEPT_CTRL: WIN32_ERROR = 1061u32;
+pub const ERROR_SERVICE_DATABASE_LOCKED: WIN32_ERROR = 1055u32;
+pub const ERROR_SERVICE_DEPENDENCY_DELETED: WIN32_ERROR = 1075u32;
+pub const ERROR_SERVICE_DEPENDENCY_FAIL: WIN32_ERROR = 1068u32;
+pub const ERROR_SERVICE_DISABLED: WIN32_ERROR = 1058u32;
+pub const ERROR_SERVICE_DOES_NOT_EXIST: WIN32_ERROR = 1060u32;
+pub const ERROR_SERVICE_EXISTS: WIN32_ERROR = 1073u32;
+pub const ERROR_SERVICE_LOGON_FAILED: WIN32_ERROR = 1069u32;
+pub const ERROR_SERVICE_MARKED_FOR_DELETE: WIN32_ERROR = 1072u32;
+pub const ERROR_SERVICE_NEVER_STARTED: WIN32_ERROR = 1077u32;
+pub const ERROR_SERVICE_NOTIFICATION: WIN32_ERROR = 716u32;
+pub const ERROR_SERVICE_NOTIFY_CLIENT_LAGGING: WIN32_ERROR = 1294u32;
+pub const ERROR_SERVICE_NOT_ACTIVE: WIN32_ERROR = 1062u32;
+pub const ERROR_SERVICE_NOT_FOUND: WIN32_ERROR = 1243u32;
+pub const ERROR_SERVICE_NOT_IN_EXE: WIN32_ERROR = 1083u32;
+pub const ERROR_SERVICE_NO_THREAD: WIN32_ERROR = 1054u32;
+pub const ERROR_SERVICE_REQUEST_TIMEOUT: WIN32_ERROR = 1053u32;
+pub const ERROR_SERVICE_SPECIFIC_ERROR: WIN32_ERROR = 1066u32;
+pub const ERROR_SERVICE_START_HANG: WIN32_ERROR = 1070u32;
+pub const ERROR_SESSION_CREDENTIAL_CONFLICT: WIN32_ERROR = 1219u32;
+pub const ERROR_SESSION_KEY_TOO_SHORT: WIN32_ERROR = 501u32;
+pub const ERROR_SETCOUNT_ON_BAD_LB: WIN32_ERROR = 1433u32;
+pub const ERROR_SETMARK_DETECTED: WIN32_ERROR = 1103u32;
+pub const ERROR_SET_CONTEXT_DENIED: WIN32_ERROR = 1660u32;
+pub const ERROR_SET_NOT_FOUND: WIN32_ERROR = 1170u32;
+pub const ERROR_SET_POWER_STATE_FAILED: WIN32_ERROR = 1141u32;
+pub const ERROR_SET_POWER_STATE_VETOED: WIN32_ERROR = 1140u32;
+pub const ERROR_SHARED_POLICY: WIN32_ERROR = 8218u32;
+pub const ERROR_SHARING_BUFFER_EXCEEDED: WIN32_ERROR = 36u32;
+pub const ERROR_SHARING_PAUSED: WIN32_ERROR = 70u32;
+pub const ERROR_SHARING_VIOLATION: WIN32_ERROR = 32u32;
+pub const ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME: WIN32_ERROR = 305u32;
+pub const ERROR_SHUTDOWN_DISKS_NOT_IN_MAINTENANCE_MODE: WIN32_ERROR = 1192u32;
+pub const ERROR_SHUTDOWN_IN_PROGRESS: WIN32_ERROR = 1115u32;
+pub const ERROR_SHUTDOWN_IS_SCHEDULED: WIN32_ERROR = 1190u32;
+pub const ERROR_SHUTDOWN_USERS_LOGGED_ON: WIN32_ERROR = 1191u32;
+pub const ERROR_SIGNAL_PENDING: WIN32_ERROR = 162u32;
+pub const ERROR_SIGNAL_REFUSED: WIN32_ERROR = 156u32;
+pub const ERROR_SINGLE_INSTANCE_APP: WIN32_ERROR = 1152u32;
+pub const ERROR_SMARTCARD_SUBSYSTEM_FAILURE: WIN32_ERROR = 1264u32;
+pub const ERROR_SMB1_NOT_AVAILABLE: WIN32_ERROR = 384u32;
+pub const ERROR_SMB_GUEST_LOGON_BLOCKED: WIN32_ERROR = 1272u32;
+pub const ERROR_SMR_GARBAGE_COLLECTION_REQUIRED: WIN32_ERROR = 4445u32;
+pub const ERROR_SOME_NOT_MAPPED: WIN32_ERROR = 1301u32;
+pub const ERROR_SOURCE_ELEMENT_EMPTY: WIN32_ERROR = 1160u32;
+pub const ERROR_SPARSE_FILE_NOT_SUPPORTED: WIN32_ERROR = 490u32;
+pub const ERROR_SPECIAL_ACCOUNT: WIN32_ERROR = 1371u32;
+pub const ERROR_SPECIAL_GROUP: WIN32_ERROR = 1372u32;
+pub const ERROR_SPECIAL_USER: WIN32_ERROR = 1373u32;
+pub const ERROR_SRC_SRV_DLL_LOAD_FAILED: WIN32_ERROR = 428u32;
+pub const ERROR_STACK_BUFFER_OVERRUN: WIN32_ERROR = 1282u32;
+pub const ERROR_STACK_OVERFLOW: WIN32_ERROR = 1001u32;
+pub const ERROR_STACK_OVERFLOW_READ: WIN32_ERROR = 599u32;
+pub const ERROR_STOPPED_ON_SYMLINK: WIN32_ERROR = 681u32;
+pub const ERROR_STORAGE_LOST_DATA_PERSISTENCE: WIN32_ERROR = 368u32;
+pub const ERROR_STORAGE_RESERVE_ALREADY_EXISTS: WIN32_ERROR = 418u32;
+pub const ERROR_STORAGE_RESERVE_DOES_NOT_EXIST: WIN32_ERROR = 417u32;
+pub const ERROR_STORAGE_RESERVE_ID_INVALID: WIN32_ERROR = 416u32;
+pub const ERROR_STORAGE_RESERVE_NOT_EMPTY: WIN32_ERROR = 419u32;
+pub const ERROR_STORAGE_STACK_ACCESS_DENIED: WIN32_ERROR = 472u32;
+pub const ERROR_STORAGE_TOPOLOGY_ID_MISMATCH: WIN32_ERROR = 345u32;
+pub const ERROR_STRICT_CFG_VIOLATION: WIN32_ERROR = 1657u32;
+pub const ERROR_SUBST_TO_JOIN: WIN32_ERROR = 141u32;
+pub const ERROR_SUBST_TO_SUBST: WIN32_ERROR = 139u32;
+pub const ERROR_SUCCESS: WIN32_ERROR = 0u32;
+pub const ERROR_SUCCESS_REBOOT_INITIATED: WIN32_ERROR = 1641u32;
+pub const ERROR_SWAPERROR: WIN32_ERROR = 999u32;
+pub const ERROR_SYMLINK_CLASS_DISABLED: WIN32_ERROR = 1463u32;
+pub const ERROR_SYMLINK_NOT_SUPPORTED: WIN32_ERROR = 1464u32;
+pub const ERROR_SYNCHRONIZATION_REQUIRED: WIN32_ERROR = 569u32;
+pub const ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED: WIN32_ERROR = 1274u32;
+pub const ERROR_SYSTEM_HIVE_TOO_LARGE: WIN32_ERROR = 653u32;
+pub const ERROR_SYSTEM_IMAGE_BAD_SIGNATURE: WIN32_ERROR = 637u32;
+pub const ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION: WIN32_ERROR = 783u32;
+pub const ERROR_SYSTEM_POWERSTATE_TRANSITION: WIN32_ERROR = 782u32;
+pub const ERROR_SYSTEM_PROCESS_TERMINATED: WIN32_ERROR = 591u32;
+pub const ERROR_SYSTEM_SHUTDOWN: WIN32_ERROR = 641u32;
+pub const ERROR_SYSTEM_TRACE: WIN32_ERROR = 150u32;
+pub const ERROR_THREAD_1_INACTIVE: WIN32_ERROR = 210u32;
+pub const ERROR_THREAD_ALREADY_IN_TASK: WIN32_ERROR = 1552u32;
+pub const ERROR_THREAD_MODE_ALREADY_BACKGROUND: WIN32_ERROR = 400u32;
+pub const ERROR_THREAD_MODE_NOT_BACKGROUND: WIN32_ERROR = 401u32;
+pub const ERROR_THREAD_NOT_IN_PROCESS: WIN32_ERROR = 566u32;
+pub const ERROR_THREAD_WAS_SUSPENDED: WIN32_ERROR = 699u32;
+pub const ERROR_TIMEOUT: WIN32_ERROR = 1460u32;
+pub const ERROR_TIMER_NOT_CANCELED: WIN32_ERROR = 541u32;
+pub const ERROR_TIMER_RESOLUTION_NOT_SET: WIN32_ERROR = 607u32;
+pub const ERROR_TIMER_RESUME_IGNORED: WIN32_ERROR = 722u32;
+pub const ERROR_TIME_SENSITIVE_THREAD: WIN32_ERROR = 422u32;
+pub const ERROR_TIME_SKEW: WIN32_ERROR = 1398u32;
+pub const ERROR_TLW_WITH_WSCHILD: WIN32_ERROR = 1406u32;
+pub const ERROR_TOKEN_ALREADY_IN_USE: WIN32_ERROR = 1375u32;
+pub const ERROR_TOO_MANY_CMDS: WIN32_ERROR = 56u32;
+pub const ERROR_TOO_MANY_CONTEXT_IDS: WIN32_ERROR = 1384u32;
+pub const ERROR_TOO_MANY_DESCRIPTORS: WIN32_ERROR = 331u32;
+pub const ERROR_TOO_MANY_LINKS: WIN32_ERROR = 1142u32;
+pub const ERROR_TOO_MANY_LUIDS_REQUESTED: WIN32_ERROR = 1333u32;
+pub const ERROR_TOO_MANY_MODULES: WIN32_ERROR = 214u32;
+pub const ERROR_TOO_MANY_MUXWAITERS: WIN32_ERROR = 152u32;
+pub const ERROR_TOO_MANY_NAMES: WIN32_ERROR = 68u32;
+pub const ERROR_TOO_MANY_OPEN_FILES: WIN32_ERROR = 4u32;
+pub const ERROR_TOO_MANY_POSTS: WIN32_ERROR = 298u32;
+pub const ERROR_TOO_MANY_SECRETS: WIN32_ERROR = 1381u32;
+pub const ERROR_TOO_MANY_SEMAPHORES: WIN32_ERROR = 100u32;
+pub const ERROR_TOO_MANY_SEM_REQUESTS: WIN32_ERROR = 103u32;
+pub const ERROR_TOO_MANY_SESS: WIN32_ERROR = 69u32;
+pub const ERROR_TOO_MANY_SIDS: WIN32_ERROR = 1389u32;
+pub const ERROR_TOO_MANY_TCBS: WIN32_ERROR = 155u32;
+pub const ERROR_TOO_MANY_THREADS: WIN32_ERROR = 565u32;
+pub const ERROR_TRANSLATION_COMPLETE: WIN32_ERROR = 757u32;
+pub const ERROR_TRUSTED_DOMAIN_FAILURE: WIN32_ERROR = 1788u32;
+pub const ERROR_TRUSTED_RELATIONSHIP_FAILURE: WIN32_ERROR = 1789u32;
+pub const ERROR_TRUST_FAILURE: WIN32_ERROR = 1790u32;
+pub const ERROR_UNABLE_TO_LOCK_MEDIA: WIN32_ERROR = 1108u32;
+pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT: WIN32_ERROR = 1176u32;
+pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT_2: WIN32_ERROR = 1177u32;
+pub const ERROR_UNABLE_TO_REMOVE_REPLACED: WIN32_ERROR = 1175u32;
+pub const ERROR_UNABLE_TO_UNLOAD_MEDIA: WIN32_ERROR = 1109u32;
+pub const ERROR_UNDEFINED_CHARACTER: WIN32_ERROR = 583u32;
+pub const ERROR_UNDEFINED_SCOPE: WIN32_ERROR = 319u32;
+pub const ERROR_UNEXPECTED_MM_CREATE_ERR: WIN32_ERROR = 556u32;
+pub const ERROR_UNEXPECTED_MM_EXTEND_ERR: WIN32_ERROR = 558u32;
+pub const ERROR_UNEXPECTED_MM_MAP_ERROR: WIN32_ERROR = 557u32;
+pub const ERROR_UNEXPECTED_NTCACHEMANAGER_ERROR: WIN32_ERROR = 443u32;
+pub const ERROR_UNEXP_NET_ERR: WIN32_ERROR = 59u32;
+pub const ERROR_UNHANDLED_EXCEPTION: WIN32_ERROR = 574u32;
+pub const ERROR_UNIDENTIFIED_ERROR: WIN32_ERROR = 1287u32;
+pub const ERROR_UNKNOWN_COMPONENT: WIN32_ERROR = 1607u32;
+pub const ERROR_UNKNOWN_FEATURE: WIN32_ERROR = 1606u32;
+pub const ERROR_UNKNOWN_PATCH: WIN32_ERROR = 1647u32;
+pub const ERROR_UNKNOWN_PORT: WIN32_ERROR = 1796u32;
+pub const ERROR_UNKNOWN_PRINTER_DRIVER: WIN32_ERROR = 1797u32;
+pub const ERROR_UNKNOWN_PRINTPROCESSOR: WIN32_ERROR = 1798u32;
+pub const ERROR_UNKNOWN_PRODUCT: WIN32_ERROR = 1605u32;
+pub const ERROR_UNKNOWN_PROPERTY: WIN32_ERROR = 1608u32;
+pub const ERROR_UNKNOWN_REVISION: WIN32_ERROR = 1305u32;
+pub const ERROR_UNRECOGNIZED_MEDIA: WIN32_ERROR = 1785u32;
+pub const ERROR_UNRECOGNIZED_VOLUME: WIN32_ERROR = 1005u32;
+pub const ERROR_UNSATISFIED_DEPENDENCIES: WIN32_ERROR = 441u32;
+pub const ERROR_UNSUPPORTED_COMPRESSION: WIN32_ERROR = 618u32;
+pub const ERROR_UNSUPPORTED_TYPE: WIN32_ERROR = 1630u32;
+pub const ERROR_UNTRUSTED_MOUNT_POINT: WIN32_ERROR = 448u32;
+pub const ERROR_UNWIND: WIN32_ERROR = 542u32;
+pub const ERROR_UNWIND_CONSOLIDATE: WIN32_ERROR = 684u32;
+pub const ERROR_USER_APC: WIN32_ERROR = 737u32;
+pub const ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED: WIN32_ERROR = 1934u32;
+pub const ERROR_USER_EXISTS: WIN32_ERROR = 1316u32;
+pub const ERROR_USER_MAPPED_FILE: WIN32_ERROR = 1224u32;
+pub const ERROR_USER_PROFILE_LOAD: WIN32_ERROR = 500u32;
+pub const ERROR_VALIDATE_CONTINUE: WIN32_ERROR = 625u32;
+pub const ERROR_VC_DISCONNECTED: WIN32_ERROR = 240u32;
+pub const ERROR_VDM_DISALLOWED: WIN32_ERROR = 1286u32;
+pub const ERROR_VDM_HARD_ERROR: WIN32_ERROR = 593u32;
+pub const ERROR_VERIFIER_STOP: WIN32_ERROR = 537u32;
+pub const ERROR_VERSION_PARSE_ERROR: WIN32_ERROR = 777u32;
+pub const ERROR_VIRUS_DELETED: WIN32_ERROR = 226u32;
+pub const ERROR_VIRUS_INFECTED: WIN32_ERROR = 225u32;
+pub const ERROR_VOLSNAP_HIBERNATE_READY: WIN32_ERROR = 761u32;
+pub const ERROR_VOLSNAP_PREPARE_HIBERNATE: WIN32_ERROR = 655u32;
+pub const ERROR_VOLUME_MOUNTED: WIN32_ERROR = 743u32;
+pub const ERROR_VOLUME_NOT_CLUSTER_ALIGNED: WIN32_ERROR = 407u32;
+pub const ERROR_VOLUME_NOT_SIS_ENABLED: WIN32_ERROR = 4500u32;
+pub const ERROR_VOLUME_NOT_SUPPORTED: WIN32_ERROR = 492u32;
+pub const ERROR_VOLUME_NOT_SUPPORT_EFS: WIN32_ERROR = 6014u32;
+pub const ERROR_VOLUME_WRITE_ACCESS_DENIED: WIN32_ERROR = 508u32;
+pub const ERROR_WAIT_1: WIN32_ERROR = 731u32;
+pub const ERROR_WAIT_2: WIN32_ERROR = 732u32;
+pub const ERROR_WAIT_3: WIN32_ERROR = 733u32;
+pub const ERROR_WAIT_63: WIN32_ERROR = 734u32;
+pub const ERROR_WAIT_FOR_OPLOCK: WIN32_ERROR = 765u32;
+pub const ERROR_WAIT_NO_CHILDREN: WIN32_ERROR = 128u32;
+pub const ERROR_WAKE_SYSTEM: WIN32_ERROR = 730u32;
+pub const ERROR_WAKE_SYSTEM_DEBUGGER: WIN32_ERROR = 675u32;
+pub const ERROR_WAS_LOCKED: WIN32_ERROR = 717u32;
+pub const ERROR_WAS_UNLOCKED: WIN32_ERROR = 715u32;
+pub const ERROR_WEAK_WHFBKEY_BLOCKED: WIN32_ERROR = 8651u32;
+pub const ERROR_WINDOW_NOT_COMBOBOX: WIN32_ERROR = 1423u32;
+pub const ERROR_WINDOW_NOT_DIALOG: WIN32_ERROR = 1420u32;
+pub const ERROR_WINDOW_OF_OTHER_THREAD: WIN32_ERROR = 1408u32;
+pub const ERROR_WIP_ENCRYPTION_FAILED: WIN32_ERROR = 6023u32;
+pub const ERROR_WOF_FILE_RESOURCE_TABLE_CORRUPT: WIN32_ERROR = 4448u32;
+pub const ERROR_WOF_WIM_HEADER_CORRUPT: WIN32_ERROR = 4446u32;
+pub const ERROR_WOF_WIM_RESOURCE_TABLE_CORRUPT: WIN32_ERROR = 4447u32;
+pub const ERROR_WORKING_SET_QUOTA: WIN32_ERROR = 1453u32;
+pub const ERROR_WOW_ASSERTION: WIN32_ERROR = 670u32;
+pub const ERROR_WRITE_FAULT: WIN32_ERROR = 29u32;
+pub const ERROR_WRITE_PROTECT: WIN32_ERROR = 19u32;
+pub const ERROR_WRONG_COMPARTMENT: WIN32_ERROR = 1468u32;
+pub const ERROR_WRONG_DISK: WIN32_ERROR = 34u32;
+pub const ERROR_WRONG_EFS: WIN32_ERROR = 6005u32;
+pub const ERROR_WRONG_PASSWORD: WIN32_ERROR = 1323u32;
+pub const ERROR_WRONG_TARGET_NAME: WIN32_ERROR = 1396u32;
+pub const ERROR_WX86_ERROR: WIN32_ERROR = 540u32;
+pub const ERROR_WX86_WARNING: WIN32_ERROR = 539u32;
+pub const ERROR_XMLDSIG_ERROR: WIN32_ERROR = 1466u32;
+pub const ERROR_XML_PARSE_ERROR: WIN32_ERROR = 1465u32;
+pub type EXCEPTION_DISPOSITION = i32;
+pub const EXCEPTION_MAXIMUM_PARAMETERS: u32 = 15u32;
+#[repr(C)]
+pub struct EXCEPTION_POINTERS {
+ pub ExceptionRecord: *mut EXCEPTION_RECORD,
+ pub ContextRecord: *mut CONTEXT,
+}
+impl ::core::marker::Copy for EXCEPTION_POINTERS {}
+impl ::core::clone::Clone for EXCEPTION_POINTERS {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct EXCEPTION_RECORD {
+ pub ExceptionCode: NTSTATUS,
+ pub ExceptionFlags: u32,
+ pub ExceptionRecord: *mut EXCEPTION_RECORD,
+ pub ExceptionAddress: *mut ::core::ffi::c_void,
+ pub NumberParameters: u32,
+ pub ExceptionInformation: [usize; 15],
+}
+impl ::core::marker::Copy for EXCEPTION_RECORD {}
+impl ::core::clone::Clone for EXCEPTION_RECORD {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const EXCEPTION_STACK_OVERFLOW: NTSTATUS = -1073741571i32;
+pub const EXTENDED_STARTUPINFO_PRESENT: PROCESS_CREATION_FLAGS = 524288u32;
+pub const E_NOTIMPL: HRESULT = -2147467263i32;
+pub const ExceptionCollidedUnwind: EXCEPTION_DISPOSITION = 3i32;
+pub const ExceptionContinueExecution: EXCEPTION_DISPOSITION = 0i32;
+pub const ExceptionContinueSearch: EXCEPTION_DISPOSITION = 1i32;
+pub const ExceptionNestedException: EXCEPTION_DISPOSITION = 2i32;
+pub type FACILITY_CODE = u32;
+pub const FACILITY_NT_BIT: FACILITY_CODE = 268435456u32;
+pub const FALSE: BOOL = 0i32;
+pub type FARPROC = ::core::option::Option<unsafe extern "system" fn() -> isize>;
+#[repr(C)]
+pub struct FD_SET {
+ pub fd_count: u32,
+ pub fd_array: [SOCKET; 64],
+}
+impl ::core::marker::Copy for FD_SET {}
+impl ::core::clone::Clone for FD_SET {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct FILETIME {
+ pub dwLowDateTime: u32,
+ pub dwHighDateTime: u32,
+}
+impl ::core::marker::Copy for FILETIME {}
+impl ::core::clone::Clone for FILETIME {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type FILE_ACCESS_RIGHTS = u32;
+pub const FILE_ADD_FILE: FILE_ACCESS_RIGHTS = 2u32;
+pub const FILE_ADD_SUBDIRECTORY: FILE_ACCESS_RIGHTS = 4u32;
+pub const FILE_ALL_ACCESS: FILE_ACCESS_RIGHTS = 2032127u32;
+pub const FILE_APPEND_DATA: FILE_ACCESS_RIGHTS = 4u32;
+pub const FILE_ATTRIBUTE_ARCHIVE: FILE_FLAGS_AND_ATTRIBUTES = 32u32;
+pub const FILE_ATTRIBUTE_COMPRESSED: FILE_FLAGS_AND_ATTRIBUTES = 2048u32;
+pub const FILE_ATTRIBUTE_DEVICE: FILE_FLAGS_AND_ATTRIBUTES = 64u32;
+pub const FILE_ATTRIBUTE_DIRECTORY: FILE_FLAGS_AND_ATTRIBUTES = 16u32;
+pub const FILE_ATTRIBUTE_EA: FILE_FLAGS_AND_ATTRIBUTES = 262144u32;
+pub const FILE_ATTRIBUTE_ENCRYPTED: FILE_FLAGS_AND_ATTRIBUTES = 16384u32;
+pub const FILE_ATTRIBUTE_HIDDEN: FILE_FLAGS_AND_ATTRIBUTES = 2u32;
+pub const FILE_ATTRIBUTE_INTEGRITY_STREAM: FILE_FLAGS_AND_ATTRIBUTES = 32768u32;
+pub const FILE_ATTRIBUTE_NORMAL: FILE_FLAGS_AND_ATTRIBUTES = 128u32;
+pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: FILE_FLAGS_AND_ATTRIBUTES = 8192u32;
+pub const FILE_ATTRIBUTE_NO_SCRUB_DATA: FILE_FLAGS_AND_ATTRIBUTES = 131072u32;
+pub const FILE_ATTRIBUTE_OFFLINE: FILE_FLAGS_AND_ATTRIBUTES = 4096u32;
+pub const FILE_ATTRIBUTE_PINNED: FILE_FLAGS_AND_ATTRIBUTES = 524288u32;
+pub const FILE_ATTRIBUTE_READONLY: FILE_FLAGS_AND_ATTRIBUTES = 1u32;
+pub const FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS: FILE_FLAGS_AND_ATTRIBUTES = 4194304u32;
+pub const FILE_ATTRIBUTE_RECALL_ON_OPEN: FILE_FLAGS_AND_ATTRIBUTES = 262144u32;
+pub const FILE_ATTRIBUTE_REPARSE_POINT: FILE_FLAGS_AND_ATTRIBUTES = 1024u32;
+pub const FILE_ATTRIBUTE_SPARSE_FILE: FILE_FLAGS_AND_ATTRIBUTES = 512u32;
+pub const FILE_ATTRIBUTE_SYSTEM: FILE_FLAGS_AND_ATTRIBUTES = 4u32;
+#[repr(C)]
+pub struct FILE_ATTRIBUTE_TAG_INFO {
+ pub FileAttributes: u32,
+ pub ReparseTag: u32,
+}
+impl ::core::marker::Copy for FILE_ATTRIBUTE_TAG_INFO {}
+impl ::core::clone::Clone for FILE_ATTRIBUTE_TAG_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32;
+pub const FILE_ATTRIBUTE_UNPINNED: FILE_FLAGS_AND_ATTRIBUTES = 1048576u32;
+pub const FILE_ATTRIBUTE_VIRTUAL: FILE_FLAGS_AND_ATTRIBUTES = 65536u32;
+#[repr(C)]
+pub struct FILE_BASIC_INFO {
+ pub CreationTime: i64,
+ pub LastAccessTime: i64,
+ pub LastWriteTime: i64,
+ pub ChangeTime: i64,
+ pub FileAttributes: u32,
+}
+impl ::core::marker::Copy for FILE_BASIC_INFO {}
+impl ::core::clone::Clone for FILE_BASIC_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const FILE_BEGIN: SET_FILE_POINTER_MOVE_METHOD = 0u32;
+pub const FILE_COMPLETE_IF_OPLOCKED: NTCREATEFILE_CREATE_OPTIONS = 256u32;
+pub const FILE_CONTAINS_EXTENDED_CREATE_INFORMATION: NTCREATEFILE_CREATE_OPTIONS = 268435456u32;
+pub const FILE_CREATE: NTCREATEFILE_CREATE_DISPOSITION = 2u32;
+pub const FILE_CREATE_PIPE_INSTANCE: FILE_ACCESS_RIGHTS = 4u32;
+pub const FILE_CREATE_TREE_CONNECTION: NTCREATEFILE_CREATE_OPTIONS = 128u32;
+pub type FILE_CREATION_DISPOSITION = u32;
+pub const FILE_CURRENT: SET_FILE_POINTER_MOVE_METHOD = 1u32;
+pub const FILE_DELETE_CHILD: FILE_ACCESS_RIGHTS = 64u32;
+pub const FILE_DELETE_ON_CLOSE: NTCREATEFILE_CREATE_OPTIONS = 4096u32;
+pub const FILE_DIRECTORY_FILE: NTCREATEFILE_CREATE_OPTIONS = 1u32;
+pub const FILE_DISALLOW_EXCLUSIVE: NTCREATEFILE_CREATE_OPTIONS = 131072u32;
+pub const FILE_DISPOSITION_FLAG_DELETE: FILE_DISPOSITION_INFO_EX_FLAGS = 1u32;
+pub const FILE_DISPOSITION_FLAG_DO_NOT_DELETE: FILE_DISPOSITION_INFO_EX_FLAGS = 0u32;
+pub const FILE_DISPOSITION_FLAG_FORCE_IMAGE_SECTION_CHECK: FILE_DISPOSITION_INFO_EX_FLAGS = 4u32;
+pub const FILE_DISPOSITION_FLAG_IGNORE_READONLY_ATTRIBUTE: FILE_DISPOSITION_INFO_EX_FLAGS = 16u32;
+pub const FILE_DISPOSITION_FLAG_ON_CLOSE: FILE_DISPOSITION_INFO_EX_FLAGS = 8u32;
+pub const FILE_DISPOSITION_FLAG_POSIX_SEMANTICS: FILE_DISPOSITION_INFO_EX_FLAGS = 2u32;
+#[repr(C)]
+pub struct FILE_DISPOSITION_INFO {
+ pub DeleteFile: BOOLEAN,
+}
+impl ::core::marker::Copy for FILE_DISPOSITION_INFO {}
+impl ::core::clone::Clone for FILE_DISPOSITION_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct FILE_DISPOSITION_INFO_EX {
+ pub Flags: FILE_DISPOSITION_INFO_EX_FLAGS,
+}
+impl ::core::marker::Copy for FILE_DISPOSITION_INFO_EX {}
+impl ::core::clone::Clone for FILE_DISPOSITION_INFO_EX {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type FILE_DISPOSITION_INFO_EX_FLAGS = u32;
+pub const FILE_END: SET_FILE_POINTER_MOVE_METHOD = 2u32;
+#[repr(C)]
+pub struct FILE_END_OF_FILE_INFO {
+ pub EndOfFile: i64,
+}
+impl ::core::marker::Copy for FILE_END_OF_FILE_INFO {}
+impl ::core::clone::Clone for FILE_END_OF_FILE_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const FILE_EXECUTE: FILE_ACCESS_RIGHTS = 32u32;
+pub type FILE_FLAGS_AND_ATTRIBUTES = u32;
+pub const FILE_FLAG_BACKUP_SEMANTICS: FILE_FLAGS_AND_ATTRIBUTES = 33554432u32;
+pub const FILE_FLAG_DELETE_ON_CLOSE: FILE_FLAGS_AND_ATTRIBUTES = 67108864u32;
+pub const FILE_FLAG_FIRST_PIPE_INSTANCE: FILE_FLAGS_AND_ATTRIBUTES = 524288u32;
+pub const FILE_FLAG_NO_BUFFERING: FILE_FLAGS_AND_ATTRIBUTES = 536870912u32;
+pub const FILE_FLAG_OPEN_NO_RECALL: FILE_FLAGS_AND_ATTRIBUTES = 1048576u32;
+pub const FILE_FLAG_OPEN_REPARSE_POINT: FILE_FLAGS_AND_ATTRIBUTES = 2097152u32;
+pub const FILE_FLAG_OVERLAPPED: FILE_FLAGS_AND_ATTRIBUTES = 1073741824u32;
+pub const FILE_FLAG_POSIX_SEMANTICS: FILE_FLAGS_AND_ATTRIBUTES = 16777216u32;
+pub const FILE_FLAG_RANDOM_ACCESS: FILE_FLAGS_AND_ATTRIBUTES = 268435456u32;
+pub const FILE_FLAG_SEQUENTIAL_SCAN: FILE_FLAGS_AND_ATTRIBUTES = 134217728u32;
+pub const FILE_FLAG_SESSION_AWARE: FILE_FLAGS_AND_ATTRIBUTES = 8388608u32;
+pub const FILE_FLAG_WRITE_THROUGH: FILE_FLAGS_AND_ATTRIBUTES = 2147483648u32;
+pub const FILE_GENERIC_EXECUTE: FILE_ACCESS_RIGHTS = 1179808u32;
+pub const FILE_GENERIC_READ: FILE_ACCESS_RIGHTS = 1179785u32;
+pub const FILE_GENERIC_WRITE: FILE_ACCESS_RIGHTS = 1179926u32;
+#[repr(C)]
+pub struct FILE_ID_BOTH_DIR_INFO {
+ pub NextEntryOffset: u32,
+ pub FileIndex: u32,
+ pub CreationTime: i64,
+ pub LastAccessTime: i64,
+ pub LastWriteTime: i64,
+ pub ChangeTime: i64,
+ pub EndOfFile: i64,
+ pub AllocationSize: i64,
+ pub FileAttributes: u32,
+ pub FileNameLength: u32,
+ pub EaSize: u32,
+ pub ShortNameLength: i8,
+ pub ShortName: [u16; 12],
+ pub FileId: i64,
+ pub FileName: [u16; 1],
+}
+impl ::core::marker::Copy for FILE_ID_BOTH_DIR_INFO {}
+impl ::core::clone::Clone for FILE_ID_BOTH_DIR_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type FILE_INFO_BY_HANDLE_CLASS = i32;
+pub const FILE_LIST_DIRECTORY: FILE_ACCESS_RIGHTS = 1u32;
+pub const FILE_NAME_NORMALIZED: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32;
+pub const FILE_NAME_OPENED: GETFINALPATHNAMEBYHANDLE_FLAGS = 8u32;
+pub const FILE_NON_DIRECTORY_FILE: NTCREATEFILE_CREATE_OPTIONS = 64u32;
+pub const FILE_NO_COMPRESSION: NTCREATEFILE_CREATE_OPTIONS = 32768u32;
+pub const FILE_NO_EA_KNOWLEDGE: NTCREATEFILE_CREATE_OPTIONS = 512u32;
+pub const FILE_NO_INTERMEDIATE_BUFFERING: NTCREATEFILE_CREATE_OPTIONS = 8u32;
+pub const FILE_OPEN: NTCREATEFILE_CREATE_DISPOSITION = 1u32;
+pub const FILE_OPEN_BY_FILE_ID: NTCREATEFILE_CREATE_OPTIONS = 8192u32;
+pub const FILE_OPEN_FOR_BACKUP_INTENT: NTCREATEFILE_CREATE_OPTIONS = 16384u32;
+pub const FILE_OPEN_FOR_FREE_SPACE_QUERY: NTCREATEFILE_CREATE_OPTIONS = 8388608u32;
+pub const FILE_OPEN_IF: NTCREATEFILE_CREATE_DISPOSITION = 3u32;
+pub const FILE_OPEN_NO_RECALL: NTCREATEFILE_CREATE_OPTIONS = 4194304u32;
+pub const FILE_OPEN_REPARSE_POINT: NTCREATEFILE_CREATE_OPTIONS = 2097152u32;
+pub const FILE_OPEN_REQUIRING_OPLOCK: NTCREATEFILE_CREATE_OPTIONS = 65536u32;
+pub const FILE_OVERWRITE: NTCREATEFILE_CREATE_DISPOSITION = 4u32;
+pub const FILE_OVERWRITE_IF: NTCREATEFILE_CREATE_DISPOSITION = 5u32;
+pub const FILE_RANDOM_ACCESS: NTCREATEFILE_CREATE_OPTIONS = 2048u32;
+pub const FILE_READ_ATTRIBUTES: FILE_ACCESS_RIGHTS = 128u32;
+pub const FILE_READ_DATA: FILE_ACCESS_RIGHTS = 1u32;
+pub const FILE_READ_EA: FILE_ACCESS_RIGHTS = 8u32;
+pub const FILE_RESERVE_OPFILTER: NTCREATEFILE_CREATE_OPTIONS = 1048576u32;
+pub const FILE_SEQUENTIAL_ONLY: NTCREATEFILE_CREATE_OPTIONS = 4u32;
+pub const FILE_SESSION_AWARE: NTCREATEFILE_CREATE_OPTIONS = 262144u32;
+pub const FILE_SHARE_DELETE: FILE_SHARE_MODE = 4u32;
+pub type FILE_SHARE_MODE = u32;
+pub const FILE_SHARE_NONE: FILE_SHARE_MODE = 0u32;
+pub const FILE_SHARE_READ: FILE_SHARE_MODE = 1u32;
+pub const FILE_SHARE_WRITE: FILE_SHARE_MODE = 2u32;
+#[repr(C)]
+pub struct FILE_STANDARD_INFO {
+ pub AllocationSize: i64,
+ pub EndOfFile: i64,
+ pub NumberOfLinks: u32,
+ pub DeletePending: BOOLEAN,
+ pub Directory: BOOLEAN,
+}
+impl ::core::marker::Copy for FILE_STANDARD_INFO {}
+impl ::core::clone::Clone for FILE_STANDARD_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const FILE_SUPERSEDE: NTCREATEFILE_CREATE_DISPOSITION = 0u32;
+pub const FILE_SYNCHRONOUS_IO_ALERT: NTCREATEFILE_CREATE_OPTIONS = 16u32;
+pub const FILE_SYNCHRONOUS_IO_NONALERT: NTCREATEFILE_CREATE_OPTIONS = 32u32;
+pub const FILE_TRAVERSE: FILE_ACCESS_RIGHTS = 32u32;
+pub type FILE_TYPE = u32;
+pub const FILE_TYPE_CHAR: FILE_TYPE = 2u32;
+pub const FILE_TYPE_DISK: FILE_TYPE = 1u32;
+pub const FILE_TYPE_PIPE: FILE_TYPE = 3u32;
+pub const FILE_TYPE_REMOTE: FILE_TYPE = 32768u32;
+pub const FILE_TYPE_UNKNOWN: FILE_TYPE = 0u32;
+pub const FILE_WRITE_ATTRIBUTES: FILE_ACCESS_RIGHTS = 256u32;
+pub const FILE_WRITE_DATA: FILE_ACCESS_RIGHTS = 2u32;
+pub const FILE_WRITE_EA: FILE_ACCESS_RIGHTS = 16u32;
+pub const FILE_WRITE_THROUGH: NTCREATEFILE_CREATE_OPTIONS = 2u32;
+pub const FIONBIO: i32 = -2147195266i32;
+#[repr(C)]
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+pub struct FLOATING_SAVE_AREA {
+ pub ControlWord: u32,
+ pub StatusWord: u32,
+ pub TagWord: u32,
+ pub ErrorOffset: u32,
+ pub ErrorSelector: u32,
+ pub DataOffset: u32,
+ pub DataSelector: u32,
+ pub RegisterArea: [u8; 80],
+ pub Cr0NpxState: u32,
+}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::marker::Copy for FLOATING_SAVE_AREA {}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::clone::Clone for FLOATING_SAVE_AREA {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86")]
+pub struct FLOATING_SAVE_AREA {
+ pub ControlWord: u32,
+ pub StatusWord: u32,
+ pub TagWord: u32,
+ pub ErrorOffset: u32,
+ pub ErrorSelector: u32,
+ pub DataOffset: u32,
+ pub DataSelector: u32,
+ pub RegisterArea: [u8; 80],
+ pub Spare0: u32,
+}
+#[cfg(target_arch = "x86")]
+impl ::core::marker::Copy for FLOATING_SAVE_AREA {}
+#[cfg(target_arch = "x86")]
+impl ::core::clone::Clone for FLOATING_SAVE_AREA {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: FORMAT_MESSAGE_OPTIONS = 256u32;
+pub const FORMAT_MESSAGE_ARGUMENT_ARRAY: FORMAT_MESSAGE_OPTIONS = 8192u32;
+pub const FORMAT_MESSAGE_FROM_HMODULE: FORMAT_MESSAGE_OPTIONS = 2048u32;
+pub const FORMAT_MESSAGE_FROM_STRING: FORMAT_MESSAGE_OPTIONS = 1024u32;
+pub const FORMAT_MESSAGE_FROM_SYSTEM: FORMAT_MESSAGE_OPTIONS = 4096u32;
+pub const FORMAT_MESSAGE_IGNORE_INSERTS: FORMAT_MESSAGE_OPTIONS = 512u32;
+pub type FORMAT_MESSAGE_OPTIONS = u32;
+pub const FRS_ERR_SYSVOL_POPULATE_TIMEOUT: i32 = 8014i32;
+pub const FSCTL_GET_REPARSE_POINT: u32 = 589992u32;
+pub const FSCTL_SET_REPARSE_POINT: u32 = 589988u32;
+pub const FileAlignmentInfo: FILE_INFO_BY_HANDLE_CLASS = 17i32;
+pub const FileAllocationInfo: FILE_INFO_BY_HANDLE_CLASS = 5i32;
+pub const FileAttributeTagInfo: FILE_INFO_BY_HANDLE_CLASS = 9i32;
+pub const FileBasicInfo: FILE_INFO_BY_HANDLE_CLASS = 0i32;
+pub const FileCaseSensitiveInfo: FILE_INFO_BY_HANDLE_CLASS = 23i32;
+pub const FileCompressionInfo: FILE_INFO_BY_HANDLE_CLASS = 8i32;
+pub const FileDispositionInfo: FILE_INFO_BY_HANDLE_CLASS = 4i32;
+pub const FileDispositionInfoEx: FILE_INFO_BY_HANDLE_CLASS = 21i32;
+pub const FileEndOfFileInfo: FILE_INFO_BY_HANDLE_CLASS = 6i32;
+pub const FileFullDirectoryInfo: FILE_INFO_BY_HANDLE_CLASS = 14i32;
+pub const FileFullDirectoryRestartInfo: FILE_INFO_BY_HANDLE_CLASS = 15i32;
+pub const FileIdBothDirectoryInfo: FILE_INFO_BY_HANDLE_CLASS = 10i32;
+pub const FileIdBothDirectoryRestartInfo: FILE_INFO_BY_HANDLE_CLASS = 11i32;
+pub const FileIdExtdDirectoryInfo: FILE_INFO_BY_HANDLE_CLASS = 19i32;
+pub const FileIdExtdDirectoryRestartInfo: FILE_INFO_BY_HANDLE_CLASS = 20i32;
+pub const FileIdInfo: FILE_INFO_BY_HANDLE_CLASS = 18i32;
+pub const FileIoPriorityHintInfo: FILE_INFO_BY_HANDLE_CLASS = 12i32;
+pub const FileNameInfo: FILE_INFO_BY_HANDLE_CLASS = 2i32;
+pub const FileNormalizedNameInfo: FILE_INFO_BY_HANDLE_CLASS = 24i32;
+pub const FileRemoteProtocolInfo: FILE_INFO_BY_HANDLE_CLASS = 13i32;
+pub const FileRenameInfo: FILE_INFO_BY_HANDLE_CLASS = 3i32;
+pub const FileRenameInfoEx: FILE_INFO_BY_HANDLE_CLASS = 22i32;
+pub const FileStandardInfo: FILE_INFO_BY_HANDLE_CLASS = 1i32;
+pub const FileStorageInfo: FILE_INFO_BY_HANDLE_CLASS = 16i32;
+pub const FileStreamInfo: FILE_INFO_BY_HANDLE_CLASS = 7i32;
+pub type FindFileHandle = *mut ::core::ffi::c_void;
+pub type GENERIC_ACCESS_RIGHTS = u32;
+pub const GENERIC_ALL: GENERIC_ACCESS_RIGHTS = 268435456u32;
+pub const GENERIC_EXECUTE: GENERIC_ACCESS_RIGHTS = 536870912u32;
+pub const GENERIC_READ: GENERIC_ACCESS_RIGHTS = 2147483648u32;
+pub const GENERIC_WRITE: GENERIC_ACCESS_RIGHTS = 1073741824u32;
+pub type GETFINALPATHNAMEBYHANDLE_FLAGS = u32;
+#[repr(C)]
+pub struct GUID {
+ pub data1: u32,
+ pub data2: u16,
+ pub data3: u16,
+ pub data4: [u8; 8],
+}
+impl GUID {
+ pub const fn from_u128(uuid: u128) -> Self {
+ Self {
+ data1: (uuid >> 96) as u32,
+ data2: (uuid >> 80 & 0xffff) as u16,
+ data3: (uuid >> 64 & 0xffff) as u16,
+ data4: (uuid as u64).to_be_bytes(),
+ }
+ }
+}
+impl ::core::marker::Copy for GUID {}
+impl ::core::clone::Clone for GUID {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type HANDLE = *mut ::core::ffi::c_void;
+pub type HANDLE_FLAGS = u32;
+pub const HANDLE_FLAG_INHERIT: HANDLE_FLAGS = 1u32;
+pub const HANDLE_FLAG_PROTECT_FROM_CLOSE: HANDLE_FLAGS = 2u32;
+pub const HIGH_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 128u32;
+pub type HMODULE = *mut ::core::ffi::c_void;
+pub type HRESULT = i32;
+pub const IDLE_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 64u32;
+#[repr(C)]
+pub struct IN6_ADDR {
+ pub u: IN6_ADDR_0,
+}
+impl ::core::marker::Copy for IN6_ADDR {}
+impl ::core::clone::Clone for IN6_ADDR {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union IN6_ADDR_0 {
+ pub Byte: [u8; 16],
+ pub Word: [u16; 8],
+}
+impl ::core::marker::Copy for IN6_ADDR_0 {}
+impl ::core::clone::Clone for IN6_ADDR_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const INFINITE: u32 = 4294967295u32;
+pub const INHERIT_CALLER_PRIORITY: PROCESS_CREATION_FLAGS = 131072u32;
+pub const INHERIT_PARENT_AFFINITY: PROCESS_CREATION_FLAGS = 65536u32;
+pub const INIT_ONCE_INIT_FAILED: u32 = 4u32;
+pub const INVALID_FILE_ATTRIBUTES: u32 = 4294967295u32;
+pub const INVALID_HANDLE_VALUE: HANDLE = ::core::ptr::invalid_mut(-1i32 as _);
+pub const INVALID_SOCKET: SOCKET = -1i32 as _;
+#[repr(C)]
+pub struct IN_ADDR {
+ pub S_un: IN_ADDR_0,
+}
+impl ::core::marker::Copy for IN_ADDR {}
+impl ::core::clone::Clone for IN_ADDR {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union IN_ADDR_0 {
+ pub S_un_b: IN_ADDR_0_0,
+ pub S_un_w: IN_ADDR_0_1,
+ pub S_addr: u32,
+}
+impl ::core::marker::Copy for IN_ADDR_0 {}
+impl ::core::clone::Clone for IN_ADDR_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct IN_ADDR_0_0 {
+ pub s_b1: u8,
+ pub s_b2: u8,
+ pub s_b3: u8,
+ pub s_b4: u8,
+}
+impl ::core::marker::Copy for IN_ADDR_0_0 {}
+impl ::core::clone::Clone for IN_ADDR_0_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct IN_ADDR_0_1 {
+ pub s_w1: u16,
+ pub s_w2: u16,
+}
+impl ::core::marker::Copy for IN_ADDR_0_1 {}
+impl ::core::clone::Clone for IN_ADDR_0_1 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const IO_REPARSE_TAG_MOUNT_POINT: u32 = 2684354563u32;
+pub const IO_REPARSE_TAG_SYMLINK: u32 = 2684354572u32;
+#[repr(C)]
+pub struct IO_STATUS_BLOCK {
+ pub Anonymous: IO_STATUS_BLOCK_0,
+ pub Information: usize,
+}
+impl ::core::marker::Copy for IO_STATUS_BLOCK {}
+impl ::core::clone::Clone for IO_STATUS_BLOCK {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union IO_STATUS_BLOCK_0 {
+ pub Status: NTSTATUS,
+ pub Pointer: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for IO_STATUS_BLOCK_0 {}
+impl ::core::clone::Clone for IO_STATUS_BLOCK_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type IPPROTO = i32;
+pub const IPPROTO_AH: IPPROTO = 51i32;
+pub const IPPROTO_CBT: IPPROTO = 7i32;
+pub const IPPROTO_DSTOPTS: IPPROTO = 60i32;
+pub const IPPROTO_EGP: IPPROTO = 8i32;
+pub const IPPROTO_ESP: IPPROTO = 50i32;
+pub const IPPROTO_FRAGMENT: IPPROTO = 44i32;
+pub const IPPROTO_GGP: IPPROTO = 3i32;
+pub const IPPROTO_HOPOPTS: IPPROTO = 0i32;
+pub const IPPROTO_ICLFXBM: IPPROTO = 78i32;
+pub const IPPROTO_ICMP: IPPROTO = 1i32;
+pub const IPPROTO_ICMPV6: IPPROTO = 58i32;
+pub const IPPROTO_IDP: IPPROTO = 22i32;
+pub const IPPROTO_IGMP: IPPROTO = 2i32;
+pub const IPPROTO_IGP: IPPROTO = 9i32;
+pub const IPPROTO_IP: IPPROTO = 0i32;
+pub const IPPROTO_IPV4: IPPROTO = 4i32;
+pub const IPPROTO_IPV6: IPPROTO = 41i32;
+pub const IPPROTO_L2TP: IPPROTO = 115i32;
+pub const IPPROTO_MAX: IPPROTO = 256i32;
+pub const IPPROTO_ND: IPPROTO = 77i32;
+pub const IPPROTO_NONE: IPPROTO = 59i32;
+pub const IPPROTO_PGM: IPPROTO = 113i32;
+pub const IPPROTO_PIM: IPPROTO = 103i32;
+pub const IPPROTO_PUP: IPPROTO = 12i32;
+pub const IPPROTO_RAW: IPPROTO = 255i32;
+pub const IPPROTO_RDP: IPPROTO = 27i32;
+pub const IPPROTO_RESERVED_IPSEC: IPPROTO = 258i32;
+pub const IPPROTO_RESERVED_IPSECOFFLOAD: IPPROTO = 259i32;
+pub const IPPROTO_RESERVED_MAX: IPPROTO = 261i32;
+pub const IPPROTO_RESERVED_RAW: IPPROTO = 257i32;
+pub const IPPROTO_RESERVED_WNV: IPPROTO = 260i32;
+pub const IPPROTO_RM: IPPROTO = 113i32;
+pub const IPPROTO_ROUTING: IPPROTO = 43i32;
+pub const IPPROTO_SCTP: IPPROTO = 132i32;
+pub const IPPROTO_ST: IPPROTO = 5i32;
+pub const IPPROTO_TCP: IPPROTO = 6i32;
+pub const IPPROTO_UDP: IPPROTO = 17i32;
+pub const IPV6_ADD_MEMBERSHIP: i32 = 12i32;
+pub const IPV6_DROP_MEMBERSHIP: i32 = 13i32;
+#[repr(C)]
+pub struct IPV6_MREQ {
+ pub ipv6mr_multiaddr: IN6_ADDR,
+ pub ipv6mr_interface: u32,
+}
+impl ::core::marker::Copy for IPV6_MREQ {}
+impl ::core::clone::Clone for IPV6_MREQ {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const IPV6_MULTICAST_LOOP: i32 = 11i32;
+pub const IPV6_V6ONLY: i32 = 27i32;
+pub const IP_ADD_MEMBERSHIP: i32 = 12i32;
+pub const IP_DROP_MEMBERSHIP: i32 = 13i32;
+#[repr(C)]
+pub struct IP_MREQ {
+ pub imr_multiaddr: IN_ADDR,
+ pub imr_interface: IN_ADDR,
+}
+impl ::core::marker::Copy for IP_MREQ {}
+impl ::core::clone::Clone for IP_MREQ {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const IP_MULTICAST_LOOP: i32 = 11i32;
+pub const IP_MULTICAST_TTL: i32 = 10i32;
+pub const IP_TTL: i32 = 4i32;
+#[repr(C)]
+pub struct LINGER {
+ pub l_onoff: u16,
+ pub l_linger: u16,
+}
+impl ::core::marker::Copy for LINGER {}
+impl ::core::clone::Clone for LINGER {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type LPOVERLAPPED_COMPLETION_ROUTINE = ::core::option::Option<
+ unsafe extern "system" fn(
+ dwerrorcode: u32,
+ dwnumberofbytestransfered: u32,
+ lpoverlapped: *mut OVERLAPPED,
+ ) -> (),
+>;
+pub type LPPROGRESS_ROUTINE = ::core::option::Option<
+ unsafe extern "system" fn(
+ totalfilesize: i64,
+ totalbytestransferred: i64,
+ streamsize: i64,
+ streambytestransferred: i64,
+ dwstreamnumber: u32,
+ dwcallbackreason: LPPROGRESS_ROUTINE_CALLBACK_REASON,
+ hsourcefile: HANDLE,
+ hdestinationfile: HANDLE,
+ lpdata: *const ::core::ffi::c_void,
+ ) -> u32,
+>;
+pub type LPPROGRESS_ROUTINE_CALLBACK_REASON = u32;
+pub type LPTHREAD_START_ROUTINE = ::core::option::Option<
+ unsafe extern "system" fn(lpthreadparameter: *mut ::core::ffi::c_void) -> u32,
+>;
+pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = ::core::option::Option<
+ unsafe extern "system" fn(
+ dwerror: u32,
+ cbtransferred: u32,
+ lpoverlapped: *mut OVERLAPPED,
+ dwflags: u32,
+ ) -> (),
+>;
+#[repr(C)]
+pub struct M128A {
+ pub Low: u64,
+ pub High: i64,
+}
+impl ::core::marker::Copy for M128A {}
+impl ::core::clone::Clone for M128A {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: u32 = 16384u32;
+pub const MAX_PATH: u32 = 260u32;
+pub const MB_COMPOSITE: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 2u32;
+pub const MB_ERR_INVALID_CHARS: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 8u32;
+pub const MB_PRECOMPOSED: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 1u32;
+pub const MB_USEGLYPHCHARS: MULTI_BYTE_TO_WIDE_CHAR_FLAGS = 4u32;
+pub const MOVEFILE_COPY_ALLOWED: MOVE_FILE_FLAGS = 2u32;
+pub const MOVEFILE_CREATE_HARDLINK: MOVE_FILE_FLAGS = 16u32;
+pub const MOVEFILE_DELAY_UNTIL_REBOOT: MOVE_FILE_FLAGS = 4u32;
+pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE: MOVE_FILE_FLAGS = 32u32;
+pub const MOVEFILE_REPLACE_EXISTING: MOVE_FILE_FLAGS = 1u32;
+pub const MOVEFILE_WRITE_THROUGH: MOVE_FILE_FLAGS = 8u32;
+pub type MOVE_FILE_FLAGS = u32;
+pub const MSG_DONTROUTE: SEND_RECV_FLAGS = 4i32;
+pub const MSG_OOB: SEND_RECV_FLAGS = 1i32;
+pub const MSG_PEEK: SEND_RECV_FLAGS = 2i32;
+pub const MSG_PUSH_IMMEDIATE: SEND_RECV_FLAGS = 32i32;
+pub const MSG_WAITALL: SEND_RECV_FLAGS = 8i32;
+pub type MULTI_BYTE_TO_WIDE_CHAR_FLAGS = u32;
+pub const MaximumFileInfoByHandleClass: FILE_INFO_BY_HANDLE_CLASS = 25i32;
+pub type NAMED_PIPE_MODE = u32;
+pub const NORMAL_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 32u32;
+pub const NO_ERROR: WIN32_ERROR = 0u32;
+pub type NTCREATEFILE_CREATE_DISPOSITION = u32;
+pub type NTCREATEFILE_CREATE_OPTIONS = u32;
+pub type NTSTATUS = i32;
+#[repr(C)]
+pub struct OBJECT_ATTRIBUTES {
+ pub Length: u32,
+ pub RootDirectory: HANDLE,
+ pub ObjectName: *mut UNICODE_STRING,
+ pub Attributes: u32,
+ pub SecurityDescriptor: *mut ::core::ffi::c_void,
+ pub SecurityQualityOfService: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for OBJECT_ATTRIBUTES {}
+impl ::core::clone::Clone for OBJECT_ATTRIBUTES {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const OBJ_DONT_REPARSE: i32 = 4096i32;
+pub const OPEN_ALWAYS: FILE_CREATION_DISPOSITION = 4u32;
+pub const OPEN_EXISTING: FILE_CREATION_DISPOSITION = 3u32;
+#[repr(C)]
+pub struct OVERLAPPED {
+ pub Internal: usize,
+ pub InternalHigh: usize,
+ pub Anonymous: OVERLAPPED_0,
+ pub hEvent: HANDLE,
+}
+impl ::core::marker::Copy for OVERLAPPED {}
+impl ::core::clone::Clone for OVERLAPPED {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union OVERLAPPED_0 {
+ pub Anonymous: OVERLAPPED_0_0,
+ pub Pointer: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for OVERLAPPED_0 {}
+impl ::core::clone::Clone for OVERLAPPED_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct OVERLAPPED_0_0 {
+ pub Offset: u32,
+ pub OffsetHigh: u32,
+}
+impl ::core::marker::Copy for OVERLAPPED_0_0 {}
+impl ::core::clone::Clone for OVERLAPPED_0_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type PCSTR = *const u8;
+pub type PCWSTR = *const u16;
+pub type PIO_APC_ROUTINE = ::core::option::Option<
+ unsafe extern "system" fn(
+ apccontext: *const ::core::ffi::c_void,
+ iostatusblock: *const IO_STATUS_BLOCK,
+ reserved: u32,
+ ) -> (),
+>;
+pub const PIPE_ACCEPT_REMOTE_CLIENTS: NAMED_PIPE_MODE = 0u32;
+pub const PIPE_ACCESS_DUPLEX: FILE_FLAGS_AND_ATTRIBUTES = 3u32;
+pub const PIPE_ACCESS_INBOUND: FILE_FLAGS_AND_ATTRIBUTES = 1u32;
+pub const PIPE_ACCESS_OUTBOUND: FILE_FLAGS_AND_ATTRIBUTES = 2u32;
+pub const PIPE_CLIENT_END: NAMED_PIPE_MODE = 0u32;
+pub const PIPE_NOWAIT: NAMED_PIPE_MODE = 1u32;
+pub const PIPE_READMODE_BYTE: NAMED_PIPE_MODE = 0u32;
+pub const PIPE_READMODE_MESSAGE: NAMED_PIPE_MODE = 2u32;
+pub const PIPE_REJECT_REMOTE_CLIENTS: NAMED_PIPE_MODE = 8u32;
+pub const PIPE_SERVER_END: NAMED_PIPE_MODE = 1u32;
+pub const PIPE_TYPE_BYTE: NAMED_PIPE_MODE = 0u32;
+pub const PIPE_TYPE_MESSAGE: NAMED_PIPE_MODE = 4u32;
+pub const PIPE_WAIT: NAMED_PIPE_MODE = 0u32;
+pub type PROCESSOR_ARCHITECTURE = u16;
+pub type PROCESS_CREATION_FLAGS = u32;
+#[repr(C)]
+pub struct PROCESS_INFORMATION {
+ pub hProcess: HANDLE,
+ pub hThread: HANDLE,
+ pub dwProcessId: u32,
+ pub dwThreadId: u32,
+}
+impl ::core::marker::Copy for PROCESS_INFORMATION {}
+impl ::core::clone::Clone for PROCESS_INFORMATION {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const PROCESS_MODE_BACKGROUND_BEGIN: PROCESS_CREATION_FLAGS = 1048576u32;
+pub const PROCESS_MODE_BACKGROUND_END: PROCESS_CREATION_FLAGS = 2097152u32;
+pub const PROFILE_KERNEL: PROCESS_CREATION_FLAGS = 536870912u32;
+pub const PROFILE_SERVER: PROCESS_CREATION_FLAGS = 1073741824u32;
+pub const PROFILE_USER: PROCESS_CREATION_FLAGS = 268435456u32;
+pub const PROGRESS_CONTINUE: u32 = 0u32;
+pub type PSTR = *mut u8;
+pub type PVECTORED_EXCEPTION_HANDLER = ::core::option::Option<
+ unsafe extern "system" fn(exceptioninfo: *mut EXCEPTION_POINTERS) -> i32,
+>;
+pub type PWSTR = *mut u16;
+pub const READ_CONTROL: FILE_ACCESS_RIGHTS = 131072u32;
+pub const REALTIME_PRIORITY_CLASS: PROCESS_CREATION_FLAGS = 256u32;
+#[repr(C)]
+pub struct RTL_CONDITION_VARIABLE {
+ pub Ptr: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for RTL_CONDITION_VARIABLE {}
+impl ::core::clone::Clone for RTL_CONDITION_VARIABLE {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union RTL_RUN_ONCE {
+ pub Ptr: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for RTL_RUN_ONCE {}
+impl ::core::clone::Clone for RTL_RUN_ONCE {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct RTL_SRWLOCK {
+ pub Ptr: *mut ::core::ffi::c_void,
+}
+impl ::core::marker::Copy for RTL_SRWLOCK {}
+impl ::core::clone::Clone for RTL_SRWLOCK {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const SD_BOTH: WINSOCK_SHUTDOWN_HOW = 2i32;
+pub const SD_RECEIVE: WINSOCK_SHUTDOWN_HOW = 0i32;
+pub const SD_SEND: WINSOCK_SHUTDOWN_HOW = 1i32;
+pub const SECURITY_ANONYMOUS: FILE_FLAGS_AND_ATTRIBUTES = 0u32;
+#[repr(C)]
+pub struct SECURITY_ATTRIBUTES {
+ pub nLength: u32,
+ pub lpSecurityDescriptor: *mut ::core::ffi::c_void,
+ pub bInheritHandle: BOOL,
+}
+impl ::core::marker::Copy for SECURITY_ATTRIBUTES {}
+impl ::core::clone::Clone for SECURITY_ATTRIBUTES {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const SECURITY_CONTEXT_TRACKING: FILE_FLAGS_AND_ATTRIBUTES = 262144u32;
+pub const SECURITY_DELEGATION: FILE_FLAGS_AND_ATTRIBUTES = 196608u32;
+pub const SECURITY_EFFECTIVE_ONLY: FILE_FLAGS_AND_ATTRIBUTES = 524288u32;
+pub const SECURITY_IDENTIFICATION: FILE_FLAGS_AND_ATTRIBUTES = 65536u32;
+pub const SECURITY_IMPERSONATION: FILE_FLAGS_AND_ATTRIBUTES = 131072u32;
+pub const SECURITY_SQOS_PRESENT: FILE_FLAGS_AND_ATTRIBUTES = 1048576u32;
+pub const SECURITY_VALID_SQOS_FLAGS: FILE_FLAGS_AND_ATTRIBUTES = 2031616u32;
+pub type SEND_RECV_FLAGS = i32;
+pub type SET_FILE_POINTER_MOVE_METHOD = u32;
+#[repr(C)]
+pub struct SOCKADDR {
+ pub sa_family: ADDRESS_FAMILY,
+ pub sa_data: [u8; 14],
+}
+impl ::core::marker::Copy for SOCKADDR {}
+impl ::core::clone::Clone for SOCKADDR {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[cfg(target_pointer_width = "32")]
+pub type SOCKET = u32;
+#[cfg(target_pointer_width = "64")]
+pub type SOCKET = u64;
+pub const SOCKET_ERROR: i32 = -1i32;
+pub const SOCK_DGRAM: WINSOCK_SOCKET_TYPE = 2i32;
+pub const SOCK_RAW: WINSOCK_SOCKET_TYPE = 3i32;
+pub const SOCK_RDM: WINSOCK_SOCKET_TYPE = 4i32;
+pub const SOCK_SEQPACKET: WINSOCK_SOCKET_TYPE = 5i32;
+pub const SOCK_STREAM: WINSOCK_SOCKET_TYPE = 1i32;
+pub const SOL_SOCKET: i32 = 65535i32;
+pub const SO_BROADCAST: i32 = 32i32;
+pub const SO_ERROR: i32 = 4103i32;
+pub const SO_LINGER: i32 = 128i32;
+pub const SO_RCVTIMEO: i32 = 4102i32;
+pub const SO_SNDTIMEO: i32 = 4101i32;
+pub const SPECIFIC_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 65535u32;
+pub const STACK_SIZE_PARAM_IS_A_RESERVATION: THREAD_CREATION_FLAGS = 65536u32;
+pub const STANDARD_RIGHTS_ALL: FILE_ACCESS_RIGHTS = 2031616u32;
+pub const STANDARD_RIGHTS_EXECUTE: FILE_ACCESS_RIGHTS = 131072u32;
+pub const STANDARD_RIGHTS_READ: FILE_ACCESS_RIGHTS = 131072u32;
+pub const STANDARD_RIGHTS_REQUIRED: FILE_ACCESS_RIGHTS = 983040u32;
+pub const STANDARD_RIGHTS_WRITE: FILE_ACCESS_RIGHTS = 131072u32;
+pub const STARTF_FORCEOFFFEEDBACK: STARTUPINFOW_FLAGS = 128u32;
+pub const STARTF_FORCEONFEEDBACK: STARTUPINFOW_FLAGS = 64u32;
+pub const STARTF_PREVENTPINNING: STARTUPINFOW_FLAGS = 8192u32;
+pub const STARTF_RUNFULLSCREEN: STARTUPINFOW_FLAGS = 32u32;
+pub const STARTF_TITLEISAPPID: STARTUPINFOW_FLAGS = 4096u32;
+pub const STARTF_TITLEISLINKNAME: STARTUPINFOW_FLAGS = 2048u32;
+pub const STARTF_UNTRUSTEDSOURCE: STARTUPINFOW_FLAGS = 32768u32;
+pub const STARTF_USECOUNTCHARS: STARTUPINFOW_FLAGS = 8u32;
+pub const STARTF_USEFILLATTRIBUTE: STARTUPINFOW_FLAGS = 16u32;
+pub const STARTF_USEHOTKEY: STARTUPINFOW_FLAGS = 512u32;
+pub const STARTF_USEPOSITION: STARTUPINFOW_FLAGS = 4u32;
+pub const STARTF_USESHOWWINDOW: STARTUPINFOW_FLAGS = 1u32;
+pub const STARTF_USESIZE: STARTUPINFOW_FLAGS = 2u32;
+pub const STARTF_USESTDHANDLES: STARTUPINFOW_FLAGS = 256u32;
+#[repr(C)]
+pub struct STARTUPINFOW {
+ pub cb: u32,
+ pub lpReserved: PWSTR,
+ pub lpDesktop: PWSTR,
+ pub lpTitle: PWSTR,
+ pub dwX: u32,
+ pub dwY: u32,
+ pub dwXSize: u32,
+ pub dwYSize: u32,
+ pub dwXCountChars: u32,
+ pub dwYCountChars: u32,
+ pub dwFillAttribute: u32,
+ pub dwFlags: STARTUPINFOW_FLAGS,
+ pub wShowWindow: u16,
+ pub cbReserved2: u16,
+ pub lpReserved2: *mut u8,
+ pub hStdInput: HANDLE,
+ pub hStdOutput: HANDLE,
+ pub hStdError: HANDLE,
+}
+impl ::core::marker::Copy for STARTUPINFOW {}
+impl ::core::clone::Clone for STARTUPINFOW {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type STARTUPINFOW_FLAGS = u32;
+pub const STATUS_DELETE_PENDING: NTSTATUS = -1073741738i32;
+pub const STATUS_END_OF_FILE: NTSTATUS = -1073741807i32;
+pub const STATUS_INVALID_PARAMETER: NTSTATUS = -1073741811i32;
+pub const STATUS_PENDING: NTSTATUS = 259i32;
+pub const STATUS_SUCCESS: NTSTATUS = 0i32;
+pub const STD_ERROR_HANDLE: STD_HANDLE = 4294967284u32;
+pub type STD_HANDLE = u32;
+pub const STD_INPUT_HANDLE: STD_HANDLE = 4294967286u32;
+pub const STD_OUTPUT_HANDLE: STD_HANDLE = 4294967285u32;
+pub type SYMBOLIC_LINK_FLAGS = u32;
+pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: SYMBOLIC_LINK_FLAGS = 2u32;
+pub const SYMBOLIC_LINK_FLAG_DIRECTORY: SYMBOLIC_LINK_FLAGS = 1u32;
+pub const SYMLINK_FLAG_RELATIVE: u32 = 1u32;
+pub const SYNCHRONIZE: FILE_ACCESS_RIGHTS = 1048576u32;
+#[repr(C)]
+pub struct SYSTEM_INFO {
+ pub Anonymous: SYSTEM_INFO_0,
+ pub dwPageSize: u32,
+ pub lpMinimumApplicationAddress: *mut ::core::ffi::c_void,
+ pub lpMaximumApplicationAddress: *mut ::core::ffi::c_void,
+ pub dwActiveProcessorMask: usize,
+ pub dwNumberOfProcessors: u32,
+ pub dwProcessorType: u32,
+ pub dwAllocationGranularity: u32,
+ pub wProcessorLevel: u16,
+ pub wProcessorRevision: u16,
+}
+impl ::core::marker::Copy for SYSTEM_INFO {}
+impl ::core::clone::Clone for SYSTEM_INFO {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub union SYSTEM_INFO_0 {
+ pub dwOemId: u32,
+ pub Anonymous: SYSTEM_INFO_0_0,
+}
+impl ::core::marker::Copy for SYSTEM_INFO_0 {}
+impl ::core::clone::Clone for SYSTEM_INFO_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct SYSTEM_INFO_0_0 {
+ pub wProcessorArchitecture: PROCESSOR_ARCHITECTURE,
+ pub wReserved: u16,
+}
+impl ::core::marker::Copy for SYSTEM_INFO_0_0 {}
+impl ::core::clone::Clone for SYSTEM_INFO_0_0 {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const TCP_NODELAY: i32 = 1i32;
+pub const THREAD_CREATE_RUN_IMMEDIATELY: THREAD_CREATION_FLAGS = 0u32;
+pub const THREAD_CREATE_SUSPENDED: THREAD_CREATION_FLAGS = 4u32;
+pub type THREAD_CREATION_FLAGS = u32;
+#[repr(C)]
+pub struct TIMEVAL {
+ pub tv_sec: i32,
+ pub tv_usec: i32,
+}
+impl ::core::marker::Copy for TIMEVAL {}
+impl ::core::clone::Clone for TIMEVAL {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const TLS_OUT_OF_INDEXES: u32 = 4294967295u32;
+pub type TOKEN_ACCESS_MASK = u32;
+pub const TOKEN_ACCESS_PSEUDO_HANDLE: TOKEN_ACCESS_MASK = 24u32;
+pub const TOKEN_ACCESS_PSEUDO_HANDLE_WIN8: TOKEN_ACCESS_MASK = 24u32;
+pub const TOKEN_ACCESS_SYSTEM_SECURITY: TOKEN_ACCESS_MASK = 16777216u32;
+pub const TOKEN_ADJUST_DEFAULT: TOKEN_ACCESS_MASK = 128u32;
+pub const TOKEN_ADJUST_GROUPS: TOKEN_ACCESS_MASK = 64u32;
+pub const TOKEN_ADJUST_PRIVILEGES: TOKEN_ACCESS_MASK = 32u32;
+pub const TOKEN_ADJUST_SESSIONID: TOKEN_ACCESS_MASK = 256u32;
+pub const TOKEN_ALL_ACCESS: TOKEN_ACCESS_MASK = 983551u32;
+pub const TOKEN_ASSIGN_PRIMARY: TOKEN_ACCESS_MASK = 1u32;
+pub const TOKEN_DELETE: TOKEN_ACCESS_MASK = 65536u32;
+pub const TOKEN_DUPLICATE: TOKEN_ACCESS_MASK = 2u32;
+pub const TOKEN_EXECUTE: TOKEN_ACCESS_MASK = 131072u32;
+pub const TOKEN_IMPERSONATE: TOKEN_ACCESS_MASK = 4u32;
+pub const TOKEN_QUERY: TOKEN_ACCESS_MASK = 8u32;
+pub const TOKEN_QUERY_SOURCE: TOKEN_ACCESS_MASK = 16u32;
+pub const TOKEN_READ: TOKEN_ACCESS_MASK = 131080u32;
+pub const TOKEN_READ_CONTROL: TOKEN_ACCESS_MASK = 131072u32;
+pub const TOKEN_TRUST_CONSTRAINT_MASK: TOKEN_ACCESS_MASK = 131096u32;
+pub const TOKEN_WRITE: TOKEN_ACCESS_MASK = 131296u32;
+pub const TOKEN_WRITE_DAC: TOKEN_ACCESS_MASK = 262144u32;
+pub const TOKEN_WRITE_OWNER: TOKEN_ACCESS_MASK = 524288u32;
+pub const TRUE: BOOL = 1i32;
+pub const TRUNCATE_EXISTING: FILE_CREATION_DISPOSITION = 5u32;
+#[repr(C)]
+pub struct UNICODE_STRING {
+ pub Length: u16,
+ pub MaximumLength: u16,
+ pub Buffer: PWSTR,
+}
+impl ::core::marker::Copy for UNICODE_STRING {}
+impl ::core::clone::Clone for UNICODE_STRING {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const VOLUME_NAME_DOS: GETFINALPATHNAMEBYHANDLE_FLAGS = 0u32;
+pub const VOLUME_NAME_GUID: GETFINALPATHNAMEBYHANDLE_FLAGS = 1u32;
+pub const VOLUME_NAME_NONE: GETFINALPATHNAMEBYHANDLE_FLAGS = 4u32;
+pub const WAIT_ABANDONED: WIN32_ERROR = 128u32;
+pub const WAIT_ABANDONED_0: WIN32_ERROR = 128u32;
+pub const WAIT_FAILED: WIN32_ERROR = 4294967295u32;
+pub const WAIT_IO_COMPLETION: WIN32_ERROR = 192u32;
+pub const WAIT_OBJECT_0: WIN32_ERROR = 0u32;
+pub const WAIT_TIMEOUT: WIN32_ERROR = 258u32;
+pub const WC_ERR_INVALID_CHARS: u32 = 128u32;
+pub type WIN32_ERROR = u32;
+#[repr(C)]
+pub struct WIN32_FIND_DATAW {
+ pub dwFileAttributes: u32,
+ pub ftCreationTime: FILETIME,
+ pub ftLastAccessTime: FILETIME,
+ pub ftLastWriteTime: FILETIME,
+ pub nFileSizeHigh: u32,
+ pub nFileSizeLow: u32,
+ pub dwReserved0: u32,
+ pub dwReserved1: u32,
+ pub cFileName: [u16; 260],
+ pub cAlternateFileName: [u16; 14],
+}
+impl ::core::marker::Copy for WIN32_FIND_DATAW {}
+impl ::core::clone::Clone for WIN32_FIND_DATAW {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub type WINSOCK_SHUTDOWN_HOW = i32;
+pub type WINSOCK_SOCKET_TYPE = i32;
+pub const WRITE_DAC: FILE_ACCESS_RIGHTS = 262144u32;
+pub const WRITE_OWNER: FILE_ACCESS_RIGHTS = 524288u32;
+pub const WSABASEERR: WSA_ERROR = 10000i32;
+#[repr(C)]
+pub struct WSABUF {
+ pub len: u32,
+ pub buf: PSTR,
+}
+impl ::core::marker::Copy for WSABUF {}
+impl ::core::clone::Clone for WSABUF {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+pub struct WSADATA {
+ pub wVersion: u16,
+ pub wHighVersion: u16,
+ pub iMaxSockets: u16,
+ pub iMaxUdpDg: u16,
+ pub lpVendorInfo: PSTR,
+ pub szDescription: [u8; 257],
+ pub szSystemStatus: [u8; 129],
+}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::marker::Copy for WSADATA {}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::clone::Clone for WSADATA {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86")]
+pub struct WSADATA {
+ pub wVersion: u16,
+ pub wHighVersion: u16,
+ pub szDescription: [u8; 257],
+ pub szSystemStatus: [u8; 129],
+ pub iMaxSockets: u16,
+ pub iMaxUdpDg: u16,
+ pub lpVendorInfo: PSTR,
+}
+#[cfg(target_arch = "x86")]
+impl ::core::marker::Copy for WSADATA {}
+#[cfg(target_arch = "x86")]
+impl ::core::clone::Clone for WSADATA {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const WSAEACCES: WSA_ERROR = 10013i32;
+pub const WSAEADDRINUSE: WSA_ERROR = 10048i32;
+pub const WSAEADDRNOTAVAIL: WSA_ERROR = 10049i32;
+pub const WSAEAFNOSUPPORT: WSA_ERROR = 10047i32;
+pub const WSAEALREADY: WSA_ERROR = 10037i32;
+pub const WSAEBADF: WSA_ERROR = 10009i32;
+pub const WSAECANCELLED: WSA_ERROR = 10103i32;
+pub const WSAECONNABORTED: WSA_ERROR = 10053i32;
+pub const WSAECONNREFUSED: WSA_ERROR = 10061i32;
+pub const WSAECONNRESET: WSA_ERROR = 10054i32;
+pub const WSAEDESTADDRREQ: WSA_ERROR = 10039i32;
+pub const WSAEDISCON: WSA_ERROR = 10101i32;
+pub const WSAEDQUOT: WSA_ERROR = 10069i32;
+pub const WSAEFAULT: WSA_ERROR = 10014i32;
+pub const WSAEHOSTDOWN: WSA_ERROR = 10064i32;
+pub const WSAEHOSTUNREACH: WSA_ERROR = 10065i32;
+pub const WSAEINPROGRESS: WSA_ERROR = 10036i32;
+pub const WSAEINTR: WSA_ERROR = 10004i32;
+pub const WSAEINVAL: WSA_ERROR = 10022i32;
+pub const WSAEINVALIDPROCTABLE: WSA_ERROR = 10104i32;
+pub const WSAEINVALIDPROVIDER: WSA_ERROR = 10105i32;
+pub const WSAEISCONN: WSA_ERROR = 10056i32;
+pub const WSAELOOP: WSA_ERROR = 10062i32;
+pub const WSAEMFILE: WSA_ERROR = 10024i32;
+pub const WSAEMSGSIZE: WSA_ERROR = 10040i32;
+pub const WSAENAMETOOLONG: WSA_ERROR = 10063i32;
+pub const WSAENETDOWN: WSA_ERROR = 10050i32;
+pub const WSAENETRESET: WSA_ERROR = 10052i32;
+pub const WSAENETUNREACH: WSA_ERROR = 10051i32;
+pub const WSAENOBUFS: WSA_ERROR = 10055i32;
+pub const WSAENOMORE: WSA_ERROR = 10102i32;
+pub const WSAENOPROTOOPT: WSA_ERROR = 10042i32;
+pub const WSAENOTCONN: WSA_ERROR = 10057i32;
+pub const WSAENOTEMPTY: WSA_ERROR = 10066i32;
+pub const WSAENOTSOCK: WSA_ERROR = 10038i32;
+pub const WSAEOPNOTSUPP: WSA_ERROR = 10045i32;
+pub const WSAEPFNOSUPPORT: WSA_ERROR = 10046i32;
+pub const WSAEPROCLIM: WSA_ERROR = 10067i32;
+pub const WSAEPROTONOSUPPORT: WSA_ERROR = 10043i32;
+pub const WSAEPROTOTYPE: WSA_ERROR = 10041i32;
+pub const WSAEPROVIDERFAILEDINIT: WSA_ERROR = 10106i32;
+pub const WSAEREFUSED: WSA_ERROR = 10112i32;
+pub const WSAEREMOTE: WSA_ERROR = 10071i32;
+pub const WSAESHUTDOWN: WSA_ERROR = 10058i32;
+pub const WSAESOCKTNOSUPPORT: WSA_ERROR = 10044i32;
+pub const WSAESTALE: WSA_ERROR = 10070i32;
+pub const WSAETIMEDOUT: WSA_ERROR = 10060i32;
+pub const WSAETOOMANYREFS: WSA_ERROR = 10059i32;
+pub const WSAEUSERS: WSA_ERROR = 10068i32;
+pub const WSAEWOULDBLOCK: WSA_ERROR = 10035i32;
+pub const WSAHOST_NOT_FOUND: WSA_ERROR = 11001i32;
+pub const WSANOTINITIALISED: WSA_ERROR = 10093i32;
+pub const WSANO_DATA: WSA_ERROR = 11004i32;
+pub const WSANO_RECOVERY: WSA_ERROR = 11003i32;
+#[repr(C)]
+pub struct WSAPROTOCOLCHAIN {
+ pub ChainLen: i32,
+ pub ChainEntries: [u32; 7],
+}
+impl ::core::marker::Copy for WSAPROTOCOLCHAIN {}
+impl ::core::clone::Clone for WSAPROTOCOLCHAIN {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+pub struct WSAPROTOCOL_INFOW {
+ pub dwServiceFlags1: u32,
+ pub dwServiceFlags2: u32,
+ pub dwServiceFlags3: u32,
+ pub dwServiceFlags4: u32,
+ pub dwProviderFlags: u32,
+ pub ProviderId: GUID,
+ pub dwCatalogEntryId: u32,
+ pub ProtocolChain: WSAPROTOCOLCHAIN,
+ pub iVersion: i32,
+ pub iAddressFamily: i32,
+ pub iMaxSockAddr: i32,
+ pub iMinSockAddr: i32,
+ pub iSocketType: i32,
+ pub iProtocol: i32,
+ pub iProtocolMaxOffset: i32,
+ pub iNetworkByteOrder: i32,
+ pub iSecurityScheme: i32,
+ pub dwMessageSize: u32,
+ pub dwProviderReserved: u32,
+ pub szProtocol: [u16; 256],
+}
+impl ::core::marker::Copy for WSAPROTOCOL_INFOW {}
+impl ::core::clone::Clone for WSAPROTOCOL_INFOW {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+pub const WSASERVICE_NOT_FOUND: WSA_ERROR = 10108i32;
+pub const WSASYSCALLFAILURE: WSA_ERROR = 10107i32;
+pub const WSASYSNOTREADY: WSA_ERROR = 10091i32;
+pub const WSATRY_AGAIN: WSA_ERROR = 11002i32;
+pub const WSATYPE_NOT_FOUND: WSA_ERROR = 10109i32;
+pub const WSAVERNOTSUPPORTED: WSA_ERROR = 10092i32;
+pub type WSA_ERROR = i32;
+pub const WSA_E_CANCELLED: WSA_ERROR = 10111i32;
+pub const WSA_E_NO_MORE: WSA_ERROR = 10110i32;
+pub const WSA_FLAG_NO_HANDLE_INHERIT: u32 = 128u32;
+pub const WSA_FLAG_OVERLAPPED: u32 = 1u32;
+pub const WSA_INVALID_HANDLE: WSA_ERROR = 6i32;
+pub const WSA_INVALID_PARAMETER: WSA_ERROR = 87i32;
+pub const WSA_IO_INCOMPLETE: WSA_ERROR = 996i32;
+pub const WSA_IO_PENDING: WSA_ERROR = 997i32;
+pub const WSA_IPSEC_NAME_POLICY_ERROR: WSA_ERROR = 11033i32;
+pub const WSA_NOT_ENOUGH_MEMORY: WSA_ERROR = 8i32;
+pub const WSA_OPERATION_ABORTED: WSA_ERROR = 995i32;
+pub const WSA_QOS_ADMISSION_FAILURE: WSA_ERROR = 11010i32;
+pub const WSA_QOS_BAD_OBJECT: WSA_ERROR = 11013i32;
+pub const WSA_QOS_BAD_STYLE: WSA_ERROR = 11012i32;
+pub const WSA_QOS_EFILTERCOUNT: WSA_ERROR = 11021i32;
+pub const WSA_QOS_EFILTERSTYLE: WSA_ERROR = 11019i32;
+pub const WSA_QOS_EFILTERTYPE: WSA_ERROR = 11020i32;
+pub const WSA_QOS_EFLOWCOUNT: WSA_ERROR = 11023i32;
+pub const WSA_QOS_EFLOWDESC: WSA_ERROR = 11026i32;
+pub const WSA_QOS_EFLOWSPEC: WSA_ERROR = 11017i32;
+pub const WSA_QOS_EOBJLENGTH: WSA_ERROR = 11022i32;
+pub const WSA_QOS_EPOLICYOBJ: WSA_ERROR = 11025i32;
+pub const WSA_QOS_EPROVSPECBUF: WSA_ERROR = 11018i32;
+pub const WSA_QOS_EPSFILTERSPEC: WSA_ERROR = 11028i32;
+pub const WSA_QOS_EPSFLOWSPEC: WSA_ERROR = 11027i32;
+pub const WSA_QOS_ESDMODEOBJ: WSA_ERROR = 11029i32;
+pub const WSA_QOS_ESERVICETYPE: WSA_ERROR = 11016i32;
+pub const WSA_QOS_ESHAPERATEOBJ: WSA_ERROR = 11030i32;
+pub const WSA_QOS_EUNKOWNPSOBJ: WSA_ERROR = 11024i32;
+pub const WSA_QOS_GENERIC_ERROR: WSA_ERROR = 11015i32;
+pub const WSA_QOS_NO_RECEIVERS: WSA_ERROR = 11008i32;
+pub const WSA_QOS_NO_SENDERS: WSA_ERROR = 11007i32;
+pub const WSA_QOS_POLICY_FAILURE: WSA_ERROR = 11011i32;
+pub const WSA_QOS_RECEIVERS: WSA_ERROR = 11005i32;
+pub const WSA_QOS_REQUEST_CONFIRMED: WSA_ERROR = 11009i32;
+pub const WSA_QOS_RESERVED_PETYPE: WSA_ERROR = 11031i32;
+pub const WSA_QOS_SENDERS: WSA_ERROR = 11006i32;
+pub const WSA_QOS_TRAFFIC_CTRL_ERROR: WSA_ERROR = 11014i32;
+pub const WSA_SECURE_HOST_NOT_FOUND: WSA_ERROR = 11032i32;
+pub const WSA_WAIT_EVENT_0: WSA_ERROR = 0i32;
+pub const WSA_WAIT_IO_COMPLETION: WSA_ERROR = 192i32;
+#[repr(C)]
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+pub struct XSAVE_FORMAT {
+ pub ControlWord: u16,
+ pub StatusWord: u16,
+ pub TagWord: u8,
+ pub Reserved1: u8,
+ pub ErrorOpcode: u16,
+ pub ErrorOffset: u32,
+ pub ErrorSelector: u16,
+ pub Reserved2: u16,
+ pub DataOffset: u32,
+ pub DataSelector: u16,
+ pub Reserved3: u16,
+ pub MxCsr: u32,
+ pub MxCsr_Mask: u32,
+ pub FloatRegisters: [M128A; 8],
+ pub XmmRegisters: [M128A; 16],
+ pub Reserved4: [u8; 96],
+}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::marker::Copy for XSAVE_FORMAT {}
+#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
+impl ::core::clone::Clone for XSAVE_FORMAT {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
+#[repr(C)]
+#[cfg(target_arch = "x86")]
+pub struct XSAVE_FORMAT {
+ pub ControlWord: u16,
+ pub StatusWord: u16,
+ pub TagWord: u8,
+ pub Reserved1: u8,
+ pub ErrorOpcode: u16,
+ pub ErrorOffset: u32,
+ pub ErrorSelector: u16,
+ pub Reserved2: u16,
+ pub DataOffset: u32,
+ pub DataSelector: u16,
+ pub Reserved3: u16,
+ pub MxCsr: u32,
+ pub MxCsr_Mask: u32,
+ pub FloatRegisters: [M128A; 8],
+ pub XmmRegisters: [M128A; 8],
+ pub Reserved4: [u8; 224],
+}
+#[cfg(target_arch = "x86")]
+impl ::core::marker::Copy for XSAVE_FORMAT {}
+#[cfg(target_arch = "x86")]
+impl ::core::clone::Clone for XSAVE_FORMAT {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
diff --git a/library/std/src/sys/windows/compat.rs b/library/std/src/sys/windows/compat.rs
index 7dff81e..4fe95d4 100644
--- a/library/std/src/sys/windows/compat.rs
+++ b/library/std/src/sys/windows/compat.rs
@@ -114,17 +114,20 @@ impl Module {
/// (e.g. kernel32 and ntdll).
pub unsafe fn new(name: &CStr) -> Option<Self> {
// SAFETY: A CStr is always null terminated.
- let module = c::GetModuleHandleA(name.as_ptr());
+ let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
NonNull::new(module).map(Self)
}
// Try to get the address of a function.
pub fn proc_address(self, name: &CStr) -> Option<NonNull<c_void>> {
- // SAFETY:
- // `self.0` will always be a valid module.
- // A CStr is always null terminated.
- let proc = unsafe { c::GetProcAddress(self.0.as_ptr(), name.as_ptr()) };
- NonNull::new(proc)
+ unsafe {
+ // SAFETY:
+ // `self.0` will always be a valid module.
+ // A CStr is always null terminated.
+ let proc = c::GetProcAddress(self.0.as_ptr(), name.as_ptr().cast::<u8>());
+ // SAFETY: `GetProcAddress` returns None on null.
+ proc.map(|p| NonNull::new_unchecked(p as *mut c_void))
+ }
}
}
@@ -199,6 +202,7 @@ macro_rules! compat_fn_optional {
)+) => (
$(
pub mod $symbol {
+ #[allow(unused_imports)]
use super::*;
use crate::ffi::c_void;
use crate::mem;
diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/windows/fs.rs
index fe052c8..ce42776 100644
--- a/library/std/src/sys/windows/fs.rs
+++ b/library/std/src/sys/windows/fs.rs
@@ -89,6 +89,12 @@ pub struct FileTimes {
accessed: Option<c::FILETIME>,
modified: Option<c::FILETIME>,
}
+impl core::fmt::Debug for c::FILETIME {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ let time = ((self.dwHighDateTime as u64) << 32) | self.dwLowDateTime as u64;
+ f.debug_tuple("FILETIME").field(&time).finish()
+ }
+}
#[derive(Debug)]
pub struct DirBuilder;
@@ -290,6 +296,7 @@ pub fn open(path: &Path, opts: &OpenOptions) -> io::Result<File> {
ptr::null_mut(),
)
};
+ let handle = unsafe { HandleOrInvalid::from_raw_handle(handle) };
if let Ok(handle) = handle.try_into() {
Ok(File { handle: Handle::from_inner(handle) })
} else {
@@ -501,7 +508,8 @@ fn reparse_point(
}
fn readlink(&self) -> io::Result<PathBuf> {
- let mut space = Align8([MaybeUninit::<u8>::uninit(); c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE]);
+ let mut space =
+ Align8([MaybeUninit::<u8>::uninit(); c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]);
let (_bytes, buf) = self.reparse_point(&mut space)?;
unsafe {
let (path_buffer, subst_off, subst_len, relative) = match (*buf).ReparseTag {
@@ -589,7 +597,11 @@ pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
));
}
cvt(unsafe {
- c::SetFileTime(self.as_handle(), None, times.accessed.as_ref(), times.modified.as_ref())
+ let accessed =
+ times.accessed.as_ref().map(|a| a as *const c::FILETIME).unwrap_or(ptr::null());
+ let modified =
+ times.modified.as_ref().map(|a| a as *const c::FILETIME).unwrap_or(ptr::null());
+ c::SetFileTime(self.as_raw_handle(), ptr::null_mut(), accessed, modified)
})?;
Ok(())
}
@@ -618,9 +630,9 @@ fn basic_info(&self) -> io::Result<c::FILE_BASIC_INFO> {
/// then errors will be `ERROR_NOT_SUPPORTED` or `ERROR_INVALID_PARAMETER`.
fn posix_delete(&self) -> io::Result<()> {
let mut info = c::FILE_DISPOSITION_INFO_EX {
- Flags: c::FILE_DISPOSITION_DELETE
- | c::FILE_DISPOSITION_POSIX_SEMANTICS
- | c::FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE,
+ Flags: c::FILE_DISPOSITION_FLAG_DELETE
+ | c::FILE_DISPOSITION_FLAG_POSIX_SEMANTICS
+ | c::FILE_DISPOSITION_FLAG_IGNORE_READONLY_ATTRIBUTE,
};
let size = mem::size_of_val(&info);
cvt(unsafe {
@@ -791,15 +803,15 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
// See https://docs.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile
unsafe {
let mut handle = ptr::null_mut();
- let mut io_status = c::IO_STATUS_BLOCK::default();
- let name_str = c::UNICODE_STRING::from_ref(name);
+ let mut io_status = c::IO_STATUS_BLOCK::PENDING;
+ let mut name_str = c::UNICODE_STRING::from_ref(name);
use crate::sync::atomic::{AtomicU32, Ordering};
// The `OBJ_DONT_REPARSE` attribute ensures that we haven't been
// tricked into following a symlink. However, it may not be available in
// earlier versions of Windows.
static ATTRIBUTES: AtomicU32 = AtomicU32::new(c::OBJ_DONT_REPARSE);
- let object = c::OBJECT_ATTRIBUTES {
- ObjectName: &name_str,
+ let mut object = c::OBJECT_ATTRIBUTES {
+ ObjectName: &mut name_str,
RootDirectory: parent.as_raw_handle(),
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
..c::OBJECT_ATTRIBUTES::default()
@@ -807,7 +819,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result<
let status = c::NtCreateFile(
&mut handle,
access,
- &object,
+ &mut object,
&mut io_status,
crate::ptr::null_mut(),
0,
@@ -1368,7 +1380,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
_dwCallbackReason: c::DWORD,
_hSourceFile: c::HANDLE,
_hDestinationFile: c::HANDLE,
- lpData: c::LPVOID,
+ lpData: c::LPCVOID,
) -> c::DWORD {
if dwStreamNumber == 1 {
*(lpData as *mut i64) = StreamBytesTransferred;
@@ -1415,9 +1427,10 @@ fn symlink_junction_inner(original: &Path, junction: &Path) -> io::Result<()> {
let f = File::open(junction, &opts)?;
let h = f.as_inner().as_raw_handle();
unsafe {
- let mut data = Align8([MaybeUninit::<u8>::uninit(); c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE]);
+ let mut data =
+ Align8([MaybeUninit::<u8>::uninit(); c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]);
let data_ptr = data.0.as_mut_ptr();
- let data_end = data_ptr.add(c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
+ let data_end = data_ptr.add(c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize);
let db = data_ptr.cast::<c::REPARSE_MOUNTPOINT_DATA_BUFFER>();
// Zero the header to ensure it's fully initialized, including reserved parameters.
*db = mem::zeroed();
diff --git a/library/std/src/sys/windows/handle.rs b/library/std/src/sys/windows/handle.rs
index c7677d1..84c1fbd 100644
--- a/library/std/src/sys/windows/handle.rs
+++ b/library/std/src/sys/windows/handle.rs
@@ -144,7 +144,7 @@ pub unsafe fn read_overlapped(
let len = cmp::min(buf.len(), <c::DWORD>::MAX as usize) as c::DWORD;
let mut amt = 0;
let res = cvt(c::ReadFile(
- self.as_handle(),
+ self.as_raw_handle(),
buf.as_ptr() as c::LPVOID,
len,
&mut amt,
@@ -235,7 +235,7 @@ unsafe fn synchronous_read(
len: usize,
offset: Option<u64>,
) -> io::Result<usize> {
- let mut io_status = c::IO_STATUS_BLOCK::default();
+ let mut io_status = c::IO_STATUS_BLOCK::PENDING;
// The length is clamped at u32::MAX.
let len = cmp::min(len, c::DWORD::MAX as usize) as c::DWORD;
@@ -283,7 +283,7 @@ unsafe fn synchronous_read(
///
/// If `offset` is `None` then the current file position is used.
fn synchronous_write(&self, buf: &[u8], offset: Option<u64>) -> io::Result<usize> {
- let mut io_status = c::IO_STATUS_BLOCK::default();
+ let mut io_status = c::IO_STATUS_BLOCK::PENDING;
// The length is clamped at u32::MAX.
let len = cmp::min(buf.len(), c::DWORD::MAX as usize) as c::DWORD;
diff --git a/library/std/src/sys/windows/io.rs b/library/std/src/sys/windows/io.rs
index 7fdd1f7..fc9856c 100644
--- a/library/std/src/sys/windows/io.rs
+++ b/library/std/src/sys/windows/io.rs
@@ -17,10 +17,7 @@ impl<'a> IoSlice<'a> {
pub fn new(buf: &'a [u8]) -> IoSlice<'a> {
assert!(buf.len() <= c::ULONG::MAX as usize);
IoSlice {
- vec: c::WSABUF {
- len: buf.len() as c::ULONG,
- buf: buf.as_ptr() as *mut u8 as *mut c::CHAR,
- },
+ vec: c::WSABUF { len: buf.len() as c::ULONG, buf: buf.as_ptr() as *mut u8 },
_p: PhantomData,
}
}
@@ -54,7 +51,7 @@ impl<'a> IoSliceMut<'a> {
pub fn new(buf: &'a mut [u8]) -> IoSliceMut<'a> {
assert!(buf.len() <= c::ULONG::MAX as usize);
IoSliceMut {
- vec: c::WSABUF { len: buf.len() as c::ULONG, buf: buf.as_mut_ptr() as *mut c::CHAR },
+ vec: c::WSABUF { len: buf.len() as c::ULONG, buf: buf.as_mut_ptr() },
_p: PhantomData,
}
}
diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs
index 8158713..2404bbe 100644
--- a/library/std/src/sys/windows/net.rs
+++ b/library/std/src/sys/windows/net.rs
@@ -263,7 +263,7 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
&mut nread,
&mut flags,
ptr::null_mut(),
- ptr::null_mut(),
+ None,
)
};
@@ -347,7 +347,7 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
&mut nwritten,
0,
ptr::null_mut(),
- ptr::null_mut(),
+ None,
)
};
cvt(result).map(|_| nwritten as usize)
diff --git a/library/std/src/sys/windows/pipe.rs b/library/std/src/sys/windows/pipe.rs
index 0780b29..d07147e 100644
--- a/library/std/src/sys/windows/pipe.rs
+++ b/library/std/src/sys/windows/pipe.rs
@@ -373,7 +373,7 @@ struct AsyncResult {
// Asynchronous read of the pipe.
// If successful, `callback` will be called once it completes.
- let result = io(self.inner.as_handle(), buf, len, &mut overlapped, callback);
+ let result = io(self.inner.as_handle(), buf, len, &mut overlapped, Some(callback));
if result == c::FALSE {
// We can return here because the call failed.
// After this we must not return until the I/O completes.
diff --git a/library/std/src/sys/windows/process.rs b/library/std/src/sys/windows/process.rs
index 1c73b64..df3667c 100644
--- a/library/std/src/sys/windows/process.rs
+++ b/library/std/src/sys/windows/process.rs
@@ -308,7 +308,7 @@ pub fn spawn(
let stderr = stderr.to_handle(c::STD_ERROR_HANDLE, &mut pipes.stderr)?;
let mut si = zeroed_startupinfo();
- si.cb = mem::size_of::<c::STARTUPINFO>() as c::DWORD;
+ si.cb = mem::size_of::<c::STARTUPINFOW>() as c::DWORD;
// If at least one of stdin, stdout or stderr are set (i.e. are non null)
// then set the `hStd` fields in `STARTUPINFO`.
@@ -332,7 +332,7 @@ pub fn spawn(
flags,
envp,
dirp,
- &mut si,
+ &si,
&mut pi,
))
}?;
@@ -720,8 +720,8 @@ fn from(code: u32) -> Self {
}
}
-fn zeroed_startupinfo() -> c::STARTUPINFO {
- c::STARTUPINFO {
+fn zeroed_startupinfo() -> c::STARTUPINFOW {
+ c::STARTUPINFOW {
cb: 0,
lpReserved: ptr::null_mut(),
lpDesktop: ptr::null_mut(),
@@ -731,7 +731,7 @@ fn zeroed_startupinfo() -> c::STARTUPINFO {
dwXSize: 0,
dwYSize: 0,
dwXCountChars: 0,
- dwYCountCharts: 0,
+ dwYCountChars: 0,
dwFillAttribute: 0,
dwFlags: 0,
wShowWindow: 0,
diff --git a/library/std/src/sys/windows/rand.rs b/library/std/src/sys/windows/rand.rs
index cdf37cf..bca4e38 100644
--- a/library/std/src/sys/windows/rand.rs
+++ b/library/std/src/sys/windows/rand.rs
@@ -1,3 +1,4 @@
+use crate::ffi::c_void;
use crate::io;
use crate::mem;
use crate::ptr;
@@ -25,8 +26,9 @@ pub fn hashmap_random_keys() -> (u64, u64) {
#[inline(never)]
fn fallback_rng() -> (u64, u64) {
let mut v = (0, 0);
- let ret =
- unsafe { c::RtlGenRandom(&mut v as *mut _ as *mut u8, mem::size_of_val(&v) as c::ULONG) };
+ let ret = unsafe {
+ c::RtlGenRandom(&mut v as *mut _ as *mut c_void, mem::size_of_val(&v) as c::ULONG)
+ };
if ret != 0 { v } else { panic!("fallback RNG broken: {}", io::Error::last_os_error()) }
}
diff --git a/library/std/src/sys/windows/stack_overflow.rs b/library/std/src/sys/windows/stack_overflow.rs
index 18a2a36..0caf0a3 100644
--- a/library/std/src/sys/windows/stack_overflow.rs
+++ b/library/std/src/sys/windows/stack_overflow.rs
@@ -18,7 +18,7 @@ pub unsafe fn new() -> Handler {
}
}
-extern "system" fn vectored_handler(ExceptionInfo: *mut c::EXCEPTION_POINTERS) -> c::LONG {
+unsafe extern "system" fn vectored_handler(ExceptionInfo: *mut c::EXCEPTION_POINTERS) -> c::LONG {
unsafe {
let rec = &(*(*ExceptionInfo).ExceptionRecord);
let code = rec.ExceptionCode;
@@ -34,7 +34,7 @@ extern "system" fn vectored_handler(ExceptionInfo: *mut c::EXCEPTION_POINTERS) -
}
pub unsafe fn init() {
- if c::AddVectoredExceptionHandler(0, vectored_handler).is_null() {
+ if c::AddVectoredExceptionHandler(0, Some(vectored_handler)).is_null() {
panic!("failed to install exception handler");
}
// Set the thread stack guarantee for the main thread.
diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs
index 32c6ccf..2e3e085 100644
--- a/library/std/src/sys/windows/stdio.rs
+++ b/library/std/src/sys/windows/stdio.rs
@@ -180,7 +180,7 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz
let result = c::MultiByteToWideChar(
c::CP_UTF8, // CodePage
c::MB_ERR_INVALID_CHARS, // dwFlags
- utf8.as_ptr() as c::LPCCH, // lpMultiByteStr
+ utf8.as_ptr(), // lpMultiByteStr
utf8.len() as c::c_int, // cbMultiByte
utf16.as_mut_ptr() as c::LPWSTR, // lpWideCharStr
utf16.len() as c::c_int, // cchWideChar
@@ -344,7 +344,7 @@ fn read_u16s(handle: c::HANDLE, buf: &mut [MaybeUninit<u16>]) -> io::Result<usiz
// See #38274 and https://stackoverflow.com/questions/43836040/win-api-readconsole.
const CTRL_Z: u16 = 0x1A;
const CTRL_Z_MASK: c::ULONG = 1 << CTRL_Z;
- let mut input_control = c::CONSOLE_READCONSOLE_CONTROL {
+ let input_control = c::CONSOLE_READCONSOLE_CONTROL {
nLength: crate::mem::size_of::<c::CONSOLE_READCONSOLE_CONTROL>() as c::ULONG,
nInitialChars: 0,
dwCtrlWakeupMask: CTRL_Z_MASK,
@@ -360,7 +360,7 @@ fn read_u16s(handle: c::HANDLE, buf: &mut [MaybeUninit<u16>]) -> io::Result<usiz
buf.as_mut_ptr() as c::LPVOID,
buf.len() as u32,
&mut amount,
- &mut input_control as c::PCONSOLE_READCONSOLE_CONTROL,
+ &input_control,
)
})?;
@@ -385,14 +385,14 @@ fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> {
let result = unsafe {
c::WideCharToMultiByte(
- c::CP_UTF8, // CodePage
- c::WC_ERR_INVALID_CHARS, // dwFlags
- utf16.as_ptr(), // lpWideCharStr
- utf16.len() as c::c_int, // cchWideChar
- utf8.as_mut_ptr() as c::LPSTR, // lpMultiByteStr
- utf8.len() as c::c_int, // cbMultiByte
- ptr::null(), // lpDefaultChar
- ptr::null_mut(), // lpUsedDefaultChar
+ c::CP_UTF8, // CodePage
+ c::WC_ERR_INVALID_CHARS, // dwFlags
+ utf16.as_ptr(), // lpWideCharStr
+ utf16.len() as c::c_int, // cchWideChar
+ utf8.as_mut_ptr(), // lpMultiByteStr
+ utf8.len() as c::c_int, // cbMultiByte
+ ptr::null(), // lpDefaultChar
+ ptr::null_mut(), // lpUsedDefaultChar
)
};
if result == 0 {
diff --git a/library/std/src/sys/windows/thread.rs b/library/std/src/sys/windows/thread.rs
index ed58c47..18cecb6 100644
--- a/library/std/src/sys/windows/thread.rs
+++ b/library/std/src/sys/windows/thread.rs
@@ -2,6 +2,7 @@
use crate::io;
use crate::num::NonZeroUsize;
use crate::os::windows::io::AsRawHandle;
+use crate::os::windows::io::HandleOrNull;
use crate::ptr;
use crate::sys::c;
use crate::sys::handle::Handle;
@@ -32,12 +33,12 @@ pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
let ret = c::CreateThread(
ptr::null_mut(),
stack,
- thread_start,
+ Some(thread_start),
p as *mut _,
c::STACK_SIZE_PARAM_IS_A_RESERVATION,
ptr::null_mut(),
);
-
+ let ret = HandleOrNull::from_raw_handle(ret);
return if let Ok(handle) = ret.try_into() {
Ok(Thread { handle: Handle::from_inner(handle) })
} else {
diff --git a/library/std/tests/run-time-detect.rs b/library/std/tests/run-time-detect.rs
index bf3c81f..9ce29a3 100644
--- a/library/std/tests/run-time-detect.rs
+++ b/library/std/tests/run-time-detect.rs
@@ -16,7 +16,6 @@ fn arm_linux() {
// tidy-alphabetical-start
println!("aes: {}", is_arm_feature_detected!("aes"));
println!("crc: {}", is_arm_feature_detected!("crc"));
- println!("crypto: {}", is_arm_feature_detected!("crypto"));
println!("neon: {}", is_arm_feature_detected!("neon"));
println!("pmull: {}", is_arm_feature_detected!("pmull"));
println!("sha2: {}", is_arm_feature_detected!("sha2"));
diff --git a/library/stdarch b/library/stdarch
index b655243..7e2cdc6 160000
--- a/library/stdarch
+++ b/library/stdarch
@@ -1 +1 @@
-Subproject commit b655243782c18d3419439daa523782e0818ecf26
+Subproject commit 7e2cdc675b92165c5f8c4c794620252be4605e74
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 45f2975..b7c5499 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -838,6 +838,7 @@ macro_rules! describe {
run::Miri,
run::CollectLicenseMetadata,
run::GenerateCopyright,
+ run::GenerateWindowsSys,
),
Kind::Setup => describe!(setup::Profile, setup::Hook, setup::Link, setup::Vscode),
Kind::Clean => describe!(clean::CleanAll, clean::Rustc, clean::Std),
diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs
index cb15d9a..57f3119 100644
--- a/src/bootstrap/run.rs
+++ b/src/bootstrap/run.rs
@@ -253,3 +253,25 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
dest
}
}
+
+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct GenerateWindowsSys;
+
+impl Step for GenerateWindowsSys {
+ type Output = ();
+ const ONLY_HOSTS: bool = true;
+
+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+ run.path("src/tools/generate-windows-sys")
+ }
+
+ fn make_run(run: RunConfig<'_>) {
+ run.builder.ensure(GenerateWindowsSys);
+ }
+
+ fn run(self, builder: &Builder<'_>) {
+ let mut cmd = builder.tool_cmd(Tool::GenerateWindowsSys);
+ cmd.arg(&builder.src);
+ builder.run(&mut cmd);
+ }
+}
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 39f6369..f13d365 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -301,6 +301,7 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
CollectLicenseMetadata, "src/tools/collect-license-metadata", "collect-license-metadata";
GenerateCopyright, "src/tools/generate-copyright", "generate-copyright";
SuggestTests, "src/tools/suggest-tests", "suggest-tests";
+ GenerateWindowsSys, "src/tools/generate-windows-sys", "generate-windows-sys";
);
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
diff --git a/src/doc/edition-guide b/src/doc/edition-guide
index 6038be9..f63e578 160000
--- a/src/doc/edition-guide
+++ b/src/doc/edition-guide
@@ -1 +1 @@
-Subproject commit 6038be9d37d7251c966b486154af621d1794d7af
+Subproject commit f63e578b92ff43e8cc38fcaa257b660f45c8a8c2
diff --git a/src/doc/embedded-book b/src/doc/embedded-book
index 897fcf5..d9eb4c3 160000
--- a/src/doc/embedded-book
+++ b/src/doc/embedded-book
@@ -1 +1 @@
-Subproject commit 897fcf566f16bf87bf37199bdddec1801fd00532
+Subproject commit d9eb4c3f75435b008881062ffa77bf0d1527b37d
diff --git a/src/doc/reference b/src/doc/reference
index 1f8dc72..28dc0f3 160000
--- a/src/doc/reference
+++ b/src/doc/reference
@@ -1 +1 @@
-Subproject commit 1f8dc727e94ae4ef92adf70df979521a1ea1143e
+Subproject commit 28dc0f3576b55f5e57c5d6e65cd68ba3161e9fd5
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
index 31961fe..8ee9528 160000
--- a/src/doc/rust-by-example
+++ b/src/doc/rust-by-example
@@ -1 +1 @@
-Subproject commit 31961fe22521a779070a44a8f30a2b00a20b6212
+Subproject commit 8ee9528b72b927cff8fd32346db8bbd1198816f0
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
index 2a5eb92..28dbeaf 160000
--- a/src/doc/rustc-dev-guide
+++ b/src/doc/rustc-dev-guide
@@ -1 +1 @@
-Subproject commit 2a5eb92197e9cf8fe91164dcbf4f9b88c0d7e73d
+Subproject commit 28dbeaf5c44bc7f5111ad412e99f2d7c5cec6c90
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs
index fb32b6e..baf2b0a 100644
--- a/src/librustdoc/clean/auto_trait.rs
+++ b/src/librustdoc/clean/auto_trait.rs
@@ -556,7 +556,10 @@ fn param_env_to_generics(
WherePredicate::EqPredicate { lhs, rhs, bound_params } => {
match *lhs {
Type::QPath(box QPathData {
- ref assoc, ref self_type, ref trait_, ..
+ ref assoc,
+ ref self_type,
+ trait_: Some(ref trait_),
+ ..
}) => {
let ty = &*self_type;
let mut new_trait = trait_.clone();
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 951f54e..c852f9c 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -706,7 +706,12 @@ fn filter_non_trait_generics(trait_did: DefId, mut g: clean::Generics) -> clean:
g.where_predicates.retain(|pred| match pred {
clean::WherePredicate::BoundPredicate {
- ty: clean::QPath(box clean::QPathData { self_type: clean::Generic(ref s), trait_, .. }),
+ ty:
+ clean::QPath(box clean::QPathData {
+ self_type: clean::Generic(ref s),
+ trait_: Some(trait_),
+ ..
+ }),
bounds,
..
} => !(bounds.is_empty() || *s == kw::SelfUpper && trait_.def_id() == trait_did),
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 23449a2..657f3c9 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -441,7 +441,7 @@ fn clean_projection<'tcx>(
assoc: projection_to_path_segment(ty, cx),
should_show_cast,
self_type,
- trait_,
+ trait_: Some(trait_),
}))
}
@@ -1330,7 +1330,13 @@ fn param_eq_arg(param: &GenericParamDef, arg: &GenericArg) -> bool {
let mut bounds: Vec<GenericBound> = Vec::new();
generics.where_predicates.retain_mut(|pred| match *pred {
WherePredicate::BoundPredicate {
- ty: QPath(box QPathData { ref assoc, ref self_type, ref trait_, .. }),
+ ty:
+ QPath(box QPathData {
+ ref assoc,
+ ref self_type,
+ trait_: Some(ref trait_),
+ ..
+ }),
bounds: ref mut pred_bounds,
..
} => {
@@ -1492,25 +1498,30 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
assoc: clean_path_segment(p.segments.last().expect("segments were empty"), cx),
should_show_cast,
self_type,
- trait_,
+ trait_: Some(trait_),
}))
}
hir::QPath::TypeRelative(qself, segment) => {
let ty = hir_ty_to_ty(cx.tcx, hir_ty);
- let res = match ty.kind() {
+ let self_type = clean_ty(qself, cx);
+
+ let (trait_, should_show_cast) = match ty.kind() {
ty::Alias(ty::Projection, proj) => {
- Res::Def(DefKind::Trait, proj.trait_ref(cx.tcx).def_id)
+ let res = Res::Def(DefKind::Trait, proj.trait_ref(cx.tcx).def_id);
+ let trait_ = clean_path(&hir::Path { span, res, segments: &[] }, cx);
+ register_res(cx, trait_.res);
+ let self_def_id = res.opt_def_id();
+ let should_show_cast =
+ compute_should_show_cast(self_def_id, &trait_, &self_type);
+
+ (Some(trait_), should_show_cast)
}
+ ty::Alias(ty::Inherent, _) => (None, false),
// Rustdoc handles `ty::Error`s by turning them into `Type::Infer`s.
ty::Error(_) => return Type::Infer,
- // Otherwise, this is an inherent associated type.
- _ => return clean_middle_ty(ty::Binder::dummy(ty), cx, None),
+ _ => bug!("clean: expected associated type, found `{ty:?}`"),
};
- let trait_ = clean_path(&hir::Path { span, res, segments: &[] }, cx);
- register_res(cx, trait_.res);
- let self_def_id = res.opt_def_id();
- let self_type = clean_ty(qself, cx);
- let should_show_cast = compute_should_show_cast(self_def_id, &trait_, &self_type);
+
Type::QPath(Box::new(QPathData {
assoc: clean_path_segment(segment, cx),
should_show_cast,
@@ -1836,6 +1847,29 @@ pub(crate) fn clean_middle_ty<'tcx>(
clean_projection(bound_ty.rebind(*data), cx, parent_def_id)
}
+ ty::Alias(ty::Inherent, alias_ty) => {
+ let alias_ty = bound_ty.rebind(alias_ty);
+ let self_type = clean_middle_ty(alias_ty.map_bound(|ty| ty.self_ty()), cx, None);
+
+ Type::QPath(Box::new(QPathData {
+ assoc: PathSegment {
+ name: cx.tcx.associated_item(alias_ty.skip_binder().def_id).name,
+ args: GenericArgs::AngleBracketed {
+ args: substs_to_args(
+ cx,
+ alias_ty.map_bound(|ty| ty.substs.as_slice()),
+ true,
+ )
+ .into(),
+ bindings: Default::default(),
+ },
+ },
+ should_show_cast: false,
+ self_type,
+ trait_: None,
+ }))
+ }
+
ty::Param(ref p) => {
if let Some(bounds) = cx.impl_trait_bounds.remove(&p.index.into()) {
ImplTrait(bounds)
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 7371b44..38664c3 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -1660,7 +1660,7 @@ pub(crate) fn is_impl_trait(&self) -> bool {
pub(crate) fn projection(&self) -> Option<(&Type, DefId, PathSegment)> {
if let QPath(box QPathData { self_type, trait_, assoc, .. }) = self {
- Some((self_type, trait_.def_id(), assoc.clone()))
+ Some((self_type, trait_.as_ref()?.def_id(), assoc.clone()))
} else {
None
}
@@ -1704,7 +1704,7 @@ pub(crate) struct QPathData {
pub self_type: Type,
/// FIXME: compute this field on demand.
pub should_show_cast: bool,
- pub trait_: Path,
+ pub trait_: Option<Path>,
}
/// A primitive (aka, builtin) type.
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 1c6810b..d963d60 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1116,14 +1116,17 @@ fn fmt_type<'cx>(
ref trait_,
should_show_cast,
}) => {
+ // FIXME(inherent_associated_types): Once we support non-ADT self-types (#106719),
+ // we need to surround them with angle brackets in some cases (e.g. `<dyn …>::P`).
+
if f.alternate() {
- if should_show_cast {
+ if let Some(trait_) = trait_ && should_show_cast {
write!(f, "<{:#} as {:#}>::", self_type.print(cx), trait_.print(cx))?
} else {
write!(f, "{:#}::", self_type.print(cx))?
}
} else {
- if should_show_cast {
+ if let Some(trait_) = trait_ && should_show_cast {
write!(f, "<{} as {}>::", self_type.print(cx), trait_.print(cx))?
} else {
write!(f, "{}::", self_type.print(cx))?
@@ -1139,15 +1142,36 @@ fn fmt_type<'cx>(
// the ugliness comes from inlining across crates where
// everything comes in as a fully resolved QPath (hard to
// look at).
- if !f.alternate() && let Ok((url, _, path)) = href(trait_.def_id(), cx) {
- write!(
- f,
- "<a class=\"associatedtype\" href=\"{url}#{shortty}.{name}\" \
- title=\"type {path}::{name}\">{name}</a>",
- shortty = ItemType::AssocType,
- name = assoc.name,
- path = join_with_double_colon(&path),
- )
+ if !f.alternate() {
+ // FIXME(inherent_associated_types): We always link to the very first associated
+ // type (in respect to source order) that bears the given name (`assoc.name`) and that is
+ // affiliated with the computed `DefId`. This is obviously incorrect when we have
+ // multiple impl blocks. Ideally, we would thread the `DefId` of the assoc ty itself
+ // through here and map it to the corresponding HTML ID that was generated by
+ // `render::Context::derive_id` when the impl blocks were rendered.
+ // There is no such mapping unfortunately.
+ // As a hack, we could badly imitate `derive_id` here by keeping *count* when looking
+ // for the assoc ty `DefId` in `tcx.associated_items(self_ty_did).in_definition_order()`
+ // considering privacy, `doc(hidden)`, etc.
+ // I don't feel like that right now :cold_sweat:.
+
+ let parent_href = match trait_ {
+ Some(trait_) => href(trait_.def_id(), cx).ok(),
+ None => self_type.def_id(cx.cache()).and_then(|did| href(did, cx).ok()),
+ };
+
+ if let Some((url, _, path)) = parent_href {
+ write!(
+ f,
+ "<a class=\"associatedtype\" href=\"{url}#{shortty}.{name}\" \
+ title=\"type {path}::{name}\">{name}</a>",
+ shortty = ItemType::AssocType,
+ name = assoc.name,
+ path = join_with_double_colon(&path),
+ )
+ } else {
+ write!(f, "{}", assoc.name)
+ }
} else {
write!(f, "{}", assoc.name)
}?;
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index e09c648..d677316 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -2202,7 +2202,9 @@ fn collect_paths_for_type(first_ty: clean::Type, cache: &Cache) -> Vec<String> {
}
clean::Type::QPath(box clean::QPathData { self_type, trait_, .. }) => {
work.push_back(self_type);
- process_path(trait_.def_id());
+ if let Some(trait_) = trait_ {
+ process_path(trait_.def_id());
+ }
}
_ => {}
}
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index b5bebb7..b1cef20 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -574,7 +574,7 @@ fn from_tcx(ty: clean::Type, tcx: TyCtxt<'_>) -> Self {
name: assoc.name.to_string(),
args: Box::new(assoc.args.into_tcx(tcx)),
self_type: Box::new(self_type.into_tcx(tcx)),
- trait_: trait_.into_tcx(tcx),
+ trait_: trait_.map(|trait_| trait_.into_tcx(tcx)),
},
}
}
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs
index 3cf8cee..3556834 100644
--- a/src/rustdoc-json-types/lib.rs
+++ b/src/rustdoc-json-types/lib.rs
@@ -8,7 +8,7 @@
use std::path::PathBuf;
/// rustdoc format-version.
-pub const FORMAT_VERSION: u32 = 24;
+pub const FORMAT_VERSION: u32 = 25;
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
/// about the language items in the local crate, as well as info about external items to allow
@@ -581,13 +581,15 @@ pub enum Type {
#[serde(rename = "type")]
type_: Box<Type>,
},
- /// `<Type as Trait>::Name` or associated types like `T::Item` where `T: Iterator`
+ /// Associated types like `<Type as Trait>::Name` and `T::Item` where
+ /// `T: Iterator` or inherent associated types like `Struct::Name`.
QualifiedPath {
name: String,
args: Box<GenericArgs>,
self_type: Box<Type>,
+ /// `None` iff this is an *inherent* associated type.
#[serde(rename = "trait")]
- trait_: Path,
+ trait_: Option<Path>,
},
}
diff --git a/src/tools/clippy/clippy_lints/src/dereference.rs b/src/tools/clippy/clippy_lints/src/dereference.rs
index 7f3f26b..b27ffe7 100644
--- a/src/tools/clippy/clippy_lints/src/dereference.rs
+++ b/src/tools/clippy/clippy_lints/src/dereference.rs
@@ -1424,6 +1424,7 @@ fn ty_auto_deref_stability<'tcx>(
continue;
},
ty::Param(_) => TyPosition::new_deref_stable_for_result(precedence, ty),
+ ty::Alias(ty::Inherent, _) => unreachable!("inherent projection should have been normalized away above"),
ty::Alias(ty::Projection, _) if ty.has_non_region_param() => {
TyPosition::new_deref_stable_for_result(precedence, ty)
},
diff --git a/src/tools/generate-windows-sys/Cargo.toml b/src/tools/generate-windows-sys/Cargo.toml
new file mode 100644
index 0000000..23e8884
--- /dev/null
+++ b/src/tools/generate-windows-sys/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "generate-windows-sys"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies.windows-bindgen]
+version = "0.49"
diff --git a/src/tools/generate-windows-sys/src/main.rs b/src/tools/generate-windows-sys/src/main.rs
new file mode 100644
index 0000000..91d9814
--- /dev/null
+++ b/src/tools/generate-windows-sys/src/main.rs
@@ -0,0 +1,37 @@
+use std::fs;
+use std::io::{self, Write};
+use std::path::PathBuf;
+
+/// This is printed to the file before the rest of the contents.
+const PRELUDE: &str = r#"// This file is autogenerated.
+//
+// To add bindings, edit windows_sys.lst then use `./x run generate-windows-sys` to
+// regenerate the bindings.
+//
+// ignore-tidy-filelength
+"#;
+
+fn main() -> io::Result<()> {
+ let mut path: PathBuf =
+ std::env::args_os().nth(1).expect("a path to the rust repository is required").into();
+ path.push("library/std/src/sys/windows/c/windows_sys.lst");
+
+ // Load the list of APIs
+ let buffer = fs::read_to_string(&path)?;
+ let names: Vec<&str> = buffer
+ .lines()
+ .filter_map(|line| {
+ let line = line.trim();
+ if line.is_empty() || line.starts_with("//") { None } else { Some(line) }
+ })
+ .collect();
+
+ // Write the bindings to windows-sys.rs
+ let bindings = windows_bindgen::standalone_std(&names);
+ path.set_extension("rs");
+ let mut f = std::fs::File::create(&path)?;
+ f.write_all(PRELUDE.as_bytes())?;
+ f.write_all(bindings.as_bytes())?;
+
+ Ok(())
+}
diff --git a/src/tools/jsondoclint/src/validator.rs b/src/tools/jsondoclint/src/validator.rs
index a1f675a..bf8a64a 100644
--- a/src/tools/jsondoclint/src/validator.rs
+++ b/src/tools/jsondoclint/src/validator.rs
@@ -273,7 +273,9 @@ fn check_type(&mut self, x: &'a Type) {
Type::QualifiedPath { name: _, args, self_type, trait_ } => {
self.check_generic_args(&**args);
self.check_type(&**self_type);
- self.check_path(trait_, PathKind::Trait);
+ if let Some(trait_) = trait_ {
+ self.check_path(trait_, PathKind::Trait);
+ }
}
}
}
diff --git a/src/tools/miri/tests/fail/const-ub-checks.rs b/src/tools/miri/tests/fail/const-ub-checks.rs
index fa522c3..ff265fb 100644
--- a/src/tools/miri/tests/fail/const-ub-checks.rs
+++ b/src/tools/miri/tests/fail/const-ub-checks.rs
@@ -1,4 +1,3 @@
-#![feature(const_ptr_read)]
const UNALIGNED_READ: () = unsafe {
let x = &[0u8; 4];
diff --git a/tests/codegen/fewer-names.rs b/tests/codegen/fewer-names.rs
index 7f383a5..df1080b 100644
--- a/tests/codegen/fewer-names.rs
+++ b/tests/codegen/fewer-names.rs
@@ -7,14 +7,14 @@
#[no_mangle]
pub fn sum(x: u32, y: u32) -> u32 {
-// YES-LABEL: define{{.*}}i32 @sum(i32 noundef %0, i32 noundef %1)
-// YES-NEXT: %3 = add i32 %1, %0
-// YES-NEXT: ret i32 %3
+ // YES-LABEL: define{{.*}}i32 @sum(i32 noundef %0, i32 noundef %1)
+ // YES-NEXT: %3 = add i32 %1, %0
+ // YES-NEXT: ret i32 %3
-// NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y)
-// NO-NEXT: start:
-// NO-NEXT: %0 = add i32 %y, %x
-// NO-NEXT: ret i32 %0
+ // NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y)
+ // NO-NEXT: start:
+ // NO-NEXT: %z = add i32 %y, %x
+ // NO-NEXT: ret i32 %z
let z = x + y;
z
}
diff --git a/tests/codegen/mem-replace-big-type.rs b/tests/codegen/mem-replace-big-type.rs
index 81e56b5..acf759e 100644
--- a/tests/codegen/mem-replace-big-type.rs
+++ b/tests/codegen/mem-replace-big-type.rs
@@ -13,7 +13,8 @@
pub fn replace_big(dst: &mut Big, src: Big) -> Big {
// Back in 1.68, this emitted six `memcpy`s.
// `read_via_copy` in 1.69 got that down to three.
- // `write_via_move` has it down to just the two essential ones.
+ // `write_via_move` it was originally down to the essential two, however
+ // with nrvo disabled it is back at 3
std::mem::replace(dst, src)
}
@@ -22,13 +23,14 @@ pub fn replace_big(dst: &mut Big, src: Big) -> Big {
// CHECK-NOT: call void @llvm.memcpy
-// For a large type, we expect exactly two `memcpy`s
+// For a large type, we expect exactly three `memcpy`s
// CHECK-LABEL: define internal void @{{.+}}mem{{.+}}replace{{.+}}sret(%Big)
- // CHECK-NOT: alloca
- // CHECK-NOT: call void @llvm.memcpy
- // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %0, {{i8\*|ptr}} align 8 %dest, i{{.*}} 56, i1 false)
- // CHECK-NOT: call void @llvm.memcpy
- // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %dest, {{i8\*|ptr}} align 8 %src, i{{.*}} 56, i1 false)
- // CHECK-NOT: call void @llvm.memcpy
+// CHECK-NOT: call void @llvm.memcpy
+// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %result, {{i8\*|ptr}} align 8 %dest, i{{.*}} 56, i1 false)
+// CHECK-NOT: call void @llvm.memcpy
+// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %dest, {{i8\*|ptr}} align 8 %src, i{{.*}} 56, i1 false)
+// CHECK-NOT: call void @llvm.memcpy
+// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %0, {{i8\*|ptr}} align 8 %result, i{{.*}} 56, i1 false)
+// CHECK-NOT: call void @llvm.memcpy
// CHECK-NOT: call void @llvm.memcpy
diff --git a/tests/codegen/nrvo.rs b/tests/codegen/nrvo.rs
index fddb0d1..b2ae99f 100644
--- a/tests/codegen/nrvo.rs
+++ b/tests/codegen/nrvo.rs
@@ -8,7 +8,7 @@
pub fn nrvo(init: fn(&mut [u8; 4096])) -> [u8; 4096] {
// CHECK-LABEL: nrvo
// CHECK: @llvm.memset
- // CHECK-NOT: @llvm.memcpy
+ // FIXME: turn on nrvo then check-not: @llvm.memcpy
// CHECK: ret
// CHECK-EMPTY
let mut buf = [0; 4096];
diff --git a/tests/codegen/var-names.rs b/tests/codegen/var-names.rs
index 53841df..d4715ef 100644
--- a/tests/codegen/var-names.rs
+++ b/tests/codegen/var-names.rs
@@ -9,7 +9,7 @@ pub fn test(a: u32, b: u32) -> u32 {
// CHECK: %c = add i32 %a, %b
let d = c;
let e = d * a;
- // CHECK-NEXT: %0 = mul i32 %c, %a
+ // CHECK-NEXT: %e = mul i32 %c, %a
e
- // CHECK-NEXT: ret i32 %0
+ // CHECK-NEXT: ret i32 %e
}
diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs
index b3c3483..4e5d8dc 100644
--- a/tests/codegen/vec-shrink-panik.rs
+++ b/tests/codegen/vec-shrink-panik.rs
@@ -25,7 +25,7 @@ pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
// Call to panic_cannot_unwind in case of double-panic is expected
// on LLVM 16 and older, but other panics are not.
- // CHECK: cleanup
+ // CHECK: filter
// old-NEXT: ; call core::panicking::panic_cannot_unwind
// old-NEXT: panic_cannot_unwind
@@ -40,7 +40,7 @@ pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> {
// Call to panic_cannot_unwind in case of double-panic is expected,
// on LLVM 16 and older, but other panics are not.
- // CHECK: cleanup
+ // CHECK: filter
// old-NEXT: ; call core::panicking::panic_cannot_unwind
// old-NEXT: panic_cannot_unwind
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff
index e768a47..e375794 100644
--- a/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff
+++ b/tests/mir-opt/const_prop/offset_of.concrete.ConstProp.diff
@@ -22,17 +22,17 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/offset_of.rs:+1:9: +1:10
-- _1 = OffsetOf(Alpha, [0]); // scope 0 at $DIR/offset_of.rs:+1:13: +1:33
-+ _1 = const 4_usize; // scope 0 at $DIR/offset_of.rs:+1:13: +1:33
+- _1 = OffsetOf(Alpha, [0]); // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
++ _1 = const 4_usize; // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_2); // scope 1 at $DIR/offset_of.rs:+2:9: +2:10
-- _2 = OffsetOf(Alpha, [1]); // scope 1 at $DIR/offset_of.rs:+2:13: +2:33
-+ _2 = const 0_usize; // scope 1 at $DIR/offset_of.rs:+2:13: +2:33
+- _2 = OffsetOf(Alpha, [1]); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
++ _2 = const 0_usize; // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_3); // scope 2 at $DIR/offset_of.rs:+3:9: +3:11
-- _3 = OffsetOf(Alpha, [2, 0]); // scope 2 at $DIR/offset_of.rs:+3:14: +3:36
-+ _3 = const 2_usize; // scope 2 at $DIR/offset_of.rs:+3:14: +3:36
+- _3 = OffsetOf(Alpha, [2, 0]); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
++ _3 = const 2_usize; // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_4); // scope 3 at $DIR/offset_of.rs:+4:9: +4:11
-- _4 = OffsetOf(Alpha, [2, 1]); // scope 3 at $DIR/offset_of.rs:+4:14: +4:36
-+ _4 = const 3_usize; // scope 3 at $DIR/offset_of.rs:+4:14: +4:36
+- _4 = OffsetOf(Alpha, [2, 1]); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
++ _4 = const 3_usize; // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/offset_of.rs:+0:15: +5:2
StorageDead(_4); // scope 3 at $DIR/offset_of.rs:+5:1: +5:2
StorageDead(_3); // scope 2 at $DIR/offset_of.rs:+5:1: +5:2
diff --git a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff
index e40fdbd..4a65560 100644
--- a/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff
+++ b/tests/mir-opt/const_prop/offset_of.generic.ConstProp.diff
@@ -22,13 +22,13 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/offset_of.rs:+1:9: +1:11
- _1 = OffsetOf(Gamma<T>, [0]); // scope 0 at $DIR/offset_of.rs:+1:14: +1:37
+ _1 = OffsetOf(Gamma<T>, [0]); // scope 0 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_2); // scope 1 at $DIR/offset_of.rs:+2:9: +2:11
- _2 = OffsetOf(Gamma<T>, [1]); // scope 1 at $DIR/offset_of.rs:+2:14: +2:37
+ _2 = OffsetOf(Gamma<T>, [1]); // scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_3); // scope 2 at $DIR/offset_of.rs:+3:9: +3:11
- _3 = OffsetOf(Delta<T>, [1]); // scope 2 at $DIR/offset_of.rs:+3:14: +3:37
+ _3 = OffsetOf(Delta<T>, [1]); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageLive(_4); // scope 3 at $DIR/offset_of.rs:+4:9: +4:11
- _4 = OffsetOf(Delta<T>, [2]); // scope 3 at $DIR/offset_of.rs:+4:14: +4:37
+ _4 = OffsetOf(Delta<T>, [2]); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/offset_of.rs:+0:17: +5:2
StorageDead(_4); // scope 3 at $DIR/offset_of.rs:+5:1: +5:2
StorageDead(_3); // scope 2 at $DIR/offset_of.rs:+5:1: +5:2
diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
index a5129e0..94f24b50 100644
--- a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
+++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
@@ -16,7 +16,8 @@
+ let mut _4: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _5: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _6: *mut u8; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ let mut _7: *const std::vec::Vec<u32>; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ let mut _7: std::boxed::Box<std::vec::Vec<u32>>; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ let mut _8: *const std::vec::Vec<u32>; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ scope 4 {
+ }
+ }
@@ -65,9 +66,12 @@
bb3: {
- StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
- return; // scope 0 at $DIR/inline_into_box_place.rs:+2:2: +2:2
-+ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
-+ (*_7) = move _2; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ StorageLive(_7); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ _7 = ShallowInitBox(move _6, std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ _8 = (((_7.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ (*_8) = move _2; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ _1 = move _7; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
++ StorageDead(_7); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ StorageDead(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:48: +1:49
+ _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2
+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
index 21570a8..8c4ab25 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
@@ -8,8 +8,9 @@
let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:8:7: 8:15
debug self => _4; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _5: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _6: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _5: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _6: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _7: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
}
bb0: {
@@ -17,9 +18,12 @@
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _5 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _3 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ StorageLive(_5); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:7: +1:15
+ _6 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _7 = (((_6.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _5 = &mut (*_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _3 = _5; // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ StorageDead(_5); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:7: +1:15
_2 = &mut (*_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageDead(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
_0 = &mut (*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
index 4f93422..b18a41b 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
@@ -7,17 +7,21 @@
let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:18:7: 18:15
debug self => _3; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _4: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- let mut _5: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let _4: &T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _5: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ let mut _6: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_3 = &(*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
- _4 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- _2 = &(*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ StorageLive(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _5 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _4 = &(*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ _2 = _4; // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ StorageDead(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_0 = &(*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageDead(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
StorageDead(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+2:1: +2:2
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
index d76cd0e..473e02f 100644
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
@@ -12,51 +12,7 @@
+ debug rhs => _4; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ let mut _5: u16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ let mut _6: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _7: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ scope 2 {
-+ scope 3 (inlined core::num::<impl u16>::unchecked_shl::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug x => _7; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _8: std::option::Option<u16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _9: std::result::Result<u16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 4 {
-+ scope 5 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _7; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ scope 6 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ debug u => _7; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _10: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _11: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _12: u16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+ }
-+ scope 7 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _9; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let mut _13: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let _14: u16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ scope 8 {
-+ debug x => _14; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+ }
-+ scope 9 (inlined #[track_caller] Option::<u16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _8; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _15: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _16: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 10 {
-+ debug val => _5; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ scope 11 {
-+ scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 14 {
-+ scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ scope 12 (inlined Option::<u16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ debug self => _15; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
+ }
+ }
@@ -66,87 +22,30 @@
StorageLive(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
_4 = _2; // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
- _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> bb1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:23
-- // mir::Constant
-- // + span: $DIR/unchecked_shifts.rs:11:7: 11:20
-- // + literal: Const { ty: unsafe fn(u16, u32) -> u16 {core::num::<impl u16>::unchecked_shl}, val: Value(<ZST>) }
+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ _6 = (_4,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _7 = move (_6.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _11 = const 65535_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _10 = Gt(_7, move _11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ switchInt(move _10) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _5 = core::num::<impl u16>::unchecked_shl::conv(move (_6.0: u32)) -> bb1; // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // mir::Constant
+- // + span: $DIR/unchecked_shifts.rs:11:7: 11:20
+- // + literal: Const { ty: unsafe fn(u16, u32) -> u16 {core::num::<impl u16>::unchecked_shl}, val: Value(<ZST>) }
++ // + span: $SRC_DIR/core/src/num/mod.rs:LL:COL
++ // + literal: Const { ty: fn(u32) -> u16 {core::num::<impl u16>::unchecked_shl::conv}, val: Value(<ZST>) }
}
bb1: {
++ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
++ _0 = unchecked_shl::<u16>(_3, move _5) -> [return: bb2, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ // mir::Constant
++ // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
++ }
++
++ bb2: {
+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
StorageDead(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ _9 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb3: {
-+ StorageLive(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _12 = _7 as u16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _9 = Result::<u16, TryFromIntError>::Ok(move _12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb4: {
-+ StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _13 = discriminant(_9); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _13) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb5: {
-+ _8 = Option::<u16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb6: {
-+ unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb7: {
-+ _14 = move ((_9 as Ok).0: u16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ _8 = Option::<u16>::Some(move _14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb8: {
-+ StorageDead(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _16 = discriminant(_8); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ switchInt(move _16) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+
-+ bb9: {
-+ _5 = move ((_8 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ StorageDead(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _0 = unchecked_shl::<u16>(_3, move _5) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ // mir::Constant
-+ // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
-+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
}
}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
index 3c175ed..9b7b11e 100644
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
@@ -9,51 +9,7 @@
debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
let mut _3: u16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
let mut _4: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _5: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
scope 2 {
- scope 3 (inlined core::num::<impl u16>::unchecked_shl::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug x => _5; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _6: std::option::Option<u16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _7: std::result::Result<u16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 4 {
- scope 5 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _5; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- scope 6 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- debug u => _5; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _8: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _9: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _10: u16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
- }
- scope 7 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _7; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _11: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let _12: u16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 8 {
- debug x => _12; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
- scope 9 (inlined #[track_caller] Option::<u16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _6; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _13: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _14: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 10 {
- debug val => _3; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- scope 11 {
- scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
- scope 14 {
- scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
- }
- }
- }
- scope 12 (inlined Option::<u16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
- debug self => _13; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
- }
- }
}
}
@@ -61,78 +17,22 @@
StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
_4 = (_2,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _5 = move (_4.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _9 = const 65535_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _8 = Gt(_5, move _9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- switchInt(move _8) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _3 = core::num::<impl u16>::unchecked_shl::conv(move (_4.0: u32)) -> bb1; // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // mir::Constant
+ // + span: $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // + literal: Const { ty: fn(u32) -> u16 {core::num::<impl u16>::unchecked_shl::conv}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
- }
-
- bb2: {
- _7 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _10 = _5 as u16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _7 = Result::<u16, TryFromIntError>::Ok(move _10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb4: {
- StorageDead(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _11 = discriminant(_7); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb5: {
- _6 = Option::<u16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb6: {
- unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb7: {
- _12 = move ((_7 as Ok).0: u16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _6 = Option::<u16>::Some(move _12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb8: {
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _14) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb9: {
- _3 = move ((_6 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _0 = unchecked_shl::<u16>(_1, move _3) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _0 = unchecked_shl::<u16>(_1, move _3) -> [return: bb2, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
}
+
+ bb2: {
+ StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
+ }
}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
index f3d3e60..9638ddd 100644
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
@@ -12,51 +12,7 @@
+ debug rhs => _4; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ let mut _5: i16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ let mut _6: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _7: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ scope 2 {
-+ scope 3 (inlined core::num::<impl i16>::unchecked_shr::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug x => _7; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _8: std::option::Option<i16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ let mut _9: std::result::Result<i16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ scope 4 {
-+ scope 5 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _7; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ scope 6 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
-+ debug u => _7; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _10: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _11: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ let mut _12: i16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+ }
-+ scope 7 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _9; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let mut _13: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ let _14: i16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ scope 8 {
-+ debug x => _14; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+ }
-+ scope 9 (inlined #[track_caller] Option::<i16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ debug self => _8; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _15: &std::option::Option<i16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ let mut _16: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 10 {
-+ debug val => _5; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ scope 11 {
-+ scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ scope 14 {
-+ scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
-+ scope 12 (inlined Option::<i16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
-+ debug self => _15; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+ }
-+ }
-+ }
+ }
+ }
@@ -66,87 +22,30 @@
StorageLive(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
_4 = _2; // scope 0 at $DIR/unchecked_shifts.rs:+1:21: +1:22
- _0 = core::num::<impl i16>::unchecked_shr(move _3, move _4) -> bb1; // scope 0 at $DIR/unchecked_shifts.rs:+1:5: +1:23
-- // mir::Constant
-- // + span: $DIR/unchecked_shifts.rs:17:7: 17:20
-- // + literal: Const { ty: unsafe fn(i16, u32) -> i16 {core::num::<impl i16>::unchecked_shr}, val: Value(<ZST>) }
+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ _6 = (_4,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _7 = move (_6.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _11 = const 32767_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _10 = Gt(_7, move _11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_11); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ switchInt(move _10) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _5 = core::num::<impl i16>::unchecked_shr::conv(move (_6.0: u32)) -> bb1; // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // mir::Constant
+- // + span: $DIR/unchecked_shifts.rs:17:7: 17:20
+- // + literal: Const { ty: unsafe fn(i16, u32) -> i16 {core::num::<impl i16>::unchecked_shr}, val: Value(<ZST>) }
++ // + span: $SRC_DIR/core/src/num/mod.rs:LL:COL
++ // + literal: Const { ty: fn(u32) -> i16 {core::num::<impl i16>::unchecked_shr::conv}, val: Value(<ZST>) }
}
bb1: {
++ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
++ _0 = unchecked_shr::<i16>(_3, move _5) -> [return: bb2, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ // mir::Constant
++ // + span: $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(i16, i16) -> i16 {unchecked_shr::<i16>}, val: Value(<ZST>) }
++ }
++
++ bb2: {
+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
StorageDead(_3); // scope 0 at $DIR/unchecked_shifts.rs:+1:22: +1:23
return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
-+ }
-+
-+ bb2: {
-+ _9 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ // mir::Constant
-+ // + span: no-location
-+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb3: {
-+ StorageLive(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _12 = _7 as i16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ _9 = Result::<i16, TryFromIntError>::Ok(move _12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageDead(_12); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ }
-+
-+ bb4: {
-+ StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
-+ StorageLive(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _13 = discriminant(_9); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _13) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb5: {
-+ _8 = Option::<i16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb6: {
-+ unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb7: {
-+ _14 = move ((_9 as Ok).0: i16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ _8 = Option::<i16>::Some(move _14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
-+ goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
-+ }
-+
-+ bb8: {
-+ StorageDead(_14); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageLive(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _16 = discriminant(_8); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ switchInt(move _16) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ }
-+
-+ bb9: {
-+ _5 = move ((_8 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
-+ StorageDead(_15); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
-+ _0 = unchecked_shr::<i16>(_3, move _5) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ // mir::Constant
-+ // + span: $SRC_DIR/core/src/num/int_macros.rs:LL:COL
-+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(i16, i16) -> i16 {unchecked_shr::<i16>}, val: Value(<ZST>) }
}
}
diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
index 724b3c5..afe6d08 100644
--- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
@@ -9,51 +9,7 @@
debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
let mut _3: i16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
let mut _4: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _5: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
scope 2 {
- scope 3 (inlined core::num::<impl i16>::unchecked_shr::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug x => _5; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _6: std::option::Option<i16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- let mut _7: std::result::Result<i16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- scope 4 {
- scope 5 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _5; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- scope 6 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- debug u => _5; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _8: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _9: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- let mut _10: i16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
- }
- scope 7 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _7; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _11: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- let _12: i16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 8 {
- debug x => _12; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
- scope 9 (inlined #[track_caller] Option::<i16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
- debug self => _6; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _13: &std::option::Option<i16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- let mut _14: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- scope 10 {
- debug val => _3; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- scope 11 {
- scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
- scope 14 {
- scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- }
- }
- }
- }
- scope 12 (inlined Option::<i16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
- debug self => _13; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
- }
- }
- }
- }
}
}
@@ -61,78 +17,22 @@
StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
_4 = (_2,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _5 = move (_4.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _9 = const 32767_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _8 = Gt(_5, move _9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- switchInt(move _8) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _3 = core::num::<impl i16>::unchecked_shr::conv(move (_4.0: u32)) -> bb1; // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // mir::Constant
+ // + span: $SRC_DIR/core/src/num/mod.rs:LL:COL
+ // + literal: Const { ty: fn(u32) -> i16 {core::num::<impl i16>::unchecked_shr::conv}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
- return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
- }
-
- bb2: {
- _7 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- // mir::Constant
- // + span: no-location
- // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _10 = _5 as i16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- _7 = Result::<i16, TryFromIntError>::Ok(move _10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- }
-
- bb4: {
- StorageDead(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _11 = discriminant(_7); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb5: {
- _6 = Option::<i16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb6: {
- unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb7: {
- _12 = move ((_7 as Ok).0: i16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _6 = Option::<i16>::Some(move _12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb8: {
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- switchInt(move _14) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- }
-
- bb9: {
- _3 = move ((_6 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
- _0 = unchecked_shr::<i16>(_1, move _3) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ _0 = unchecked_shr::<i16>(_1, move _3) -> [return: bb2, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/num/int_macros.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(i16, i16) -> i16 {unchecked_shr::<i16>}, val: Value(<ZST>) }
}
+
+ bb2: {
+ StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
+ }
}
diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
index 8a8cd89..778ecc4 100644
--- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
@@ -9,8 +9,9 @@
+ debug self => _2; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _3: &std::option::Option<T>; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _4: isize; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
++ let _5: T; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ scope 2 {
-+ debug val => _0; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
++ debug val => _5; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
+ }
+ scope 3 {
+ scope 5 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
@@ -46,7 +47,10 @@
- bb2 (cleanup): {
- resume; // scope 0 at $DIR/unwrap_unchecked.rs:+0:1: +2:2
+ bb2: {
-+ _0 = move ((_2 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
++ StorageLive(_5); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
++ _5 = move ((_2 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
++ _0 = move _5; // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
++ StorageDead(_5); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ StorageDead(_3); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
+ StorageDead(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:26: +1:27
+ return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
index c5e2469..5cdf4fa 100644
--- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
@@ -7,8 +7,9 @@
debug self => _1; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
let mut _2: &std::option::Option<T>; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
let mut _3: isize; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ let _4: T; // in scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
scope 2 {
- debug val => _0; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
+ debug val => _4; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
}
scope 3 {
scope 5 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
@@ -34,7 +35,10 @@
}
bb2: {
- _0 = move ((_1 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ StorageLive(_4); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ _4 = move ((_1 as Some).0: T); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
+ _0 = move _4; // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
+ StorageDead(_4); // scope 1 at $SRC_DIR/core/src/option.rs:LL:COL
StorageDead(_2); // scope 0 at $DIR/unwrap_unchecked.rs:+1:9: +1:27
return; // scope 0 at $DIR/unwrap_unchecked.rs:+2:2: +2:2
}
diff --git a/tests/mir-opt/nrvo_miscompile_111005.rs b/tests/mir-opt/nrvo_miscompile_111005.rs
new file mode 100644
index 0000000..a9f391b
--- /dev/null
+++ b/tests/mir-opt/nrvo_miscompile_111005.rs
@@ -0,0 +1,22 @@
+// This is a miscompilation, #111005 to track
+
+// unit-test: RenameReturnPlace
+
+#![feature(custom_mir, core_intrinsics)]
+extern crate core;
+use core::intrinsics::mir::*;
+
+// EMIT_MIR nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub fn wrong(arg: char) -> char {
+ mir!({
+ let temp = arg;
+ RET = temp;
+ temp = 'b';
+ Return()
+ })
+}
+
+fn main() {
+ assert_eq!(wrong('a'), 'a');
+}
diff --git a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
new file mode 100644
index 0000000..a0acb6e
--- /dev/null
+++ b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
@@ -0,0 +1,18 @@
+- // MIR for `wrong` before RenameReturnPlace
++ // MIR for `wrong` after RenameReturnPlace
+
+ fn wrong(_1: char) -> char {
+- let mut _0: char; // return place in scope 0 at $DIR/nrvo_miscompile_111005.rs:+0:28: +0:32
++ let mut _0: char; // return place in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _2: char; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+
+ bb0: {
+- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+- _0 = _2; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+3:9: +3:19
+- _2 = const 'b'; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+4:9: +4:19
++ _0 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
++ _0 = const 'b'; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+4:9: +4:19
+ return; // scope 0 at $DIR/nrvo_miscompile_111005.rs:+5:9: +5:17
+ }
+ }
+
diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
index 2b4971e..4fddd50 100644
--- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.mir
@@ -3,14 +3,18 @@
fn manual_replace(_1: &mut u32, _2: u32) -> u32 {
debug r => _1; // in scope 0 at $DIR/mem_replace.rs:+0:23: +0:24
debug v => _2; // in scope 0 at $DIR/mem_replace.rs:+0:36: +0:37
- let mut _0: u32; // return place in scope 0 at $DIR/mem_replace.rs:+1:9: +1:13
+ let mut _0: u32; // return place in scope 0 at $DIR/mem_replace.rs:+0:47: +0:50
+ let _3: u32; // in scope 0 at $DIR/mem_replace.rs:+1:9: +1:13
scope 1 {
- debug temp => _0; // in scope 1 at $DIR/mem_replace.rs:+1:9: +1:13
+ debug temp => _3; // in scope 1 at $DIR/mem_replace.rs:+1:9: +1:13
}
bb0: {
- _0 = (*_1); // scope 0 at $DIR/mem_replace.rs:+1:16: +1:18
+ StorageLive(_3); // scope 0 at $DIR/mem_replace.rs:+1:9: +1:13
+ _3 = (*_1); // scope 0 at $DIR/mem_replace.rs:+1:16: +1:18
(*_1) = _2; // scope 1 at $DIR/mem_replace.rs:+2:5: +2:11
+ _0 = _3; // scope 1 at $DIR/mem_replace.rs:+3:5: +3:9
+ StorageDead(_3); // scope 0 at $DIR/mem_replace.rs:+4:1: +4:2
return; // scope 0 at $DIR/mem_replace.rs:+4:2: +4:2
}
}
diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
index 50e0538..619db12 100644
--- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
@@ -7,28 +7,29 @@
scope 1 (inlined std::mem::replace::<u32>) { // at $DIR/mem_replace.rs:16:5: 16:28
debug dest => _1; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
debug src => _2; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- let mut _3: *const u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- let mut _4: *mut u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ let mut _4: *const u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ let mut _5: *mut u32; // in scope 1 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
scope 2 {
+ let _3: u32; // in scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
scope 3 {
- debug result => _0; // in scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ debug result => _3; // in scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
scope 7 (inlined std::ptr::write::<u32>) { // at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- debug dst => _4; // in scope 7 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ debug dst => _5; // in scope 7 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
debug src => _2; // in scope 7 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _6: *mut u32; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ let mut _7: *mut u32; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
scope 8 {
scope 9 (inlined std::ptr::write::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug dst => _6; // in scope 9 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug dst => _7; // in scope 9 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
}
}
}
}
scope 4 (inlined std::ptr::read::<u32>) { // at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- debug src => _3; // in scope 4 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _5: *const u32; // in scope 4 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug src => _4; // in scope 4 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ let mut _6: *const u32; // in scope 4 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
scope 5 {
scope 6 (inlined std::ptr::read::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug src => _5; // in scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug src => _6; // in scope 6 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
}
}
}
@@ -37,17 +38,20 @@
bb0: {
StorageLive(_3); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _3 = &raw const (*_1); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_5); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _0 = (*_3); // scope 5 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_5); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageLive(_4); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ _4 = &raw const (*_1); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ _3 = (*_4); // scope 5 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageDead(_4); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageLive(_5); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ _5 = &raw mut (*_1); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageLive(_7); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ (*_5) = _2; // scope 8 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ StorageDead(_7); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ StorageDead(_5); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ _0 = move _3; // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
StorageDead(_3); // scope 2 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_4); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- _4 = &raw mut (*_1); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageLive(_6); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- (*_4) = _2; // scope 8 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_6); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- StorageDead(_4); // scope 3 at $SRC_DIR/core/src/mem/mod.rs:LL:COL
return; // scope 0 at $DIR/mem_replace.rs:+2:2: +2:2
}
}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir
index ea0a44c..7d4766e 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.mir
@@ -3,66 +3,67 @@
fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> &mut [u32] {
debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:45: +0:50
debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:64: +0:69
- let mut _0: &mut [u32]; // return place in scope 0 at $DIR/slice_index.rs:+1:5: +1:35
+ let mut _0: &mut [u32]; // return place in scope 0 at $DIR/slice_index.rs:+0:88: +0:98
scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) { // at $DIR/slice_index.rs:26:11: 26:35
debug self => _1; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
debug index => _2; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- let mut _3: *mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ let mut _3: &mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
let mut _4: *mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ let mut _5: *mut [u32]; // in scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
scope 2 {
scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
debug self => _2; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug slice => _4; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let _5: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _7: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ debug slice => _5; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let _6: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
let mut _8: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _9: *mut u32; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let mut _9: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
let mut _10: *mut u32; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _11: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let mut _11: *mut u32; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
let mut _12: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- let mut _13: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- let mut _14: *mut [u32]; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ let mut _13: usize; // in scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let mut _14: std::ops::Range<usize>; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ let mut _15: *mut [u32]; // in scope 3 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
scope 4 {
- debug this => _5; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ debug this => _6; // in scope 4 at $SRC_DIR/core/src/slice/index.rs:LL:COL
scope 5 {
- let _6: usize; // in scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let _7: usize; // in scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
scope 6 {
- debug new_len => _6; // in scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ debug new_len => _7; // in scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _4; // in scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ debug self => _5; // in scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
}
scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _10; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug count => _11; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ debug self => _11; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ debug count => _12; // in scope 12 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
scope 13 {
}
}
scope 14 (inlined slice_from_raw_parts_mut::<u32>) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug data => _9; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug len => _12; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- let mut _16: *mut (); // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ debug data => _10; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ debug len => _13; // in scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { // at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug self => _9; // in scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ debug self => _10; // in scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ let mut _17: *mut (); // in scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
}
scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { // at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- debug data_address => _16; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- debug metadata => _12; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _17: std::ptr::metadata::PtrRepr<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _18: std::ptr::metadata::PtrComponents<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- let mut _19: *const (); // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ debug data_address => _17; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ debug metadata => _13; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ let mut _18: std::ptr::metadata::PtrRepr<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ let mut _19: std::ptr::metadata::PtrComponents<[u32]>; // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ let mut _20: *const (); // in scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
scope 17 {
}
}
}
}
scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug this => _13; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- debug slice => _14; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug this => _14; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ debug slice => _15; // in scope 7 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) { // at $SRC_DIR/core/src/slice/index.rs:LL:COL
- debug self => _14; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- let mut _15: *const [u32]; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ debug self => _15; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ let mut _16: *const [u32]; // in scope 8 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
scope 9 (inlined std::ptr::metadata::<[u32]>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- debug ptr => _15; // in scope 9 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ debug ptr => _16; // in scope 9 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
scope 10 {
}
}
@@ -75,60 +76,61 @@
}
bb0: {
- StorageLive(_3); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_4); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _4 = &raw mut (*_1); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_5); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_13); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ _5 = &raw mut (*_1); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_14); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_15); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageLive(_6); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageLive(_16); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_7); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _7 = (_2.1: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
StorageLive(_8); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _8 = (_2.0: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _6 = unchecked_sub::<usize>(move _7, move _8) -> [return: bb1, unwind unreachable]; // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _8 = (_2.1: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageLive(_9); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _9 = (_2.0: usize); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _7 = unchecked_sub::<usize>(move _8, move _9) -> [return: bb1, unwind unreachable]; // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/slice/index.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(usize, usize) -> usize {unchecked_sub::<usize>}, val: Value(<ZST>) }
}
bb1: {
+ StorageDead(_9); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
StorageDead(_8); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_7); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
StorageLive(_10); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _10 = _4 as *mut u32 (PtrToPtr); // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
StorageLive(_11); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _11 = (_2.0: usize); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _9 = Offset(_10, _11); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageDead(_11); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _11 = _5 as *mut u32 (PtrToPtr); // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- _12 = _6; // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageLive(_16); // scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- _16 = _9 as *mut () (PtrToPtr); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- StorageLive(_17); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ _12 = (_2.0: usize); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _10 = Offset(_11, _12); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+ StorageDead(_12); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_11); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageLive(_13); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _13 = _7; // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageLive(_17); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _17 = _10 as *mut () (PtrToPtr); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
StorageLive(_18); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
StorageLive(_19); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _19 = _16 as *const () (Pointer(MutToConstPointer)); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _18 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _19, metadata: _12 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ StorageLive(_20); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ _20 = _17 as *const () (Pointer(MutToConstPointer)); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ _19 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _20, metadata: _13 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ StorageDead(_20); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ _18 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _19 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
StorageDead(_19); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _17 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _18 }; // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_18); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- _3 = (_17.1: *mut [u32]); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_17); // scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
- StorageDead(_16); // scope 14 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- StorageDead(_12); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
- StorageDead(_6); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _4 = (_18.1: *mut [u32]); // scope 17 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ StorageDead(_18); // scope 16 at $SRC_DIR/core/src/ptr/metadata.rs:LL:COL
+ StorageDead(_17); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_13); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_10); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_7); // scope 5 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_16); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageDead(_15); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageDead(_14); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_13); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageDead(_5); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_4); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- _0 = &mut (*_3); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
- StorageDead(_3); // scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ _3 = &mut (*_4); // scope 2 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ StorageDead(_4); // scope 1 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
+ _0 = _3; // scope 0 at $DIR/slice_index.rs:+1:5: +1:35
return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
}
}
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir
index 35dd973..d3b59e2 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.mir
@@ -3,24 +3,26 @@
fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
debug slice => _1; // in scope 0 at $DIR/slice_index.rs:+0:26: +0:31
debug index => _2; // in scope 0 at $DIR/slice_index.rs:+0:41: +0:46
- let mut _0: &[u32]; // return place in scope 0 at $DIR/slice_index.rs:+1:5: +1:18
+ let mut _0: &[u32]; // return place in scope 0 at $DIR/slice_index.rs:+0:65: +0:71
let _3: &[u32]; // in scope 0 at $DIR/slice_index.rs:+1:6: +1:18
scope 1 (inlined #[track_caller] core::slice::index::<impl Index<std::ops::Range<usize>> for [u32]>::index) { // at $DIR/slice_index.rs:21:6: 21:18
debug self => _1; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
debug index => _2; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ let _4: &[u32]; // in scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
}
bb0: {
- StorageLive(_3); // scope 0 at $DIR/slice_index.rs:+1:6: +1:18
- _3 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, _1) -> bb1; // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageLive(_4); // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ _4 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, _1) -> bb1; // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/slice/index.rs:LL:COL
// + literal: Const { ty: for<'a> fn(std::ops::Range<usize>, &'a [u32]) -> &'a <std::ops::Range<usize> as SliceIndex<[u32]>>::Output {<std::ops::Range<usize> as SliceIndex<[u32]>>::index}, val: Value(<ZST>) }
}
bb1: {
+ _3 = _4; // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
+ StorageDead(_4); // scope 1 at $SRC_DIR/core/src/slice/index.rs:LL:COL
_0 = _3; // scope 0 at $DIR/slice_index.rs:+1:5: +1:18
- StorageDead(_3); // scope 0 at $DIR/slice_index.rs:+2:1: +2:2
return; // scope 0 at $DIR/slice_index.rs:+2:2: +2:2
}
}
diff --git a/tests/run-make/branch-protection-check-IBT/Makefile b/tests/run-make/branch-protection-check-IBT/Makefile
new file mode 100644
index 0000000..cabe951
--- /dev/null
+++ b/tests/run-make/branch-protection-check-IBT/Makefile
@@ -0,0 +1,15 @@
+# Check for GNU Property Note
+
+include ../tools.mk
+
+# How to run this
+# python3 x.py test --target x86_64-unknown-linux-gnu tests/run-make/branch-protection-check-IBT/
+
+# only-x86_64
+
+all:
+ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64)
+ $(RUSTC) --target x86_64-unknown-linux-gnu -Z cf-protection=branch -L$(TMPDIR) -C link-args='-nostartfiles' -C save-temps ./main.rs -o $(TMPDIR)/rsmain
+ readelf -nW $(TMPDIR)/rsmain | $(CGREP) -e ".note.gnu.property"
+endif
+
diff --git a/tests/run-make/branch-protection-check-IBT/main.rs b/tests/run-make/branch-protection-check-IBT/main.rs
new file mode 100644
index 0000000..ad379d6
--- /dev/null
+++ b/tests/run-make/branch-protection-check-IBT/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("hello world");
+}
diff --git a/tests/run-make/forced-unwind-terminate-pof/Makefile b/tests/run-make/forced-unwind-terminate-pof/Makefile
new file mode 100644
index 0000000..8716215
--- /dev/null
+++ b/tests/run-make/forced-unwind-terminate-pof/Makefile
@@ -0,0 +1,9 @@
+# ignore-cross-compile
+# only-linux
+include ../tools.mk
+
+all: foo
+ $(call RUN,foo) | $(CGREP) -v "cannot unwind"
+
+foo: foo.rs
+ $(RUSTC) $<
diff --git a/tests/run-make/forced-unwind-terminate-pof/foo.rs b/tests/run-make/forced-unwind-terminate-pof/foo.rs
new file mode 100644
index 0000000..0a51287
--- /dev/null
+++ b/tests/run-make/forced-unwind-terminate-pof/foo.rs
@@ -0,0 +1,17 @@
+// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.
+
+#![feature(c_unwind)]
+#![no_main]
+
+extern "C-unwind" {
+ fn pthread_exit(v: *mut core::ffi::c_void) -> !;
+}
+
+unsafe extern "C" fn call_pthread_exit() {
+ pthread_exit(core::ptr::null_mut());
+}
+
+#[no_mangle]
+unsafe extern "C-unwind" fn main(_argc: core::ffi::c_int, _argv: *mut *mut core::ffi::c_char) {
+ call_pthread_exit();
+}
diff --git a/tests/rustdoc/inherent-projections.rs b/tests/rustdoc/inherent-projections.rs
new file mode 100644
index 0000000..9bda0ac
--- /dev/null
+++ b/tests/rustdoc/inherent-projections.rs
@@ -0,0 +1,44 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// @has 'inherent_projections/fn.create.html'
+// @has - '//pre[@class="rust item-decl"]' "create() -> Owner::Metadata"
+// @has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Owner.html#associatedtype.Metadata'
+pub fn create() -> Owner::Metadata {}
+
+pub struct Owner;
+
+impl Owner {
+ pub type Metadata = ();
+}
+
+// Make sure we handle bound vars correctly.
+// @has 'inherent_projections/type.User.html' '//pre[@class="rust item-decl"]' "for<'a> fn(_: Carrier<'a>::Focus)"
+pub type User = for<'a> fn(Carrier<'a>::Focus);
+
+pub struct Carrier<'a>(&'a ());
+
+impl<'a> Carrier<'a> {
+ pub type Focus = &'a mut i32;
+}
+
+////////////////////////////////////////
+
+// FIXME(inherent_associated_types): Below we link to `Proj` but we should link to `Proj-1`.
+// The current test checks for the buggy behavior for demonstration purposes.
+
+// @has 'inherent_projections/type.Test.html'
+// @has - '//pre[@class="rust item-decl"]' "Parametrized<i32>"
+// @has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj'
+// @!has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj-1'
+pub type Test = Parametrized<i32>::Proj;
+
+pub struct Parametrized<T>(T);
+
+impl Parametrized<bool> {
+ pub type Proj = ();
+}
+
+impl Parametrized<i32> {
+ pub type Proj = String;
+}
diff --git a/tests/rustdoc/intra-doc/inherent-associated-types.rs b/tests/rustdoc/intra-doc/inherent-associated-types.rs
new file mode 100644
index 0000000..2b28d2a
--- /dev/null
+++ b/tests/rustdoc/intra-doc/inherent-associated-types.rs
@@ -0,0 +1,45 @@
+#![feature(inherent_associated_types)]
+
+#![allow(incomplete_features)]
+#![deny(rustdoc::broken_intra_doc_links)]
+
+// @has inherent_associated_types/index.html
+
+// @has - '//a/@href' 'enum.Simple.html#associatedtype.Type'
+//! [`Simple::Type`]
+
+pub enum Simple {}
+
+impl Simple {
+ pub type Type = ();
+}
+
+////////////////////////////////////////
+
+// @has 'inherent_associated_types/type.Test0.html' '//a/@href' \
+// 'struct.Parametrized.html#associatedtype.Proj'
+/// [`Parametrized<bool>::Proj`]
+pub type Test0 = ();
+
+// FIXME(inherent_associated_types): The intra-doc link below should point to `Proj-1` not `Proj`.
+// The current test checks for the buggy behavior for demonstration purposes.
+// The same bug happens for inherent associated functions and constants (see #85960, #93398).
+//
+// Further, at some point we should reject the intra-doc link `Parametrized::Proj`.
+// It currently links to `Parametrized<bool>::Proj`.
+
+// @has 'inherent_associated_types/type.Test1.html'
+// @has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj'
+// @!has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj-1'
+/// [`Parametrized<i32>::Proj`]
+pub type Test1 = ();
+
+pub struct Parametrized<T>(T);
+
+impl Parametrized<bool> {
+ pub type Proj = ();
+}
+
+impl Parametrized<i32> {
+ pub type Proj = String;
+}
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs
new file mode 100644
index 0000000..642b58b
--- /dev/null
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs
@@ -0,0 +1,49 @@
+// check-fail
+// Tests that a doc comment will not preclude a field from being considered a diagnostic argument
+// normalize-stderr-test "the following other types implement trait `IntoDiagnosticArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
+// normalize-stderr-test "diagnostic_builder\.rs:[0-9]+:[0-9]+" -> "diagnostic_builder.rs:LL:CC"
+
+// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
+// changing the output of this test. Since Subdiagnostic is strictly internal to the compiler
+// the test is just ignored on stable and beta:
+// ignore-stage1
+// ignore-beta
+// ignore-stable
+
+#![feature(rustc_private)]
+#![crate_type = "lib"]
+
+extern crate rustc_errors;
+extern crate rustc_fluent_macro;
+extern crate rustc_macros;
+extern crate rustc_session;
+extern crate rustc_span;
+
+use rustc_errors::{Applicability, DiagnosticMessage, SubdiagnosticMessage};
+use rustc_fluent_macro::fluent_messages;
+use rustc_macros::{Diagnostic, Subdiagnostic};
+use rustc_span::Span;
+
+fluent_messages! { "./example.ftl" }
+
+struct NotIntoDiagnosticArg;
+
+#[derive(Diagnostic)]
+#[diag(no_crate_example)]
+struct Test {
+ #[primary_span]
+ span: Span,
+ /// A doc comment
+ arg: NotIntoDiagnosticArg,
+ //~^ ERROR the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
+}
+
+#[derive(Subdiagnostic)]
+#[label(no_crate_example)]
+struct SubTest {
+ #[primary_span]
+ span: Span,
+ /// A doc comment
+ arg: NotIntoDiagnosticArg,
+ //~^ ERROR the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
+}
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
new file mode 100644
index 0000000..e4b8958
--- /dev/null
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
@@ -0,0 +1,30 @@
+error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
+ --> $DIR/diagnostic-derive-doc-comment-field.rs:37:10
+ |
+LL | #[derive(Diagnostic)]
+ | ---------- required by a bound introduced by this call
+...
+LL | arg: NotIntoDiagnosticArg,
+ | ^^^^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
+ |
+ = help: normalized in stderr
+note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
+ --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
+ = note: this error originates in the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
+ --> $DIR/diagnostic-derive-doc-comment-field.rs:47:10
+ |
+LL | #[derive(Subdiagnostic)]
+ | ------------- required by a bound introduced by this call
+...
+LL | arg: NotIntoDiagnosticArg,
+ | ^^^^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
+ |
+ = help: normalized in stderr
+note: required by a bound in `Diagnostic::set_arg`
+ --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:964:5
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index 80ab03a..39e34d7 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -339,12 +339,12 @@ struct ErrorWithDefaultLabelAttr<'a> {
}
#[derive(Diagnostic)]
-//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
#[diag(no_crate_example, code = "E0123")]
struct ArgFieldWithoutSkip {
#[primary_span]
span: Span,
other: Hello,
+ //~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
}
#[derive(Diagnostic)]
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 5e1bea4..801e4b5 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -641,15 +641,18 @@
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
- --> $DIR/diagnostic-derive.rs:341:10
+ --> $DIR/diagnostic-derive.rs:346:12
|
LL | #[derive(Diagnostic)]
- | ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
+ | ---------- required by a bound introduced by this call
+...
+LL | other: Hello,
+ | ^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
|
= help: normalized in stderr
note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
--> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
- = note: this error originates in the derive macro `Diagnostic` which comes from the expansion of the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
+ = note: this error originates in the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 84 previous errors
diff --git a/tests/ui/argument-suggestions/issue-97484.stderr b/tests/ui/argument-suggestions/issue-97484.stderr
index a86cbbf..082564f 100644
--- a/tests/ui/argument-suggestions/issue-97484.stderr
+++ b/tests/ui/argument-suggestions/issue-97484.stderr
@@ -16,7 +16,7 @@
help: consider borrowing here
|
LL | foo(&&A, B, C, D, &E, F, G);
- | ~~
+ | +
help: remove the extra arguments
|
LL - foo(&&A, B, C, D, E, F, G);
diff --git a/tests/ui/array-slice-vec/slice-mut-2.stderr b/tests/ui/array-slice-vec/slice-mut-2.stderr
index 5b040d3..c33919c 100644
--- a/tests/ui/array-slice-vec/slice-mut-2.stderr
+++ b/tests/ui/array-slice-vec/slice-mut-2.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let x: &[isize] = &mut [1, 2, 3, 4, 5];
- | ~~~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs
new file mode 100644
index 0000000..f415744
--- /dev/null
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.rs
@@ -0,0 +1,10 @@
+// known-bug: #108491
+
+// FIXME(inherent_associated_types): This should pass.
+
+struct Foo {
+ bar: Self::Bar,
+}
+impl Foo {
+ pub type Bar = usize;
+}
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
new file mode 100644
index 0000000..f313c49
--- /dev/null
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr
@@ -0,0 +1,49 @@
+error[E0601]: `main` function not found in crate `cycle_iat_inside_of_adt`
+ --> $DIR/cycle-iat-inside-of-adt.rs:10:2
+ |
+LL | }
+ | ^ consider adding a `main` function to `$DIR/cycle-iat-inside-of-adt.rs`
+
+error[E0391]: cycle detected when computing predicates of `Foo`
+ --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ |
+LL | struct Foo {
+ | ^^^^^^^^^^
+ |
+note: ...which requires computing predicates of `Foo`...
+ --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ |
+LL | struct Foo {
+ | ^^^^^^^^^^
+note: ...which requires computing inferred outlives predicates of `Foo`...
+ --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ |
+LL | struct Foo {
+ | ^^^^^^^^^^
+ = note: ...which requires computing the inferred outlives predicates for items in this crate...
+note: ...which requires computing type of `Foo::bar`...
+ --> $DIR/cycle-iat-inside-of-adt.rs:6:5
+ |
+LL | bar: Self::Bar,
+ | ^^^^^^^^^^^^^^
+note: ...which requires computing normalized predicates of `Foo`...
+ --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ |
+LL | struct Foo {
+ | ^^^^^^^^^^
+ = note: ...which again requires computing predicates of `Foo`, completing the cycle
+note: cycle used when collecting item types in top-level module
+ --> $DIR/cycle-iat-inside-of-adt.rs:5:1
+ |
+LL | / struct Foo {
+LL | | bar: Self::Bar,
+LL | | }
+LL | | impl Foo {
+LL | | pub type Bar = usize;
+LL | | }
+ | |_^
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0391, E0601.
+For more information about an error, try `rustc --explain E0391`.
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.rs b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.rs
new file mode 100644
index 0000000..0c2a38b
--- /dev/null
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.rs
@@ -0,0 +1,16 @@
+// known-bug: unknown
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// FIXME(inherent_associated_types): This shouldn't lead to a cycle error.
+
+fn user<T>() where S<T>::P: std::fmt::Debug {}
+
+struct S<T>;
+
+impl<T: Copy> S<T> {
+ type P = ();
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr
new file mode 100644
index 0000000..aaa9a39
--- /dev/null
+++ b/tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-where-predicate.stderr
@@ -0,0 +1,37 @@
+error[E0391]: cycle detected when computing predicates of `user`
+ --> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
+ |
+LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires computing predicates of `user`...
+ --> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
+ |
+LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires computing explicit predicates of `user`...
+ --> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
+ |
+LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires computing normalized predicates of `user`...
+ --> $DIR/cycle-iat-inside-of-where-predicate.rs:8:1
+ |
+LL | fn user<T>() where S<T>::P: std::fmt::Debug {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which again requires computing predicates of `user`, completing the cycle
+note: cycle used when collecting item types in top-level module
+ --> $DIR/cycle-iat-inside-of-where-predicate.rs:3:1
+ |
+LL | / #![feature(inherent_associated_types)]
+LL | | #![allow(incomplete_features)]
+LL | |
+LL | | // FIXME(inherent_associated_types): This shouldn't lead to a cycle error.
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/associated-inherent-types/bugs/ice-substitution.rs b/tests/ui/associated-inherent-types/bugs/ice-substitution.rs
deleted file mode 100644
index 53ac79e..0000000
--- a/tests/ui/associated-inherent-types/bugs/ice-substitution.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// known-bug: unknown
-// failure-status: 101
-// normalize-stderr-test "note: .*\n\n" -> ""
-// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
-// rustc-env:RUST_BACKTRACE=0
-
-// FIXME: I presume a type variable that couldn't be solved by `resolve_vars_if_possible`
-// escapes the InferCtxt snapshot.
-
-#![feature(inherent_associated_types)]
-#![allow(incomplete_features)]
-
-struct Cont<T>(T);
-
-impl<T: Copy> Cont<T> {
- type Out = Vec<T>;
-}
-
-pub fn weird<T: Copy>(x: T) {
- let _: Cont<_>::Out = vec![true];
-}
-
-fn main() {}
diff --git a/tests/ui/associated-inherent-types/bugs/ice-substitution.stderr b/tests/ui/associated-inherent-types/bugs/ice-substitution.stderr
deleted file mode 100644
index 1648cfb..0000000
--- a/tests/ui/associated-inherent-types/bugs/ice-substitution.stderr
+++ /dev/null
@@ -1,6 +0,0 @@
-error: the compiler unexpectedly panicked. this is a bug.
-
-query stack during panic:
-#0 [typeck] type-checking `weird`
-#1 [used_trait_imports] finding used_trait_imports `weird`
-end of query stack
diff --git a/tests/ui/associated-inherent-types/bugs/inference-fail.rs b/tests/ui/associated-inherent-types/bugs/inference-fail.rs
deleted file mode 100644
index a920b41..0000000
--- a/tests/ui/associated-inherent-types/bugs/inference-fail.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// known-bug: unknown
-
-#![feature(inherent_associated_types)]
-#![allow(incomplete_features)]
-
-struct S<T>(T);
-
-impl S<()> {
- type P = i128;
-}
-
-fn main() {
- // We fail to infer `_ == ()` here.
- let _: S<_>::P;
-}
diff --git a/tests/ui/associated-inherent-types/bugs/inference-fail.stderr b/tests/ui/associated-inherent-types/bugs/inference-fail.stderr
deleted file mode 100644
index 425691b..0000000
--- a/tests/ui/associated-inherent-types/bugs/inference-fail.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/inference-fail.rs:14:14
- |
-LL | let _: S<_>::P;
- | ^ cannot infer type
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/associated-inherent-types/bugs/lack-of-regionck.rs b/tests/ui/associated-inherent-types/bugs/lack-of-regionck.rs
deleted file mode 100644
index 632dbf3..0000000
--- a/tests/ui/associated-inherent-types/bugs/lack-of-regionck.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// known-bug: unknown
-// check-pass
-
-// We currently don't region-check inherent associated type projections at all.
-
-#![feature(inherent_associated_types)]
-#![allow(incomplete_features, dead_code)]
-
-struct S<T>(T);
-
-impl S<&'static ()> {
- type T = ();
-}
-
-fn usr<'a>() {
- let _: S::<&'a ()>::T; // this should *fail* but it doesn't!
-}
-
-fn main() {}
diff --git a/tests/ui/associated-inherent-types/bugs/wf-check-skipped.rs b/tests/ui/associated-inherent-types/bugs/wf-check-skipped.rs
new file mode 100644
index 0000000..c7f66e6
--- /dev/null
+++ b/tests/ui/associated-inherent-types/bugs/wf-check-skipped.rs
@@ -0,0 +1,15 @@
+// known-bug: #100041
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// FIXME(inherent_associated_types): This should fail.
+
+struct Foo;
+
+impl Foo {
+ type Bar<T> = ();
+}
+
+fn main() -> Foo::Bar::<Vec<[u32]>> {}
diff --git a/tests/ui/associated-inherent-types/dispatch-on-self-type-0.rs b/tests/ui/associated-inherent-types/dispatch-on-self-type-0.rs
index f846bfa..83be4f4 100644
--- a/tests/ui/associated-inherent-types/dispatch-on-self-type-0.rs
+++ b/tests/ui/associated-inherent-types/dispatch-on-self-type-0.rs
@@ -31,7 +31,7 @@ fn main() {
let _: Select<u8>::Projection = ();
let _: Choose<NonCopy>::Result = ();
- let _: Choose<bool>::Result = vec![true];
+ let _: Choose<&str>::Result = vec!["…"]; // regression test for issue #108957
}
// Test if we use the correct `ParamEnv` when proving obligations.
diff --git a/tests/ui/associated-inherent-types/former-subst-ice.rs b/tests/ui/associated-inherent-types/former-subst-ice.rs
new file mode 100644
index 0000000..48390b9
--- /dev/null
+++ b/tests/ui/associated-inherent-types/former-subst-ice.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Cont<T>(T);
+
+impl<T: Copy> Cont<T> {
+ type Out = Vec<T>;
+}
+
+pub fn weird<T: Copy>(x: T) {
+ let _: Cont<_>::Out = vec![true];
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr
new file mode 100644
index 0000000..464b59c
--- /dev/null
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/generic-associated-types-bad.rs:16:10
+ |
+LL | const _: Ty::Pr<String> = String::new();
+ | ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `Ty::Pr`
+ --> $DIR/generic-associated-types-bad.rs:10:16
+ |
+LL | type Pr<T: Copy> = T;
+ | ^^^^ required by this bound in `Ty::Pr`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr
new file mode 100644
index 0000000..4f371b2
--- /dev/null
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `Vec<()>: Copy` is not satisfied
+ --> $DIR/generic-associated-types-bad.rs:20:12
+ |
+LL | let _: Ty::Pr<Vec<()>>;
+ | ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Vec<()>`
+ |
+note: required by a bound in `Ty::Pr`
+ --> $DIR/generic-associated-types-bad.rs:10:16
+ |
+LL | type Pr<T: Copy> = T;
+ | ^^^^ required by this bound in `Ty::Pr`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr
new file mode 100644
index 0000000..74ec394
--- /dev/null
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr
@@ -0,0 +1,11 @@
+error: lifetime may not live long enough
+ --> $DIR/generic-associated-types-bad.rs:25:12
+ |
+LL | fn user<'a>() {
+ | -- lifetime `'a` defined here
+LL | #[cfg(region)]
+LL | let _: Ty::Static<&'a str> = "";
+ | ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.rs b/tests/ui/associated-inherent-types/generic-associated-types-bad.rs
new file mode 100644
index 0000000..e66392a
--- /dev/null
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.rs
@@ -0,0 +1,26 @@
+// revisions: item local region
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+#[derive(Clone, Copy)]
+pub enum Ty {}
+
+impl Ty {
+ type Pr<T: Copy> = T;
+
+ type Static<Q: 'static> = Q;
+}
+
+#[cfg(item)]
+const _: Ty::Pr<String> = String::new(); //[item]~ the trait bound `String: Copy` is not satisfied
+
+fn main() {
+ #[cfg(local)]
+ let _: Ty::Pr<Vec<()>>; //[local]~ ERROR the trait bound `Vec<()>: Copy` is not satisfied
+}
+
+fn user<'a>() {
+ #[cfg(region)]
+ let _: Ty::Static<&'a str> = ""; //[region]~ ERROR lifetime may not live long enough
+}
diff --git a/tests/ui/associated-inherent-types/inference-fail.rs b/tests/ui/associated-inherent-types/inference-fail.rs
new file mode 100644
index 0000000..939a4ff
--- /dev/null
+++ b/tests/ui/associated-inherent-types/inference-fail.rs
@@ -0,0 +1,11 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct S<T>(T);
+
+impl<T> S<T> { type P = (); }
+
+fn main() {
+ // There is no way to infer this type.
+ let _: S<_>::P = (); //~ ERROR type annotations needed
+}
diff --git a/tests/ui/associated-inherent-types/inference-fail.stderr b/tests/ui/associated-inherent-types/inference-fail.stderr
new file mode 100644
index 0000000..f29144e
--- /dev/null
+++ b/tests/ui/associated-inherent-types/inference-fail.stderr
@@ -0,0 +1,9 @@
+error[E0282]: type annotations needed
+ --> $DIR/inference-fail.rs:10:12
+ |
+LL | let _: S<_>::P = ();
+ | ^^^^^^^ cannot infer type for type parameter `T`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/associated-inherent-types/inference.rs b/tests/ui/associated-inherent-types/inference.rs
new file mode 100644
index 0000000..3817921
--- /dev/null
+++ b/tests/ui/associated-inherent-types/inference.rs
@@ -0,0 +1,39 @@
+// Testing inference capabilities.
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+use std::convert::identity;
+
+struct Container<T>(T);
+
+impl Container<u32> {
+ type Sink = ();
+}
+
+impl<Any> Container<Any> {
+ type Thing = Any;
+}
+
+impl<T> Container<(T, ())> {
+ type Output = ((), Wrapped<T>);
+}
+
+fn main() {
+ // Inferred via the Self type of the impl.
+ let _: Container<_>::Sink;
+
+ // Inferred via the RHS:
+
+ let _: Container<_>::Thing = 0;
+
+ let _: Container<Wrapped<_>>::Thing = Wrapped(false);
+
+ let _: Container<_>::Output = (drop(1), Wrapped("..."));
+
+ let binding: Container<_>::Thing = Default::default(); // unsolved at this point
+ identity::<String>(binding); // constrained and solved here
+}
+
+struct Wrapped<T>(T);
diff --git a/tests/ui/associated-inherent-types/issue-109768.rs b/tests/ui/associated-inherent-types/issue-109768.rs
new file mode 100644
index 0000000..a3ae2e2
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109768.rs
@@ -0,0 +1,12 @@
+// incremental
+
+struct Wrapper<T>(T);
+
+struct Local<T, U>(T, U);
+
+impl<T> Local { //~ ERROR missing generics for struct `Local`
+ type AssocType3 = T; //~ ERROR inherent associated types are unstable
+
+ const WRAPPED_ASSOC_3: Wrapper<Self::AssocType3> = Wrapper();
+}
+//~^ ERROR `main` function not found
diff --git a/tests/ui/associated-inherent-types/issue-109768.stderr b/tests/ui/associated-inherent-types/issue-109768.stderr
new file mode 100644
index 0000000..97706d4
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109768.stderr
@@ -0,0 +1,35 @@
+error[E0601]: `main` function not found in crate `issue_109768`
+ --> $DIR/issue-109768.rs:11:2
+ |
+LL | }
+ | ^ consider adding a `main` function to `$DIR/issue-109768.rs`
+
+error[E0107]: missing generics for struct `Local`
+ --> $DIR/issue-109768.rs:7:9
+ |
+LL | impl<T> Local {
+ | ^^^^^ expected 2 generic arguments
+ |
+note: struct defined here, with 2 generic parameters: `T`, `U`
+ --> $DIR/issue-109768.rs:5:8
+ |
+LL | struct Local<T, U>(T, U);
+ | ^^^^^ - -
+help: add missing generic arguments
+ |
+LL | impl<T> Local<T, U> {
+ | ++++++
+
+error[E0658]: inherent associated types are unstable
+ --> $DIR/issue-109768.rs:8:5
+ |
+LL | type AssocType3 = T;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
+ = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0107, E0601, E0658.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/associated-inherent-types/issue-109789.rs b/tests/ui/associated-inherent-types/issue-109789.rs
new file mode 100644
index 0000000..0b5ba7d
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109789.rs
@@ -0,0 +1,22 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Foo<T>(T);
+
+impl Foo<fn(&'static ())> {
+ type Assoc = u32;
+}
+
+trait Other {}
+impl Other for u32 {}
+
+// FIXME(inherent_associated_types): Avoid emitting two diagnostics (they only differ in span).
+// FIXME(inherent_associated_types): Enhancement: Spruce up the diagnostic by saying something like
+// "implementation is not general enough" as is done for traits via
+// `try_report_trait_placeholder_mismatch`.
+
+fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}
+//~^ ERROR mismatched types
+//~| ERROR mismatched types
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-109789.stderr b/tests/ui/associated-inherent-types/issue-109789.stderr
new file mode 100644
index 0000000..7af3382
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109789.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-109789.rs:18:1
+ |
+LL | fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected struct `Foo<fn(&'static ())>`
+ found struct `Foo<for<'a> fn(&'a ())>`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109789.rs:18:11
+ |
+LL | fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected struct `Foo<fn(&'static ())>`
+ found struct `Foo<for<'a> fn(&'a ())>`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/associated-inherent-types/issue-109790.rs b/tests/ui/associated-inherent-types/issue-109790.rs
new file mode 100644
index 0000000..b2be19a
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109790.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Foo<T>(T);
+
+impl<'a> Foo<fn(&'a ())> {
+ type Assoc = &'a ();
+}
+
+trait Other {}
+impl Other for u32 {}
+
+fn bar(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/late-bound-regions.rs b/tests/ui/associated-inherent-types/late-bound-regions.rs
new file mode 100644
index 0000000..488a2cd
--- /dev/null
+++ b/tests/ui/associated-inherent-types/late-bound-regions.rs
@@ -0,0 +1,25 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// Test if we correctly normalize `S<'a>::P` with respect to late-bound regions.
+
+type Function = for<'a> fn(&'a i32) -> S<'a>::P;
+
+struct S<'a>(&'a ());
+
+trait Inter {
+ type P;
+}
+
+impl<'a> S<'a> {
+ type P = &'a i32;
+}
+
+fn ret_ref_local<'e>() -> &'e i32 {
+ let f: Function = |x| x;
+
+ let local = 0;
+ f(&local) //~ ERROR cannot return value referencing local variable `local`
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/late-bound-regions.stderr b/tests/ui/associated-inherent-types/late-bound-regions.stderr
new file mode 100644
index 0000000..4706fcc
--- /dev/null
+++ b/tests/ui/associated-inherent-types/late-bound-regions.stderr
@@ -0,0 +1,12 @@
+error[E0515]: cannot return value referencing local variable `local`
+ --> $DIR/late-bound-regions.rs:22:5
+ |
+LL | f(&local)
+ | ^^------^
+ | | |
+ | | `local` is borrowed here
+ | returns a value referencing data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/associated-inherent-types/normalization-overflow.rs b/tests/ui/associated-inherent-types/normalization-overflow.rs
new file mode 100644
index 0000000..4228238
--- /dev/null
+++ b/tests/ui/associated-inherent-types/normalization-overflow.rs
@@ -0,0 +1,12 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// FIXME(fmease): I'd prefer to report a cycle error here instead of an overflow one.
+
+struct T;
+
+impl T {
+ type This = Self::This; //~ ERROR overflow evaluating associated type `T::This`
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/normalization-overflow.stderr b/tests/ui/associated-inherent-types/normalization-overflow.stderr
new file mode 100644
index 0000000..16bb642
--- /dev/null
+++ b/tests/ui/associated-inherent-types/normalization-overflow.stderr
@@ -0,0 +1,8 @@
+error: overflow evaluating associated type `T::This`
+ --> $DIR/normalization-overflow.rs:9:17
+ |
+LL | type This = Self::This;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/associated-inherent-types/private-in-public.rs b/tests/ui/associated-inherent-types/private-in-public.rs
new file mode 100644
index 0000000..a4b3725
--- /dev/null
+++ b/tests/ui/associated-inherent-types/private-in-public.rs
@@ -0,0 +1,26 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+#![crate_type = "lib"]
+
+#![deny(private_in_public)]
+
+pub type PubAlias0 = PubTy::PrivAssocTy;
+//~^ ERROR private associated type `PubTy::PrivAssocTy` in public interface (error E0446)
+//~| WARNING this was previously accepted
+pub type PubAlias1 = PrivTy::PubAssocTy;
+//~^ ERROR private type `PrivTy` in public interface (error E0446)
+//~| WARNING this was previously accepted
+pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
+//~^ ERROR private type `PrivTy` in public interface (error E0446)
+//~| WARNING this was previously accepted
+
+pub struct PubTy;
+impl PubTy {
+ type PrivAssocTy = ();
+ pub type PubAssocTy<T> = T;
+}
+
+struct PrivTy;
+impl PrivTy {
+ pub type PubAssocTy = ();
+}
diff --git a/tests/ui/associated-inherent-types/private-in-public.stderr b/tests/ui/associated-inherent-types/private-in-public.stderr
new file mode 100644
index 0000000..f0a64e9
--- /dev/null
+++ b/tests/ui/associated-inherent-types/private-in-public.stderr
@@ -0,0 +1,34 @@
+error: private associated type `PubTy::PrivAssocTy` in public interface (error E0446)
+ --> $DIR/private-in-public.rs:7:1
+ |
+LL | pub type PubAlias0 = PubTy::PrivAssocTy;
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+note: the lint level is defined here
+ --> $DIR/private-in-public.rs:5:9
+ |
+LL | #![deny(private_in_public)]
+ | ^^^^^^^^^^^^^^^^^
+
+error: private type `PrivTy` in public interface (error E0446)
+ --> $DIR/private-in-public.rs:10:1
+ |
+LL | pub type PubAlias1 = PrivTy::PubAssocTy;
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+
+error: private type `PrivTy` in public interface (error E0446)
+ --> $DIR/private-in-public.rs:13:1
+ |
+LL | pub type PubAlias2 = PubTy::PubAssocTy<PrivTy>;
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/associated-inherent-types/regionck-0.rs b/tests/ui/associated-inherent-types/regionck-0.rs
new file mode 100644
index 0000000..7c94539
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-0.rs
@@ -0,0 +1,14 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct S<T>(T);
+
+impl S<&'static ()> {
+ type T = ();
+}
+
+fn user<'a>() {
+ let _: S::<&'a ()>::T; //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/regionck-0.stderr b/tests/ui/associated-inherent-types/regionck-0.stderr
new file mode 100644
index 0000000..3a438ee
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-0.stderr
@@ -0,0 +1,10 @@
+error: lifetime may not live long enough
+ --> $DIR/regionck-0.rs:11:12
+ |
+LL | fn user<'a>() {
+ | -- lifetime `'a` defined here
+LL | let _: S::<&'a ()>::T;
+ | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/associated-inherent-types/regionck-1.rs b/tests/ui/associated-inherent-types/regionck-1.rs
new file mode 100644
index 0000000..ec663cd
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-1.rs
@@ -0,0 +1,13 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct U;
+
+impl U {
+ // Don't imply any bounds here.
+
+ type NoTyOutliv<'a, T> = &'a T; //~ ERROR the parameter type `T` may not live long enough
+ type NoReOutliv<'a, 'b> = &'a &'b (); //~ ERROR reference has a longer lifetime than the data it references
+}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/regionck-1.stderr b/tests/ui/associated-inherent-types/regionck-1.stderr
new file mode 100644
index 0000000..b17d89c
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-1.stderr
@@ -0,0 +1,29 @@
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/regionck-1.rs:9:30
+ |
+LL | type NoTyOutliv<'a, T> = &'a T;
+ | ^^^^^- help: consider adding a where clause: `where T: 'a`
+ | |
+ | ...so that the reference type `&'a T` does not outlive the data it points at
+
+error[E0491]: in type `&'a &'b ()`, reference has a longer lifetime than the data it references
+ --> $DIR/regionck-1.rs:10:31
+ |
+LL | type NoReOutliv<'a, 'b> = &'a &'b ();
+ | ^^^^^^^^^^
+ |
+note: the pointer is valid for the lifetime `'a` as defined here
+ --> $DIR/regionck-1.rs:10:21
+ |
+LL | type NoReOutliv<'a, 'b> = &'a &'b ();
+ | ^^
+note: but the referenced data is only valid for the lifetime `'b` as defined here
+ --> $DIR/regionck-1.rs:10:25
+ |
+LL | type NoReOutliv<'a, 'b> = &'a &'b ();
+ | ^^
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
diff --git a/tests/ui/associated-inherent-types/regionck-2.rs b/tests/ui/associated-inherent-types/regionck-2.rs
new file mode 100644
index 0000000..7a0b8b0
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-2.rs
@@ -0,0 +1,14 @@
+// Regression test for issue #109299.
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Lexer<'d>(&'d ());
+
+impl Lexer<'static> {
+ type Cursor = ();
+}
+
+fn test(_: Lexer::Cursor) {} //~ ERROR mismatched types
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/regionck-2.stderr b/tests/ui/associated-inherent-types/regionck-2.stderr
new file mode 100644
index 0000000..b0a4ed3
--- /dev/null
+++ b/tests/ui/associated-inherent-types/regionck-2.stderr
@@ -0,0 +1,18 @@
+error[E0308]: mismatched types
+ --> $DIR/regionck-2.rs:12:12
+ |
+LL | fn test(_: Lexer::Cursor) {}
+ | ^^^^^^^^^^^^^ lifetime mismatch
+ |
+ = note: expected struct `Lexer<'static>`
+ found struct `Lexer<'_>`
+note: the anonymous lifetime defined here...
+ --> $DIR/regionck-2.rs:12:12
+ |
+LL | fn test(_: Lexer::Cursor) {}
+ | ^^^^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/associated-inherent-types/type-alias-bounds-are-enforced.rs b/tests/ui/associated-inherent-types/type-alias-bounds-are-enforced.rs
new file mode 100644
index 0000000..b32b428
--- /dev/null
+++ b/tests/ui/associated-inherent-types/type-alias-bounds-are-enforced.rs
@@ -0,0 +1,26 @@
+// check-pass
+// compile-flags: --crate-type=lib
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// Bounds on the self type play a major role in the resolution of inherent associated types (*).
+// As a result of that, if a type alias contains any then its bounds have to be respected and the
+// lint `type_alias_bounds` should not fire.
+//
+// FIXME(inherent_associated_types): In the current implementation that is. We might move the
+// selection phase of IATs from hir_typeck to trait_selection resulting in us not requiring the
+// ParamEnv that early allowing us to ignore bounds on type aliases again.
+// Triage this before stabilization.
+
+#![deny(type_alias_bounds)]
+
+pub type Alias<T: Bound> = (Source<T>::Assoc,);
+
+
+pub struct Source<T>(T);
+pub trait Bound {}
+
+impl<T: Bound> Source<T> {
+ pub type Assoc = ();
+}
diff --git a/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.rs b/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.rs
new file mode 100644
index 0000000..d081c4d
--- /dev/null
+++ b/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.rs
@@ -0,0 +1,12 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct S<T>(T);
+
+impl<T: Copy> S<T> {
+ type T = T;
+}
+
+fn main() {
+ let _: S<_>::T = String::new(); //~ ERROR the trait bound `String: Copy` is not satisfied
+}
diff --git a/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.stderr b/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.stderr
new file mode 100644
index 0000000..ecf30f4
--- /dev/null
+++ b/tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/unsatisfied-bounds-inferred-type.rs:11:12
+ |
+LL | let _: S<_>::T = String::new();
+ | ^^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `S<T>::T`
+ --> $DIR/unsatisfied-bounds-inferred-type.rs:6:9
+ |
+LL | impl<T: Copy> S<T> {
+ | ^^^^ required by this bound in `S<T>::T`
+LL | type T = T;
+ | - required by a bound in this associated type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.rs b/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.rs
new file mode 100644
index 0000000..97bd2c4
--- /dev/null
+++ b/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.rs
@@ -0,0 +1,14 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct S<T>(T);
+
+impl<T> S<T> {
+ type X = ()
+ where
+ T: Copy;
+}
+
+fn main() {
+ let _: S::<String>::X; //~ ERROR the trait bound `String: Copy` is not satisfied
+}
diff --git a/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.stderr b/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.stderr
new file mode 100644
index 0000000..d4968cd
--- /dev/null
+++ b/tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/unsatisfied-bounds-where-clause-on-assoc-ty.rs:13:12
+ |
+LL | let _: S::<String>::X;
+ | ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `S<T>::X`
+ --> $DIR/unsatisfied-bounds-where-clause-on-assoc-ty.rs:9:12
+ |
+LL | type X = ()
+ | - required by a bound in this associated type
+LL | where
+LL | T: Copy;
+ | ^^^^ required by this bound in `S<T>::X`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/async-await/issues/issue-102206.stderr b/tests/ui/async-await/issues/issue-102206.stderr
index 750b7a8..cd84505 100644
--- a/tests/ui/async-await/issues/issue-102206.stderr
+++ b/tests/ui/async-await/issues/issue-102206.stderr
@@ -2,14 +2,16 @@
--> $DIR/issue-102206.rs:6:27
|
LL | std::mem::size_of_val(foo());
- | --------------------- ^^^^^
- | | |
- | | expected `&_`, found future
- | | help: consider borrowing here: `&foo()`
+ | --------------------- ^^^^^ expected `&_`, found future
+ | |
| arguments to this function are incorrect
|
note: function defined here
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+help: consider borrowing here
+ |
+LL | std::mem::size_of_val(&foo());
+ | +
error: aborting due to previous error
diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
index 4cc1d82..cfc86ff 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
+++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let x = &mut 0;
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
--> $DIR/borrow-raw-address-of-deref-mutability.rs:14:13
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable pointer
|
LL | let x = &mut 0 as *const i32;
- | ~~~~~~
+ | +++
error: aborting due to 2 previous errors
diff --git a/tests/ui/borrowck/borrowck-access-permissions.stderr b/tests/ui/borrowck/borrowck-access-permissions.stderr
index 26f3e2b..c161e2d 100644
--- a/tests/ui/borrowck/borrowck-access-permissions.stderr
+++ b/tests/ui/borrowck/borrowck-access-permissions.stderr
@@ -35,7 +35,7 @@
help: consider changing this to be a mutable reference
|
LL | let ref_x = &mut x;
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
--> $DIR/borrowck-access-permissions.rs:39:23
@@ -46,7 +46,7 @@
help: consider changing this to be a mutable pointer
|
LL | let ptr_x : *const _ = &mut x;
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-access-permissions.rs:48:18
@@ -57,7 +57,7 @@
help: consider changing this to be a mutable reference
|
LL | let foo_ref = &mut foo;
- | ~~~~~~~~
+ | +++
error: aborting due to 6 previous errors
diff --git a/tests/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr b/tests/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr
index cbacc87..cf0c412 100644
--- a/tests/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr
+++ b/tests/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr
@@ -6,8 +6,8 @@
|
help: consider changing this to be a mutable reference
|
-LL | fn a(s: &mut S<'_>) {
- | ~~~~~~~~~~
+LL | fn a(s: &mut S) {
+ | +++
error[E0594]: cannot assign to `*s.pointer`, which is behind a `&` reference
--> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:17:5
@@ -17,8 +17,8 @@
|
help: consider changing this to be a mutable reference
|
-LL | fn c(s: &mut &mut S<'_>) {
- | ~~~~~~~~~~~~~~~
+LL | fn c(s: &mut &mut S) {
+ | +++
error: aborting due to 2 previous errors
diff --git a/tests/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr b/tests/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr
index dd0817f..59ef61b 100644
--- a/tests/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr
+++ b/tests/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr
@@ -27,8 +27,8 @@
|
help: consider changing this to be a mutable reference
|
-LL | fn foo4(t0: &mut &mut isize) {
- | ~~~~~~~~~~~~~~~
+LL | fn foo4(t0: &mut &mut isize) {
+ | +++
error: aborting due to 3 previous errors
diff --git a/tests/ui/borrowck/borrowck-issue-14498.stderr b/tests/ui/borrowck/borrowck-issue-14498.stderr
index 374c5ee..12d67d5 100644
--- a/tests/ui/borrowck/borrowck-issue-14498.stderr
+++ b/tests/ui/borrowck/borrowck-issue-14498.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let p = &mut y;
- | ~~~~~~
+ | +++
error[E0506]: cannot assign to `**y` because it is borrowed
--> $DIR/borrowck-issue-14498.rs:25:5
diff --git a/tests/ui/borrowck/borrowck-reborrow-from-mut.stderr b/tests/ui/borrowck/borrowck-reborrow-from-mut.stderr
index d9590e4..fb3db4e 100644
--- a/tests/ui/borrowck/borrowck-reborrow-from-mut.stderr
+++ b/tests/ui/borrowck/borrowck-reborrow-from-mut.stderr
@@ -111,7 +111,7 @@
help: consider changing this to be a mutable reference
|
LL | fn borrow_mut_from_imm(foo: &mut Foo) {
- | ~~~~~~~~
+ | +++
error: aborting due to 11 previous errors
diff --git a/tests/ui/borrowck/issue-85765.stderr b/tests/ui/borrowck/issue-85765.stderr
index b4bb128..2985a65 100644
--- a/tests/ui/borrowck/issue-85765.stderr
+++ b/tests/ui/borrowck/issue-85765.stderr
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | let r = &mut mutvar;
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to `*x`, which is behind a `&` reference
--> $DIR/issue-85765.rs:19:5
diff --git a/tests/ui/borrowck/mutability-errors.stderr b/tests/ui/borrowck/mutability-errors.stderr
index d7c6027..b39e57d 100644
--- a/tests/ui/borrowck/mutability-errors.stderr
+++ b/tests/ui/borrowck/mutability-errors.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn named_ref(x: &mut (i32,)) {
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to `x.0`, which is behind a `&` reference
--> $DIR/mutability-errors.rs:10:5
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | fn named_ref(x: &mut (i32,)) {
- | ~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/mutability-errors.rs:11:5
@@ -29,7 +29,7 @@
help: consider changing this to be a mutable reference
|
LL | fn named_ref(x: &mut (i32,)) {
- | ~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `&` reference
--> $DIR/mutability-errors.rs:12:5
@@ -40,7 +40,7 @@
help: consider changing this to be a mutable reference
|
LL | fn named_ref(x: &mut (i32,)) {
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/mutability-errors.rs:16:5
@@ -74,8 +74,8 @@
|
help: consider changing this to be a mutable pointer
|
-LL | unsafe fn named_ptr(x: *mut (i32,)) {
- | ~~~~~~~~~~~
+LL | unsafe fn named_ptr(x: *mut const (i32,)) {
+ | +++
error[E0594]: cannot assign to `x.0`, which is behind a `*const` pointer
--> $DIR/mutability-errors.rs:24:5
@@ -85,8 +85,8 @@
|
help: consider changing this to be a mutable pointer
|
-LL | unsafe fn named_ptr(x: *mut (i32,)) {
- | ~~~~~~~~~~~
+LL | unsafe fn named_ptr(x: *mut const (i32,)) {
+ | +++
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
--> $DIR/mutability-errors.rs:25:5
@@ -96,8 +96,8 @@
|
help: consider changing this to be a mutable pointer
|
-LL | unsafe fn named_ptr(x: *mut (i32,)) {
- | ~~~~~~~~~~~
+LL | unsafe fn named_ptr(x: *mut const (i32,)) {
+ | +++
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `*const` pointer
--> $DIR/mutability-errors.rs:26:5
@@ -107,8 +107,8 @@
|
help: consider changing this to be a mutable pointer
|
-LL | unsafe fn named_ptr(x: *mut (i32,)) {
- | ~~~~~~~~~~~
+LL | unsafe fn named_ptr(x: *mut const (i32,)) {
+ | +++
error[E0594]: cannot assign to data in a `*const` pointer
--> $DIR/mutability-errors.rs:30:5
diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr b/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr
index 95f36fc..1904faa 100644
--- a/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr
+++ b/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr
@@ -10,7 +10,7 @@
help: consider changing this to be a mutable reference
|
LL | let ref_mref_x = &mut mref_x;
- | ~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference
--> $DIR/mut_ref.rs:26:13
diff --git a/tests/ui/coercion/coercion-slice.stderr b/tests/ui/coercion/coercion-slice.stderr
index c7b856a..17bbca7 100644
--- a/tests/ui/coercion/coercion-slice.stderr
+++ b/tests/ui/coercion/coercion-slice.stderr
@@ -2,11 +2,14 @@
--> $DIR/coercion-slice.rs:4:21
|
LL | let _: &[i32] = [0];
- | ------ ^^^
- | | |
- | | expected `&[i32]`, found `[{integer}; 1]`
- | | help: consider borrowing here: `&[0]`
+ | ------ ^^^ expected `&[i32]`, found `[{integer}; 1]`
+ | |
| expected due to this
+ |
+help: consider borrowing here
+ |
+LL | let _: &[i32] = &[0];
+ | +
error: aborting due to previous error
diff --git a/tests/ui/const-generics/issues/issue-105821.rs b/tests/ui/const-generics/issues/issue-105821.rs
index cba2e22..6cfabb6 100644
--- a/tests/ui/const-generics/issues/issue-105821.rs
+++ b/tests/ui/const-generics/issues/issue-105821.rs
@@ -1,7 +1,7 @@
// check-pass
#![allow(incomplete_features)]
-#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
+#![feature(adt_const_params, generic_const_exprs)]
#![allow(dead_code)]
const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1]
diff --git a/tests/ui/const-ptr/out_of_bounds_read.rs b/tests/ui/const-ptr/out_of_bounds_read.rs
index 9dd6691..a371aa9 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.rs
+++ b/tests/ui/const-ptr/out_of_bounds_read.rs
@@ -1,7 +1,5 @@
// error-pattern: evaluation of constant value failed
-#![feature(const_ptr_read)]
-
fn main() {
use std::ptr;
diff --git a/tests/ui/const-ptr/out_of_bounds_read.stderr b/tests/ui/const-ptr/out_of_bounds_read.stderr
index 89536f5..c5c0a1c 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.stderr
+++ b/tests/ui/const-ptr/out_of_bounds_read.stderr
@@ -6,7 +6,7 @@
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
note: inside `_READ`
- --> $DIR/out_of_bounds_read.rs:12:33
+ --> $DIR/out_of_bounds_read.rs:10:33
|
LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@
note: inside `ptr::const_ptr::<impl *const u32>::read`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `_CONST_READ`
- --> $DIR/out_of_bounds_read.rs:13:39
+ --> $DIR/out_of_bounds_read.rs:11:39
|
LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
| ^^^^^^^^^^^^^^^^^^^
@@ -36,7 +36,7 @@
note: inside `ptr::mut_ptr::<impl *mut u32>::read`
--> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
note: inside `_MUT_READ`
- --> $DIR/out_of_bounds_read.rs:14:37
+ --> $DIR/out_of_bounds_read.rs:12:37
|
LL | const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.rs b/tests/ui/consts/const-eval/ub-ref-ptr.rs
index 369e451..a5d2ea0 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.rs
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.rs
@@ -3,7 +3,6 @@
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![allow(invalid_value)]
-#![feature(const_ptr_read)]
use std::mem;
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.stderr b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
index 080568b..1d19dff 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:16:1
+ --> $DIR/ub-ref-ptr.rs:15:1
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -10,7 +10,7 @@
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:20:1
+ --> $DIR/ub-ref-ptr.rs:19:1
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
@@ -21,7 +21,7 @@
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:24:1
+ --> $DIR/ub-ref-ptr.rs:23:1
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -32,7 +32,7 @@
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:27:1
+ --> $DIR/ub-ref-ptr.rs:26:1
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
@@ -43,7 +43,7 @@
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-ref-ptr.rs:34:1
+ --> $DIR/ub-ref-ptr.rs:33:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -52,7 +52,7 @@
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-ref-ptr.rs:37:39
+ --> $DIR/ub-ref-ptr.rs:36:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -61,13 +61,13 @@
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
note: erroneous constant used
- --> $DIR/ub-ref-ptr.rs:37:38
+ --> $DIR/ub-ref-ptr.rs:36:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-ref-ptr.rs:40:86
+ --> $DIR/ub-ref-ptr.rs:39:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -76,13 +76,13 @@
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
note: erroneous constant used
- --> $DIR/ub-ref-ptr.rs:40:85
+ --> $DIR/ub-ref-ptr.rs:39:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
| ^^^^^^^^^^^^^^^^^^^^^
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:43:1
+ --> $DIR/ub-ref-ptr.rs:42:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
@@ -93,7 +93,7 @@
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:46:1
+ --> $DIR/ub-ref-ptr.rs:45:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
@@ -104,13 +104,13 @@
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-ref-ptr.rs:49:41
+ --> $DIR/ub-ref-ptr.rs:48:41
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:53:1
+ --> $DIR/ub-ref-ptr.rs:52:1
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -121,13 +121,13 @@
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-ref-ptr.rs:55:38
+ --> $DIR/ub-ref-ptr.rs:54:38
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:58:1
+ --> $DIR/ub-ref-ptr.rs:57:1
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -138,7 +138,7 @@
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:60:1
+ --> $DIR/ub-ref-ptr.rs:59:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
@@ -158,7 +158,7 @@
note: inside `ptr::const_ptr::<impl *const u32>::read`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `UNALIGNED_READ`
- --> $DIR/ub-ref-ptr.rs:67:5
+ --> $DIR/ub-ref-ptr.rs:66:5
|
LL | ptr.read();
| ^^^^^^^^^^
diff --git a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs
index e2f8149..6a3c93c 100644
--- a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs
+++ b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs
@@ -1,7 +1,6 @@
// revisions: no_flag with_flag
// [no_flag] check-pass
// [with_flag] compile-flags: -Zextra-const-ub-checks
-#![feature(const_ptr_read)]
use std::mem::transmute;
diff --git a/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr b/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr
index b2a5fd9..3970bae 100644
--- a/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr
+++ b/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr
@@ -1,11 +1,11 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:9:20
+ --> $DIR/detect-extra-ub.rs:8:20
|
LL | let _x: bool = transmute(3u8);
| ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:15:21
+ --> $DIR/detect-extra-ub.rs:14:21
|
LL | let _x: usize = transmute(&3u8);
| ^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -14,7 +14,7 @@
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:21:30
+ --> $DIR/detect-extra-ub.rs:20:30
|
LL | let _x: (usize, usize) = transmute(x);
| ^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -23,7 +23,7 @@
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:26:20
+ --> $DIR/detect-extra-ub.rs:25:20
|
LL | let _x: &u32 = transmute(&[0u8; 4]);
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1)
diff --git a/tests/ui/consts/issue-miri-1910.rs b/tests/ui/consts/issue-miri-1910.rs
index 29e0ea9..3798332 100644
--- a/tests/ui/consts/issue-miri-1910.rs
+++ b/tests/ui/consts/issue-miri-1910.rs
@@ -1,6 +1,5 @@
// error-pattern unable to turn pointer into raw bytes
// normalize-stderr-test: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC"
-#![feature(const_ptr_read)]
const C: () = unsafe {
let foo = Some(&42 as *const i32);
diff --git a/tests/ui/consts/issue-miri-1910.stderr b/tests/ui/consts/issue-miri-1910.stderr
index a10eea9..fb758d4 100644
--- a/tests/ui/consts/issue-miri-1910.stderr
+++ b/tests/ui/consts/issue-miri-1910.stderr
@@ -10,7 +10,7 @@
note: inside `ptr::const_ptr::<impl *const u8>::read`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `C`
- --> $DIR/issue-miri-1910.rs:8:5
+ --> $DIR/issue-miri-1910.rs:7:5
|
LL | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/did_you_mean/issue-38147-4.stderr b/tests/ui/did_you_mean/issue-38147-4.stderr
index d333998..43647fa 100644
--- a/tests/ui/did_you_mean/issue-38147-4.stderr
+++ b/tests/ui/did_you_mean/issue-38147-4.stderr
@@ -6,8 +6,8 @@
|
help: consider changing this to be a mutable reference
|
-LL | fn f(x: usize, f: &mut Foo<'_>) {
- | ~~~~~~~~~~~~
+LL | fn f(x: usize, f: &mut Foo) {
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/did_you_mean/issue-39544.stderr b/tests/ui/did_you_mean/issue-39544.stderr
index 8dc0512..8ccb4cb 100644
--- a/tests/ui/did_you_mean/issue-39544.stderr
+++ b/tests/ui/did_you_mean/issue-39544.stderr
@@ -40,7 +40,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo1(&self, other: &mut Z) {
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:25:17
@@ -62,7 +62,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo2<'a>(&'a self, other: &mut Z) {
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:30:17
@@ -73,7 +73,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo3<'a>(self: &'a mut Self, other: &Z) {
- | ~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:31:17
@@ -84,7 +84,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo3<'a>(self: &'a Self, other: &mut Z) {
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:35:17
@@ -95,7 +95,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo4(other: &mut Z) {
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
--> $DIR/issue-39544.rs:41:13
@@ -117,7 +117,7 @@
help: consider changing this to be a mutable reference
|
LL | pub fn with_arg(z: Z, w: &mut Z) {
- | ~~~~~~
+ | +++
error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference
--> $DIR/issue-39544.rs:48:5
diff --git a/tests/ui/did_you_mean/issue-40823.stderr b/tests/ui/did_you_mean/issue-40823.stderr
index aadd698..ba94a57 100644
--- a/tests/ui/did_you_mean/issue-40823.stderr
+++ b/tests/ui/did_you_mean/issue-40823.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let mut buf = &mut [1, 2, 3, 4];
- | ~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/error-codes/E0389.stderr b/tests/ui/error-codes/E0389.stderr
index 51c4c92..e400185 100644
--- a/tests/ui/error-codes/E0389.stderr
+++ b/tests/ui/error-codes/E0389.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let fancy_ref = &mut (&mut fancy);
- | ~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/feature-gates/feature-gate-builtin_syntax.rs b/tests/ui/feature-gates/feature-gate-builtin_syntax.rs
new file mode 100644
index 0000000..832bb5a
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-builtin_syntax.rs
@@ -0,0 +1,7 @@
+struct Foo {
+ v: u8,
+ w: u8,
+}
+fn main() {
+ builtin # offset_of(Foo, v); //~ ERROR `builtin #` syntax is unstable
+}
diff --git a/tests/ui/feature-gates/feature-gate-builtin_syntax.stderr b/tests/ui/feature-gates/feature-gate-builtin_syntax.stderr
new file mode 100644
index 0000000..3bc7848
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-builtin_syntax.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `builtin #` syntax is unstable
+ --> $DIR/feature-gate-builtin_syntax.rs:6:15
+ |
+LL | builtin # offset_of(Foo, v);
+ | ^^^^^^^^^
+ |
+ = note: see issue #110680 <https://github.com/rust-lang/rust/issues/110680> for more information
+ = help: add `#![feature(builtin_syntax)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/inference/deref-suggestion.stderr b/tests/ui/inference/deref-suggestion.stderr
index 6f5aaca..c58aab4 100644
--- a/tests/ui/inference/deref-suggestion.stderr
+++ b/tests/ui/inference/deref-suggestion.stderr
@@ -98,19 +98,23 @@
--> $DIR/deref-suggestion.rs:40:17
|
LL | let s = S { u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `u: &u`
+ | ^ expected `&u32`, found integer
+ |
+help: consider borrowing here
+ |
+LL | let s = S { u: &u };
+ | ++++
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:42:20
|
LL | let s = S { u: u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `&u`
+ | ^ expected `&u32`, found integer
+ |
+help: consider borrowing here
+ |
+LL | let s = S { u: &u };
+ | +
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:45:17
diff --git a/tests/ui/issues/issue-11374.stderr b/tests/ui/issues/issue-11374.stderr
index 6e1fb15..879dc5b 100644
--- a/tests/ui/issues/issue-11374.stderr
+++ b/tests/ui/issues/issue-11374.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-11374.rs:26:15
|
LL | c.read_to(v);
- | ------- ^
- | | |
- | | expected `&mut [u8]`, found `Vec<_>`
- | | help: consider mutably borrowing here: `&mut v`
+ | ------- ^ expected `&mut [u8]`, found `Vec<_>`
+ | |
| arguments to this method are incorrect
|
= note: expected mutable reference `&mut [u8]`
@@ -15,6 +13,10 @@
|
LL | pub fn read_to(&mut self, vec: &mut [u8]) {
| ^^^^^^^ --------------
+help: consider mutably borrowing here
+ |
+LL | c.read_to(&mut v);
+ | ++++
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-17033.stderr b/tests/ui/issues/issue-17033.stderr
index f26bee5..3419c07 100644
--- a/tests/ui/issues/issue-17033.stderr
+++ b/tests/ui/issues/issue-17033.stderr
@@ -2,11 +2,14 @@
--> $DIR/issue-17033.rs:2:10
|
LL | (*p)(())
- | ---- ^^
- | | |
- | | expected `&mut ()`, found `()`
- | | help: consider mutably borrowing here: `&mut ()`
+ | ---- ^^ expected `&mut ()`, found `()`
+ | |
| arguments to this function are incorrect
+ |
+help: consider mutably borrowing here
+ |
+LL | (*p)(&mut ())
+ | ++++
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-18819.stderr b/tests/ui/issues/issue-18819.stderr
index 1fc974b..40098f9 100644
--- a/tests/ui/issues/issue-18819.stderr
+++ b/tests/ui/issues/issue-18819.stderr
@@ -19,7 +19,7 @@
help: consider borrowing here
|
LL | print_x(&X);
- | ~~
+ | +
help: provide the argument
|
LL | print_x(/* &dyn Foo<Item = bool> */, /* &str */);
diff --git a/tests/ui/issues/issue-46302.stderr b/tests/ui/issues/issue-46302.stderr
index a6f97c3..6e12603 100644
--- a/tests/ui/issues/issue-46302.stderr
+++ b/tests/ui/issues/issue-46302.stderr
@@ -2,10 +2,12 @@
--> $DIR/issue-46302.rs:3:27
|
LL | let u: &str = if true { s[..2] } else { s };
- | ^^^^^^
- | |
- | expected `&str`, found `str`
- | help: consider borrowing here: `&s[..2]`
+ | ^^^^^^ expected `&str`, found `str`
+ |
+help: consider borrowing here
+ |
+LL | let u: &str = if true { &s[..2] } else { s };
+ | +
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/tests/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr
index e874ded..211dd51 100644
--- a/tests/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr
+++ b/tests/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:12:42
|
LL | light_flows_our_war_of_mocking_words(behold as usize);
- | ------------------------------------ ^^^^^^^^^^^^^^^
- | | |
- | | expected `&usize`, found `usize`
- | | help: consider borrowing here: `&(behold as usize)`
+ | ------------------------------------ ^^^^^^^^^^^^^^^ expected `&usize`, found `usize`
+ | |
| arguments to this function are incorrect
|
note: function defined here
@@ -13,15 +11,17 @@
|
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
+help: consider borrowing here
+ |
+LL | light_flows_our_war_of_mocking_words(&(behold as usize));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42
|
LL | light_flows_our_war_of_mocking_words(with_tears + 4);
- | ------------------------------------ ^^^^^^^^^^^^^^
- | | |
- | | expected `&usize`, found `usize`
- | | help: consider borrowing here: `&(with_tears + 4)`
+ | ------------------------------------ ^^^^^^^^^^^^^^ expected `&usize`, found `usize`
+ | |
| arguments to this function are incorrect
|
note: function defined here
@@ -29,6 +29,10 @@
|
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
+help: consider borrowing here
+ |
+LL | light_flows_our_war_of_mocking_words(&(with_tears + 4));
+ | ++ +
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-51515.rs b/tests/ui/issues/issue-51515.rs
index 84e09af..33a9bf8 100644
--- a/tests/ui/issues/issue-51515.rs
+++ b/tests/ui/issues/issue-51515.rs
@@ -1,7 +1,6 @@
fn main() {
let foo = &16;
//~^ HELP consider changing this to be a mutable reference
- //~| SUGGESTION &mut 16
*foo = 32;
//~^ ERROR cannot assign to `*foo`, which is behind a `&` reference
let bar = foo;
diff --git a/tests/ui/issues/issue-51515.stderr b/tests/ui/issues/issue-51515.stderr
index 94e5c9f..88b8d21 100644
--- a/tests/ui/issues/issue-51515.stderr
+++ b/tests/ui/issues/issue-51515.stderr
@@ -1,5 +1,5 @@
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
- --> $DIR/issue-51515.rs:5:5
+ --> $DIR/issue-51515.rs:4:5
|
LL | *foo = 32;
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
@@ -7,10 +7,10 @@
help: consider changing this to be a mutable reference
|
LL | let foo = &mut 16;
- | ~~~~~~~
+ | +++
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
- --> $DIR/issue-51515.rs:9:5
+ --> $DIR/issue-51515.rs:8:5
|
LL | *bar = 64;
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
diff --git a/tests/ui/issues/issue-61106.stderr b/tests/ui/issues/issue-61106.stderr
index eff3e6e..aa922e2 100644
--- a/tests/ui/issues/issue-61106.stderr
+++ b/tests/ui/issues/issue-61106.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-61106.rs:3:9
|
LL | foo(x.clone());
- | --- ^^^^^^^^^
- | | |
- | | expected `&str`, found `String`
- | | help: consider borrowing here: `&x`
+ | --- ^^^^^^^^^ expected `&str`, found `String`
+ | |
| arguments to this function are incorrect
|
note: function defined here
@@ -13,6 +11,10 @@
|
LL | fn foo(_: &str) {}
| ^^^ -------
+help: consider borrowing here
+ |
+LL | foo(&x.clone());
+ | +
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-61623.stderr b/tests/ui/issues/issue-61623.stderr
index 5fcc338..bedea38 100644
--- a/tests/ui/issues/issue-61623.stderr
+++ b/tests/ui/issues/issue-61623.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn f3<'a>(x: &'a mut ((), &'a mut ())) {
- | ~~~~~~~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/methods/method-self-arg-1.stderr b/tests/ui/methods/method-self-arg-1.stderr
index 9241a8b..dcc21ac 100644
--- a/tests/ui/methods/method-self-arg-1.stderr
+++ b/tests/ui/methods/method-self-arg-1.stderr
@@ -2,10 +2,8 @@
--> $DIR/method-self-arg-1.rs:11:14
|
LL | Foo::bar(x);
- | -------- ^
- | | |
- | | expected `&Foo`, found `Foo`
- | | help: consider borrowing here: `&x`
+ | -------- ^ expected `&Foo`, found `Foo`
+ | |
| arguments to this function are incorrect
|
note: method defined here
@@ -13,6 +11,10 @@
|
LL | fn bar(&self) {}
| ^^^ -----
+help: consider borrowing here
+ |
+LL | Foo::bar(&x);
+ | +
error[E0308]: mismatched types
--> $DIR/method-self-arg-1.rs:13:14
diff --git a/tests/ui/mismatched_types/dont-point-return-on-E0308.stderr b/tests/ui/mismatched_types/dont-point-return-on-E0308.stderr
index 1394268..7be94ef 100644
--- a/tests/ui/mismatched_types/dont-point-return-on-E0308.stderr
+++ b/tests/ui/mismatched_types/dont-point-return-on-E0308.stderr
@@ -2,10 +2,8 @@
--> $DIR/dont-point-return-on-E0308.rs:11:11
|
LL | f(());
- | - ^^
- | | |
- | | expected `&()`, found `()`
- | | help: consider borrowing here: `&()`
+ | - ^^ expected `&()`, found `()`
+ | |
| arguments to this function are incorrect
|
note: function defined here
@@ -13,6 +11,10 @@
|
LL | async fn f(_: &()) {}
| ^ ------
+help: consider borrowing here
+ |
+LL | f(&());
+ | +
error: aborting due to previous error
diff --git a/tests/ui/mut/mut-cross-borrowing.stderr b/tests/ui/mut/mut-cross-borrowing.stderr
index 8401827..8a3076d 100644
--- a/tests/ui/mut/mut-cross-borrowing.stderr
+++ b/tests/ui/mut/mut-cross-borrowing.stderr
@@ -2,10 +2,8 @@
--> $DIR/mut-cross-borrowing.rs:7:7
|
LL | f(x)
- | - ^
- | | |
- | | expected `&mut isize`, found `Box<{integer}>`
- | | help: consider mutably borrowing here: `&mut x`
+ | - ^ expected `&mut isize`, found `Box<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut isize`
@@ -15,6 +13,10 @@
|
LL | fn f(_: &mut isize) {}
| ^ -------------
+help: consider mutably borrowing here
+ |
+LL | f(&mut x)
+ | ++++
error: aborting due to previous error
diff --git a/tests/ui/nll/issue-47388.stderr b/tests/ui/nll/issue-47388.stderr
index c780451..09b9d63 100644
--- a/tests/ui/nll/issue-47388.stderr
+++ b/tests/ui/nll/issue-47388.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let fancy_ref = &mut (&mut fancy);
- | ~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/nll/issue-51244.stderr b/tests/ui/nll/issue-51244.stderr
index 03d8acc..8ccb580 100644
--- a/tests/ui/nll/issue-51244.stderr
+++ b/tests/ui/nll/issue-51244.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | let ref mut my_ref @ _ = 0;
- | ~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/nll/issue-57989.stderr b/tests/ui/nll/issue-57989.stderr
index d5effd6..6062b31 100644
--- a/tests/ui/nll/issue-57989.stderr
+++ b/tests/ui/nll/issue-57989.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn f(x: &mut i32) {
- | ~~~~~~~~
+ | +++
error[E0506]: cannot assign to `*x` because it is borrowed
--> $DIR/issue-57989.rs:5:5
diff --git a/tests/ui/offset-of/offset-of-arg-count.rs b/tests/ui/offset-of/offset-of-arg-count.rs
index 163b074..5e66e33 100644
--- a/tests/ui/offset-of/offset-of-arg-count.rs
+++ b/tests/ui/offset-of/offset-of-arg-count.rs
@@ -3,7 +3,15 @@
use std::mem::offset_of;
fn main() {
- offset_of!(NotEnoughArguments); //~ ERROR expected one of
- offset_of!(NotEnoughArgumentsWithAComma, ); //~ ERROR expected 2 arguments
- offset_of!(Container, field, too many arguments); //~ ERROR expected 2 arguments
+ offset_of!(NotEnoughArguments); //~ ERROR unexpected end of macro invocation
+ offset_of!(NotEnoughArgumentsWithAComma, ); //~ ERROR unexpected end of macro invocation
+ offset_of!(Container, field, too many arguments); //~ ERROR no rules expected the token `too`
+ offset_of!(S, f); // compiles fine
+ offset_of!(S, f,); // also compiles fine
+ offset_of!(S, f.); //~ ERROR unexpected end of macro invocation
+ offset_of!(S, f.,); //~ ERROR expected identifier
+ offset_of!(S, f..); //~ ERROR no rules expected the token
+ offset_of!(S, f..,); //~ ERROR no rules expected the token
}
+
+struct S { f: u8, }
diff --git a/tests/ui/offset-of/offset-of-arg-count.stderr b/tests/ui/offset-of/offset-of-arg-count.stderr
index ebecc98..4275a89 100644
--- a/tests/ui/offset-of/offset-of-arg-count.stderr
+++ b/tests/ui/offset-of/offset-of-arg-count.stderr
@@ -1,20 +1,59 @@
-error: expected one of `!`, `(`, `+`, `,`, `::`, or `<`, found `<eof>`
- --> $DIR/offset-of-arg-count.rs:6:16
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-arg-count.rs:6:34
|
LL | offset_of!(NotEnoughArguments);
- | ^^^^^^^^^^^^^^^^^^ expected one of `!`, `(`, `+`, `,`, `::`, or `<`
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match `,`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-error: expected 2 arguments
- --> $DIR/offset-of-arg-count.rs:7:5
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-arg-count.rs:7:45
|
LL | offset_of!(NotEnoughArgumentsWithAComma, );
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match meta-variable `$fields:tt`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-error: expected 2 arguments
- --> $DIR/offset-of-arg-count.rs:8:5
+error: no rules expected the token `too`
+ --> $DIR/offset-of-arg-count.rs:8:34
|
LL | offset_of!(Container, field, too many arguments);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence end
-error: aborting due to 3 previous errors
+error: unexpected end of macro invocation
+ --> $DIR/offset-of-arg-count.rs:11:21
+ |
+LL | offset_of!(S, f.);
+ | ^ missing tokens in macro arguments
+ |
+note: while trying to match meta-variable `$fields:tt`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+
+error: expected identifier, found `,`
+ --> $DIR/offset-of-arg-count.rs:12:21
+ |
+LL | offset_of!(S, f.,);
+ | ^ expected identifier
+
+error: no rules expected the token `..`
+ --> $DIR/offset-of-arg-count.rs:13:20
+ |
+LL | offset_of!(S, f..);
+ | ^^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence start
+
+error: no rules expected the token `..`
+ --> $DIR/offset-of-arg-count.rs:14:20
+ |
+LL | offset_of!(S, f..,);
+ | ^^ no rules expected this token in macro call
+ |
+ = note: while trying to match sequence start
+
+error: aborting due to 7 previous errors
diff --git a/tests/ui/offset-of/offset-of-builtin.rs b/tests/ui/offset-of/offset-of-builtin.rs
new file mode 100644
index 0000000..1be9899
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-builtin.rs
@@ -0,0 +1,44 @@
+#![feature(builtin_syntax)]
+
+// For the exposed macro we already test these errors in the other files,
+// but this test helps to make sure the builtin construct also errors.
+// This has the same examples as offset-of-arg-count.rs
+
+fn main() {
+ builtin # offset_of(NotEnoughArguments); //~ ERROR expected one of
+}
+fn t1() {
+ // Already errored upon at the macro level. Yielding an error would require
+ // extra effort.
+ builtin # offset_of(NotEnoughArgumentsWithAComma, );
+}
+fn t2() {
+ builtin # offset_of(Container, field, too many arguments); //~ ERROR expected identifier, found
+ //~| ERROR found `,`
+ //~| ERROR found `many`
+ //~| ERROR found `arguments`
+}
+fn t3() {
+ builtin # offset_of(S, f); // compiles fine
+}
+fn t4() {
+ // Already errored upon at the macro level. Yielding an error would require
+ // extra effort.
+ builtin # offset_of(S, f);
+}
+fn t5() {
+ builtin # offset_of(S, f.); //~ ERROR expected identifier
+}
+fn t6() {
+ builtin # offset_of(S, f.,); //~ ERROR expected identifier
+}
+fn t7() {
+ builtin # offset_of(S, f..); //~ ERROR expected one of
+}
+fn t8() {
+ // Already errored upon at the macro level. Yielding an error would require
+ // extra effort.
+ builtin # offset_of(S, f..,);
+}
+
+struct S { f: u8, }
diff --git a/tests/ui/offset-of/offset-of-builtin.stderr b/tests/ui/offset-of/offset-of-builtin.stderr
new file mode 100644
index 0000000..1a1f33c
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-builtin.stderr
@@ -0,0 +1,65 @@
+error: expected one of `!`, `(`, `+`, `,`, `::`, or `<`, found `)`
+ --> $DIR/offset-of-builtin.rs:8:43
+ |
+LL | builtin # offset_of(NotEnoughArguments);
+ | ^ expected one of `!`, `(`, `+`, `,`, `::`, or `<`
+
+error: expected identifier, found `,`
+ --> $DIR/offset-of-builtin.rs:16:41
+ |
+LL | builtin # offset_of(Container, field, too many arguments);
+ | ^
+ | |
+ | expected identifier
+ | help: remove this comma
+
+error: expected one of `)` or `.`, found `,`
+ --> $DIR/offset-of-builtin.rs:16:41
+ |
+LL | builtin # offset_of(Container, field, too many arguments);
+ | ^
+ | |
+ | expected one of `)` or `.`
+ | help: missing `.`
+
+error: expected one of `)` or `.`, found `many`
+ --> $DIR/offset-of-builtin.rs:16:47
+ |
+LL | builtin # offset_of(Container, field, too many arguments);
+ | -^^^^ expected one of `)` or `.`
+ | |
+ | help: missing `.`
+
+error: expected one of `)` or `.`, found `arguments`
+ --> $DIR/offset-of-builtin.rs:16:52
+ |
+LL | builtin # offset_of(Container, field, too many arguments);
+ | -^^^^^^^^^ expected one of `)` or `.`
+ | |
+ | help: missing `.`
+
+error: expected identifier, found `)`
+ --> $DIR/offset-of-builtin.rs:30:30
+ |
+LL | builtin # offset_of(S, f.);
+ | ^ expected identifier
+
+error: expected identifier, found `,`
+ --> $DIR/offset-of-builtin.rs:33:30
+ |
+LL | builtin # offset_of(S, f.,);
+ | ^ expected identifier
+
+error: expected one of `)` or `.`, found `..`
+ --> $DIR/offset-of-builtin.rs:36:29
+ |
+LL | builtin # offset_of(S, f..);
+ | ^^ expected one of `)` or `.`
+ |
+help: if you meant to bind the contents of the rest of the array pattern into `f`, use `@`
+ |
+LL | builtin # offset_of(S, f @ ..);
+ | +
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/offset-of/offset-of-dst-field.stderr b/tests/ui/offset-of/offset-of-dst-field.stderr
index 8e88015..e6e0f49 100644
--- a/tests/ui/offset-of/offset-of-dst-field.stderr
+++ b/tests/ui/offset-of/offset-of-dst-field.stderr
@@ -5,6 +5,7 @@
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time
--> $DIR/offset-of-dst-field.rs:31:5
@@ -13,6 +14,7 @@
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `(dyn Trait + 'static)`
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the size for values of type `Extern` cannot be known at compilation time
--> $DIR/offset-of-dst-field.rs:32:5
@@ -21,6 +23,7 @@
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `Extern`
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
diff --git a/tests/ui/offset-of/offset-of-unstable.stderr b/tests/ui/offset-of/offset-of-unstable.stderr
index 25811a0..c398825 100644
--- a/tests/ui/offset-of/offset-of-unstable.stderr
+++ b/tests/ui/offset-of/offset-of-unstable.stderr
@@ -33,6 +33,7 @@
| |_____^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/offset-of-unstable.rs:18:5
@@ -41,6 +42,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/offset-of-unstable.rs:20:5
@@ -49,6 +51,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/offset-of-unstable.rs:21:5
@@ -61,6 +64,7 @@
| |_____^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/offset-of-unstable.rs:26:5
@@ -73,6 +77,7 @@
| |_____^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+ = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors
diff --git a/tests/ui/parser/builtin-syntax.rs b/tests/ui/parser/builtin-syntax.rs
new file mode 100644
index 0000000..897dab8
--- /dev/null
+++ b/tests/ui/parser/builtin-syntax.rs
@@ -0,0 +1,9 @@
+#![feature(builtin_syntax)]
+
+fn main() {
+ builtin # foobar(); //~ ERROR unknown `builtin #` construct
+}
+
+fn not_identifier() {
+ builtin # {}(); //~ ERROR expected identifier after
+}
diff --git a/tests/ui/parser/builtin-syntax.stderr b/tests/ui/parser/builtin-syntax.stderr
new file mode 100644
index 0000000..ee3764a
--- /dev/null
+++ b/tests/ui/parser/builtin-syntax.stderr
@@ -0,0 +1,14 @@
+error: unknown `builtin #` construct `foobar`
+ --> $DIR/builtin-syntax.rs:4:5
+ |
+LL | builtin # foobar();
+ | ^^^^^^^^^^^^^^^^
+
+error: expected identifier after `builtin #`
+ --> $DIR/builtin-syntax.rs:8:15
+ |
+LL | builtin # {}();
+ | ^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/issue-103869.rs b/tests/ui/parser/issue-103869.rs
deleted file mode 100644
index 9213437..0000000
--- a/tests/ui/parser/issue-103869.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-enum VecOrMap{
- vec: Vec<usize>,
- //~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `:`
- //~| HELP: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
- map: HashMap<String,usize>
-}
-
-fn main() {}
diff --git a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
index c7c7c07..a033cc0 100644
--- a/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
+++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
@@ -112,7 +112,7 @@
help: consider changing this to be a mutable reference
|
LL | let (ref mut _x0, _x1, ref _x2, ..) = tup;
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to `*_x2`, which is behind a `&` reference
--> $DIR/borrowck-move-ref-pattern.rs:27:5
@@ -123,7 +123,7 @@
help: consider changing this to be a mutable reference
|
LL | let (ref _x0, _x1, ref mut _x2, ..) = tup;
- | ~~~~~~~~~~~
+ | +++
error[E0382]: use of moved value: `tup.1`
--> $DIR/borrowck-move-ref-pattern.rs:28:10
diff --git a/tests/ui/range/issue-54505-no-literals.fixed b/tests/ui/range/issue-54505-no-literals.fixed
index 4d8f671..71c36c7 100644
--- a/tests/ui/range/issue-54505-no-literals.fixed
+++ b/tests/ui/range/issue-54505-no-literals.fixed
@@ -16,60 +16,60 @@
take_range(&std::ops::Range { start: 0, end: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::Range { start: 0, end: 1 }
+ //~| SUGGESTION &
take_range(&::std::ops::Range { start: 0, end: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::Range { start: 0, end: 1 }
+ //~| SUGGESTION &
take_range(&std::ops::RangeFrom { start: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeFrom { start: 1 }
+ //~| SUGGESTION &
take_range(&::std::ops::RangeFrom { start: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeFrom { start: 1 }
+ //~| SUGGESTION &
take_range(&std::ops::RangeFull {});
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeFull {}
+ //~| SUGGESTION &
take_range(&::std::ops::RangeFull {});
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeFull {}
+ //~| SUGGESTION &
take_range(&std::ops::RangeInclusive::new(0, 1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeInclusive::new(0, 1)
+ //~| SUGGESTION &
take_range(&::std::ops::RangeInclusive::new(0, 1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeInclusive::new(0, 1)
+ //~| SUGGESTION &
take_range(&std::ops::RangeTo { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeTo { end: 5 }
+ //~| SUGGESTION &
take_range(&::std::ops::RangeTo { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeTo { end: 5 }
+ //~| SUGGESTION &
take_range(&std::ops::RangeToInclusive { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeToInclusive { end: 5 }
+ //~| SUGGESTION &
take_range(&::std::ops::RangeToInclusive { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeToInclusive { end: 5 }
+ //~| SUGGESTION &
}
diff --git a/tests/ui/range/issue-54505-no-literals.rs b/tests/ui/range/issue-54505-no-literals.rs
index dc21dcb..db125d1 100644
--- a/tests/ui/range/issue-54505-no-literals.rs
+++ b/tests/ui/range/issue-54505-no-literals.rs
@@ -16,60 +16,60 @@ fn main() {
take_range(std::ops::Range { start: 0, end: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::Range { start: 0, end: 1 }
+ //~| SUGGESTION &
take_range(::std::ops::Range { start: 0, end: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::Range { start: 0, end: 1 }
+ //~| SUGGESTION &
take_range(std::ops::RangeFrom { start: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeFrom { start: 1 }
+ //~| SUGGESTION &
take_range(::std::ops::RangeFrom { start: 1 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeFrom { start: 1 }
+ //~| SUGGESTION &
take_range(std::ops::RangeFull {});
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeFull {}
+ //~| SUGGESTION &
take_range(::std::ops::RangeFull {});
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeFull {}
+ //~| SUGGESTION &
take_range(std::ops::RangeInclusive::new(0, 1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeInclusive::new(0, 1)
+ //~| SUGGESTION &
take_range(::std::ops::RangeInclusive::new(0, 1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeInclusive::new(0, 1)
+ //~| SUGGESTION &
take_range(std::ops::RangeTo { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeTo { end: 5 }
+ //~| SUGGESTION &
take_range(::std::ops::RangeTo { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeTo { end: 5 }
+ //~| SUGGESTION &
take_range(std::ops::RangeToInclusive { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &std::ops::RangeToInclusive { end: 5 }
+ //~| SUGGESTION &
take_range(::std::ops::RangeToInclusive { end: 5 });
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &::std::ops::RangeToInclusive { end: 5 }
+ //~| SUGGESTION &
}
diff --git a/tests/ui/range/issue-54505-no-literals.stderr b/tests/ui/range/issue-54505-no-literals.stderr
index d112983..5894bb6 100644
--- a/tests/ui/range/issue-54505-no-literals.stderr
+++ b/tests/ui/range/issue-54505-no-literals.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-54505-no-literals.rs:16:16
|
LL | take_range(std::ops::Range { start: 0, end: 1 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `Range<{integer}>`
- | | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `Range<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -15,15 +13,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::Range { start: 0, end: 1 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:21:16
|
LL | take_range(::std::ops::Range { start: 0, end: 1 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `Range<{integer}>`
- | | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `Range<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -33,15 +33,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::Range { start: 0, end: 1 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:26:16
|
LL | take_range(std::ops::RangeFrom { start: 1 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeFrom<{integer}>`
- | | help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeFrom<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -51,15 +53,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::RangeFrom { start: 1 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:31:16
|
LL | take_range(::std::ops::RangeFrom { start: 1 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeFrom<{integer}>`
- | | help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeFrom<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -69,15 +73,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::RangeFrom { start: 1 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:36:16
|
LL | take_range(std::ops::RangeFull {});
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeFull`
- | | help: consider borrowing here: `&std::ops::RangeFull {}`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeFull`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -87,15 +93,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::RangeFull {});
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:41:16
|
LL | take_range(::std::ops::RangeFull {});
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeFull`
- | | help: consider borrowing here: `&::std::ops::RangeFull {}`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeFull`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -105,15 +113,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::RangeFull {});
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:46:16
|
LL | take_range(std::ops::RangeInclusive::new(0, 1));
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeInclusive<{integer}>`
- | | help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -123,15 +133,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::RangeInclusive::new(0, 1));
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:51:16
|
LL | take_range(::std::ops::RangeInclusive::new(0, 1));
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeInclusive<{integer}>`
- | | help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -141,15 +153,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::RangeInclusive::new(0, 1));
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:56:16
|
LL | take_range(std::ops::RangeTo { end: 5 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeTo<{integer}>`
- | | help: consider borrowing here: `&std::ops::RangeTo { end: 5 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeTo<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -159,15 +173,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::RangeTo { end: 5 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:61:16
|
LL | take_range(::std::ops::RangeTo { end: 5 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeTo<{integer}>`
- | | help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeTo<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -177,15 +193,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::RangeTo { end: 5 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:66:16
|
LL | take_range(std::ops::RangeToInclusive { end: 5 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeToInclusive<{integer}>`
- | | help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeToInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -195,15 +213,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&std::ops::RangeToInclusive { end: 5 });
+ | +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-literals.rs:71:16
|
LL | take_range(::std::ops::RangeToInclusive { end: 5 });
- | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&_`, found `RangeToInclusive<{integer}>`
- | | help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }`
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `RangeToInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -213,6 +233,10 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&::std::ops::RangeToInclusive { end: 5 });
+ | +
error: aborting due to 12 previous errors
diff --git a/tests/ui/range/issue-54505-no-std.rs b/tests/ui/range/issue-54505-no-std.rs
index 9f378b4..db455fa 100644
--- a/tests/ui/range/issue-54505-no-std.rs
+++ b/tests/ui/range/issue-54505-no-std.rs
@@ -29,30 +29,30 @@ fn main() {
take_range(0..1);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..1)
+ //~| SUGGESTION &(
take_range(1..);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(1..)
+ //~| SUGGESTION &(
take_range(..);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..)
+ //~| SUGGESTION &(
take_range(0..=1);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..=1)
+ //~| SUGGESTION &(
take_range(..5);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..5)
+ //~| SUGGESTION &(
take_range(..=42);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..=42)
+ //~| SUGGESTION &(
}
diff --git a/tests/ui/range/issue-54505-no-std.stderr b/tests/ui/range/issue-54505-no-std.stderr
index a6a9f89..13563d1 100644
--- a/tests/ui/range/issue-54505-no-std.stderr
+++ b/tests/ui/range/issue-54505-no-std.stderr
@@ -14,10 +14,8 @@
--> $DIR/issue-54505-no-std.rs:29:16
|
LL | take_range(0..1);
- | ---------- ^^^^
- | | |
- | | expected `&_`, found `Range<{integer}>`
- | | help: consider borrowing here: `&(0..1)`
+ | ---------- ^^^^ expected `&_`, found `Range<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -27,15 +25,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(0..1));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:34:16
|
LL | take_range(1..);
- | ---------- ^^^
- | | |
- | | expected `&_`, found `RangeFrom<{integer}>`
- | | help: consider borrowing here: `&(1..)`
+ | ---------- ^^^ expected `&_`, found `RangeFrom<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -45,15 +45,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(1..));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:39:16
|
LL | take_range(..);
- | ---------- ^^
- | | |
- | | expected `&_`, found `RangeFull`
- | | help: consider borrowing here: `&(..)`
+ | ---------- ^^ expected `&_`, found `RangeFull`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -63,15 +65,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:44:16
|
LL | take_range(0..=1);
- | ---------- ^^^^^
- | | |
- | | expected `&_`, found `RangeInclusive<{integer}>`
- | | help: consider borrowing here: `&(0..=1)`
+ | ---------- ^^^^^ expected `&_`, found `RangeInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -81,15 +85,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(0..=1));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:49:16
|
LL | take_range(..5);
- | ---------- ^^^
- | | |
- | | expected `&_`, found `RangeTo<{integer}>`
- | | help: consider borrowing here: `&(..5)`
+ | ---------- ^^^ expected `&_`, found `RangeTo<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -99,15 +105,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..5));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505-no-std.rs:54:16
|
LL | take_range(..=42);
- | ---------- ^^^^^
- | | |
- | | expected `&_`, found `RangeToInclusive<{integer}>`
- | | help: consider borrowing here: `&(..=42)`
+ | ---------- ^^^^^ expected `&_`, found `RangeToInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -117,6 +125,10 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..=42));
+ | ++ +
error: aborting due to 8 previous errors
diff --git a/tests/ui/range/issue-54505.fixed b/tests/ui/range/issue-54505.fixed
index f8298c0..9d113ba 100644
--- a/tests/ui/range/issue-54505.fixed
+++ b/tests/ui/range/issue-54505.fixed
@@ -14,30 +14,30 @@
take_range(&(0..1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..1)
+ //~| SUGGESTION &(
take_range(&(1..));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(1..)
+ //~| SUGGESTION &(
take_range(&(..));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..)
+ //~| SUGGESTION &(
take_range(&(0..=1));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..=1)
+ //~| SUGGESTION &(
take_range(&(..5));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..5)
+ //~| SUGGESTION &(
take_range(&(..=42));
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..=42)
+ //~| SUGGESTION &(
}
diff --git a/tests/ui/range/issue-54505.rs b/tests/ui/range/issue-54505.rs
index 0367325..c992998 100644
--- a/tests/ui/range/issue-54505.rs
+++ b/tests/ui/range/issue-54505.rs
@@ -14,30 +14,30 @@ fn main() {
take_range(0..1);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..1)
+ //~| SUGGESTION &(
take_range(1..);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(1..)
+ //~| SUGGESTION &(
take_range(..);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..)
+ //~| SUGGESTION &(
take_range(0..=1);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(0..=1)
+ //~| SUGGESTION &(
take_range(..5);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..5)
+ //~| SUGGESTION &(
take_range(..=42);
//~^ ERROR mismatched types [E0308]
//~| HELP consider borrowing here
- //~| SUGGESTION &(..=42)
+ //~| SUGGESTION &(
}
diff --git a/tests/ui/range/issue-54505.stderr b/tests/ui/range/issue-54505.stderr
index eda047b..0e959fc 100644
--- a/tests/ui/range/issue-54505.stderr
+++ b/tests/ui/range/issue-54505.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-54505.rs:14:16
|
LL | take_range(0..1);
- | ---------- ^^^^
- | | |
- | | expected `&_`, found `Range<{integer}>`
- | | help: consider borrowing here: `&(0..1)`
+ | ---------- ^^^^ expected `&_`, found `Range<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -15,15 +13,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(0..1));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505.rs:19:16
|
LL | take_range(1..);
- | ---------- ^^^
- | | |
- | | expected `&_`, found `RangeFrom<{integer}>`
- | | help: consider borrowing here: `&(1..)`
+ | ---------- ^^^ expected `&_`, found `RangeFrom<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -33,15 +33,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(1..));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505.rs:24:16
|
LL | take_range(..);
- | ---------- ^^
- | | |
- | | expected `&_`, found `RangeFull`
- | | help: consider borrowing here: `&(..)`
+ | ---------- ^^ expected `&_`, found `RangeFull`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -51,15 +53,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505.rs:29:16
|
LL | take_range(0..=1);
- | ---------- ^^^^^
- | | |
- | | expected `&_`, found `RangeInclusive<{integer}>`
- | | help: consider borrowing here: `&(0..=1)`
+ | ---------- ^^^^^ expected `&_`, found `RangeInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -69,15 +73,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(0..=1));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505.rs:34:16
|
LL | take_range(..5);
- | ---------- ^^^
- | | |
- | | expected `&_`, found `RangeTo<{integer}>`
- | | help: consider borrowing here: `&(..5)`
+ | ---------- ^^^ expected `&_`, found `RangeTo<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -87,15 +93,17 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..5));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-54505.rs:39:16
|
LL | take_range(..=42);
- | ---------- ^^^^^
- | | |
- | | expected `&_`, found `RangeToInclusive<{integer}>`
- | | help: consider borrowing here: `&(..=42)`
+ | ---------- ^^^^^ expected `&_`, found `RangeToInclusive<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -105,6 +113,10 @@
|
LL | fn take_range(_r: &impl RangeBounds<i8>) {}
| ^^^^^^^^^^ -------------------------
+help: consider borrowing here
+ |
+LL | take_range(&(..=42));
+ | ++ +
error: aborting due to 6 previous errors
diff --git a/tests/ui/range/issue-73553-misinterp-range-literal.stderr b/tests/ui/range/issue-73553-misinterp-range-literal.stderr
index 77595b3..52efa24 100644
--- a/tests/ui/range/issue-73553-misinterp-range-literal.stderr
+++ b/tests/ui/range/issue-73553-misinterp-range-literal.stderr
@@ -2,10 +2,8 @@
--> $DIR/issue-73553-misinterp-range-literal.rs:12:10
|
LL | demo(tell(1)..tell(10));
- | ---- ^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&Range<usize>`, found `Range<usize>`
- | | help: consider borrowing here: `&(tell(1)..tell(10))`
+ | ---- ^^^^^^^^^^^^^^^^^ expected `&Range<usize>`, found `Range<usize>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&std::ops::Range<usize>`
@@ -15,15 +13,17 @@
|
LL | fn demo(r: &Range) {
| ^^^^ ---------
+help: consider borrowing here
+ |
+LL | demo(&(tell(1)..tell(10)));
+ | ++ +
error[E0308]: mismatched types
--> $DIR/issue-73553-misinterp-range-literal.rs:14:10
|
LL | demo(1..10);
- | ---- ^^^^^
- | | |
- | | expected `&Range<usize>`, found `Range<{integer}>`
- | | help: consider borrowing here: `&(1..10)`
+ | ---- ^^^^^ expected `&Range<usize>`, found `Range<{integer}>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&std::ops::Range<usize>`
@@ -33,6 +33,10 @@
|
LL | fn demo(r: &Range) {
| ^^^^ ---------
+help: consider borrowing here
+ |
+LL | demo(&(1..10));
+ | ++ +
error: aborting due to 2 previous errors
diff --git a/tests/ui/reachable/auxiliary/foreign-priv-aux.rs b/tests/ui/reachable/auxiliary/foreign-priv-aux.rs
new file mode 100644
index 0000000..10dc086
--- /dev/null
+++ b/tests/ui/reachable/auxiliary/foreign-priv-aux.rs
@@ -0,0 +1,21 @@
+trait PrivTrait {
+ fn priv_fn(&self);
+}
+
+pub struct ImplPrivTrait;
+
+impl PrivTrait for ImplPrivTrait {
+ fn priv_fn(&self) {}
+}
+
+pub struct Wrapper<T>(T);
+
+pub trait PubTrait {
+ fn pub_fn(&self);
+}
+
+impl<T: PrivTrait> PubTrait for Wrapper<T> {
+ fn pub_fn(&self) {
+ self.0.priv_fn()
+ }
+}
diff --git a/tests/ui/reachable/foreign-priv.rs b/tests/ui/reachable/foreign-priv.rs
new file mode 100644
index 0000000..bf336b6
--- /dev/null
+++ b/tests/ui/reachable/foreign-priv.rs
@@ -0,0 +1,12 @@
+// aux-build:foreign-priv-aux.rs
+// build-pass
+
+#![crate_type = "lib"]
+
+extern crate foreign_priv_aux;
+
+use foreign_priv_aux::{ImplPrivTrait, PubTrait, Wrapper};
+
+pub fn foo(x: Wrapper<ImplPrivTrait>) {
+ x.pub_fn();
+}
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs b/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
index 3ac9099..f31123f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
@@ -12,7 +12,9 @@ trait Specialize {}
trait Foo {}
#[const_trait]
-trait Bar {}
+trait Bar {
+ fn bar();
+}
// bgr360: I was only able to exercise the code path that raises the
// "missing ~const qualifier" error by making this base impl non-const, even
@@ -21,26 +23,36 @@ trait Bar {}
impl<T> Bar for T
where
T: ~const Foo,
-{}
+{
+ default fn bar() {}
+}
impl<T> Bar for T
where
T: Foo, //~ ERROR missing `~const` qualifier
T: Specialize,
-{}
+{
+ fn bar() {}
+}
#[const_trait]
-trait Baz {}
+trait Baz {
+ fn baz();
+}
impl<T> const Baz for T
where
T: ~const Foo,
-{}
+{
+ default fn baz() {}
+}
impl<T> const Baz for T //~ ERROR conflicting implementations of trait `Baz`
where
T: Foo,
T: Specialize,
-{}
+{
+ fn baz() {}
+}
fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
index 4aea197..057cf4a 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
@@ -1,11 +1,11 @@
error: missing `~const` qualifier for specialization
- --> $DIR/const-default-bound-non-const-specialized-bound.rs:28:8
+ --> $DIR/const-default-bound-non-const-specialized-bound.rs:32:8
|
LL | T: Foo,
| ^^^
error[E0119]: conflicting implementations of trait `Baz`
- --> $DIR/const-default-bound-non-const-specialized-bound.rs:40:1
+ --> $DIR/const-default-bound-non-const-specialized-bound.rs:50:1
|
LL | impl<T> const Baz for T
| ----------------------- first implementation here
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs b/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
index 9c2c2cf..92d8be6 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs
@@ -11,27 +11,39 @@
trait Specialize {}
#[const_trait]
-trait Foo {}
+trait Foo {
+ fn foo();
+}
-impl<T> const Foo for T {}
+impl<T> const Foo for T {
+ default fn foo() {}
+}
impl<T> const Foo for T
where
T: ~const Specialize,
-{}
+{
+ fn foo() {}
+}
#[const_trait]
-trait Bar {}
+trait Bar {
+ fn bar() {}
+}
impl<T> const Bar for T
where
T: ~const Foo,
-{}
+{
+ default fn bar() {}
+}
impl<T> const Bar for T
where
T: ~const Foo,
T: ~const Specialize,
-{}
+{
+ fn bar() {}
+}
fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs b/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
index 1e6b1c6..51bfaf7 100644
--- a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs
@@ -15,31 +15,43 @@ trait Specialize {}
trait Foo {}
#[const_trait]
-trait Bar {}
+trait Bar {
+ fn bar();
+}
impl<T> Bar for T
where
T: Foo,
-{}
+{
+ default fn bar() {}
+}
impl<T> const Bar for T
where
T: ~const Foo,
T: Specialize,
-{}
+{
+ fn bar() {}
+}
#[const_trait]
-trait Baz {}
+trait Baz {
+ fn baz();
+}
impl<T> const Baz for T
where
T: Foo,
-{}
+{
+ default fn baz() {}
+}
impl<T> const Baz for T
where
T: ~const Foo,
T: Specialize,
-{}
+{
+ fn baz() {}
+}
fn main() {}
diff --git a/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr b/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
index 570328f..80c5f9d 100644
--- a/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
+++ b/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | fn deref_extend_mut_field1(x: &mut Own<Point>) -> &mut isize {
- | ~~~~~~~~~~~~~~~
+ | +++
error[E0499]: cannot borrow `*x` as mutable more than once at a time
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:78:19
@@ -50,7 +50,7 @@
help: consider changing this to be a mutable reference
|
LL | fn assign_field2<'a>(x: &'a mut Own<Point>) {
- | ~~~~~~~~~~~~~~~~~~
+ | +++
error[E0499]: cannot borrow `*x` as mutable more than once at a time
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:101:5
@@ -82,7 +82,7 @@
help: consider changing this to be a mutable reference
|
LL | fn deref_extend_mut_method1(x: &mut Own<Point>) -> &mut isize {
- | ~~~~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:129:6
@@ -104,7 +104,7 @@
help: consider changing this to be a mutable reference
|
LL | fn assign_method2<'a>(x: &'a mut Own<Point>) {
- | ~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to 10 previous errors
diff --git a/tests/ui/span/borrowck-borrow-overloaded-deref-mut.stderr b/tests/ui/span/borrowck-borrow-overloaded-deref-mut.stderr
index 3fed7b3..dbd52dc 100644
--- a/tests/ui/span/borrowck-borrow-overloaded-deref-mut.stderr
+++ b/tests/ui/span/borrowck-borrow-overloaded-deref-mut.stderr
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | fn deref_extend_mut1<'a>(x: &'a mut Own<isize>) -> &'a mut isize {
- | ~~~~~~~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/borrowck-borrow-overloaded-deref-mut.rs:49:6
@@ -40,7 +40,7 @@
help: consider changing this to be a mutable reference
|
LL | fn assign2<'a>(x: &'a mut Own<isize>) {
- | ~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to 4 previous errors
diff --git a/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
index 9711dad..99c8fa1 100644
--- a/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
+++ b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
@@ -19,7 +19,7 @@
help: consider changing this to be a mutable reference
|
LL | fn test2<F>(f: &mut F) where F: FnMut() {
- | ~~~~~~
+ | +++
error[E0596]: cannot borrow `f.f` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:34:5
@@ -29,8 +29,8 @@
|
help: consider changing this to be a mutable reference
|
-LL | fn test4(f: &mut Test<'_>) {
- | ~~~~~~~~~~~~~
+LL | fn test4(f: &mut Test) {
+ | +++
error[E0507]: cannot move out of `f`, a captured variable in an `FnMut` closure
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:57:13
diff --git a/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr b/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
index 2a842f5..328197a 100644
--- a/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
+++ b/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn b(x: &mut Foo) {
- | ~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/span/borrowck-fn-in-const-b.stderr b/tests/ui/span/borrowck-fn-in-const-b.stderr
index 1df19de..17fdcc6 100644
--- a/tests/ui/span/borrowck-fn-in-const-b.stderr
+++ b/tests/ui/span/borrowck-fn-in-const-b.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn broken(x: &mut Vec<String>) {
- | ~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/span/borrowck-object-mutability.stderr b/tests/ui/span/borrowck-object-mutability.stderr
index b6517e0..805a803 100644
--- a/tests/ui/span/borrowck-object-mutability.stderr
+++ b/tests/ui/span/borrowck-object-mutability.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn borrowed_receiver(x: &mut dyn Foo) {
- | ~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable
--> $DIR/borrowck-object-mutability.rs:18:5
diff --git a/tests/ui/span/coerce-suggestions.stderr b/tests/ui/span/coerce-suggestions.stderr
index bb30f00..ff840b7 100644
--- a/tests/ui/span/coerce-suggestions.stderr
+++ b/tests/ui/span/coerce-suggestions.stderr
@@ -10,11 +10,14 @@
--> $DIR/coerce-suggestions.rs:9:19
|
LL | let x: &str = String::new();
- | ---- ^^^^^^^^^^^^^
- | | |
- | | expected `&str`, found `String`
- | | help: consider borrowing here: `&String::new()`
+ | ---- ^^^^^^^^^^^^^ expected `&str`, found `String`
+ | |
| expected due to this
+ |
+help: consider borrowing here
+ |
+LL | let x: &str = &String::new();
+ | +
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:12:10
diff --git a/tests/ui/span/issue-39018.stderr b/tests/ui/span/issue-39018.stderr
index bae9363..c8c4a51 100644
--- a/tests/ui/span/issue-39018.stderr
+++ b/tests/ui/span/issue-39018.stderr
@@ -78,10 +78,12 @@
--> $DIR/issue-39018.rs:29:17
|
LL | let _ = a + b;
- | ^
- | |
- | expected `&str`, found `String`
- | help: consider borrowing here: `&b`
+ | ^ expected `&str`, found `String`
+ |
+help: consider borrowing here
+ |
+LL | let _ = a + &b;
+ | +
error[E0369]: cannot add `String` to `&String`
--> $DIR/issue-39018.rs:30:15
diff --git a/tests/ui/span/mut-arg-hint.stderr b/tests/ui/span/mut-arg-hint.stderr
index 96ce4d5..06011ea 100644
--- a/tests/ui/span/mut-arg-hint.stderr
+++ b/tests/ui/span/mut-arg-hint.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn foo(mut a: &mut String) {
- | ~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/mut-arg-hint.rs:8:5
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | pub fn foo<'a>(mut a: &'a mut String) {
- | ~~~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/mut-arg-hint.rs:15:9
@@ -29,7 +29,7 @@
help: consider changing this to be a mutable reference
|
LL | pub fn foo(mut a: &mut String) {
- | ~~~~~~~~~~~
+ | +++
error: aborting due to 3 previous errors
diff --git a/tests/ui/specialization/min_specialization/specialize-associated-type.rs b/tests/ui/specialization/min_specialization/specialize-associated-type.rs
new file mode 100644
index 0000000..c4960b0
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize-associated-type.rs
@@ -0,0 +1,37 @@
+// Another regression test for #109815.
+
+// check-pass
+
+#![feature(min_specialization)]
+#![feature(rustc_attrs)]
+
+#[rustc_specialization_trait]
+trait X {}
+trait Z {
+ type Assoc: X;
+}
+struct A<T>(T);
+
+impl X for () {}
+
+impl<T: X> Z for A<T> {
+ type Assoc = ();
+}
+
+trait MyFrom<T> {
+ fn from(other: T) -> Self;
+}
+
+impl<T> MyFrom<()> for T {
+ default fn from(other: ()) -> T {
+ panic!();
+ }
+}
+
+impl<T: X> MyFrom<<A<T> as Z>::Assoc> for T {
+ fn from(other: ()) -> T {
+ panic!();
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/specialization/min_specialization/specialize_nothing.rs b/tests/ui/specialization/min_specialization/specialize_nothing.rs
new file mode 100644
index 0000000..ef92254
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_nothing.rs
@@ -0,0 +1,14 @@
+#![feature(min_specialization)]
+
+trait Special {
+ fn be_special();
+}
+
+impl<T> Special for T {
+ fn be_special() {}
+}
+
+impl Special for usize {}
+//~^ ERROR specialization impl does not specialize any associated items
+
+fn main() {}
diff --git a/tests/ui/specialization/min_specialization/specialize_nothing.stderr b/tests/ui/specialization/min_specialization/specialize_nothing.stderr
new file mode 100644
index 0000000..65f7378
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_nothing.stderr
@@ -0,0 +1,14 @@
+error: specialization impl does not specialize any associated items
+ --> $DIR/specialize_nothing.rs:11:1
+ |
+LL | impl Special for usize {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: impl is a specialization of this impl
+ --> $DIR/specialize_nothing.rs:7:1
+ |
+LL | impl<T> Special for T {
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/specialization/min_specialization/specialize_on_type_error.rs b/tests/ui/specialization/min_specialization/specialize_on_type_error.rs
new file mode 100644
index 0000000..24e92a0
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_on_type_error.rs
@@ -0,0 +1,33 @@
+// A regression test for #109815.
+
+#![feature(min_specialization)]
+#![feature(rustc_attrs)]
+
+#[rustc_specialization_trait]
+trait X {}
+trait Y: X {}
+trait Z {
+ type Assoc: Y;
+}
+struct A<T>(T);
+
+impl<T: X> Z for A<T> {}
+//~^ ERROR not all trait items implemented
+
+trait MyFrom<T> {
+ fn from(other: T) -> Self;
+}
+
+impl<T> MyFrom<T> for T {
+ default fn from(other: T) -> T {
+ other
+ }
+}
+
+impl<T: X> MyFrom<<A<T> as Z>::Assoc> for T {
+ fn from(other: <A<T> as Z>::Assoc) -> T {
+ other
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/specialization/min_specialization/specialize_on_type_error.stderr b/tests/ui/specialization/min_specialization/specialize_on_type_error.stderr
new file mode 100644
index 0000000..cc12302
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_on_type_error.stderr
@@ -0,0 +1,12 @@
+error[E0046]: not all trait items implemented, missing: `Assoc`
+ --> $DIR/specialize_on_type_error.rs:14:1
+ |
+LL | type Assoc: Y;
+ | ------------- `Assoc` from trait
+...
+LL | impl<T: X> Z for A<T> {}
+ | ^^^^^^^^^^^^^^^^^^^^^ missing `Assoc` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.rs b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.rs
new file mode 100644
index 0000000..d90b81f
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.rs
@@ -0,0 +1,50 @@
+// Regression test for #79457.
+
+#![feature(min_specialization)]
+
+use std::any::Any;
+
+pub trait Tr {
+ fn method(self) -> Box<dyn Any + 'static>;
+ fn other(self);
+}
+
+impl<T: Any + 'static> Tr for T {
+ default fn method(self) -> Box<dyn Any + 'static> {
+ Box::new(self)
+ }
+
+ default fn other(self) {}
+}
+
+impl<'a> Tr for &'a i32 {
+ //~^ ERROR does not fulfill the required lifetime
+ fn other(self) {}
+}
+
+fn promote_to_static<'a>(i: &'a i32) -> &'static i32 {
+ *i.method().downcast().unwrap()
+}
+
+struct Wrapper<'a>(&'a i32);
+
+impl<'a> Tr for Wrapper<'a> {
+ //~^ ERROR does not fulfill the required lifetime
+ fn other(self) {}
+}
+
+fn promote_to_static_2<'a>(w: Wrapper<'a>) -> Wrapper<'static> {
+ *w.method().downcast().unwrap()
+}
+
+fn main() {
+ let i = Box::new(100_i32);
+ let static_i: &'static i32 = promote_to_static(&*i);
+ drop(i);
+ println!("{}", *static_i);
+
+ let j = Box::new(200_i32);
+ let static_w: Wrapper<'static> = promote_to_static_2(Wrapper(&*j));
+ drop(j);
+ println!("{}", *static_w.0);
+}
diff --git a/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr
new file mode 100644
index 0000000..2af7587
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr
@@ -0,0 +1,27 @@
+error[E0477]: the type `&'a i32` does not fulfill the required lifetime
+ --> $DIR/specialize_with_generalize_lifetimes.rs:20:1
+ |
+LL | impl<'a> Tr for &'a i32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/specialize_with_generalize_lifetimes.rs:12:15
+ |
+LL | impl<T: Any + 'static> Tr for T {
+ | ^^^^^^^
+
+error[E0477]: the type `Wrapper<'a>` does not fulfill the required lifetime
+ --> $DIR/specialize_with_generalize_lifetimes.rs:31:1
+ |
+LL | impl<'a> Tr for Wrapper<'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/specialize_with_generalize_lifetimes.rs:12:15
+ |
+LL | impl<T: Any + 'static> Tr for T {
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0477`.
diff --git a/tests/ui/str/str-array-assignment.stderr b/tests/ui/str/str-array-assignment.stderr
index c23400a..515cb9e 100644
--- a/tests/ui/str/str-array-assignment.stderr
+++ b/tests/ui/str/str-array-assignment.stderr
@@ -10,10 +10,12 @@
--> $DIR/str-array-assignment.rs:5:27
|
LL | let u: &str = if true { s[..2] } else { s };
- | ^^^^^^
- | |
- | expected `&str`, found `str`
- | help: consider borrowing here: `&s[..2]`
+ | ^^^^^^ expected `&str`, found `str`
+ |
+help: consider borrowing here
+ |
+LL | let u: &str = if true { &s[..2] } else { s };
+ | +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/str-array-assignment.rs:7:7
@@ -33,11 +35,14 @@
--> $DIR/str-array-assignment.rs:9:17
|
LL | let w: &str = s[..2];
- | ---- ^^^^^^
- | | |
- | | expected `&str`, found `str`
- | | help: consider borrowing here: `&s[..2]`
+ | ---- ^^^^^^ expected `&str`, found `str`
+ | |
| expected due to this
+ |
+help: consider borrowing here
+ |
+LL | let w: &str = &s[..2];
+ | +
error: aborting due to 4 previous errors
diff --git a/tests/ui/structs-enums/issue-103869.fixed b/tests/ui/structs-enums/issue-103869.fixed
new file mode 100644
index 0000000..49fe32c
--- /dev/null
+++ b/tests/ui/structs-enums/issue-103869.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+struct VecOrMap {
+ //~^ HELP: perhaps you meant to use `struct` here
+ vec: Vec<usize>,
+ //~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `:`
+ //~| HELP: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
+}
+
+fn main() {
+ let o = VecOrMap { vec: vec![1, 2, 3] };
+ println!("{:?}", o.vec);
+}
diff --git a/tests/ui/structs-enums/issue-103869.rs b/tests/ui/structs-enums/issue-103869.rs
new file mode 100644
index 0000000..729079e
--- /dev/null
+++ b/tests/ui/structs-enums/issue-103869.rs
@@ -0,0 +1,13 @@
+// run-rustfix
+
+enum VecOrMap {
+ //~^ HELP: perhaps you meant to use `struct` here
+ vec: Vec<usize>,
+ //~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `:`
+ //~| HELP: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
+}
+
+fn main() {
+ let o = VecOrMap { vec: vec![1, 2, 3] };
+ println!("{:?}", o.vec);
+}
diff --git a/tests/ui/parser/issue-103869.stderr b/tests/ui/structs-enums/issue-103869.stderr
similarity index 71%
rename from tests/ui/parser/issue-103869.stderr
rename to tests/ui/structs-enums/issue-103869.stderr
index 9eb20e2..4665ebf 100644
--- a/tests/ui/parser/issue-103869.stderr
+++ b/tests/ui/structs-enums/issue-103869.stderr
@@ -1,12 +1,17 @@
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `:`
- --> $DIR/issue-103869.rs:2:8
+ --> $DIR/issue-103869.rs:5:8
|
-LL | enum VecOrMap{
+LL | enum VecOrMap {
| -------- while parsing this enum
+LL |
LL | vec: Vec<usize>,
| ^ expected one of `(`, `,`, `=`, `{`, or `}`
|
= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
+help: perhaps you meant to use `struct` here
+ |
+LL | struct VecOrMap {
+ | ~~~~~~
error: aborting due to previous error
diff --git a/tests/ui/suggestions/as-ref.stderr b/tests/ui/suggestions/as-ref.stderr
index 0ee343e..2147d2d 100644
--- a/tests/ui/suggestions/as-ref.stderr
+++ b/tests/ui/suggestions/as-ref.stderr
@@ -2,61 +2,73 @@
--> $DIR/as-ref.rs:7:29
|
LL | opt.map(|arg| takes_ref(arg));
- | --- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().map`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | opt.as_ref().map(|arg| takes_ref(arg));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:8:39
|
LL | opt.and_then(|arg| Some(takes_ref(arg)));
- | -------- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().and_then`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | opt.as_ref().and_then(|arg| Some(takes_ref(arg)));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:10:29
|
LL | opt.map(|arg| takes_ref(arg));
- | --- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().map`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | opt.as_ref().map(|arg| takes_ref(arg));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:11:37
|
LL | opt.and_then(|arg| Ok(takes_ref(arg)));
- | -------- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().and_then`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | opt.as_ref().and_then(|arg| Ok(takes_ref(arg)));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:13:29
@@ -101,61 +113,73 @@
--> $DIR/as-ref.rs:22:42
|
LL | multiple_ref_opt.map(|arg| takes_ref(arg));
- | --- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().map`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | multiple_ref_opt.as_ref().map(|arg| takes_ref(arg));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:23:52
|
LL | multiple_ref_opt.and_then(|arg| Some(takes_ref(arg)));
- | -------- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().and_then`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | multiple_ref_opt.as_ref().and_then(|arg| Some(takes_ref(arg)));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:25:45
|
LL | multiple_ref_result.map(|arg| takes_ref(arg));
- | --- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().map`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | multiple_ref_result.as_ref().map(|arg| takes_ref(arg));
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:26:53
|
LL | multiple_ref_result.and_then(|arg| Ok(takes_ref(arg)));
- | -------- --------- ^^^ expected `&Foo`, found `Foo`
- | | |
- | | arguments to this function are incorrect
- | help: consider using `as_ref` instead: `as_ref().and_then`
+ | --------- ^^^ expected `&Foo`, found `Foo`
+ | |
+ | arguments to this function are incorrect
|
note: function defined here
--> $DIR/as-ref.rs:3:4
|
LL | fn takes_ref(_: &Foo) {}
| ^^^^^^^^^ -------
+help: consider using `as_ref` instead
+ |
+LL | multiple_ref_result.as_ref().and_then(|arg| Ok(takes_ref(arg)));
+ | +++++++++
error: aborting due to 11 previous errors
diff --git a/tests/ui/suggestions/issue-68049-2.stderr b/tests/ui/suggestions/issue-68049-2.stderr
index de35aa5..6f3c784 100644
--- a/tests/ui/suggestions/issue-68049-2.stderr
+++ b/tests/ui/suggestions/issue-68049-2.stderr
@@ -4,10 +4,10 @@
LL | *input = self.0;
| ^^^^^^^^^^^^^^^ `input` is a `&` reference, so the data it refers to cannot be written
|
-help: consider changing that to be a mutable reference
+help: consider changing this to be a mutable reference
|
-LL | fn example(&self, input: &mut i32); // should suggest here
- | ~~~~~~~~
+LL | fn example(&self, input: &mut i32) { // should not suggest here
+ | +++
error[E0594]: cannot assign to `self.0`, which is behind a `&` reference
--> $DIR/issue-68049-2.rs:17:5
@@ -15,7 +15,7 @@
LL | self.0 += *input;
| ^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written
|
-help: consider changing that to be a mutable reference
+help: consider changing this to be a mutable reference
|
LL | fn example(&mut self, input: &i32); // should suggest here
| ~~~~~~~~~
diff --git a/tests/ui/suggestions/suggest-ref-macro.rs b/tests/ui/suggestions/suggest-ref-macro.rs
index 6f780f3..730f5fa 100644
--- a/tests/ui/suggestions/suggest-ref-macro.rs
+++ b/tests/ui/suggestions/suggest-ref-macro.rs
@@ -14,7 +14,7 @@ macro_rules! bla {
() => {
x(123);
//~^ ERROR mismatched types
- //~| SUGGESTION &mut 123
+ //~| SUGGESTION &mut
};
($v:expr) => {
x($v)
@@ -25,5 +25,5 @@ fn main() {
bla!();
bla!(456);
//~^ ERROR mismatched types
- //~| SUGGESTION &mut 456
+ //~| SUGGESTION &mut
}
diff --git a/tests/ui/suggestions/suggest-ref-macro.stderr b/tests/ui/suggestions/suggest-ref-macro.stderr
index 17de49f..08bc9e8 100644
--- a/tests/ui/suggestions/suggest-ref-macro.stderr
+++ b/tests/ui/suggestions/suggest-ref-macro.stderr
@@ -18,10 +18,8 @@
--> $DIR/suggest-ref-macro.rs:15:11
|
LL | x(123);
- | - ^^^
- | | |
- | | expected `&mut i32`, found integer
- | | help: consider mutably borrowing here: `&mut 123`
+ | - ^^^ expected `&mut i32`, found integer
+ | |
| arguments to this function are incorrect
...
LL | bla!();
@@ -33,6 +31,10 @@
LL | fn x(_: &mut i32) {}
| ^ -----------
= note: this error originates in the macro `bla` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider mutably borrowing here
+ |
+LL | x(&mut 123);
+ | ++++
error[E0308]: mismatched types
--> $DIR/suggest-ref-macro.rs:26:10
@@ -41,16 +43,17 @@
| - arguments to this function are incorrect
...
LL | bla!(456);
- | ^^^
- | |
- | expected `&mut i32`, found integer
- | help: consider mutably borrowing here: `&mut 456`
+ | ^^^ expected `&mut i32`, found integer
|
note: function defined here
--> $DIR/suggest-ref-macro.rs:11:4
|
LL | fn x(_: &mut i32) {}
| ^ -----------
+help: consider mutably borrowing here
+ |
+LL | bla!(&mut 456);
+ | ++++
error: aborting due to 3 previous errors
diff --git a/tests/ui/suggestions/suggest-ref-mut.rs b/tests/ui/suggestions/suggest-ref-mut.rs
index d04113f..b40439b 100644
--- a/tests/ui/suggestions/suggest-ref-mut.rs
+++ b/tests/ui/suggestions/suggest-ref-mut.rs
@@ -12,12 +12,10 @@ fn zap(&self) {
fn main() {
let ref foo = 16;
//~^ HELP
- //~| SUGGESTION ref mut foo
*foo = 32;
//~^ ERROR
if let Some(ref bar) = Some(16) {
//~^ HELP
- //~| SUGGESTION ref mut bar
*bar = 32;
//~^ ERROR
}
@@ -25,6 +23,5 @@ fn main() {
ref quo => { *quo = 32; },
//~^ ERROR
//~| HELP
- //~| SUGGESTION ref mut quo
}
}
diff --git a/tests/ui/suggestions/suggest-ref-mut.stderr b/tests/ui/suggestions/suggest-ref-mut.stderr
index 7973759..cc00022 100644
--- a/tests/ui/suggestions/suggest-ref-mut.stderr
+++ b/tests/ui/suggestions/suggest-ref-mut.stderr
@@ -10,7 +10,7 @@
| ~~~~~~~~~
error[E0594]: cannot assign to `*foo`, which is behind a `&` reference
- --> $DIR/suggest-ref-mut.rs:16:5
+ --> $DIR/suggest-ref-mut.rs:15:5
|
LL | *foo = 32;
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
@@ -18,10 +18,10 @@
help: consider changing this to be a mutable reference
|
LL | let ref mut foo = 16;
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
- --> $DIR/suggest-ref-mut.rs:21:9
+ --> $DIR/suggest-ref-mut.rs:19:9
|
LL | *bar = 32;
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
@@ -29,10 +29,10 @@
help: consider changing this to be a mutable reference
|
LL | if let Some(ref mut bar) = Some(16) {
- | ~~~~~~~~~~~
+ | +++
error[E0594]: cannot assign to `*quo`, which is behind a `&` reference
- --> $DIR/suggest-ref-mut.rs:25:22
+ --> $DIR/suggest-ref-mut.rs:23:22
|
LL | ref quo => { *quo = 32; },
| ^^^^^^^^^ `quo` is a `&` reference, so the data it refers to cannot be written
@@ -40,7 +40,7 @@
help: consider changing this to be a mutable reference
|
LL | ref mut quo => { *quo = 32; },
- | ~~~~~~~~~~~
+ | +++
error: aborting due to 4 previous errors
diff --git a/tests/ui/suggestions/type-ascription-instead-of-let.fixed b/tests/ui/suggestions/type-ascription-instead-of-let.fixed
new file mode 100644
index 0000000..e3d03b6
--- /dev/null
+++ b/tests/ui/suggestions/type-ascription-instead-of-let.fixed
@@ -0,0 +1,11 @@
+// run-rustfix
+
+fn fun(x: i32) -> i32 { x }
+
+fn main() {
+ let _closure_annotated = |value: i32| -> i32 {
+ let temp: i32 = fun(5i32);
+ //~^ ERROR expected identifier, found `:`
+ temp + value + 1
+ };
+}
diff --git a/tests/ui/suggestions/type-ascription-instead-of-let.rs b/tests/ui/suggestions/type-ascription-instead-of-let.rs
index 5ad6024..6e1c86f 100644
--- a/tests/ui/suggestions/type-ascription-instead-of-let.rs
+++ b/tests/ui/suggestions/type-ascription-instead-of-let.rs
@@ -1,7 +1,9 @@
+// run-rustfix
+
fn fun(x: i32) -> i32 { x }
fn main() {
- let closure_annotated = |value: i32| -> i32 {
+ let _closure_annotated = |value: i32| -> i32 {
temp: i32 = fun(5i32);
//~^ ERROR expected identifier, found `:`
temp + value + 1
diff --git a/tests/ui/suggestions/type-ascription-instead-of-let.stderr b/tests/ui/suggestions/type-ascription-instead-of-let.stderr
index fb697b0..065b1f4 100644
--- a/tests/ui/suggestions/type-ascription-instead-of-let.stderr
+++ b/tests/ui/suggestions/type-ascription-instead-of-let.stderr
@@ -1,8 +1,13 @@
error: expected identifier, found `:`
- --> $DIR/type-ascription-instead-of-let.rs:5:13
+ --> $DIR/type-ascription-instead-of-let.rs:7:13
|
LL | temp: i32 = fun(5i32);
| ^ expected identifier
+ |
+help: you might have meant to introduce a new binding
+ |
+LL | let temp: i32 = fun(5i32);
+ | +++
error: aborting due to previous error
diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
index 39b60c3..c054ddb 100644
--- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
+++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
@@ -7,7 +7,7 @@
help: consider changing this to be a mutable reference
|
LL | fn reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
- | ~~~~~~~~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
--> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:10:6
@@ -18,7 +18,7 @@
help: consider changing this to be a mutable reference
|
LL | fn copy_reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
- | ~~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to 2 previous errors
diff --git a/tests/ui/type/missing-let-in-binding-2.fixed b/tests/ui/type/missing-let-in-binding-2.fixed
new file mode 100644
index 0000000..d64013c
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-2.fixed
@@ -0,0 +1,5 @@
+// run-rustfix
+
+fn main() {
+ let _v: Vec<i32> = vec![1, 2, 3]; //~ ERROR expected identifier, found `:`
+}
diff --git a/tests/ui/type/missing-let-in-binding-2.rs b/tests/ui/type/missing-let-in-binding-2.rs
new file mode 100644
index 0000000..f95f7be
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-2.rs
@@ -0,0 +1,5 @@
+// run-rustfix
+
+fn main() {
+ _v: Vec<i32> = vec![1, 2, 3]; //~ ERROR expected identifier, found `:`
+}
diff --git a/tests/ui/type/missing-let-in-binding-2.stderr b/tests/ui/type/missing-let-in-binding-2.stderr
new file mode 100644
index 0000000..2e10125
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-2.stderr
@@ -0,0 +1,13 @@
+error: expected identifier, found `:`
+ --> $DIR/missing-let-in-binding-2.rs:4:7
+ |
+LL | _v: Vec<i32> = vec![1, 2, 3];
+ | ^ expected identifier
+ |
+help: you might have meant to introduce a new binding
+ |
+LL | let _v: Vec<i32> = vec![1, 2, 3];
+ | +++
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type/missing-let-in-binding-3.rs b/tests/ui/type/missing-let-in-binding-3.rs
new file mode 100644
index 0000000..d56b139
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-3.rs
@@ -0,0 +1,5 @@
+struct A {
+ : :u8, //~ ERROR expected identifier, found `:`
+}
+
+fn main() {}
diff --git a/tests/ui/type/missing-let-in-binding-3.stderr b/tests/ui/type/missing-let-in-binding-3.stderr
new file mode 100644
index 0000000..ca828ce
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-3.stderr
@@ -0,0 +1,10 @@
+error: expected identifier, found `:`
+ --> $DIR/missing-let-in-binding-3.rs:2:5
+ |
+LL | struct A {
+ | - while parsing this struct
+LL | : :u8,
+ | ^ expected identifier
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type/missing-let-in-binding-4.rs b/tests/ui/type/missing-let-in-binding-4.rs
new file mode 100644
index 0000000..879a6fe
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-4.rs
@@ -0,0 +1,5 @@
+struct A {
+ : u8 =, //~ ERROR expected identifier, found `:`
+}
+
+fn main() {}
diff --git a/tests/ui/type/missing-let-in-binding-4.stderr b/tests/ui/type/missing-let-in-binding-4.stderr
new file mode 100644
index 0000000..e6f173a
--- /dev/null
+++ b/tests/ui/type/missing-let-in-binding-4.stderr
@@ -0,0 +1,10 @@
+error: expected identifier, found `:`
+ --> $DIR/missing-let-in-binding-4.rs:2:5
+ |
+LL | struct A {
+ | - while parsing this struct
+LL | : u8 =,
+ | ^ expected identifier
+
+error: aborting due to previous error
+
diff --git a/tests/ui/type/type-mismatch.stderr b/tests/ui/type/type-mismatch.stderr
index 67a1f89..ce6f29d 100644
--- a/tests/ui/type/type-mismatch.stderr
+++ b/tests/ui/type/type-mismatch.stderr
@@ -378,10 +378,8 @@
--> $DIR/type-mismatch.rs:47:23
|
LL | want::<&Foo<foo>>(f);
- | ----------------- ^
- | | |
- | | expected `&Foo<foo>`, found `Foo<foo>`
- | | help: consider borrowing here: `&f`
+ | ----------------- ^ expected `&Foo<foo>`, found `Foo<foo>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&Foo<foo>`
@@ -391,6 +389,10 @@
|
LL | fn want<T>(t: T) {}
| ^^^^ ----
+help: consider borrowing here
+ |
+LL | want::<&Foo<foo>>(&f);
+ | +
error[E0308]: mismatched types
--> $DIR/type-mismatch.rs:48:26
@@ -556,10 +558,8 @@
--> $DIR/type-mismatch.rs:61:26
|
LL | want::<&Foo<foo, B>>(f);
- | -------------------- ^
- | | |
- | | expected `&Foo<foo, B>`, found `Foo<foo, B>`
- | | help: consider borrowing here: `&f`
+ | -------------------- ^ expected `&Foo<foo, B>`, found `Foo<foo, B>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&Foo<foo, B>`
@@ -569,6 +569,10 @@
|
LL | fn want<T>(t: T) {}
| ^^^^ ----
+help: consider borrowing here
+ |
+LL | want::<&Foo<foo, B>>(&f);
+ | +
error[E0308]: mismatched types
--> $DIR/type-mismatch.rs:65:19
diff --git a/tests/ui/typeck/bad-index-due-to-nested.stderr b/tests/ui/typeck/bad-index-due-to-nested.stderr
index cdb2337..f9cdb28 100644
--- a/tests/ui/typeck/bad-index-due-to-nested.stderr
+++ b/tests/ui/typeck/bad-index-due-to-nested.stderr
@@ -42,13 +42,14 @@
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
| - this type parameter
LL | map[k]
- | ^
- | |
- | expected `&K`, found type parameter `K`
- | help: consider borrowing here: `&k`
+ | ^ expected `&K`, found type parameter `K`
|
= note: expected reference `&K`
found type parameter `K`
+help: consider borrowing here
+ |
+LL | map[&k]
+ | +
error[E0308]: mismatched types
--> $DIR/bad-index-due-to-nested.rs:20:5
@@ -56,13 +57,14 @@
LL | fn index<'a, K, V>(map: &'a HashMap<K, V>, k: K) -> &'a V {
| - this type parameter ----- expected `&'a V` because of return type
LL | map[k]
- | ^^^^^^
- | |
- | expected `&V`, found type parameter `V`
- | help: consider borrowing here: `&map[k]`
+ | ^^^^^^ expected `&V`, found type parameter `V`
|
= note: expected reference `&'a V`
found type parameter `V`
+help: consider borrowing here
+ |
+LL | &map[k]
+ | +
error: aborting due to 4 previous errors
diff --git a/tests/ui/typeck/bad-type-in-vec-contains.stderr b/tests/ui/typeck/bad-type-in-vec-contains.stderr
index 72533ab..b9b3a5f 100644
--- a/tests/ui/typeck/bad-type-in-vec-contains.stderr
+++ b/tests/ui/typeck/bad-type-in-vec-contains.stderr
@@ -2,16 +2,18 @@
--> $DIR/bad-type-in-vec-contains.rs:5:21
|
LL | primes.contains(3);
- | -------- ^
- | | |
- | | expected `&_`, found integer
- | | help: consider borrowing here: `&3`
+ | -------- ^ expected `&_`, found integer
+ | |
| arguments to this method are incorrect
|
= note: expected reference `&_`
found type `{integer}`
note: method defined here
--> $SRC_DIR/core/src/slice/mod.rs:LL:COL
+help: consider borrowing here
+ |
+LL | primes.contains(&3);
+ | +
error: aborting due to previous error
diff --git a/tests/ui/typeck/issue-13853.stderr b/tests/ui/typeck/issue-13853.stderr
index 11d34f5..8ecb8b6 100644
--- a/tests/ui/typeck/issue-13853.stderr
+++ b/tests/ui/typeck/issue-13853.stderr
@@ -20,10 +20,8 @@
--> $DIR/issue-13853.rs:37:13
|
LL | iterate(graph);
- | ------- ^^^^^
- | | |
- | | expected `&_`, found `Vec<Stuff>`
- | | help: consider borrowing here: `&graph`
+ | ------- ^^^^^ expected `&_`, found `Vec<Stuff>`
+ | |
| arguments to this function are incorrect
|
= note: expected reference `&_`
@@ -33,6 +31,10 @@
|
LL | fn iterate<N: Node, G: Graph<N>>(graph: &G) {
| ^^^^^^^ ---------
+help: consider borrowing here
+ |
+LL | iterate(&graph);
+ | +
error: aborting due to 3 previous errors
diff --git a/tests/ui/unsized-locals/suggest-borrow.stderr b/tests/ui/unsized-locals/suggest-borrow.stderr
index d456c16..8741b35 100644
--- a/tests/ui/unsized-locals/suggest-borrow.stderr
+++ b/tests/ui/unsized-locals/suggest-borrow.stderr
@@ -16,11 +16,14 @@
--> $DIR/suggest-borrow.rs:3:20
|
LL | let x: &[u8] = vec!(1, 2, 3)[..];
- | ----- ^^^^^^^^^^^^^^^^^
- | | |
- | | expected `&[u8]`, found `[{integer}]`
- | | help: consider borrowing here: `&vec!(1, 2, 3)[..]`
+ | ----- ^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `[{integer}]`
+ | |
| expected due to this
+ |
+help: consider borrowing here
+ |
+LL | let x: &[u8] = &vec!(1, 2, 3)[..];
+ | +
error[E0308]: mismatched types
--> $DIR/suggest-borrow.rs:4:19