Skip to content

Commit

Permalink
Auto merge of rust-lang#3844 - rust-lang:rustup-2024-08-26, r=RalfJung
Browse files Browse the repository at this point in the history
Automatic Rustup
  • Loading branch information
bors committed Aug 26, 2024
2 parents dbfd066 + 9fb611c commit 2f13379
Show file tree
Hide file tree
Showing 859 changed files with 10,888 additions and 6,886 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ jobs:
- name: cargo update
# Remove first line that always just says "Updating crates.io index"
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update library
run: |
echo -e "\nlibrary dependencies:" >> cargo_update.log
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update rustbook
run: |
echo -e "\nrustbook dependencies:" >> cargo_update.log
Expand All @@ -74,6 +78,7 @@ jobs:
name: Cargo-lock
path: |
Cargo.lock
library/Cargo.lock
src/tools/rustbook/Cargo.lock
retention-days: 1
- name: upload cargo-update log artifact for use in PR
Expand Down Expand Up @@ -119,7 +124,7 @@ jobs:
git config user.name github-actions
git config user.email github-actions@github.com
git switch --force-create cargo_update
git add ./Cargo.lock ./src/tools/rustbook/Cargo.lock
git add ./Cargo.lock ./library/Cargo.lock ./src/tools/rustbook/Cargo.lock
git commit --no-verify --file=commit.txt
- name: push
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ build/
/src/tools/x/target
# Created by default with `src/ci/docker/run.sh`
/obj/
/rustc-ice*

## ICE reports
rustc-ice-*.txt

## Temporary files
*~
Expand Down
45 changes: 15 additions & 30 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,6 @@ dependencies = [
"yansi-term",
]

[[package]]
name = "annotate-snippets"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d9b665789884a7e8fb06c84b295e923b03ca51edbb7d08f91a6a50322ecbfe6"
dependencies = [
"anstyle",
"unicode-width",
]

