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 6 pull requests #126144

Merged
merged 20 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
10 changes: 5 additions & 5 deletions compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,14 +998,14 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let Some(module) = single_import.imported_module.get() else {
return Err((Undetermined, Weak::No));
};
let ImportKind::Single { source: ident, source_bindings, .. } = &single_import.kind
let ImportKind::Single { source: ident, target, target_bindings, .. } =
&single_import.kind
else {
unreachable!();
};
if binding.map_or(false, |binding| binding.module().is_some())
&& source_bindings.iter().all(|binding| matches!(binding.get(), Err(Undetermined)))
{
// This branch allows the binding to be defined or updated later,
if (ident != target) && target_bindings.iter().all(|binding| binding.get().is_none()) {
// This branch allows the binding to be defined or updated later if the target name
// can hide the source but these bindings are not obtained.
// avoiding module inconsistency between the resolve process and the finalize process.
// See more details in #124840
return Err((Undetermined, Weak::No));
Expand Down
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
#![feature(deref_pure_trait)]
#![feature(dispatch_from_dyn)]
#![feature(error_generic_member_access)]
#![feature(error_in_core)]
#![feature(exact_size_is_empty)]
#![feature(extend_one)]
#![feature(fmt_internals)]
Expand Down
16 changes: 3 additions & 13 deletions library/core/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![doc = include_str!("error.md")]
#![unstable(feature = "error_in_core", issue = "103765")]
#![stable(feature = "error_in_core", since = "CURRENT_RUSTC_VERSION")]

#[cfg(test)]
mod tests;
Expand Down Expand Up @@ -130,7 +130,6 @@ pub trait Error: Debug + Display {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
/// use core::fmt;
/// use core::error::{request_ref, Request};
///
Expand Down Expand Up @@ -361,8 +360,7 @@ impl dyn Error {
/// Get a string value from an error.
///
/// ```rust
/// # #![feature(error_generic_member_access)]
/// # #![feature(error_in_core)]
/// #![feature(error_generic_member_access)]
/// use std::error::Error;
/// use core::error::request_value;
///
Expand All @@ -385,8 +383,7 @@ where
/// Get a string reference from an error.
///
/// ```rust
/// # #![feature(error_generic_member_access)]
/// # #![feature(error_in_core)]
/// #![feature(error_generic_member_access)]
/// use core::error::Error;
/// use core::error::request_ref;
///
Expand Down Expand Up @@ -458,7 +455,6 @@ where
///
/// ```
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
/// use core::fmt;
/// use core::error::Request;
/// use core::error::request_ref;
Expand Down Expand Up @@ -529,7 +525,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
///
Expand Down Expand Up @@ -564,7 +559,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
///
Expand Down Expand Up @@ -600,7 +594,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
///
Expand Down Expand Up @@ -633,7 +626,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
///
Expand Down Expand Up @@ -700,7 +692,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
/// use core::error::request_value;
Expand Down Expand Up @@ -788,7 +779,6 @@ impl<'a> Request<'a> {
///
/// ```rust
/// #![feature(error_generic_member_access)]
/// #![feature(error_in_core)]
///
/// use core::error::Request;
/// use core::error::request_ref;
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
//! requires at least a level of pointer indirection each time a new object is added to the mix
//! (and, practically, a heap allocation).
//!
//! Although there were other reason as well, this issue of expensive composition is the key thing
//! Although there were other reasons as well, this issue of expensive composition is the key thing
//! that drove Rust towards adopting a different model. It is particularly a problem
//! when one considers, for example, the implications of composing together the [`Future`]s which
//! will eventually make up an asynchronous task (including address-sensitive `async fn` state
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
#![feature(const_slice_from_ref)]
#![feature(waker_getters)]
#![feature(error_generic_member_access)]
#![feature(error_in_core)]
#![feature(trait_upcasting)]
#![feature(is_ascii_octdigit)]
#![feature(get_many_mut)]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@
#![feature(core_io_borrowed_buf)]
#![feature(duration_constants)]
#![feature(error_generic_member_access)]
#![feature(error_in_core)]
#![feature(error_iter)]
#![feature(exact_size_is_empty)]
#![feature(exclusive_wrapper)]
Expand Down
4 changes: 4 additions & 0 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,8 @@ impl fmt::Debug for File {
target_os = "netbsd",
target_os = "openbsd",
target_os = "vxworks",
target_os = "solaris",
target_os = "illumos",
target_vendor = "apple",
))]
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
Expand All @@ -1583,6 +1585,8 @@ impl fmt::Debug for File {
target_os = "netbsd",
target_os = "openbsd",
target_os = "vxworks",
target_os = "solaris",
target_os = "illumos",
target_vendor = "apple",
)))]
fn get_mode(_fd: c_int) -> Option<(bool, bool)> {
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ ENV SCRIPT python3 ../x.py check --stage 0 --set build.optimized-compiler-builti
/scripts/validate-toolstate.sh && \
/scripts/validate-error-codes.sh && \
reuse --include-submodules lint && \
# Runs checks to ensure that there are no ES5 issues in our JS code.
es-check es8 ../src/librustdoc/html/static/js/*.js && \
# Runs checks to ensure that there are no issues in our JS code.
es-check es2019 ../src/librustdoc/html/static/js/*.js && \
eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js && \
eslint -c ../src/tools/rustdoc-js/.eslintrc.js ../src/tools/rustdoc-js/tester.js && \
eslint -c ../src/tools/rustdoc-gui/.eslintrc.js ../src/tools/rustdoc-gui/tester.js
3 changes: 3 additions & 0 deletions src/ci/docker/host-x86_64/x86_64-gnu-integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This job builds a toolchain capable of building Fuchsia, and then builds
# Fuchsia. See the build-fuchsia.sh script in this directory for more details.

FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
Expand Down
101 changes: 69 additions & 32 deletions src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,87 @@

# Downloads and builds the Fuchsia operating system using a toolchain installed
# in $RUST_INSTALL_DIR.
#
# You may run this script locally using Docker with the following command:
#
# $ src/ci/docker/run.sh x86_64-gnu-integration
#
# Alternatively, from within the container with --dev, assuming you have made it
# as far as building the toolchain with the above command:
#
# $ src/ci/docker/run.sh --dev x86_64-gnu-integration
# docker# git config --global --add safe.directory /checkout/obj/fuchsia
# docker# ../src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh
#
# Also see the docs in the rustc-dev-guide for more info:
# https://github.com/rust-lang/rustc-dev-guide/pull/1989

set -euf -o pipefail

INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6
# Set this variable to 1 to disable updating the Fuchsia checkout. This is
# useful for making local changes. You can find the Fuchsia checkout in
# `obj/x86_64-gnu-integration/fuchsia` in your local checkout after running this
# job for the first time.
KEEP_CHECKOUT=

# Any upstream refs that should be cherry-picked. This can be used to include
# Gerrit changes from https://fxrev.dev during development (click the "Download"
# button on a changelist to see the cherry pick ref). Example:
# PICK_REFS=(refs/changes/71/1054071/2 refs/changes/74/1054574/2)
PICK_REFS=()

# The commit hash of Fuchsia's integration.git to check out. This controls the
# commit hash of fuchsia.git and some other repos in the "monorepo" checkout, in
# addition to versions of prebuilts. It should be bumped regularly by the
# Fuchsia team – we aim for every 1-2 months.
INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6

checkout=fuchsia
jiri=.jiri_root/bin/jiri

set -x

# This script will:
# - create a directory named "fuchsia" if it does not exist
# - download "jiri" to "fuchsia/.jiri_root/bin"
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
| base64 --decode \
| bash -s $checkout

cd $checkout

$jiri init \
-partial=true \
-analytics-opt=false \
.

$jiri import \
-name=integration \
-revision=$INTEGRATION_SHA \
-overwrite=true \
flower \
"https://fuchsia.googlesource.com/integration"

if [ -d ".git" ]; then
# Wipe out any local changes if we're reusing a checkout.
git checkout --force JIRI_HEAD
fi
if [ -z "$KEEP_CHECKOUT" ]; then
# This script will:
# - create a directory named "fuchsia" if it does not exist
# - download "jiri" to "fuchsia/.jiri_root/bin"
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
| base64 --decode \
| bash -s $checkout

$jiri update -autoupdate=false
cd $checkout

echo integration commit = $(git -C integration rev-parse HEAD)
$jiri init \
-partial=true \
-analytics-opt=false \
.

for git_ref in "${PICK_REFS[@]}"; do
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
git cherry-pick --no-commit FETCH_HEAD
done
$jiri import \
-name=integration \
-revision=$INTEGRATION_SHA \
-overwrite=true \
flower \
"https://fuchsia.googlesource.com/integration"

if [ -d ".git" ]; then
# Wipe out any local changes if we're reusing a checkout.
git checkout --force JIRI_HEAD
fi

$jiri update -autoupdate=false

echo integration commit = $(git -C integration rev-parse HEAD)

for git_ref in "${PICK_REFS[@]}"; do
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
git cherry-pick --no-commit FETCH_HEAD
done
else
echo Reusing existing Fuchsia checkout
cd $checkout
fi

# Run the script inside the Fuchsia checkout responsible for building Fuchsia.
# You can change arguments to the build by setting KEEP_CHECKOUT=1 above and
# modifying them in build_fuchsia_from_rust_ci.sh.
bash scripts/rust/build_fuchsia_from_rust_ci.sh
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 8,
"ecmaVersion": 2019,
"sourceType": "module"
},
"rules": {
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/js/externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ let ParserState;
* foundElems: number,
* totalElems: number,
* literalSearch: boolean,
* corrections: Array<{from: string, to: integer}>,
* corrections: Array<{from: string, to: integer}> | null,
* typeFingerprint: Uint32Array,
* error: Array<string> | null,
* }}
*/
let ParsedQuery;
Expand Down
Loading
Loading