Skip to content

Rollup of 12 pull requests #140112

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

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8dc7732
Clarify why SGX code specifies linkage/symbol names for certain statics
Apr 14, 2025
a86df23
tests: rework `amdgpu-require-explicit-cpu.rs`
jieyouxu Apr 19, 2025
40b7332
tests: adjust some `augmented-assignment*` tests
jieyouxu Apr 19, 2025
b47fe51
tests: adjust `tests/ui/auto-instantiate.rs`
jieyouxu Apr 19, 2025
6be60e8
needed a stronger pause
tshepang Apr 19, 2025
d09b3c7
fix grammar
tshepang Apr 19, 2025
4861270
improve readability by adding pauses
tshepang Apr 19, 2025
021ebcc
Merge pull request #2348 from rust-lang/tshepang-error-pattern-cleaning
tshepang Apr 19, 2025
ae4b6d6
Update docs for `AssocItems::filter_by_name_unhygienic`
GuillaumeGomez Apr 19, 2025
e0437ec
Fix error when an intra doc link is trying to resolve an empty associ…
GuillaumeGomez Apr 19, 2025
88a5e1e
Add regression test for #140026
GuillaumeGomez Apr 19, 2025
df8a3d5
stabilize `naked_functions`
folkertdev Dec 18, 2024
c7e976e
rustdoc-json: Improve test for auto-trait impls
aDotInTheVoid Apr 20, 2025
fd4a093
jsondocck: Require command is at start of line
aDotInTheVoid Apr 20, 2025
4c20d17
Add ui test emit-output-types-without-args.rs
xizheyin Apr 20, 2025
6ea0fe5
Update `libc` to 0.2.172 for std
Berrysoft Apr 20, 2025
6033e9d
Don't compute name of associated item if it's an RPITIT
compiler-errors Apr 20, 2025
de93239
remove a couple clones
matthiaskrgr Apr 19, 2025
605af72
build_helper: try to rename dir before delete
ChrisDenton Apr 20, 2025
49b62ee
Preparing for merge from rustc
invalid-email-address Apr 21, 2025
d12c1f5
Merge from rustc
invalid-email-address Apr 21, 2025
c6510d9
Merge pull request #2349 from rust-lang/rustc-pull
tshepang Apr 21, 2025
6fe881c
Construct OutputType using macro and print [=FILENAME] help info
xizheyin Apr 20, 2025
c24ab05
Rollup merge of #134213 - folkertdev:stabilize-naked-functions, r=tgr…
jieyouxu Apr 21, 2025
626d70f
Rollup merge of #139795 - jethrogb:jb/sgx-linkage-comments, r=joboet
jieyouxu Apr 21, 2025
86208e6
Rollup merge of #139981 - compiler-errors:name-2, r=nnethercote
jieyouxu Apr 21, 2025
6707823
Rollup merge of #140036 - jieyouxu:ui-cleanup-4, r=compiler-errors
jieyouxu Apr 21, 2025
c197283
Rollup merge of #140047 - matthiaskrgr:clo, r=compiler-errors
jieyouxu Apr 21, 2025
9a68cd4
Rollup merge of #140052 - GuillaumeGomez:fix-140026, r=nnethercote
jieyouxu Apr 21, 2025
33ca5ca
Rollup merge of #140074 - aDotInTheVoid:auto-test, r=GuillaumeGomez
jieyouxu Apr 21, 2025
c1082cd
Rollup merge of #140076 - aDotInTheVoid:jsondocline, r=GuillaumeGomez
jieyouxu Apr 21, 2025
a0a0c7b
Rollup merge of #140077 - xizheyin:issue-139805, r=jieyouxu
jieyouxu Apr 21, 2025
1a01392
Rollup merge of #140081 - Berrysoft:update-libc-172, r=tgross35
jieyouxu Apr 21, 2025
bc9a96b
Rollup merge of #140091 - ChrisDenton:rename-remove, r=jieyouxu
jieyouxu Apr 21, 2025
043ee6f
Rollup merge of #140107 - tshepang:rdg-push, r=jieyouxu
jieyouxu Apr 21, 2025
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
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ dependencies = [
name = "build_helper"
version = "0.1.0"
dependencies = [
"fastrand",
"serde",
"serde_derive",
]
Expand Down
10 changes: 4 additions & 6 deletions compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,14 @@ mod llvm_enzyme {
}
};
let arg = ty.kind.is_simple_path().unwrap();
let sl: Vec<Symbol> = vec![arg, kw::Default];
let tmp = ecx.def_site_path(&sl);
let tmp = ecx.def_site_path(&[arg, kw::Default]);
let default_call_expr = ecx.expr_path(ecx.path(span, tmp));
let default_call_expr = ecx.expr_call(new_decl_span, default_call_expr, thin_vec![]);
body.stmts.push(ecx.stmt_expr(default_call_expr));
return body;
}

