Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #104393

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fc380ec
Adjust `tcp_quickack` feature to allow other `os::linux::net` features.
jmillikin Sep 18, 2022
8f1e6eb
Move `unix_socket_abstract` feature API to `SocketAddrExt`.
jmillikin Sep 18, 2022
12c15a2
Split out from_u32_unchecked from const_char_convert
est31 Sep 29, 2022
176c44c
Stabilize const_char_convert
est31 Sep 29, 2022
d8c0fef
Fixed some `_i32` notation in `maybe_uninit`’s doc
Elarcis Nov 12, 2022
56dfb70
use `EXE_EXTENSION` while searching for python
SparkyPotato Nov 13, 2022
8e81cc2
rustdoc: Resolve doc links in external traits having local impls
petrochenkov Nov 13, 2022
d634c1c
avoid rustc_llvm rebuilds when LD_LIBRARY_PATH changes
RalfJung Nov 13, 2022
6de5f62
Bump chalk to v0.87
compiler-errors Nov 13, 2022
36a1068
Make rustc build with new chalk
compiler-errors Nov 13, 2022
2de7581
Rollup merge of #101967 - jmillikin:linux-abstract-socket-addr, r=jos…
matthiaskrgr Nov 14, 2022
ab87c4c
Rollup merge of #102470 - est31:stabilize_const_char_convert, r=josht…
matthiaskrgr Nov 14, 2022
95ea4f0
Rollup merge of #104332 - Elarcis:maybe_uninit_doc_fix, r=m-ou-se
matthiaskrgr Nov 14, 2022
5e2785f
Rollup merge of #104350 - SparkyPotato:fix-x-wrapper, r=jyn514
matthiaskrgr Nov 14, 2022
7bb7bf7
Rollup merge of #104364 - petrochenkov:docice2, r=GuillaumeGomez
matthiaskrgr Nov 14, 2022
4c8b7b3
Rollup merge of #104375 - RalfJung:rustc_llvm_rebuild, r=jyn514,Mark-…
matthiaskrgr Nov 14, 2022
d403505
Rollup merge of #104378 - compiler-errors:chalk-up, r=jackh726
matthiaskrgr Nov 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ dependencies = [

[[package]]
name = "chalk-derive"
version = "0.80.0"
version = "0.87.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0001adf0cf12361e08b65e1898ea138f8f77d8f5177cbf29b6b3b3532252bd6"
checksum = "d552b2fa341f5fc35c6b917b1d289d3c3a34d0b74e579390ea6192d6152a8cdb"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -514,9 +514,9 @@ dependencies = [

[[package]]
name = "chalk-engine"
version = "0.80.0"
version = "0.87.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c44ee96f2d67cb5193d1503f185db1abad9933a1c6e6b4169c176f90baecd393"
checksum = "7e54ac43048cb31c470d7b3e3acd409090ef4a5abddfe02455187aebc3d6879f"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand All @@ -527,9 +527,9 @@ dependencies = [

[[package]]
name = "chalk-ir"
version = "0.80.0"
version = "0.87.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92d8a95548f23618fda86426e4304e563ec2bb7ba0216139f0748d63c107b5f1"
checksum = "43aa55deff4e7fbdb09fa014543372f2c95a06835ac487b9ce57b5099b950838"
dependencies = [
"bitflags",
"chalk-derive",
Expand All @@ -538,9 +538,9 @@ dependencies = [

[[package]]
name = "chalk-solve"
version = "0.80.0"
version = "0.87.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f37f492dacfafe2e21319b80827da2779932909bb392f0cc86b2bd5c07c1b4e1"
checksum = "61213deefc36ba265ad01c4d997e18bcddf7922862a4594a47ca4575afb3dab4"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ fn detect_llvm_link() -> (&'static str, &'static str) {
// perfect -- we might actually want to see something from Cargo's added library paths -- but
// for now it works.
fn restore_library_path() {
let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
env::set_var(&key, &env);
} else {
env::remove_var(&key);
if let Some(key) = tracked_env_var_os("REAL_LIBRARY_PATH_VAR") {
if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
env::set_var(&key, &env);
} else {
env::remove_var(&key);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ doctest = false

[dependencies]
bitflags = "1.2.1"
chalk-ir = "0.80.0"
chalk-ir = "0.87.0"
either = "1.5.0"
gsgdt = "0.1.2"
polonius-engine = "0.13.0"
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,11 @@ impl<'a> Resolver<'a> {
}
}

/// For rustdoc.
pub fn get_partial_res(&self, node_id: NodeId) -> Option<PartialRes> {
self.partial_res_map.get(&node_id).copied()
}

/// Retrieves the span of the given `DefId` if `DefId` is in the local crate.
#[inline]
pub fn opt_span(&self, def_id: DefId) -> Option<Span> {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
chalk-ir = "0.80.0"
chalk-engine = "0.80.0"
chalk-solve = "0.80.0"
chalk-ir = "0.87.0"
chalk-engine = "0.87.0"
chalk-solve = "0.87.0"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
rustc_infer = { path = "../rustc_infer" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
3 changes: 3 additions & 0 deletions compiler/rustc_traits/src/chalk/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
Some(CoerceUnsized)
} else if lang_items.dispatch_from_dyn_trait() == Some(def_id) {
Some(DispatchFromDyn)
} else if lang_items.tuple_trait() == Some(def_id) {
Some(Tuple)
} else {
None
};
Expand Down Expand Up @@ -570,6 +572,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
CoerceUnsized => lang_items.coerce_unsized_trait(),
DiscriminantKind => lang_items.discriminant_kind_trait(),
DispatchFromDyn => lang_items.dispatch_from_dyn_trait(),
Tuple => lang_items.tuple_trait(),
};
def_id.map(chalk_ir::TraitId)
}
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_traits/src/chalk/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime<RustInterner<'t
name: ty::BoundRegionKind::BrAnon(p.idx as u32, None),
}),
chalk_ir::LifetimeData::Static => return interner.tcx.lifetimes.re_static,
chalk_ir::LifetimeData::Empty(_) => {
bug!("Chalk should not have been passed an empty lifetime.")
}
chalk_ir::LifetimeData::Erased => return interner.tcx.lifetimes.re_erased,
chalk_ir::LifetimeData::Phantom(void, _) => match *void {},
};
Expand Down
1 change: 0 additions & 1 deletion library/core/src/char/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
}

/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[inline]
#[must_use]
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl char {
/// assert_eq!(None, c);
/// ```
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
#[inline]
pub const fn from_u32(i: u32) -> Option<char> {
Expand Down Expand Up @@ -183,7 +183,7 @@ impl char {
/// assert_eq!('❤', c);
/// ```
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
#[must_use]
#[inline]
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
Expand Down Expand Up @@ -241,7 +241,7 @@ impl char {
/// let _c = char::from_digit(1, 37);
/// ```
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
#[inline]
pub const fn from_digit(num: u32, radix: u32) -> Option<char> {
Expand Down Expand Up @@ -338,7 +338,7 @@ impl char {
/// let _ = '1'.to_digit(37);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/char/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn decode_utf16<I: IntoIterator<Item = u16>>(iter: I) -> DecodeUtf16<I::Into

/// Converts a `u32` to a `char`. Use [`char::from_u32`] instead.
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
#[inline]
pub const fn from_u32(i: u32) -> Option<char> {
Expand All @@ -120,7 +120,7 @@ pub const fn from_u32(i: u32) -> Option<char> {
/// Converts a `u32` to a `char`, ignoring validity. Use [`char::from_u32_unchecked`].
/// instead.
#[stable(feature = "char_from_unchecked", since = "1.5.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
#[must_use]
#[inline]
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
Expand All @@ -130,7 +130,7 @@ pub const unsafe fn from_u32_unchecked(i: u32) -> char {

/// Converts a digit in the given radix to a `char`. Use [`char::from_digit`] instead.
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
#[inline]
pub const fn from_digit(num: u32, radix: u32) -> Option<char> {
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
#![feature(const_black_box)]
#![feature(const_caller_location)]
#![feature(const_cell_into_inner)]
#![feature(const_char_convert)]
#![feature(const_char_from_u32_unchecked)]
#![feature(const_clone)]
#![feature(const_cmp)]
#![feature(const_discriminant)]
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ impl<T> MaybeUninit<T> {
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_slice)]
/// use std::mem::MaybeUninit;
///
/// let val = 0x12345678i32;
/// let val = 0x12345678_i32;
/// let uninit = MaybeUninit::new(val);
/// let uninit_bytes = uninit.as_bytes();
/// let bytes = unsafe { MaybeUninit::slice_assume_init_ref(uninit_bytes) };
Expand All @@ -1198,7 +1198,7 @@ impl<T> MaybeUninit<T> {
/// #![feature(maybe_uninit_as_bytes)]
/// use std::mem::MaybeUninit;
///
/// let val = 0x12345678i32;
/// let val = 0x12345678_i32;
/// let mut uninit = MaybeUninit::new(val);
/// let uninit_bytes = uninit.as_bytes_mut();
/// if cfg!(target_endian = "little") {
Expand Down
9 changes: 7 additions & 2 deletions library/std/src/os/android/net.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Linux and Android-specific definitions for socket options.
//! Android-specific networking functionality.

#![unstable(feature = "tcp_quickack", issue = "96256")]
pub use crate::os::net::tcp::TcpStreamExt;

#[unstable(feature = "unix_socket_abstract", issue = "85410")]
pub use crate::os::net::linux_ext::addr::SocketAddrExt;

#[unstable(feature = "tcp_quickack", issue = "96256")]
pub use crate::os::net::linux_ext::tcp::TcpStreamExt;
9 changes: 7 additions & 2 deletions library/std/src/os/linux/net.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Linux and Android-specific definitions for socket options.
//! Linux-specific networking functionality.

#![unstable(feature = "tcp_quickack", issue = "96256")]
pub use crate::os::net::tcp::TcpStreamExt;

#[unstable(feature = "unix_socket_abstract", issue = "85410")]
pub use crate::os::net::linux_ext::addr::SocketAddrExt;

#[unstable(feature = "tcp_quickack", issue = "96256")]
pub use crate::os::net::linux_ext::tcp::TcpStreamExt;
64 changes: 64 additions & 0 deletions library/std/src/os/net/linux_ext/addr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//! Linux and Android-specific extensions to socket addresses.

use crate::os::unix::net::SocketAddr;
use crate::sealed::Sealed;

/// Platform-specific extensions to [`SocketAddr`].
#[unstable(feature = "unix_socket_abstract", issue = "85410")]
pub trait SocketAddrExt: Sealed {
/// Creates a Unix socket address in the abstract namespace.
///
/// The abstract namespace is a Linux-specific extension that allows Unix
/// sockets to be bound without creating an entry in the filesystem.
/// Abstract sockets are unaffected by filesystem layout or permissions,
/// and no cleanup is necessary when the socket is closed.
///
/// An abstract socket address name may contain any bytes, including zero.
///
/// # Errors
///
/// Returns an error if the name is longer than `SUN_LEN - 1`.
///
/// # Examples
///
/// ```no_run
/// #![feature(unix_socket_abstract)]
/// use std::os::unix::net::{UnixListener, SocketAddr};
/// use std::os::linux::net::SocketAddrExt;
///
/// fn main() -> std::io::Result<()> {
/// let addr = SocketAddr::from_abstract_name(b"hidden")?;
/// let listener = match UnixListener::bind_addr(&addr) {
/// Ok(sock) => sock,
/// Err(err) => {
/// println!("Couldn't bind: {err:?}");
/// return Err(err);
/// }
/// };
/// Ok(())
/// }
/// ```
fn from_abstract_name<N>(name: &N) -> crate::io::Result<SocketAddr>
where
N: AsRef<[u8]>;

/// Returns the contents of this address if it is in the abstract namespace.
///
/// # Examples
///
/// ```no_run
/// #![feature(unix_socket_abstract)]
/// use std::os::unix::net::{UnixListener, SocketAddr};
/// use std::os::linux::net::SocketAddrExt;
///
/// fn main() -> std::io::Result<()> {
/// let name = b"hidden";
/// let name_addr = SocketAddr::from_abstract_name(name)?;
/// let socket = UnixListener::bind_addr(&name_addr)?;
/// let local_addr = socket.local_addr().expect("Couldn't get local address");
/// assert_eq!(local_addr.as_abstract_name(), Some(&name[..]));
/// Ok(())
/// }
/// ```
fn as_abstract_name(&self) -> Option<&[u8]>;
}
12 changes: 12 additions & 0 deletions library/std/src/os/net/linux_ext/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Linux and Android-specific networking functionality.

#![doc(cfg(any(target_os = "linux", target_os = "android")))]

#[unstable(feature = "unix_socket_abstract", issue = "85410")]
pub(crate) mod addr;

#[unstable(feature = "tcp_quickack", issue = "96256")]
pub(crate) mod tcp;

#[cfg(test)]
mod tests;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#[cfg(any(target_os = "android", target_os = "linux",))]
#[test]
fn quickack() {
use crate::{
net::{test::next_test_ip4, TcpListener, TcpStream},
os::net::tcp::TcpStreamExt,
os::net::linux_ext::tcp::TcpStreamExt,
};

macro_rules! t {
Expand Down
9 changes: 3 additions & 6 deletions library/std/src/os/net/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! Linux and Android-specific definitions for socket options.
//! OS-specific networking functionality.

#![unstable(feature = "tcp_quickack", issue = "96256")]
#![doc(cfg(any(target_os = "linux", target_os = "android",)))]
pub mod tcp;
#[cfg(test)]
mod tests;
#[cfg(any(target_os = "linux", target_os = "android", doc))]
pub(super) mod linux_ext;
Loading