[[package]]
name = "annotate-snippets"
version = "0.11.4"
Expand Down Expand Up @@ -205,9 +195,9 @@ dependencies = [

[[package]]
name = "ar_archive_writer"
version = "0.4.0"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c"
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
dependencies = [
"object 0.36.3",
]
Expand Down Expand Up @@ -420,12 +410,9 @@ version = "0.1.0"

[[package]]
name = "cc"
version = "1.1.13"
version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48"
dependencies = [
"shlex",
]
checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437"

[[package]]
name = "cfg-if"
Expand Down Expand Up @@ -549,6 +536,7 @@ name = "clippy"
version = "0.1.82"
dependencies = [
"anstream",
"cargo_metadata 0.18.1",
"clippy_config",
"clippy_lints",
"clippy_utils",
Expand All @@ -562,6 +550,7 @@ dependencies = [
"regex",
"rustc_tools_util",
"serde",
"serde_json",
"syn 2.0.75",
"tempfile",
"termize",
Expand All @@ -576,7 +565,6 @@ name = "clippy_config"
version = "0.1.82"
dependencies = [
"itertools",
"rustc-semver",
"serde",
"toml 0.7.8",
"walkdir",
Expand Down Expand Up @@ -608,7 +596,6 @@ dependencies = [
"quine-mc_cluskey",
"regex",
"regex-syntax 0.8.4",
"rustc-semver",
"semver",
"serde",
"serde_json",
Expand All @@ -627,7 +614,6 @@ dependencies = [
"arrayvec",
"clippy_config",
"itertools",
"rustc-semver",
"rustc_apfloat",
]

Expand Down Expand Up @@ -2240,9 +2226,12 @@ dependencies = [

[[package]]
name = "minifier"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95bbbf96b9ac3482c2a25450b67a15ed851319bc5fabf3b40742ea9066e84282"
checksum = "9aa3f302fe0f8de065d4a2d1ed64f60204623cac58b80cd3c2a83a25d5a7d437"
dependencies = [
"clap",
]

[[package]]
name = "minimal-lexical"
Expand Down Expand Up @@ -3139,6 +3128,7 @@ dependencies = [
"bstr",
"build_helper",
"gimli 0.31.0",
"libc",
"object 0.36.3",
"regex",
"serde_json",
Expand Down Expand Up @@ -3211,12 +3201,6 @@ dependencies = [
"num_cpus",
]

[[package]]
name = "rustc-semver"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84"

[[package]]
name = "rustc-stable-hash"
version = "0.1.0"
Expand Down Expand Up @@ -3642,7 +3626,7 @@ dependencies = [
name = "rustc_errors"
version = "0.0.0"
dependencies = [
"annotate-snippets 0.10.2",
"annotate-snippets 0.11.4",
"derive_setters",
"rustc_ast",
"rustc_ast_pretty",
Expand Down Expand Up @@ -3702,7 +3686,7 @@ dependencies = [
name = "rustc_fluent_macro"
version = "0.0.0"
dependencies = [
"annotate-snippets 0.10.2",
"annotate-snippets 0.11.4",
"fluent-bundle",
"fluent-syntax",
"proc-macro2",
Expand Down Expand Up @@ -4552,6 +4536,7 @@ dependencies = [
"bitflags 2.6.0",
"derive-where",
"indexmap",
"rustc-hash",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_index",
Expand Down
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Compatibility Notes
- [Turn `proc_macro_back_compat` lint into a hard error.](https://github.com/rust-lang/rust/pull/125596/)
- [Detect unused structs even when implementing private traits](https://github.com/rust-lang/rust/pull/122382/)
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`](https://github.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://github.com/rust-lang/rust/issues/127340)
- [Type inference will fail in some cases due to new implementations of `FromIterator for Box<str>`.](https://github.com/rust-lang/rust/pull/99969/)
Notably, this breaks versions of the `time` crate before 0.3.35, due to no longer inferring the implementation for `Box<[_]>`.

<a id="1.80-Internal-Changes"></a>

Expand Down
11 changes: 11 additions & 0 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2902,6 +2902,17 @@ pub struct AttrItem {
pub tokens: Option<LazyAttrTokenStream>,
}

impl AttrItem {
pub fn is_valid_for_outer_style(&self) -> bool {
self.path == sym::cfg_attr
|| self.path == sym::cfg
|| self.path == sym::forbid
|| self.path == sym::warn
|| self.path == sym::allow
|| self.path == sym::deny
}
}

/// `TraitRef`s appear in impls.
///
/// Resolution maps each `TraitRef`'s `ref_id` to its defining trait; that's all
Expand Down
9 changes: 5 additions & 4 deletions compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// Multiple different abi names may actually be the same ABI
// If the specified ABIs are not the same name, alert the user that they resolve to the same ABI
let source_map = self.tcx.sess.source_map();
let equivalent = (source_map.span_to_snippet(*prev_sp)
!= source_map.span_to_snippet(*abi_span))
.then_some(());
let equivalent = source_map.span_to_snippet(*prev_sp)
!= source_map.span_to_snippet(*abi_span);

self.dcx().emit_err(AbiSpecifiedMultipleTimes {
abi_span: *abi_span,
Expand Down Expand Up @@ -221,7 +220,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let parent_def_id = self.current_def_id_parent;
let node_id = self.next_node_id();
// HACK(min_generic_const_args): see lower_anon_const
if !expr.is_potential_trivial_const_arg() {
if !self.tcx.features().const_arg_path
|| !expr.is_potential_trivial_const_arg()
{
self.create_def(
parent_def_id,
node_id,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub struct AbiSpecifiedMultipleTimes {
#[label]
pub prev_span: Span,
#[note]
pub equivalent: Option<()>,
pub equivalent: bool,
}

#[derive(Diagnostic)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let node_id = self.next_node_id();

// HACK(min_generic_const_args): see lower_anon_const
if !arg.is_potential_trivial_const_arg() {
if !self.tcx.features().const_arg_path || !arg.is_potential_trivial_const_arg() {
// Add a definition for the in-band const def.
self.create_def(parent_def_id, node_id, kw::Empty, DefKind::AnonConst, f.span);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
};
hir::FnHeader {
safety: self.lower_safety(h.safety, default_safety),
asyncness: asyncness,
asyncness,
constness: self.lower_constness(h.constness),
abi: self.lower_extern(h.ext),
}
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
span: Span,
) -> &'hir hir::ConstArg<'hir> {
let ct_kind = match res {
Res::Def(DefKind::ConstParam, _) => {
Res::Def(DefKind::ConstParam, _) if self.tcx.features().const_arg_path => {
let qpath = self.lower_qpath(
ty_id,
&None,
Expand Down Expand Up @@ -2433,7 +2433,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
self.resolver.get_partial_res(expr.id).and_then(|partial_res| partial_res.full_res());
debug!("res={:?}", maybe_res);
// FIXME(min_generic_const_args): for now we only lower params to ConstArgKind::Path
if let Some(res) = maybe_res
if self.tcx.features().const_arg_path
&& let Some(res) = maybe_res
&& let Res::Def(DefKind::ConstParam, _) = res
&& let ExprKind::Path(qself, path) = &expr.kind
{
Expand Down Expand Up @@ -2464,7 +2465,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
/// See [`hir::ConstArg`] for when to use this function vs
/// [`Self::lower_anon_const_to_const_arg`].
fn lower_anon_const_to_anon_const(&mut self, c: &AnonConst) -> &'hir hir::AnonConst {
if c.value.is_potential_trivial_const_arg() {
if self.tcx.features().const_arg_path && c.value.is_potential_trivial_const_arg() {
// HACK(min_generic_const_args): see DefCollector::visit_anon_const
// Over there, we guess if this is a bare param and only create a def if
// we think it's not. However we may can guess wrong (see there for example)
Expand Down
23 changes: 10 additions & 13 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,8 @@ impl<'a> AstValidator<'a> {
FnHeader { safety: _, coroutine_kind, constness, ext }: FnHeader,
) {
let report_err = |span| {
self.dcx().emit_err(errors::FnQualifierInExtern {
span: span,
block: self.current_extern_span(),
});
self.dcx()
.emit_err(errors::FnQualifierInExtern { span, block: self.current_extern_span() });
};
match coroutine_kind {
Some(knd) => report_err(knd.span()),
Expand Down Expand Up @@ -963,14 +961,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
self_ty,
items,
}) => {
let error =
|annotation_span, annotation, only_trait: bool| errors::InherentImplCannot {
span: self_ty.span,
annotation_span,
annotation,
self_ty: self_ty.span,
only_trait: only_trait.then_some(()),
};
let error = |annotation_span, annotation, only_trait| errors::InherentImplCannot {
span: self_ty.span,
annotation_span,
annotation,
self_ty: self_ty.span,
only_trait,
};

self.with_in_trait_impl(None, |this| {
this.visibility_not_permitted(
Expand Down Expand Up @@ -1195,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
} else if where_clauses.after.has_where_token {
self.dcx().emit_err(errors::WhereClauseAfterTypeAlias {
span: where_clauses.after.span,
help: self.session.is_nightly_build().then_some(()),
help: self.session.is_nightly_build(),
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ pub struct InherentImplCannot<'a> {
#[label(ast_passes_type)]
pub self_ty: Span,
#[note(ast_passes_only_trait)]
pub only_trait: Option<()>,
pub only_trait: bool,
}

#[derive(Diagnostic)]
Expand Down Expand Up @@ -528,7 +528,7 @@ pub struct WhereClauseAfterTypeAlias {
#[primary_span]
pub span: Span,
#[help]
pub help: Option<()>,
pub help: bool,
}

#[derive(Diagnostic)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(fn_delegation, "functions delegation is not yet fully implemented");
gate_all!(postfix_match, "postfix match is experimental");
gate_all!(mut_ref, "mutable by-reference bindings are experimental");
gate_all!(precise_capturing, "precise captures on `impl Trait` are experimental");
gate_all!(global_registration, "global registration is experimental");
gate_all!(return_type_notation, "return type notation is experimental");

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ pub fn find_deprecation(
sess.dcx().emit_err(
session_diagnostics::DeprecatedItemSuggestion {
span: mi.span,
is_nightly: sess.is_nightly_build().then_some(()),
is_nightly: sess.is_nightly_build(),
details: (),
},
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ pub(crate) struct DeprecatedItemSuggestion {
pub span: Span,

#[help]
pub is_nightly: Option<()>,
pub is_nightly: bool,

#[note]
pub details: (),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/borrowck_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl<'infcx, 'tcx> crate::MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
ty: Ty<'_>,
is_index: Option<bool>,
) -> Diag<'infcx> {
let type_name = match (&ty.kind(), is_index) {
let type_name = match (ty.kind(), is_index) {
(&ty::Array(_, _), Some(true)) | (&ty::Array(_, _), None) => "array",
(&ty::Slice(_), _) => "slice",
_ => span_bug!(move_from_span, "this path should not cause illegal move"),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/places_conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn place_components_conflict<'tcx>(

let base_ty = base.ty(body, tcx).ty;

match (elem, &base_ty.kind(), access) {
match (elem, base_ty.kind(), access) {
(_, _, Shallow(Some(ArtificialField::ArrayLength)))
| (_, _, Shallow(Some(ArtificialField::FakeBorrow))) => {
// The array length is like additional fields on the
Expand Down
Loading

0 comments on commit 2f13379

Please sign in to comment.