mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Auto merge of #124629 - matthiaskrgr:rollup-gttvzrg, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #124138 (Ignore LLVM ABI in dlltool tests since those targets don't use dlltool) - #124414 (remove extraneous note on `UnableToRunDsymutil` diagnostic) - #124579 (Align: add bytes_usize and bits_usize) - #124622 (Cleanup: Rid the `rmake` test runners of `extern crate run_make_support;`) - #124623 (shallow resolve in orphan check) - #124624 (Use `tcx.types.unit` instead of `Ty::new_unit(tcx)`) - #124627 (interpret: hide some reexports in rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
79734f1db8
@ -742,11 +742,21 @@ impl Align {
|
|||||||
1 << self.pow2
|
1 << self.pow2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn bytes_usize(self) -> usize {
|
||||||
|
self.bytes().try_into().unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn bits(self) -> u64 {
|
pub fn bits(self) -> u64 {
|
||||||
self.bytes() * 8
|
self.bytes() * 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn bits_usize(self) -> usize {
|
||||||
|
self.bits().try_into().unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
/// Computes the best alignment possible for the given offset
|
/// Computes the best alignment possible for the given offset
|
||||||
/// (the largest power of two that the offset is a multiple of).
|
/// (the largest power of two that the offset is a multiple of).
|
||||||
///
|
///
|
||||||
|
@ -1223,7 +1223,7 @@ fn get_rust_try_fn<'a, 'gcc, 'tcx>(
|
|||||||
tcx,
|
tcx,
|
||||||
ty::Binder::dummy(tcx.mk_fn_sig(
|
ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
iter::once(i8p),
|
iter::once(i8p),
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
rustc_hir::Unsafety::Unsafe,
|
rustc_hir::Unsafety::Unsafe,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
@ -1234,7 +1234,7 @@ fn get_rust_try_fn<'a, 'gcc, 'tcx>(
|
|||||||
tcx,
|
tcx,
|
||||||
ty::Binder::dummy(tcx.mk_fn_sig(
|
ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
[i8p, i8p].iter().cloned(),
|
[i8p, i8p].iter().cloned(),
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
rustc_hir::Unsafety::Unsafe,
|
rustc_hir::Unsafety::Unsafe,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
|
@ -984,7 +984,7 @@ fn get_rust_try_fn<'ll, 'tcx>(
|
|||||||
tcx,
|
tcx,
|
||||||
ty::Binder::dummy(tcx.mk_fn_sig(
|
ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
[i8p],
|
[i8p],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
hir::Unsafety::Unsafe,
|
hir::Unsafety::Unsafe,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
@ -995,7 +995,7 @@ fn get_rust_try_fn<'ll, 'tcx>(
|
|||||||
tcx,
|
tcx,
|
||||||
ty::Binder::dummy(tcx.mk_fn_sig(
|
ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
[i8p, i8p],
|
[i8p, i8p],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
hir::Unsafety::Unsafe,
|
hir::Unsafety::Unsafe,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
|
@ -431,7 +431,6 @@ pub struct ProcessingDymutilFailed {
|
|||||||
|
|
||||||
#[derive(Diagnostic)]
|
#[derive(Diagnostic)]
|
||||||
#[diag(codegen_ssa_unable_to_run_dsymutil)]
|
#[diag(codegen_ssa_unable_to_run_dsymutil)]
|
||||||
#[note]
|
|
||||||
pub struct UnableToRunDsymutil {
|
pub struct UnableToRunDsymutil {
|
||||||
pub error: Error,
|
pub error: Error,
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ mod util;
|
|||||||
mod validity;
|
mod validity;
|
||||||
mod visitor;
|
mod visitor;
|
||||||
|
|
||||||
|
#[doc(no_inline)]
|
||||||
pub use rustc_middle::mir::interpret::*; // have all the `interpret` symbols in one place: here
|
pub use rustc_middle::mir::interpret::*; // have all the `interpret` symbols in one place: here
|
||||||
|
|
||||||
pub use self::eval_context::{format_interp_error, Frame, FrameInfo, InterpCx, StackPopCleanup};
|
pub use self::eval_context::{format_interp_error, Frame, FrameInfo, InterpCx, StackPopCleanup};
|
||||||
|
@ -208,11 +208,11 @@ pub fn check_intrinsic_type(
|
|||||||
Ty::new_tup(tcx, &[param(0), tcx.types.bool]),
|
Ty::new_tup(tcx, &[param(0), tcx.types.bool]),
|
||||||
),
|
),
|
||||||
"load" => (1, vec![Ty::new_imm_ptr(tcx, param(0))], param(0)),
|
"load" => (1, vec![Ty::new_imm_ptr(tcx, param(0))], param(0)),
|
||||||
"store" => (1, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], Ty::new_unit(tcx)),
|
"store" => (1, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit),
|
||||||
|
|
||||||
"xchg" | "xadd" | "xsub" | "and" | "nand" | "or" | "xor" | "max" | "min" | "umax"
|
"xchg" | "xadd" | "xsub" | "and" | "nand" | "or" | "xor" | "max" | "min" | "umax"
|
||||||
| "umin" => (1, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], param(0)),
|
| "umin" => (1, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], param(0)),
|
||||||
"fence" | "singlethreadfence" => (0, Vec::new(), Ty::new_unit(tcx)),
|
"fence" | "singlethreadfence" => (0, Vec::new(), tcx.types.unit),
|
||||||
op => {
|
op => {
|
||||||
tcx.dcx().emit_err(UnrecognizedAtomicOperation { span, op });
|
tcx.dcx().emit_err(UnrecognizedAtomicOperation { span, op });
|
||||||
return;
|
return;
|
||||||
@ -224,7 +224,7 @@ pub fn check_intrinsic_type(
|
|||||||
let (n_tps, n_cts, inputs, output) = match intrinsic_name {
|
let (n_tps, n_cts, inputs, output) = match intrinsic_name {
|
||||||
sym::abort => (0, 0, vec![], tcx.types.never),
|
sym::abort => (0, 0, vec![], tcx.types.never),
|
||||||
sym::unreachable => (0, 0, vec![], tcx.types.never),
|
sym::unreachable => (0, 0, vec![], tcx.types.never),
|
||||||
sym::breakpoint => (0, 0, vec![], Ty::new_unit(tcx)),
|
sym::breakpoint => (0, 0, vec![], tcx.types.unit),
|
||||||
sym::size_of | sym::pref_align_of | sym::min_align_of | sym::variant_count => {
|
sym::size_of | sym::pref_align_of | sym::min_align_of | sym::variant_count => {
|
||||||
(1, 0, vec![], tcx.types.usize)
|
(1, 0, vec![], tcx.types.usize)
|
||||||
}
|
}
|
||||||
@ -235,14 +235,14 @@ pub fn check_intrinsic_type(
|
|||||||
sym::caller_location => (0, 0, vec![], tcx.caller_location_ty()),
|
sym::caller_location => (0, 0, vec![], tcx.caller_location_ty()),
|
||||||
sym::assert_inhabited
|
sym::assert_inhabited
|
||||||
| sym::assert_zero_valid
|
| sym::assert_zero_valid
|
||||||
| sym::assert_mem_uninitialized_valid => (1, 0, vec![], Ty::new_unit(tcx)),
|
| sym::assert_mem_uninitialized_valid => (1, 0, vec![], tcx.types.unit),
|
||||||
sym::forget => (1, 0, vec![param(0)], Ty::new_unit(tcx)),
|
sym::forget => (1, 0, vec![param(0)], tcx.types.unit),
|
||||||
sym::transmute | sym::transmute_unchecked => (2, 0, vec![param(0)], param(1)),
|
sym::transmute | sym::transmute_unchecked => (2, 0, vec![param(0)], param(1)),
|
||||||
sym::prefetch_read_data
|
sym::prefetch_read_data
|
||||||
| sym::prefetch_write_data
|
| sym::prefetch_write_data
|
||||||
| sym::prefetch_read_instruction
|
| sym::prefetch_read_instruction
|
||||||
| sym::prefetch_write_instruction => {
|
| sym::prefetch_write_instruction => {
|
||||||
(1, 0, vec![Ty::new_imm_ptr(tcx, param(0)), tcx.types.i32], Ty::new_unit(tcx))
|
(1, 0, vec![Ty::new_imm_ptr(tcx, param(0)), tcx.types.i32], tcx.types.unit)
|
||||||
}
|
}
|
||||||
sym::needs_drop => (1, 0, vec![], tcx.types.bool),
|
sym::needs_drop => (1, 0, vec![], tcx.types.bool),
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ pub fn check_intrinsic_type(
|
|||||||
Ty::new_mut_ptr(tcx, param(0)),
|
Ty::new_mut_ptr(tcx, param(0)),
|
||||||
tcx.types.usize,
|
tcx.types.usize,
|
||||||
],
|
],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
),
|
),
|
||||||
sym::volatile_copy_memory | sym::volatile_copy_nonoverlapping_memory => (
|
sym::volatile_copy_memory | sym::volatile_copy_nonoverlapping_memory => (
|
||||||
1,
|
1,
|
||||||
@ -280,7 +280,7 @@ pub fn check_intrinsic_type(
|
|||||||
Ty::new_imm_ptr(tcx, param(0)),
|
Ty::new_imm_ptr(tcx, param(0)),
|
||||||
tcx.types.usize,
|
tcx.types.usize,
|
||||||
],
|
],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
),
|
),
|
||||||
sym::compare_bytes => {
|
sym::compare_bytes => {
|
||||||
let byte_ptr = Ty::new_imm_ptr(tcx, tcx.types.u8);
|
let byte_ptr = Ty::new_imm_ptr(tcx, tcx.types.u8);
|
||||||
@ -290,7 +290,7 @@ pub fn check_intrinsic_type(
|
|||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
vec![Ty::new_mut_ptr(tcx, param(0)), tcx.types.u8, tcx.types.usize],
|
vec![Ty::new_mut_ptr(tcx, param(0)), tcx.types.u8, tcx.types.usize],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
),
|
),
|
||||||
|
|
||||||
sym::sqrtf16 => (0, 0, vec![tcx.types.f16], tcx.types.f16),
|
sym::sqrtf16 => (0, 0, vec![tcx.types.f16], tcx.types.f16),
|
||||||
@ -409,7 +409,7 @@ pub fn check_intrinsic_type(
|
|||||||
(1, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(0))
|
(1, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(0))
|
||||||
}
|
}
|
||||||
sym::volatile_store | sym::unaligned_volatile_store => {
|
sym::volatile_store | sym::unaligned_volatile_store => {
|
||||||
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], Ty::new_unit(tcx))
|
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
sym::ctpop | sym::ctlz | sym::ctlz_nonzero | sym::cttz | sym::cttz_nonzero => {
|
sym::ctpop | sym::ctlz | sym::ctlz_nonzero | sym::cttz | sym::cttz_nonzero => {
|
||||||
@ -440,7 +440,7 @@ pub fn check_intrinsic_type(
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
vec![Ty::new_mut_ptr(tcx, tcx.types.u8), tcx.types.usize, tcx.types.usize],
|
vec![Ty::new_mut_ptr(tcx, tcx.types.u8), tcx.types.usize, tcx.types.usize],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
),
|
),
|
||||||
|
|
||||||
sym::ptr_offset_from => (
|
sym::ptr_offset_from => (
|
||||||
@ -477,16 +477,16 @@ pub fn check_intrinsic_type(
|
|||||||
| sym::frem_algebraic => (1, 0, vec![param(0), param(0)], param(0)),
|
| sym::frem_algebraic => (1, 0, vec![param(0), param(0)], param(0)),
|
||||||
sym::float_to_int_unchecked => (2, 0, vec![param(0)], param(1)),
|
sym::float_to_int_unchecked => (2, 0, vec![param(0)], param(1)),
|
||||||
|
|
||||||
sym::assume => (0, 1, vec![tcx.types.bool], Ty::new_unit(tcx)),
|
sym::assume => (0, 1, vec![tcx.types.bool], tcx.types.unit),
|
||||||
sym::likely => (0, 1, vec![tcx.types.bool], tcx.types.bool),
|
sym::likely => (0, 1, vec![tcx.types.bool], tcx.types.bool),
|
||||||
sym::unlikely => (0, 1, vec![tcx.types.bool], tcx.types.bool),
|
sym::unlikely => (0, 1, vec![tcx.types.bool], tcx.types.bool),
|
||||||
|
|
||||||
sym::read_via_copy => (1, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(0)),
|
sym::read_via_copy => (1, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(0)),
|
||||||
sym::write_via_move => {
|
sym::write_via_move => {
|
||||||
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], Ty::new_unit(tcx))
|
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
sym::typed_swap => (1, 1, vec![Ty::new_mut_ptr(tcx, param(0)); 2], Ty::new_unit(tcx)),
|
sym::typed_swap => (1, 1, vec![Ty::new_mut_ptr(tcx, param(0)); 2], tcx.types.unit),
|
||||||
|
|
||||||
sym::discriminant_value => {
|
sym::discriminant_value => {
|
||||||
let assoc_items = tcx.associated_item_def_ids(
|
let assoc_items = tcx.associated_item_def_ids(
|
||||||
@ -511,14 +511,14 @@ pub fn check_intrinsic_type(
|
|||||||
let mut_u8 = Ty::new_mut_ptr(tcx, tcx.types.u8);
|
let mut_u8 = Ty::new_mut_ptr(tcx, tcx.types.u8);
|
||||||
let try_fn_ty = ty::Binder::dummy(tcx.mk_fn_sig(
|
let try_fn_ty = ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
[mut_u8],
|
[mut_u8],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
hir::Unsafety::Normal,
|
hir::Unsafety::Normal,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
));
|
));
|
||||||
let catch_fn_ty = ty::Binder::dummy(tcx.mk_fn_sig(
|
let catch_fn_ty = ty::Binder::dummy(tcx.mk_fn_sig(
|
||||||
[mut_u8, mut_u8],
|
[mut_u8, mut_u8],
|
||||||
Ty::new_unit(tcx),
|
tcx.types.unit,
|
||||||
false,
|
false,
|
||||||
hir::Unsafety::Normal,
|
hir::Unsafety::Normal,
|
||||||
Abi::Rust,
|
Abi::Rust,
|
||||||
@ -532,14 +532,14 @@ pub fn check_intrinsic_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
sym::va_start | sym::va_end => match mk_va_list_ty(hir::Mutability::Mut) {
|
sym::va_start | sym::va_end => match mk_va_list_ty(hir::Mutability::Mut) {
|
||||||
Some((va_list_ref_ty, _)) => (0, 0, vec![va_list_ref_ty], Ty::new_unit(tcx)),
|
Some((va_list_ref_ty, _)) => (0, 0, vec![va_list_ref_ty], tcx.types.unit),
|
||||||
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
|
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
|
||||||
},
|
},
|
||||||
|
|
||||||
sym::va_copy => match mk_va_list_ty(hir::Mutability::Not) {
|
sym::va_copy => match mk_va_list_ty(hir::Mutability::Not) {
|
||||||
Some((va_list_ref_ty, va_list_ty)) => {
|
Some((va_list_ref_ty, va_list_ty)) => {
|
||||||
let va_list_ptr_ty = Ty::new_mut_ptr(tcx, va_list_ty);
|
let va_list_ptr_ty = Ty::new_mut_ptr(tcx, va_list_ty);
|
||||||
(0, 0, vec![va_list_ptr_ty, va_list_ref_ty], Ty::new_unit(tcx))
|
(0, 0, vec![va_list_ptr_ty, va_list_ref_ty], tcx.types.unit)
|
||||||
}
|
}
|
||||||
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
|
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
|
||||||
},
|
},
|
||||||
@ -550,7 +550,7 @@ pub fn check_intrinsic_type(
|
|||||||
},
|
},
|
||||||
|
|
||||||
sym::nontemporal_store => {
|
sym::nontemporal_store => {
|
||||||
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], Ty::new_unit(tcx))
|
(1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
sym::raw_eq => {
|
sym::raw_eq => {
|
||||||
@ -570,7 +570,7 @@ pub fn check_intrinsic_type(
|
|||||||
sym::const_eval_select => (4, 1, vec![param(0), param(1), param(2)], param(3)),
|
sym::const_eval_select => (4, 1, vec![param(0), param(1), param(2)], param(3)),
|
||||||
|
|
||||||
sym::vtable_size | sym::vtable_align => {
|
sym::vtable_size | sym::vtable_align => {
|
||||||
(0, 0, vec![Ty::new_imm_ptr(tcx, Ty::new_unit(tcx))], tcx.types.usize)
|
(0, 0, vec![Ty::new_imm_ptr(tcx, tcx.types.unit)], tcx.types.usize)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This type check is not particularly useful, but the `where` bounds
|
// This type check is not particularly useful, but the `where` bounds
|
||||||
@ -623,8 +623,8 @@ pub fn check_intrinsic_type(
|
|||||||
sym::simd_fma => (1, 0, vec![param(0), param(0), param(0)], param(0)),
|
sym::simd_fma => (1, 0, vec![param(0), param(0), param(0)], param(0)),
|
||||||
sym::simd_gather => (3, 0, vec![param(0), param(1), param(2)], param(0)),
|
sym::simd_gather => (3, 0, vec![param(0), param(1), param(2)], param(0)),
|
||||||
sym::simd_masked_load => (3, 0, vec![param(0), param(1), param(2)], param(2)),
|
sym::simd_masked_load => (3, 0, vec![param(0), param(1), param(2)], param(2)),
|
||||||
sym::simd_masked_store => (3, 0, vec![param(0), param(1), param(2)], Ty::new_unit(tcx)),
|
sym::simd_masked_store => (3, 0, vec![param(0), param(1), param(2)], tcx.types.unit),
|
||||||
sym::simd_scatter => (3, 0, vec![param(0), param(1), param(2)], Ty::new_unit(tcx)),
|
sym::simd_scatter => (3, 0, vec![param(0), param(1), param(2)], tcx.types.unit),
|
||||||
sym::simd_insert => (2, 0, vec![param(0), tcx.types.u32, param(1)], param(0)),
|
sym::simd_insert => (2, 0, vec![param(0), tcx.types.u32, param(1)], param(0)),
|
||||||
sym::simd_extract => (2, 0, vec![param(0), tcx.types.u32], param(1)),
|
sym::simd_extract => (2, 0, vec![param(0), tcx.types.u32], param(1)),
|
||||||
sym::simd_cast
|
sym::simd_cast
|
||||||
|
@ -330,6 +330,7 @@ fn orphan_check<'tcx>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let Ok(result) = traits::orphan_check_trait_ref::<!>(
|
let Ok(result) = traits::orphan_check_trait_ref::<!>(
|
||||||
|
&infcx,
|
||||||
trait_ref,
|
trait_ref,
|
||||||
traits::InCrate::Local { mode },
|
traits::InCrate::Local { mode },
|
||||||
lazily_normalize_ty,
|
lazily_normalize_ty,
|
||||||
|
@ -2370,7 +2370,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||||||
self.lower_ty(output)
|
self.lower_ty(output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hir::FnRetTy::DefaultReturn(..) => Ty::new_unit(tcx),
|
hir::FnRetTy::DefaultReturn(..) => tcx.types.unit,
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!(?output_ty);
|
debug!(?output_ty);
|
||||||
|
@ -66,7 +66,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
// us to give better error messages (pointing to a usually better
|
// us to give better error messages (pointing to a usually better
|
||||||
// arm for inconsistent arms or to the whole match when a `()` type
|
// arm for inconsistent arms or to the whole match when a `()` type
|
||||||
// is required).
|
// is required).
|
||||||
Expectation::ExpectHasType(ety) if ety != Ty::new_unit(self.tcx) => ety,
|
Expectation::ExpectHasType(ety) if ety != tcx.types.unit => ety,
|
||||||
_ => self.next_ty_var(TypeVariableOrigin { param_def_id: None, span: expr.span }),
|
_ => self.next_ty_var(TypeVariableOrigin { param_def_id: None, span: expr.span }),
|
||||||
};
|
};
|
||||||
CoerceMany::with_coercion_sites(coerce_first, arms)
|
CoerceMany::with_coercion_sites(coerce_first, arms)
|
||||||
|
@ -1462,7 +1462,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
|
|||||||
fcx,
|
fcx,
|
||||||
cause,
|
cause,
|
||||||
None,
|
None,
|
||||||
Ty::new_unit(fcx.tcx),
|
fcx.tcx.types.unit,
|
||||||
augment_error,
|
augment_error,
|
||||||
label_unit_as_expected,
|
label_unit_as_expected,
|
||||||
)
|
)
|
||||||
|
@ -654,7 +654,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
} else {
|
} else {
|
||||||
// Otherwise, this is a break *without* a value. That's
|
// Otherwise, this is a break *without* a value. That's
|
||||||
// always legal, and is equivalent to `break ()`.
|
// always legal, and is equivalent to `break ()`.
|
||||||
e_ty = Ty::new_unit(tcx);
|
e_ty = tcx.types.unit;
|
||||||
cause = self.misc(expr.span);
|
cause = self.misc(expr.span);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1133,7 +1133,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
// The expected type is `bool` but this will result in `()` so we can reasonably
|
// The expected type is `bool` but this will result in `()` so we can reasonably
|
||||||
// say that the user intended to write `lhs == rhs` instead of `lhs = rhs`.
|
// say that the user intended to write `lhs == rhs` instead of `lhs = rhs`.
|
||||||
// The likely cause of this is `if foo = bar { .. }`.
|
// The likely cause of this is `if foo = bar { .. }`.
|
||||||
let actual_ty = Ty::new_unit(self.tcx);
|
let actual_ty = self.tcx.types.unit;
|
||||||
let mut err = self.demand_suptype_diag(expr.span, expected_ty, actual_ty).unwrap();
|
let mut err = self.demand_suptype_diag(expr.span, expected_ty, actual_ty).unwrap();
|
||||||
let lhs_ty = self.check_expr(lhs);
|
let lhs_ty = self.check_expr(lhs);
|
||||||
let rhs_ty = self.check_expr(rhs);
|
let rhs_ty = self.check_expr(rhs);
|
||||||
@ -1256,7 +1256,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
if let Err(guar) = (lhs_ty, rhs_ty).error_reported() {
|
if let Err(guar) = (lhs_ty, rhs_ty).error_reported() {
|
||||||
Ty::new_error(self.tcx, guar)
|
Ty::new_error(self.tcx, guar)
|
||||||
} else {
|
} else {
|
||||||
Ty::new_unit(self.tcx)
|
self.tcx.types.unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1319,7 +1319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
if ctxt.coerce.is_none() && !ctxt.may_break {
|
if ctxt.coerce.is_none() && !ctxt.may_break {
|
||||||
self.dcx().span_bug(body.span, "no coercion, but loop may not break");
|
self.dcx().span_bug(body.span, "no coercion, but loop may not break");
|
||||||
}
|
}
|
||||||
ctxt.coerce.map(|c| c.complete(self)).unwrap_or_else(|| Ty::new_unit(self.tcx))
|
ctxt.coerce.map(|c| c.complete(self)).unwrap_or_else(|| self.tcx.types.unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks a method call.
|
/// Checks a method call.
|
||||||
@ -3174,7 +3174,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
self.dcx().emit_err(YieldExprOutsideOfCoroutine { span: expr.span });
|
self.dcx().emit_err(YieldExprOutsideOfCoroutine { span: expr.span });
|
||||||
// Avoid expressions without types during writeback (#78653).
|
// Avoid expressions without types during writeback (#78653).
|
||||||
self.check_expr(value);
|
self.check_expr(value);
|
||||||
Ty::new_unit(self.tcx)
|
self.tcx.types.unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1660,7 +1660,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
hir::StmtKind::Item(_) => {}
|
hir::StmtKind::Item(_) => {}
|
||||||
hir::StmtKind::Expr(ref expr) => {
|
hir::StmtKind::Expr(ref expr) => {
|
||||||
// Check with expected type of `()`.
|
// Check with expected type of `()`.
|
||||||
self.check_expr_has_type_or_error(expr, Ty::new_unit(self.tcx), |err| {
|
self.check_expr_has_type_or_error(expr, self.tcx.types.unit, |err| {
|
||||||
if expr.can_have_side_effects() {
|
if expr.can_have_side_effects() {
|
||||||
self.suggest_semicolon_at_end(expr.span, err);
|
self.suggest_semicolon_at_end(expr.span, err);
|
||||||
}
|
}
|
||||||
@ -1676,7 +1676,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_block_no_value(&self, blk: &'tcx hir::Block<'tcx>) {
|
pub fn check_block_no_value(&self, blk: &'tcx hir::Block<'tcx>) {
|
||||||
let unit = Ty::new_unit(self.tcx);
|
let unit = self.tcx.types.unit;
|
||||||
let ty = self.check_block_with_expected(blk, ExpectHasType(unit));
|
let ty = self.check_block_with_expected(blk, ExpectHasType(unit));
|
||||||
|
|
||||||
// if the block produces a `!` value, that can always be
|
// if the block produces a `!` value, that can always be
|
||||||
@ -1794,7 +1794,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
blk.span,
|
blk.span,
|
||||||
blk.hir_id,
|
blk.hir_id,
|
||||||
expected_ty,
|
expected_ty,
|
||||||
Ty::new_unit(self.tcx),
|
self.tcx.types.unit,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if !self.err_ctxt().consider_removing_semicolon(
|
if !self.err_ctxt().consider_removing_semicolon(
|
||||||
|
@ -39,7 +39,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
let ty =
|
let ty =
|
||||||
if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) {
|
if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) {
|
||||||
self.enforce_builtin_binop_types(lhs.span, lhs_ty, rhs.span, rhs_ty, op);
|
self.enforce_builtin_binop_types(lhs.span, lhs_ty, rhs.span, rhs_ty, op);
|
||||||
Ty::new_unit(self.tcx)
|
self.tcx.types.unit
|
||||||
} else {
|
} else {
|
||||||
return_ty
|
return_ty
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use crate::lints::UnitBindingsDiag;
|
use crate::lints::UnitBindingsDiag;
|
||||||
use crate::{LateLintPass, LintContext};
|
use crate::{LateLintPass, LintContext};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_middle::ty::Ty;
|
|
||||||
use rustc_session::{declare_lint, declare_lint_pass};
|
use rustc_session::{declare_lint, declare_lint_pass};
|
||||||
|
|
||||||
declare_lint! {
|
declare_lint! {
|
||||||
@ -57,8 +56,8 @@ impl<'tcx> LateLintPass<'tcx> for UnitBindings {
|
|||||||
&& let Some(init) = local.init
|
&& let Some(init) = local.init
|
||||||
&& let init_ty = tyck_results.expr_ty(init)
|
&& let init_ty = tyck_results.expr_ty(init)
|
||||||
&& let local_ty = tyck_results.node_type(local.hir_id)
|
&& let local_ty = tyck_results.node_type(local.hir_id)
|
||||||
&& init_ty == Ty::new_unit(cx.tcx)
|
&& init_ty == cx.tcx.types.unit
|
||||||
&& local_ty == Ty::new_unit(cx.tcx)
|
&& local_ty == cx.tcx.types.unit
|
||||||
&& local.ty.is_none()
|
&& local.ty.is_none()
|
||||||
&& !matches!(init.kind, hir::ExprKind::Tup([]))
|
&& !matches!(init.kind, hir::ExprKind::Tup([]))
|
||||||
&& !matches!(local.pat.kind, hir::PatKind::Tuple([], ..))
|
&& !matches!(local.pat.kind, hir::PatKind::Tuple([], ..))
|
||||||
|
@ -125,7 +125,7 @@ impl Primitive {
|
|||||||
F64 => tcx.types.f64,
|
F64 => tcx.types.f64,
|
||||||
F128 => tcx.types.f128,
|
F128 => tcx.types.f128,
|
||||||
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
|
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
|
||||||
Pointer(_) => Ty::new_mut_ptr(tcx, Ty::new_unit(tcx)),
|
Pointer(_) => Ty::new_mut_ptr(tcx, tcx.types.unit),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ where
|
|||||||
// (which may have no non-DST form), and will work as long
|
// (which may have no non-DST form), and will work as long
|
||||||
// as the `Abi` or `FieldsShape` is checked by users.
|
// as the `Abi` or `FieldsShape` is checked by users.
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
let nil = Ty::new_unit(tcx);
|
let nil = tcx.types.unit;
|
||||||
let unit_ptr_ty = if this.ty.is_unsafe_ptr() {
|
let unit_ptr_ty = if this.ty.is_unsafe_ptr() {
|
||||||
Ty::new_mut_ptr(tcx, nil)
|
Ty::new_mut_ptr(tcx, nil)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1750,11 +1750,6 @@ impl<'tcx> Ty<'tcx> {
|
|||||||
|
|
||||||
// misc
|
// misc
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn new_unit(tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
|
||||||
tcx.types.unit
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new_static_str(tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
pub fn new_static_str(tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
||||||
Ty::new_imm_ref(tcx, tcx.lifetimes.re_static, tcx.types.str_)
|
Ty::new_imm_ref(tcx, tcx.lifetimes.re_static, tcx.types.str_)
|
||||||
|
@ -997,7 +997,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
match self.unit_temp {
|
match self.unit_temp {
|
||||||
Some(tmp) => tmp,
|
Some(tmp) => tmp,
|
||||||
None => {
|
None => {
|
||||||
let ty = Ty::new_unit(self.tcx);
|
let ty = self.tcx.types.unit;
|
||||||
let fn_span = self.fn_span;
|
let fn_span = self.fn_span;
|
||||||
let tmp = self.temp(ty, fn_span);
|
let tmp = self.temp(ty, fn_span);
|
||||||
self.unit_temp = Some(tmp);
|
self.unit_temp = Some(tmp);
|
||||||
|
@ -15,7 +15,7 @@ use rustc_hir::HirId;
|
|||||||
use rustc_hir::Node;
|
use rustc_hir::Node;
|
||||||
use rustc_middle::middle::region;
|
use rustc_middle::middle::region;
|
||||||
use rustc_middle::thir::*;
|
use rustc_middle::thir::*;
|
||||||
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt};
|
use rustc_middle::ty::{self, RvalueScopes, TyCtxt};
|
||||||
|
|
||||||
pub(crate) fn thir_body(
|
pub(crate) fn thir_body(
|
||||||
tcx: TyCtxt<'_>,
|
tcx: TyCtxt<'_>,
|
||||||
@ -39,7 +39,7 @@ pub(crate) fn thir_body(
|
|||||||
// It will always be `()` in this case.
|
// It will always be `()` in this case.
|
||||||
if tcx.is_coroutine(owner_def.to_def_id()) && body.params.is_empty() {
|
if tcx.is_coroutine(owner_def.to_def_id()) && body.params.is_empty() {
|
||||||
cx.thir.params.push(Param {
|
cx.thir.params.push(Param {
|
||||||
ty: Ty::new_unit(tcx),
|
ty: tcx.types.unit,
|
||||||
pat: None,
|
pat: None,
|
||||||
ty_span: None,
|
ty_span: None,
|
||||||
self_kind: None,
|
self_kind: None,
|
||||||
|
@ -631,7 +631,7 @@ where
|
|||||||
|
|
||||||
let ref_ty = Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, ty);
|
let ref_ty = Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, ty);
|
||||||
let ref_place = self.new_temp(ref_ty);
|
let ref_place = self.new_temp(ref_ty);
|
||||||
let unit_temp = Place::from(self.new_temp(Ty::new_unit(tcx)));
|
let unit_temp = Place::from(self.new_temp(tcx.types.unit));
|
||||||
|
|
||||||
let result = BasicBlockData {
|
let result = BasicBlockData {
|
||||||
statements: vec![self.assign(
|
statements: vec![self.assign(
|
||||||
|
@ -1260,7 +1260,7 @@ fn create_coroutine_drop_shim<'tcx>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace the return variable
|
// Replace the return variable
|
||||||
body.local_decls[RETURN_PLACE] = LocalDecl::with_source_info(Ty::new_unit(tcx), source_info);
|
body.local_decls[RETURN_PLACE] = LocalDecl::with_source_info(tcx.types.unit, source_info);
|
||||||
|
|
||||||
make_coroutine_state_argument_indirect(tcx, &mut body);
|
make_coroutine_state_argument_indirect(tcx, &mut body);
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use crate::solve::GoalSource;
|
use crate::solve::GoalSource;
|
||||||
use crate::solve::{inspect, EvalCtxt, SolverMode};
|
use crate::solve::{inspect, EvalCtxt, SolverMode};
|
||||||
use crate::traits::coherence;
|
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::DefId;
|
||||||
use rustc_infer::traits::query::NoSolution;
|
use rustc_infer::traits::query::NoSolution;
|
||||||
use rustc_middle::traits::solve::inspect::ProbeKind;
|
use rustc_middle::traits::solve::inspect::ProbeKind;
|
||||||
@ -769,13 +768,10 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
|||||||
candidates.extend(self.probe_trait_candidate(CandidateSource::CoherenceUnknowable).enter(
|
candidates.extend(self.probe_trait_candidate(CandidateSource::CoherenceUnknowable).enter(
|
||||||
|ecx| {
|
|ecx| {
|
||||||
let trait_ref = goal.predicate.trait_ref(tcx);
|
let trait_ref = goal.predicate.trait_ref(tcx);
|
||||||
let lazily_normalize_ty = |ty| ecx.structurally_normalize_ty(goal.param_env, ty);
|
if ecx.trait_ref_is_knowable(goal.param_env, trait_ref)? {
|
||||||
|
Err(NoSolution)
|
||||||
match coherence::trait_ref_is_knowable(tcx, trait_ref, lazily_normalize_ty)? {
|
} else {
|
||||||
Ok(()) => Err(NoSolution),
|
ecx.evaluate_added_goals_and_make_canonical_response(Certainty::AMBIGUOUS)
|
||||||
Err(_) => {
|
|
||||||
ecx.evaluate_added_goals_and_make_canonical_response(Certainty::AMBIGUOUS)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
@ -27,6 +27,7 @@ use rustc_span::DUMMY_SP;
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
|
use crate::traits::coherence;
|
||||||
use crate::traits::vtable::{count_own_vtable_entries, prepare_vtable_segments, VtblSegment};
|
use crate::traits::vtable::{count_own_vtable_entries, prepare_vtable_segments, VtblSegment};
|
||||||
|
|
||||||
use super::inspect::ProofTreeBuilder;
|
use super::inspect::ProofTreeBuilder;
|
||||||
@ -942,6 +943,17 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(super) fn trait_ref_is_knowable(
|
||||||
|
&mut self,
|
||||||
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
|
trait_ref: ty::TraitRef<'tcx>,
|
||||||
|
) -> Result<bool, NoSolution> {
|
||||||
|
let infcx = self.infcx;
|
||||||
|
let lazily_normalize_ty = |ty| self.structurally_normalize_ty(param_env, ty);
|
||||||
|
coherence::trait_ref_is_knowable(infcx, trait_ref, lazily_normalize_ty)
|
||||||
|
.map(|is_knowable| is_knowable.is_ok())
|
||||||
|
}
|
||||||
|
|
||||||
pub(super) fn can_define_opaque_ty(&self, def_id: impl Into<DefId>) -> bool {
|
pub(super) fn can_define_opaque_ty(&self, def_id: impl Into<DefId>) -> bool {
|
||||||
self.infcx.can_define_opaque_ty(def_id)
|
self.infcx.can_define_opaque_ty(def_id)
|
||||||
}
|
}
|
||||||
|
@ -618,19 +618,20 @@ fn try_prove_negated_where_clause<'tcx>(
|
|||||||
/// This both checks whether any downstream or sibling crates could
|
/// This both checks whether any downstream or sibling crates could
|
||||||
/// implement it and whether an upstream crate can add this impl
|
/// implement it and whether an upstream crate can add this impl
|
||||||
/// without breaking backwards compatibility.
|
/// without breaking backwards compatibility.
|
||||||
#[instrument(level = "debug", skip(tcx, lazily_normalize_ty), ret)]
|
#[instrument(level = "debug", skip(infcx, lazily_normalize_ty), ret)]
|
||||||
pub fn trait_ref_is_knowable<'tcx, E: Debug>(
|
pub fn trait_ref_is_knowable<'tcx, E: Debug>(
|
||||||
tcx: TyCtxt<'tcx>,
|
infcx: &InferCtxt<'tcx>,
|
||||||
trait_ref: ty::TraitRef<'tcx>,
|
trait_ref: ty::TraitRef<'tcx>,
|
||||||
mut lazily_normalize_ty: impl FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
mut lazily_normalize_ty: impl FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
||||||
) -> Result<Result<(), Conflict>, E> {
|
) -> Result<Result<(), Conflict>, E> {
|
||||||
if orphan_check_trait_ref(trait_ref, InCrate::Remote, &mut lazily_normalize_ty)?.is_ok() {
|
if orphan_check_trait_ref(infcx, trait_ref, InCrate::Remote, &mut lazily_normalize_ty)?.is_ok()
|
||||||
|
{
|
||||||
// A downstream or cousin crate is allowed to implement some
|
// A downstream or cousin crate is allowed to implement some
|
||||||
// generic parameters of this trait-ref.
|
// generic parameters of this trait-ref.
|
||||||
return Ok(Err(Conflict::Downstream));
|
return Ok(Err(Conflict::Downstream));
|
||||||
}
|
}
|
||||||
|
|
||||||
if trait_ref_is_local_or_fundamental(tcx, trait_ref) {
|
if trait_ref_is_local_or_fundamental(infcx.tcx, trait_ref) {
|
||||||
// This is a local or fundamental trait, so future-compatibility
|
// This is a local or fundamental trait, so future-compatibility
|
||||||
// is no concern. We know that downstream/cousin crates are not
|
// is no concern. We know that downstream/cousin crates are not
|
||||||
// allowed to implement a generic parameter of this trait ref,
|
// allowed to implement a generic parameter of this trait ref,
|
||||||
@ -648,6 +649,7 @@ pub fn trait_ref_is_knowable<'tcx, E: Debug>(
|
|||||||
// about future-compatibility, which means that we're OK if
|
// about future-compatibility, which means that we're OK if
|
||||||
// we are an owner.
|
// we are an owner.
|
||||||
if orphan_check_trait_ref(
|
if orphan_check_trait_ref(
|
||||||
|
infcx,
|
||||||
trait_ref,
|
trait_ref,
|
||||||
InCrate::Local { mode: OrphanCheckMode::Proper },
|
InCrate::Local { mode: OrphanCheckMode::Proper },
|
||||||
&mut lazily_normalize_ty,
|
&mut lazily_normalize_ty,
|
||||||
@ -786,38 +788,32 @@ pub struct UncoveredTyParams<'tcx, T> {
|
|||||||
///
|
///
|
||||||
/// Note that this function is never called for types that have both type
|
/// Note that this function is never called for types that have both type
|
||||||
/// parameters and inference variables.
|
/// parameters and inference variables.
|
||||||
#[instrument(level = "trace", skip(lazily_normalize_ty), ret)]
|
#[instrument(level = "trace", skip(infcx, lazily_normalize_ty), ret)]
|
||||||
pub fn orphan_check_trait_ref<'tcx, E: Debug>(
|
pub fn orphan_check_trait_ref<'tcx, E: Debug>(
|
||||||
|
infcx: &InferCtxt<'tcx>,
|
||||||
trait_ref: ty::TraitRef<'tcx>,
|
trait_ref: ty::TraitRef<'tcx>,
|
||||||
in_crate: InCrate,
|
in_crate: InCrate,
|
||||||
lazily_normalize_ty: impl FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
lazily_normalize_ty: impl FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
||||||
) -> Result<Result<(), OrphanCheckErr<'tcx, Ty<'tcx>>>, E> {
|
) -> Result<Result<(), OrphanCheckErr<'tcx, Ty<'tcx>>>, E> {
|
||||||
if trait_ref.has_infer() && trait_ref.has_param() {
|
if trait_ref.has_param() {
|
||||||
bug!(
|
bug!("orphan check only expects inference variables: {trait_ref:?}");
|
||||||
"can't orphan check a trait ref with both params and inference variables {:?}",
|
|
||||||
trait_ref
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut checker = OrphanChecker::new(in_crate, lazily_normalize_ty);
|
let mut checker = OrphanChecker::new(infcx, in_crate, lazily_normalize_ty);
|
||||||
|
|
||||||
// Does there exist some local type after the `ParamTy`.
|
|
||||||
let search_first_local_ty = |checker: &mut OrphanChecker<'tcx, _>| {
|
|
||||||
checker.search_first_local_ty = true;
|
|
||||||
match trait_ref.visit_with(checker).break_value() {
|
|
||||||
Some(OrphanCheckEarlyExit::LocalTy(local_ty)) => Some(local_ty),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(match trait_ref.visit_with(&mut checker) {
|
Ok(match trait_ref.visit_with(&mut checker) {
|
||||||
ControlFlow::Continue(()) => Err(OrphanCheckErr::NonLocalInputType(checker.non_local_tys)),
|
ControlFlow::Continue(()) => Err(OrphanCheckErr::NonLocalInputType(checker.non_local_tys)),
|
||||||
ControlFlow::Break(residual) => match residual {
|
ControlFlow::Break(residual) => match residual {
|
||||||
OrphanCheckEarlyExit::NormalizationFailure(err) => return Err(err),
|
OrphanCheckEarlyExit::NormalizationFailure(err) => return Err(err),
|
||||||
OrphanCheckEarlyExit::UncoveredTyParam(ty) => {
|
OrphanCheckEarlyExit::UncoveredTyParam(ty) => {
|
||||||
|
// Does there exist some local type after the `ParamTy`.
|
||||||
|
checker.search_first_local_ty = true;
|
||||||
|
let local_ty = match trait_ref.visit_with(&mut checker).break_value() {
|
||||||
|
Some(OrphanCheckEarlyExit::LocalTy(local_ty)) => Some(local_ty),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
Err(OrphanCheckErr::UncoveredTyParams(UncoveredTyParams {
|
Err(OrphanCheckErr::UncoveredTyParams(UncoveredTyParams {
|
||||||
uncovered: ty,
|
uncovered: ty,
|
||||||
local_ty: search_first_local_ty(&mut checker),
|
local_ty,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
OrphanCheckEarlyExit::LocalTy(_) => Ok(()),
|
OrphanCheckEarlyExit::LocalTy(_) => Ok(()),
|
||||||
@ -825,7 +821,8 @@ pub fn orphan_check_trait_ref<'tcx, E: Debug>(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
struct OrphanChecker<'tcx, F> {
|
struct OrphanChecker<'a, 'tcx, F> {
|
||||||
|
infcx: &'a InferCtxt<'tcx>,
|
||||||
in_crate: InCrate,
|
in_crate: InCrate,
|
||||||
in_self_ty: bool,
|
in_self_ty: bool,
|
||||||
lazily_normalize_ty: F,
|
lazily_normalize_ty: F,
|
||||||
@ -834,12 +831,13 @@ struct OrphanChecker<'tcx, F> {
|
|||||||
non_local_tys: Vec<(Ty<'tcx>, IsFirstInputType)>,
|
non_local_tys: Vec<(Ty<'tcx>, IsFirstInputType)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx, F, E> OrphanChecker<'tcx, F>
|
impl<'a, 'tcx, F, E> OrphanChecker<'a, 'tcx, F>
|
||||||
where
|
where
|
||||||
F: FnOnce(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
F: FnOnce(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
||||||
{
|
{
|
||||||
fn new(in_crate: InCrate, lazily_normalize_ty: F) -> Self {
|
fn new(infcx: &'a InferCtxt<'tcx>, in_crate: InCrate, lazily_normalize_ty: F) -> Self {
|
||||||
OrphanChecker {
|
OrphanChecker {
|
||||||
|
infcx,
|
||||||
in_crate,
|
in_crate,
|
||||||
in_self_ty: true,
|
in_self_ty: true,
|
||||||
lazily_normalize_ty,
|
lazily_normalize_ty,
|
||||||
@ -878,7 +876,7 @@ enum OrphanCheckEarlyExit<'tcx, E> {
|
|||||||
LocalTy(Ty<'tcx>),
|
LocalTy(Ty<'tcx>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx, F, E> TypeVisitor<TyCtxt<'tcx>> for OrphanChecker<'tcx, F>
|
impl<'a, 'tcx, F, E> TypeVisitor<TyCtxt<'tcx>> for OrphanChecker<'a, 'tcx, F>
|
||||||
where
|
where
|
||||||
F: FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
F: FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,
|
||||||
{
|
{
|
||||||
@ -889,6 +887,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn visit_ty(&mut self, ty: Ty<'tcx>) -> Self::Result {
|
fn visit_ty(&mut self, ty: Ty<'tcx>) -> Self::Result {
|
||||||
|
let ty = self.infcx.shallow_resolve(ty);
|
||||||
let ty = match (self.lazily_normalize_ty)(ty) {
|
let ty = match (self.lazily_normalize_ty)(ty) {
|
||||||
Ok(norm_ty) if norm_ty.is_ty_var() => ty,
|
Ok(norm_ty) if norm_ty.is_ty_var() => ty,
|
||||||
Ok(norm_ty) => norm_ty,
|
Ok(norm_ty) => norm_ty,
|
||||||
@ -1149,7 +1148,7 @@ impl<'a, 'tcx> ProofTreeVisitor<'tcx> for AmbiguityCausesVisitor<'a, 'tcx> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
infcx.probe(|_| {
|
infcx.probe(|_| {
|
||||||
match trait_ref_is_knowable(infcx.tcx, trait_ref, lazily_normalize_ty) {
|
match trait_ref_is_knowable(infcx, trait_ref, lazily_normalize_ty) {
|
||||||
Err(()) => {}
|
Err(()) => {}
|
||||||
Ok(Ok(())) => warn!("expected an unknowable trait ref: {trait_ref:?}"),
|
Ok(Ok(())) => warn!("expected an unknowable trait ref: {trait_ref:?}"),
|
||||||
Ok(Err(conflict)) => {
|
Ok(Err(conflict)) => {
|
||||||
|
@ -781,7 +781,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||||||
&& self.fallback_has_occurred
|
&& self.fallback_has_occurred
|
||||||
{
|
{
|
||||||
let predicate = trait_predicate.map_bound(|trait_pred| {
|
let predicate = trait_predicate.map_bound(|trait_pred| {
|
||||||
trait_pred.with_self_ty(self.tcx, Ty::new_unit(self.tcx))
|
trait_pred.with_self_ty(self.tcx, tcx.types.unit)
|
||||||
});
|
});
|
||||||
let unit_obligation = obligation.with(tcx, predicate);
|
let unit_obligation = obligation.with(tcx, predicate);
|
||||||
if self.predicate_may_hold(&unit_obligation) {
|
if self.predicate_may_hold(&unit_obligation) {
|
||||||
|
@ -519,7 +519,7 @@ fn virtual_call_violations_for_method<'tcx>(
|
|||||||
|
|
||||||
// e.g., `Rc<()>`
|
// e.g., `Rc<()>`
|
||||||
let unit_receiver_ty =
|
let unit_receiver_ty =
|
||||||
receiver_for_self_ty(tcx, receiver_ty, Ty::new_unit(tcx), method.def_id);
|
receiver_for_self_ty(tcx, receiver_ty, tcx.types.unit, method.def_id);
|
||||||
|
|
||||||
match abi_of_ty(unit_receiver_ty) {
|
match abi_of_ty(unit_receiver_ty) {
|
||||||
Some(Abi::Scalar(..)) => (),
|
Some(Abi::Scalar(..)) => (),
|
||||||
|
@ -1497,7 +1497,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
// bound regions.
|
// bound regions.
|
||||||
let trait_ref = predicate.skip_binder().trait_ref;
|
let trait_ref = predicate.skip_binder().trait_ref;
|
||||||
|
|
||||||
coherence::trait_ref_is_knowable::<!>(self.tcx(), trait_ref, |ty| Ok(ty)).unwrap()
|
coherence::trait_ref_is_knowable::<!>(self.infcx, trait_ref, |ty| Ok(ty)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if the global caches can be used.
|
/// Returns `true` if the global caches can be used.
|
||||||
|
@ -266,7 +266,7 @@ pub(crate) mod rustc {
|
|||||||
|
|
||||||
ty::Ref(lifetime, ty, mutability) => {
|
ty::Ref(lifetime, ty, mutability) => {
|
||||||
let ty_and_layout = cx.layout_of(*ty)?;
|
let ty_and_layout = cx.layout_of(*ty)?;
|
||||||
let align = ty_and_layout.align.abi.bytes() as usize;
|
let align = ty_and_layout.align.abi.bytes_usize();
|
||||||
let size = ty_and_layout.size.bytes_usize();
|
let size = ty_and_layout.size.bytes_usize();
|
||||||
Ok(Tree::Ref(Ref {
|
Ok(Tree::Ref(Ref {
|
||||||
lifetime: *lifetime,
|
lifetime: *lifetime,
|
||||||
|
@ -854,7 +854,7 @@ fn make_thin_self_ptr<'tcx>(
|
|||||||
// we now have a type like `*mut RcBox<dyn Trait>`
|
// we now have a type like `*mut RcBox<dyn Trait>`
|
||||||
// change its layout to that of `*mut ()`, a thin pointer, but keep the same type
|
// change its layout to that of `*mut ()`, a thin pointer, but keep the same type
|
||||||
// this is understood as a special case elsewhere in the compiler
|
// this is understood as a special case elsewhere in the compiler
|
||||||
let unit_ptr_ty = Ty::new_mut_ptr(tcx, Ty::new_unit(tcx));
|
let unit_ptr_ty = Ty::new_mut_ptr(tcx, tcx.types.unit);
|
||||||
|
|
||||||
TyAndLayout {
|
TyAndLayout {
|
||||||
ty: fat_pointer_ty,
|
ty: fat_pointer_ty,
|
||||||
|
@ -119,16 +119,6 @@ pub(super) fn handle_needs(
|
|||||||
condition: config.debugger != Some(Debugger::Lldb) || config.lldb_native_rust,
|
condition: config.debugger != Some(Debugger::Lldb) || config.lldb_native_rust,
|
||||||
ignore_reason: "ignored on targets without Rust's LLDB",
|
ignore_reason: "ignored on targets without Rust's LLDB",
|
||||||
},
|
},
|
||||||
Need {
|
|
||||||
name: "needs-i686-dlltool",
|
|
||||||
condition: cache.i686_dlltool,
|
|
||||||
ignore_reason: "ignored when dlltool for i686 is not present",
|
|
||||||
},
|
|
||||||
Need {
|
|
||||||
name: "needs-x86_64-dlltool",
|
|
||||||
condition: cache.x86_64_dlltool,
|
|
||||||
ignore_reason: "ignored when dlltool for x86_64 is not present",
|
|
||||||
},
|
|
||||||
Need {
|
Need {
|
||||||
name: "needs-dlltool",
|
name: "needs-dlltool",
|
||||||
condition: cache.dlltool,
|
condition: cache.dlltool,
|
||||||
@ -218,27 +208,11 @@ pub(super) struct CachedNeedsConditions {
|
|||||||
profiler_support: bool,
|
profiler_support: bool,
|
||||||
xray: bool,
|
xray: bool,
|
||||||
rust_lld: bool,
|
rust_lld: bool,
|
||||||
i686_dlltool: bool,
|
|
||||||
x86_64_dlltool: bool,
|
|
||||||
dlltool: bool,
|
dlltool: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CachedNeedsConditions {
|
impl CachedNeedsConditions {
|
||||||
pub(super) fn load(config: &Config) -> Self {
|
pub(super) fn load(config: &Config) -> Self {
|
||||||
let path = std::env::var_os("PATH").expect("missing PATH environment variable");
|
|
||||||
let path = std::env::split_paths(&path).collect::<Vec<_>>();
|
|
||||||
|
|
||||||
// On Windows, dlltool.exe is used for all architectures.
|
|
||||||
#[cfg(windows)]
|
|
||||||
let dlltool = path.iter().any(|dir| dir.join("dlltool.exe").is_file());
|
|
||||||
|
|
||||||
// For non-Windows, there are architecture specific dlltool binaries.
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
let i686_dlltool = path.iter().any(|dir| dir.join("i686-w64-mingw32-dlltool").is_file());
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
let x86_64_dlltool =
|
|
||||||
path.iter().any(|dir| dir.join("x86_64-w64-mingw32-dlltool").is_file());
|
|
||||||
|
|
||||||
let target = &&*config.target;
|
let target = &&*config.target;
|
||||||
let sanitizers = &config.target_cfg().sanitizers;
|
let sanitizers = &config.target_cfg().sanitizers;
|
||||||
Self {
|
Self {
|
||||||
@ -278,26 +252,30 @@ impl CachedNeedsConditions {
|
|||||||
.join(if config.host.contains("windows") { "rust-lld.exe" } else { "rust-lld" })
|
.join(if config.host.contains("windows") { "rust-lld.exe" } else { "rust-lld" })
|
||||||
.exists(),
|
.exists(),
|
||||||
|
|
||||||
#[cfg(windows)]
|
dlltool: find_dlltool(&config),
|
||||||
i686_dlltool: dlltool,
|
|
||||||
#[cfg(windows)]
|
|
||||||
x86_64_dlltool: dlltool,
|
|
||||||
#[cfg(windows)]
|
|
||||||
dlltool,
|
|
||||||
|
|
||||||
// For non-Windows, there are architecture specific dlltool binaries.
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
i686_dlltool,
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
x86_64_dlltool,
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
dlltool: if config.matches_arch("x86") {
|
|
||||||
i686_dlltool
|
|
||||||
} else if config.matches_arch("x86_64") {
|
|
||||||
x86_64_dlltool
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn find_dlltool(config: &Config) -> bool {
|
||||||
|
let path = std::env::var_os("PATH").expect("missing PATH environment variable");
|
||||||
|
let path = std::env::split_paths(&path).collect::<Vec<_>>();
|
||||||
|
|
||||||
|
// dlltool is used ony by GNU based `*-*-windows-gnu`
|
||||||
|
if !(config.matches_os("windows") && config.matches_env("gnu") && config.matches_abi("")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On Windows, dlltool.exe is used for all architectures.
|
||||||
|
// For non-Windows, there are architecture specific dlltool binaries.
|
||||||
|
let dlltool_found = if cfg!(windows) {
|
||||||
|
path.iter().any(|dir| dir.join("dlltool.exe").is_file())
|
||||||
|
} else if config.matches_arch("i686") {
|
||||||
|
path.iter().any(|dir| dir.join("i686-w64-mingw32-dlltool").is_file())
|
||||||
|
} else if config.matches_arch("x86_64") {
|
||||||
|
path.iter().any(|dir| dir.join("x86_64-w64-mingw32-dlltool").is_file())
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
|
dlltool_found
|
||||||
|
}
|
||||||
|
@ -89,8 +89,10 @@ mod shims;
|
|||||||
// Establish a "crate-wide prelude": we often import `crate::*`.
|
// Establish a "crate-wide prelude": we often import `crate::*`.
|
||||||
|
|
||||||
// Make all those symbols available in the same place as our own.
|
// Make all those symbols available in the same place as our own.
|
||||||
|
#[doc(no_inline)]
|
||||||
pub use rustc_const_eval::interpret::*;
|
pub use rustc_const_eval::interpret::*;
|
||||||
// Resolve ambiguity.
|
// Resolve ambiguity.
|
||||||
|
#[doc(no_inline)]
|
||||||
pub use rustc_const_eval::interpret::{self, AllocMap, PlaceTy, Provenance as _};
|
pub use rustc_const_eval::interpret::{self, AllocMap, PlaceTy, Provenance as _};
|
||||||
|
|
||||||
pub use crate::shims::env::{EnvVars, EvalContextExt as _};
|
pub use crate::shims::env::{EnvVars, EvalContextExt as _};
|
||||||
|
@ -380,7 +380,7 @@ impl<'mir, 'tcx: 'mir> PrimitiveLayouts<'tcx> {
|
|||||||
let mut_raw_ptr = Ty::new_mut_ptr(tcx, tcx.types.unit);
|
let mut_raw_ptr = Ty::new_mut_ptr(tcx, tcx.types.unit);
|
||||||
let const_raw_ptr = Ty::new_imm_ptr(tcx, tcx.types.unit);
|
let const_raw_ptr = Ty::new_imm_ptr(tcx, tcx.types.unit);
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
unit: layout_cx.layout_of(Ty::new_unit(tcx))?,
|
unit: layout_cx.layout_of(tcx.types.unit)?,
|
||||||
i8: layout_cx.layout_of(tcx.types.i8)?,
|
i8: layout_cx.layout_of(tcx.types.i8)?,
|
||||||
i16: layout_cx.layout_of(tcx.types.i16)?,
|
i16: layout_cx.layout_of(tcx.types.i16)?,
|
||||||
i32: layout_cx.layout_of(tcx.types.i32)?,
|
i32: layout_cx.layout_of(tcx.types.i32)?,
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
// Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
|
// Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
|
||||||
// `rustc` version and the `since` property in feature stability gating is properly respected.
|
// `rustc` version and the `since` property in feature stability gating is properly respected.
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use run_make_support::{rustc, aux_build};
|
use run_make_support::{rustc, aux_build};
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
// Test that if we build `b` against a version of `a` that has one set of types, it will not run
|
// Test that if we build `b` against a version of `a` that has one set of types, it will not run
|
||||||
// with a dylib that has a different set of types.
|
// with a dylib that has a different set of types.
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{run, run_fail, rustc};
|
use run_make_support::{run, run_fail, rustc};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//! Check that non-trivial `repr(C)` enum in Rust has valid C layout.
|
//! Check that non-trivial `repr(C)` enum in Rust has valid C layout.
|
||||||
//@ ignore-cross-compile
|
//@ ignore-cross-compile
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
|
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
//
|
//
|
||||||
// Fixes: rust-lang/rust#123234
|
// Fixes: rust-lang/rust#123234
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
// Also see discussion at
|
// Also see discussion at
|
||||||
// <https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551>
|
// <https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551>
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::object;
|
use run_make_support::object;
|
||||||
use run_make_support::object::read::archive::ArchiveFile;
|
use run_make_support::object::read::archive::ArchiveFile;
|
||||||
use run_make_support::object::read::Object;
|
use run_make_support::object::read::Object;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// This test checks that the core library of Rust can be compiled without enabling
|
// This test checks that the core library of Rust can be compiled without enabling
|
||||||
// support for formatting and parsing floating-point numbers.
|
// support for formatting and parsing floating-point numbers.
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::rustc;
|
use run_make_support::rustc;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
//! which requires extra `target-abi` metadata to be emitted.
|
//! which requires extra `target-abi` metadata to be emitted.
|
||||||
//@ needs-matching-clang
|
//@ needs-matching-clang
|
||||||
//@ needs-llvm-components riscv
|
//@ needs-llvm-components riscv
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{bin_name, clang, llvm_readobj, rustc, tmp_dir};
|
use run_make_support::{bin_name, clang, llvm_readobj, rustc, tmp_dir};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
|
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, rustdoc, tmp_dir};
|
use run_make_support::{rustc, rustdoc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{aux_build, tmp_dir};
|
use run_make_support::{aux_build, tmp_dir};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{diff, rustc};
|
use run_make_support::{diff, rustc};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::rustc;
|
use run_make_support::rustc;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
//!
|
//!
|
||||||
//! It also checks that some targets have the correct set cfgs.
|
//! It also checks that some targets have the correct set cfgs.
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
//@ ignore-cross-compile
|
//@ ignore-cross-compile
|
||||||
//@ ignore-wasm
|
//@ ignore-wasm
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
|
|
||||||
use run_make_support::{rustc, is_msvc};
|
use run_make_support::{rustc, is_msvc};
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//! This checks the output of some `--print` options when
|
//! This checks the output of some `--print` options when
|
||||||
//! output to a file (instead of stdout)
|
//! output to a file (instead of stdout)
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
|
||||||
use run_make_support::{rustc, target, tmp_dir};
|
use run_make_support::{rustc, target, tmp_dir};
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
# Tests that raw-dylib cross compilation works correctly
|
# Tests that raw-dylib cross compilation works correctly
|
||||||
|
|
||||||
# only-gnu
|
# needs-dlltool
|
||||||
# needs-i686-dlltool
|
|
||||||
# needs-x86_64-dlltool
|
|
||||||
|
|
||||||
# i686 dlltool.exe can't product x64 binaries.
|
# i686 dlltool.exe can't product x64 binaries.
|
||||||
# ignore-i686-pc-windows-gnu
|
# ignore-i686-pc-windows-gnu
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//@ ignore-windows
|
//@ ignore-windows
|
||||||
// This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
|
// This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use gimli::{AttributeValue, Dwarf, EndianRcSlice, Reader, RunTimeEndian};
|
use gimli::{AttributeValue, Dwarf, EndianRcSlice, Reader, RunTimeEndian};
|
||||||
use object::{Object, ObjectSection};
|
use object::{Object, ObjectSection};
|
||||||
use run_make_support::{gimli, object, rustc, tmp_dir};
|
use run_make_support::{gimli, object, rustc, tmp_dir};
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
//@ needs-rust-lld
|
//@ needs-rust-lld
|
||||||
//@ only-x86_64-unknown-linux-gnu
|
//@ only-x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::regex::Regex;
|
use run_make_support::regex::Regex;
|
||||||
use run_make_support::rustc;
|
use run_make_support::rustc;
|
||||||
use std::process::Output;
|
use std::process::Output;
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
//@ ignore-msvc
|
//@ ignore-msvc
|
||||||
//@ ignore-s390x lld does not yet support s390x as target
|
//@ ignore-s390x lld does not yet support s390x as target
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::regex::Regex;
|
use run_make_support::regex::Regex;
|
||||||
use run_make_support::rustc;
|
use run_make_support::rustc;
|
||||||
use std::process::Output;
|
use std::process::Output;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustdoc, tmp_dir};
|
use run_make_support::{rustdoc, tmp_dir};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::{fs, iter};
|
use std::{fs, iter};
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
//@ needs-wasmtime
|
//@ needs-wasmtime
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir, wasmparser};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{tmp_dir, wasmparser, rustc};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{tmp_dir, wasmparser, rustc};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{tmp_dir, wasmparser, rustc};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use wasmparser::TypeRef::Func;
|
use wasmparser::TypeRef::Func;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir, wasmparser};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
|
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir};
|
use run_make_support::{rustc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir, wasmparser};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir, wasmparser};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
extern crate run_make_support;
|
|
||||||
|
|
||||||
use run_make_support::{rustc, tmp_dir, wasmparser};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// Tests that dlltool failing to generate an import library will raise an error.
|
// Tests that dlltool failing to generate an import library will raise an error.
|
||||||
|
|
||||||
//@ only-gnu
|
|
||||||
//@ only-windows
|
|
||||||
//@ needs-dlltool
|
//@ needs-dlltool
|
||||||
//@ compile-flags: --crate-type lib --emit link
|
//@ compile-flags: --crate-type lib --emit link
|
||||||
//@ normalize-stderr-test: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
|
//@ normalize-stderr-test: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Tests that failing to run dlltool will raise an error.
|
// Tests that failing to run dlltool will raise an error.
|
||||||
|
|
||||||
//@ only-gnu
|
//@ needs-dlltool
|
||||||
//@ only-windows
|
|
||||||
//@ compile-flags: --crate-type lib --emit link -Cdlltool=does_not_exit.exe
|
//@ compile-flags: --crate-type lib --emit link -Cdlltool=does_not_exit.exe
|
||||||
#[link(name = "foo", kind = "raw-dylib")]
|
#[link(name = "foo", kind = "raw-dylib")]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Loading…
Reference in New Issue
Block a user