Skip to content

Rollup of 17 pull requests #139613

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 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a11fbee
Small code improvement in rustdoc hidden stripper
GuillaumeGomez Mar 7, 2025
e89c849
Clean up librustdoc::html::render to be better encapsulated
xizheyin Mar 17, 2025
abe6e88
Allow drivers to supply a list of extra symbols to intern
Alexendoo Mar 19, 2025
f9770e7
Test linking and running no_std binaries
madsmtm Mar 24, 2025
b8c4c16
Suppress missing field error when autoderef bottoms out in infer
compiler-errors Apr 5, 2025
34e9759
compiletest: Trim whitespace from environment variable names
Zalathar Apr 8, 2025
a0d9c87
Inline `calc_default_binding_mode`
Nadrieril Apr 6, 2025
9f57903
Insert adjustments incrementally
Nadrieril Apr 6, 2025
19950b5
Turn the peeling loop into a recursive call
Nadrieril Apr 6, 2025
38adb99
Reorganize `check_pat_inner`
Nadrieril Apr 6, 2025
6588018
Return a type from `check_pat_inner`
Nadrieril Apr 6, 2025
f458151
Remove redundant assignment
Nadrieril Apr 6, 2025
12311ef
fix title of offset_of_enum feature
programmerjake Apr 8, 2025
f151cea
emit a better error message for using the macro incorrectly
ZuseZ4 Apr 9, 2025
f419b18
Return early on an error path in `parse_item_impl`.
nnethercote Apr 8, 2025
7ae5c7f
Avoid an empty trait name in impl blocks.
nnethercote Apr 9, 2025
b2aa9d0
Remove some dead or leftover code related to rustc-intrinsic abi removal
oli-obk Apr 8, 2025
cf68565
Temporarily leave the review rotation
fmease Apr 9, 2025
32c8f7d
librustdoc: remove IndexItem::new, use previous fields constructor
xizheyin Apr 9, 2025
67ff336
saethlin is back from vacation
saethlin Apr 9, 2025
50d0ce1
Ensure `swap_nonoverlapping` is really always untyped
scottmcm Feb 22, 2025
b06a88f
Add a Miri test for 134713
scottmcm Feb 22, 2025
8b227a4
rustdoc: Enable Markdown extensions when looking for doctests
camelid Apr 9, 2025
63dcac8
skip `tests/codegen/swap-small-types` when debug assertions are on
scottmcm Apr 9, 2025
7103aea
Tracking issue template: fine-grained information on style update status
joshtriplett Apr 9, 2025
d21ee7e
Update `compiler-builtins` to 0.1.153
tgross35 Apr 9, 2025
3f03734
Rollup merge of #137412 - scottmcm:redo-swap, r=cuviper
Zalathar Apr 10, 2025
234f687
Rollup merge of #138167 - GuillaumeGomez:rustdoc-hidden-stripper-impr…
Zalathar Apr 10, 2025
a4176f5
Rollup merge of #138605 - xizheyin:issue-138567, r=GuillaumeGomez
Zalathar Apr 10, 2025
3990e5d
Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead
Zalathar Apr 10, 2025
b4c6991
Rollup merge of #138904 - madsmtm:apple-test-no-std, r=tgross35
Zalathar Apr 10, 2025
6e7de73
Rollup merge of #139423 - compiler-errors:field-autoderef, r=oli-obk
Zalathar Apr 10, 2025
8ec3cda
Rollup merge of #139449 - Nadrieril:peel-recursive, r=lcnr
Zalathar Apr 10, 2025
8eb9358
Rollup merge of #139507 - Zalathar:trim-env-name, r=jieyouxu
Zalathar Apr 10, 2025
bb8e0d3
Rollup merge of #139530 - oli-obk:rustc-intrinsic-cleanup, r=RalfJung
Zalathar Apr 10, 2025
b6a151a
Rollup merge of #139560 - programmerjake:patch-5, r=jieyouxu
Zalathar Apr 10, 2025
96d6efd
Rollup merge of #139563 - EnzymeAD:better-autodiff-err, r=jieyouxu
Zalathar Apr 10, 2025
6c891d6
Rollup merge of #139568 - nnethercote:empty-trait-name, r=compiler-er…
Zalathar Apr 10, 2025
f592cbe
Rollup merge of #139580 - fmease:unrotate, r=fmease
Zalathar Apr 10, 2025
5288906
Rollup merge of #139589 - saethlin:vacation, r=camelid
Zalathar Apr 10, 2025
6252499
Rollup merge of #139592 - camelid:doctest-md-opts, r=notriddle
Zalathar Apr 10, 2025
7a37e31
Rollup merge of #139599 - joshtriplett:style-tracking, r=traviscross
Zalathar Apr 10, 2025
d49e8c9
Rollup merge of #139600 - tgross35:update-builtins, r=tgross35
Zalathar Apr 10, 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
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/tracking_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ for larger features an implementation could be broken up into multiple PRs.
- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
instructions?)
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
- [ ] Formatting for new syntax has been added to the [Style Guide] ([nightly-style-procedure])
- [ ] Style updates for any new syntax ([nightly-style-procedure])
- [ ] Style team decision on new formatting
- [ ] Formatting for new syntax has been added to the [Style Guide]
- [ ] (non-blocking) Formatting has been implemented in `rustfmt`
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ mod llvm_enzyme {
let meta_item_vec: ThinVec<MetaItemInner> = match meta_item.kind {
ast::MetaItemKind::List(ref vec) => vec.clone(),
_ => {
dcx.emit_err(errors::AutoDiffInvalidApplication { span: item.span() });
dcx.emit_err(errors::AutoDiffMissingConfig { span: item.span() });
return vec![item];
}
};
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
hash_untracked_state: None,
register_lints: None,
override_queries: None,
extra_symbols: Vec::new(),
make_codegen_backend: None,
registry: diagnostics_registry(),
using_internal_features: &USING_INTERNAL_FEATURES,
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_error_codes/src/error_codes/E0622.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#### Note: this error code is no longer emitted by the compiler.

An intrinsic was declared without being a function.

Erroneous code example:

```compile_fail,E0622
```no_run
#![feature(intrinsics)]
#![allow(internal_features)]

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ E0618: 0618,
E0619: 0619,
E0620: 0620,
E0621: 0621,
E0622: 0622,
E0622: 0622, // REMOVED: rustc-intrinsic ABI was removed
E0623: 0623,
E0624: 0624,
E0625: 0625,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn def_path_hash_depends_on_crate_id() {
// the crate by changing the crate disambiguator (e.g. via bumping the
// crate's version number).

create_session_globals_then(Edition::Edition2024, None, || {
create_session_globals_then(Edition::Edition2024, &[], None, || {
let id0 = StableCrateId::new(Symbol::intern("foo"), false, vec!["1".to_string()], "");
let id1 = StableCrateId::new(Symbol::intern("foo"), false, vec!["2".to_string()], "");

Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
def_id,
tcx.def_ident_span(def_id).unwrap(),
i.name,
ExternAbi::Rust,
)
}
}
Expand Down Expand Up @@ -787,16 +786,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
for item in items {
let def_id = item.id.owner_id.def_id;

if tcx.has_attr(def_id, sym::rustc_intrinsic) {
intrinsic::check_intrinsic_type(
tcx,
item.id.owner_id.def_id,
item.span,
item.ident.name,
abi,
);
}

let generics = tcx.generics_of(def_id);
let own_counts = generics.own_counts();
if generics.own_params.len() - own_counts.lifetimes != 0 {
Expand Down
33 changes: 9 additions & 24 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! Type-checking for the `#[rustc_intrinsic]` intrinsics that the compiler exposes.

use rustc_abi::ExternAbi;
use rustc_errors::codes::*;
use rustc_errors::{DiagMessage, struct_span_code_err};
use rustc_hir::{self as hir, Safety};
use rustc_errors::DiagMessage;
use rustc_hir::{self as hir};
use rustc_middle::bug;
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
use rustc_middle::ty::{self, Ty, TyCtxt};
Expand All @@ -26,17 +25,10 @@ fn equate_intrinsic_type<'tcx>(
sig: ty::PolyFnSig<'tcx>,
) {
let (generics, span) = match tcx.hir_node_by_def_id(def_id) {
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { generics, .. }, .. })
| hir::Node::ForeignItem(hir::ForeignItem {
kind: hir::ForeignItemKind::Fn(_, _, generics),
..
}) => (tcx.generics_of(def_id), generics.span),
_ => {
struct_span_code_err!(tcx.dcx(), span, E0622, "intrinsic must be a function")
.with_span_label(span, "expected a function")
.emit();
return;
hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { generics, .. }, .. }) => {
(tcx.generics_of(def_id), generics.span)
}
_ => tcx.dcx().span_bug(span, "intrinsic must be a function"),
};
let own_counts = generics.own_counts();

Expand Down Expand Up @@ -70,13 +62,7 @@ fn equate_intrinsic_type<'tcx>(
}

/// Returns the unsafety of the given intrinsic.
pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hir::Safety {
let has_safe_attr = if tcx.has_attr(intrinsic_id, sym::rustc_intrinsic) {
tcx.fn_sig(intrinsic_id).skip_binder().safety()
} else {
// Old-style intrinsics are never safe
Safety::Unsafe
};
fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hir::Safety {
let is_in_list = match tcx.item_name(intrinsic_id.into()) {
// When adding a new intrinsic to this list,
// it's usually worth updating that intrinsic's documentation
Expand Down Expand Up @@ -148,7 +134,7 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -
_ => hir::Safety::Unsafe,
};

if has_safe_attr != is_in_list {
if tcx.fn_sig(intrinsic_id).skip_binder().safety() != is_in_list {
tcx.dcx().struct_span_err(
tcx.def_span(intrinsic_id),
DiagMessage::from(format!(
Expand All @@ -163,12 +149,11 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -

/// Remember to add all intrinsics here, in `compiler/rustc_codegen_llvm/src/intrinsic.rs`,
/// and in `library/core/src/intrinsics.rs`.
pub fn check_intrinsic_type(
pub(crate) fn check_intrinsic_type(
tcx: TyCtxt<'_>,
intrinsic_id: LocalDefId,
span: Span,
intrinsic_name: Symbol,
abi: ExternAbi,
) {
let generics = tcx.generics_of(intrinsic_id);
let param = |n| {
Expand Down Expand Up @@ -706,7 +691,7 @@ pub fn check_intrinsic_type(
};
(n_tps, 0, n_cts, inputs, output, safety)
};
let sig = tcx.mk_fn_sig(inputs, output, false, safety, abi);
let sig = tcx.mk_fn_sig(inputs, output, false, safety, ExternAbi::Rust);
let sig = ty::Binder::bind_with_vars(sig, bound_vars);
equate_intrinsic_type(tcx, span, intrinsic_id, n_tps, n_lts, n_cts, sig)
}
9 changes: 7 additions & 2 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2920,8 +2920,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
// We failed to check the expression, report an error.

// Emits an error if we deref an infer variable, like calling `.field` on a base type of &_.
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
// Emits an error if we deref an infer variable, like calling `.field` on a base type
// of `&_`. We can also use this to suppress unnecessary "missing field" errors that
// will follow ambiguity errors.
let final_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
if let ty::Error(_) = final_ty.kind() {
return final_ty;
}

if let Some((adjustments, did)) = private_candidate {
// (#90483) apply adjustments to avoid ExprUseVisitor from
Expand Down
Loading
Loading