Skip to content
10 changes: 5 additions & 5 deletions compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,13 @@ fn parse_never_type_options_attr(
continue;
}

if item.has_name(sym::diverging_block_default) && fallback.is_none() {
let mode = item.value_str().unwrap();
match mode {
if item.has_name(sym::diverging_block_default) && block.is_none() {
let default = item.value_str().unwrap();
match default {
sym::unit => block = Some(DivergingBlockBehavior::Unit),
sym::never => block = Some(DivergingBlockBehavior::Never),
_ => {
tcx.dcx().span_err(item.span(), format!("unknown diverging block default: `{mode}` (supported: `unit` and `never`)"));
tcx.dcx().span_err(item.span(), format!("unknown diverging block default: `{default}` (supported: `unit` and `never`)"));
}
};
continue;
Expand All @@ -431,7 +431,7 @@ fn parse_never_type_options_attr(
tcx.dcx().span_err(
item.span(),
format!(
"unknown never type option: `{}` (supported: `fallback`)",
"unknown or duplicate never type option: `{}` (supported: `fallback`, `diverging_block_default`)",
item.name_or_empty()
),
);
Expand Down
15 changes: 10 additions & 5 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,11 @@ impl PlaceholderLike for PlaceholderConst {
}
}

/// When type checking, we use the `ParamEnv` to track
/// details about the set of where-clauses that are in scope at this
/// particular point.
/// When interacting with the type system we must provide information about the
/// environment. `ParamEnv` is the type that represents this information. See the
/// [dev guide chapter](param_env_guide) for more information.
///
/// [param_env_guide]: https://rustc-dev-guide.rust-lang.org/param_env/param_env_summary.html
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct ParamEnv<'tcx> {
/// This packs both caller bounds and the reveal enum into one pointer.
Expand Down Expand Up @@ -1103,8 +1105,11 @@ impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for ParamEnv<'tcx> {
impl<'tcx> ParamEnv<'tcx> {
/// Construct a trait environment suitable for contexts where
/// there are no where-clauses in scope. Hidden types (like `impl
/// Trait`) are left hidden, so this is suitable for ordinary
/// type-checking.
/// Trait`) are left hidden. In majority of cases it is incorrect
/// to use an empty environment. See the [dev guide section][param_env_guide]
/// for information on what a `ParamEnv` is and how to acquire one.
///
/// [param_env_guide]: https://rustc-dev-guide.rust-lang.org/param_env/param_env_summary.html
#[inline]
pub fn empty() -> Self {
Self::new(List::empty(), Reveal::UserFacing)
Expand Down
14 changes: 11 additions & 3 deletions library/std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,19 @@ impl Thread {
// Newlib, Emscripten, and VxWorks have no way to set a thread name.
}

#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd",))]
#[cfg(any(
target_os = "linux",
target_os = "freebsd",
target_os = "netbsd",
target_os = "solaris",
target_os = "illumos"
))]
pub fn get_name() -> Option<CString> {
#[cfg(target_os = "linux")]
const TASK_COMM_LEN: usize = 16;
#[cfg(target_os = "freebsd")]
const TASK_COMM_LEN: usize = libc::MAXCOMLEN + 1;
#[cfg(target_os = "netbsd")]
#[cfg(any(target_os = "netbsd", target_os = "solaris", target_os = "illumos"))]
const TASK_COMM_LEN: usize = 32;
let mut name = vec![0u8; TASK_COMM_LEN];
let res = unsafe {
Expand Down Expand Up @@ -282,7 +288,9 @@ impl Thread {
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "haiku"
target_os = "haiku",
target_os = "solaris",
target_os = "illumos"
)))]
pub fn get_name() -> Option<CString> {
None
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ target | std | notes
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | 64-bit UEFI

[^x86_32-floats-x87]: Floating-point support on `i586` targets is non-compliant: the `x87` registers and instructions used for these targets do not provide IEEE-754-compliant behavior, in particular when it comes to rounding and NaN payload bits. See [issue #114479][x86-32-float-issue].

[wasi-rename]: https://github.com/rust-lang/compiler-team/issues/607

[Fortanix ABI]: https://edp.fortanix.com/
Expand Down