let mut exprs: P<ast::Expr> = primal_call.clone();
let mut exprs: P<ast::Expr> = primal_call;
let d_ret_ty = match d_sig.decl.output {
FnRetTy::Ty(ref ty) => ty.clone(),
FnRetTy::Default(span) => {
Expand All @@ -622,7 +621,7 @@ mod llvm_enzyme {
// type due to the Const return activity.
exprs = ecx.expr_call(new_decl_span, bb_call_expr, thin_vec![exprs]);
} else {
let q = QSelf { ty: d_ret_ty.clone(), path_span: span, position: 0 };
let q = QSelf { ty: d_ret_ty, path_span: span, position: 0 };
let y =
ExprKind::Path(Some(P(q)), ecx.path_ident(span, Ident::from_str("default")));
let default_call_expr = ecx.expr(span, y);
Expand All @@ -640,8 +639,7 @@ mod llvm_enzyme {
let mut exprs2 = thin_vec![exprs];
for arg in args.iter().skip(1) {
let arg = arg.kind.is_simple_path().unwrap();
let sl: Vec<Symbol> = vec![arg, kw::Default];
let tmp = ecx.def_site_path(&sl);
let tmp = ecx.def_site_path(&[arg, kw::Default]);
let default_call_expr = ecx.expr_path(ecx.path(span, tmp));
let default_call_expr =
ecx.expr_call(new_decl_span, default_call_expr, thin_vec![]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
#![feature(
no_core,
lang_items,
never_type,
linkage,
extern_types,
naked_functions,
thread_local,
repr_simd
)]
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, repr_simd)]
#![no_core]
#![allow(dead_code, non_camel_case_types, internal_features)]

Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0787.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ An unsupported naked function definition.
Erroneous code example:

```compile_fail,E0787
#![feature(naked_functions)]

#[unsafe(naked)]
pub extern "C" fn f() -> u32 {
42
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ declare_features! (
/// Allows patterns with concurrent by-move and by-ref bindings.
/// For example, you can write `Foo(a, ref b)` where `a` is by-move and `b` is by-ref.
(accepted, move_ref_pattern, "1.49.0", Some(68354)),
/// Allows using `#[naked]` on functions.
(accepted, naked_functions, "CURRENT_RUSTC_VERSION", Some(90957)),
/// Allows specifying modifiers in the link attribute: `#[link(modifiers = "...")]`
(accepted, native_link_modifiers, "1.61.0", Some(81490)),
/// Allows specifying the bundle link modifier
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
ungated!(unsafe(Edition2024) no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, EncodeCrossCrate::No),
ungated!(link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding, EncodeCrossCrate::Yes),
ungated!(unsafe naked, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),

// Limits:
ungated!(
Expand Down Expand Up @@ -515,12 +516,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
// Unstable attributes:
// ==========================================================================

// Linking:
gated!(
unsafe naked, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No,
naked_functions, experimental!(naked)
),

// Testing:
gated!(
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing,
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,6 @@ declare_features! (
(unstable, must_not_suspend, "1.57.0", Some(83310)),
/// Allows `mut ref` and `mut ref mut` identifier patterns.
(incomplete, mut_ref, "1.79.0", Some(123076)),
/// Allows using `#[naked]` on functions.
(unstable, naked_functions, "1.9.0", Some(90957)),
/// Allows using `#[naked]` on `extern "Rust"` functions.
(unstable, naked_functions_rustic_abi, "CURRENT_RUSTC_VERSION", Some(138997)),
/// Allows using `#[target_feature(enable = "...")]` on `#[naked]` on functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
let items: &AssocItems = self.tcx.associated_items(self.def_id);
items
.in_definition_order()
.filter(|item| item.is_type())
.filter(|item| {
!self
.gen_args
.constraints
.iter()
.any(|constraint| constraint.ident.name == item.name())
item.is_type()
&& !item.is_impl_trait_in_trait()
&& !self
.gen_args
.constraints
.iter()
.any(|constraint| constraint.ident.name == item.name())
})
.filter(|item| !item.is_impl_trait_in_trait())
.map(|item| self.tcx.item_ident(item.def_id).to_string())
.collect()
} else {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, struct_span_code_err,
};
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Namespace, Res};
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::{self as hir, AnonConst, GenericArg, GenericArgs, HirId};
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
Expand Down Expand Up @@ -1731,9 +1731,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
tcx.associated_items(*trait_def_id)
.in_definition_order()
.any(|i| {
i.namespace() == Namespace::TypeNS
i.is_type()
&& !i.is_impl_trait_in_trait()
&& i.ident(tcx).normalize_to_macros_2_0() == assoc_ident
&& i.is_type()
})
// Consider only accessible traits
&& tcx.visibility(*trait_def_id)
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_middle/src/ty/assoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ impl AssocItems {
}

/// Returns an iterator over all associated items with the given name, ignoring hygiene.
///
/// Panics if `name.is_empty()` returns `true`.
pub fn filter_by_name_unhygienic(
&self,
name: Symbol,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/builder/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ fn build_scope_drops<'tcx>(
// path, then don't generate the drop. (We only take this into
// account for non-unwind paths so as not to disturb the
// caching mechanism.)
if scope.moved_locals.iter().any(|&o| o == local) {
if scope.moved_locals.contains(&local) {
continue;
}

Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
}
}
// FIXME(#80564): We permit struct fields, match arms and macro defs to have an
// `#[naked]` attribute with just a lint, because we previously
// erroneously allowed it and some crates used it accidentally, to be compatible
// with crates depending on them, we can't throw an error here.
Target::Field | Target::Arm | Target::MacroDef => {
self.inline_attr_str_error_with_macro_def(hir_id, attr, "naked")
}
_ => {
self.dcx().emit_err(errors::AttrShouldBeAppliedToFn {
attr_span: attr.span(),
Expand Down
Loading
Loading