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 13 pull requests #137980

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
1cac5fa
Look for `python3` first on MacOS, not `py`
jyn514 Feb 13, 2025
d1fb18e
Calculate drop glue and show it on hover
ChayimFriedman2 Jan 20, 2025
477a2ee
std::fs: slightly reformat `remove_dir_all` error docs
jieyouxu Feb 18, 2025
629fa76
feat: update insta inline snapshot when clicks 'Update Test' runnable
andylokandy Feb 21, 2025
2b6ea13
fix
andylokandy Feb 21, 2025
9323ba5
Remove MaybeForgetReturn suggestion
compiler-errors Feb 20, 2025
a0c69fd
Allow "package/feature" format feature flag
kazatsuyu Feb 22, 2025
b340545
[illumos] attempt to use posix_spawn to spawn processes
sunshowers Feb 11, 2025
4ab9329
Include private items in completions for local crates
Timmmm Feb 21, 2025
e2a7731
Downgrade to ubuntu-22.04 for aarch64-unknown-linux-gnu and arm-unkno…
lnicola Feb 24, 2025
5397431
Fix event_name check in workflows
lnicola Feb 24, 2025
dac3460
Merge pull request #19216 from lnicola/ubuntu-22.04
lnicola Feb 24, 2025
af83f2f
Merge pull request #19217 from lnicola/event-name
lnicola Feb 24, 2025
7bba76e
Disable incremental on release builds
Veykril Feb 24, 2025
d761f9b
Vendor always-assert
Veykril Feb 24, 2025
a4bd32c
Merge pull request #19218 from Veykril/push-vqsronpuvrnx
Veykril Feb 24, 2025
49116c6
Merge pull request #19197 from andylokandy/insta
Veykril Feb 24, 2025
6e2abbf
Merge pull request #19211 from Timmmm/user/timh/import_private
Veykril Feb 24, 2025
18c6f22
Merge pull request #19219 from Veykril/push-rvosplwpwqqt
Veykril Feb 24, 2025
67a99a3
Migrate some leftovers in `add_missing_match_arms`
ShoyuVanilla Feb 17, 2025
756f213
Migrate `apply_demorgan` to `SyntaxEditor`
ShoyuVanilla Feb 17, 2025
1c2225b
Add `take()` method to `SyntaxEditor`
ShoyuVanilla Feb 18, 2025
32e4049
Merge pull request #18987 from ChayimFriedman2/drop-glue
Veykril Feb 24, 2025
a9dbd49
Merge pull request #19171 from ShoyuVanilla/migrate-de-morgan-assist
Veykril Feb 24, 2025
1ff2593
minor: Add tabstop to impl body in `generate_trait_impl` assist
Giga-Bowser Feb 24, 2025
e6bb047
Merge pull request #19221 from Giga-Bowser/generate-trait-impl-tabstop
lnicola Feb 24, 2025
91ff420
doc: remove nit from setup.md
Shourya742 Feb 24, 2025
d5a85af
Support target features implications in target_feature 1.1
ChayimFriedman2 Feb 25, 2025
5c654dc
Disable typos checker for the target feature names
ChayimFriedman2 Feb 25, 2025
16402de
Merge pull request #19223 from ChayimFriedman2/implied-target-feature
Veykril Feb 25, 2025
f7adafc
internal: Improve reporting of intersecting changes
Giga-Bowser Jan 10, 2025
cac5153
internal: Migrate `remove_mut` assist to `SyntaxEditor`
Giga-Bowser Nov 30, 2024
8036e84
internal: Migrate `remove_parentheses` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
1d5f831
fix: Properly handle removals in `SyntaxEditor`
Giga-Bowser Dec 5, 2024
6e6e7e9
internal: Migrate `remove_unused_param` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
3b4e268
Merge pull request #19204 from kazatsuyu/allow-package-specific-feature
ChayimFriedman2 Feb 26, 2025
aa32933
Merge pull request #19225 from Giga-Bowser/remove-assists
Veykril Feb 26, 2025
fae88f2
Use cargo zigbuild for releases
lnicola Feb 26, 2025
444ce09
Merge pull request #19220 from Shourya742/2025-02-24-nit-setup-doc
lnicola Feb 26, 2025
faaba55
Allow rust-project.json to specify sysroot workspace
darichey Feb 4, 2025
5109c0b
Drop support for stitched sysroot
darichey Feb 6, 2025
dae664d
Cofigurate out ohos target to avoid compilation crashes
LuuuXXX Feb 27, 2025
230ce20
Merge pull request #19239 from LuuuXXX/add-support-for-ohos
lnicola Feb 27, 2025
e162475
Merge pull request #19096 from darichey/rust-project-sysroot
Veykril Feb 27, 2025
d4b92f4
Merge pull request #19230 from lnicola/zig
lnicola Feb 27, 2025
cabb08d
Fix sysroot crate-graph construction not mapping crate-ids for proc-m…
Veykril Feb 27, 2025
494192b
Merge pull request #19241 from Veykril/push-lqumoruvuyvo
Veykril Feb 27, 2025
8c16ded
enable doctest
BenjaminBrienen Feb 26, 2025
df903a5
fix doc tests
BenjaminBrienen Feb 26, 2025
0404156
ignore doc test that only fails on windows
BenjaminBrienen Feb 27, 2025
1b6c4b7
ignore another test that fails on windows
BenjaminBrienen Feb 27, 2025
239a686
Merge pull request #19237 from BenjaminBrienen/doc-tests
lnicola Feb 27, 2025
d6f5377
Update Node.js, vscode, and ts deps
BenjaminBrienen Feb 26, 2025
13eb834
Merge pull request #19194 from BenjaminBrienen/node
lnicola Feb 27, 2025
af0c8b7
Add anchor for intra-doc links to associated items
ncrothers Feb 27, 2025
b2bb7cc
Fix char count in Display for ByteStr
thaliaarchi Feb 28, 2025
7348844
Avoid suggesting redundant borrowing in completion results
Shourya742 Feb 26, 2025
2071cc2
add test
Shourya742 Feb 26, 2025
bd8b58d
Merge pull request #19246 from ncrothers/add-anchor-for-associated-items
Veykril Feb 28, 2025
41dd80a
add test to reproduce #137662 (using ty decl macro fragment in an att…
jdonszelmann Feb 26, 2025
637dbe5
Fix prefix adjustment hints unnecessarily introducing parens
Veykril Feb 28, 2025
fd1f2e3
Merge pull request #19249 from Veykril/push-noosrywrsuvn
Veykril Feb 28, 2025
ff7de58
Have inline_local_variable use precedence calculation for parentheses
Veykril Feb 28, 2025
e862daf
Merge pull request #19250 from Veykril/push-tmrnrlotwtmr
Veykril Feb 28, 2025
476b098
adjust Layout debug printing to match the internal field names
RalfJung Feb 28, 2025
91034ad
Do not require that unsafe fields lack drop glue
jswrenn Feb 28, 2025
dfb2e35
Migrate `convert_bool_then` to `SyntaxEditor`
ShoyuVanilla Feb 28, 2025
08eeb8f
Cleanup highlighting macro-def handling
Veykril Mar 1, 2025
b0e3526
More precise macro modifiers for syntax highlighting
Veykril Mar 1, 2025
497f140
Cleanup string handling in syntax highlighting
Veykril Mar 1, 2025
28a5eeb
Fix `test_keyword_highlighting` test
Veykril Mar 1, 2025
629baf2
Remove syntax editing from parenthesis computation
Veykril Feb 28, 2025
a565f7f
Merge pull request #19257 from Veykril/push-myvwxskworsn
Veykril Mar 1, 2025
e6a0fc5
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Veykril Mar 1, 2025
1b85bef
Add flip or-pattern assist
Veykril Mar 2, 2025
7d8e958
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
Veykril Mar 2, 2025
768749f
Merge pull request #19259 from Veykril/push-skmvrmtorqso
Veykril Mar 2, 2025
6c1e5b4
Fix transparent diagnostics
lnicola Mar 2, 2025
5c124a3
Merge pull request #19264 from lnicola/theme-color
lnicola Mar 2, 2025
1c00d8f
Add `identifier` to pull diagnostic LSP capabilities
the-mikedavis Mar 2, 2025
a43a5f9
Merge pull request #19266 from the-mikedavis/lsp-pull-diagnostics-ide…
lnicola Mar 2, 2025
c97225b
`librustdoc`: 2024 edition! 🎊
yotamofek Feb 27, 2025
74c783c
Adapt `librustdoc` to 2024 edition lifetieme capture rules
yotamofek Feb 27, 2025
c6a7251
Merge pull request #19226 from Shourya742/2025-02-25-fix-completion-r…
ChayimFriedman2 Mar 3, 2025
969868b
Preparing for merge from rust-lang/rust
lnicola Mar 3, 2025
dd3a5f9
Merge from rust-lang/rust
lnicola Mar 3, 2025
24c480e
Bump rustc crates
lnicola Mar 3, 2025
015e81d
Merge pull request #19269 from lnicola/sync-from-rust
lnicola Mar 3, 2025
a89cddb
Add ``dyn`` keyword
Eclips4 Mar 3, 2025
3e5fddc
Allow struct field default values to reference struct's generics
compiler-errors Mar 3, 2025
12cc2b9
Remove unused `PpMode::needs_hir`
Zalathar Mar 4, 2025
7d8d843
Rollup merge of #136975 - jyn514:macos-x, r=Mark-Simulacrum
matthiaskrgr Mar 4, 2025
bda6da6
Rollup merge of #137240 - jieyouxu:remove_dir_all, r=Mark-Simulacrum
matthiaskrgr Mar 4, 2025
f850ad8
Rollup merge of #137303 - compiler-errors:maybe-forgor, r=cjgillot
matthiaskrgr Mar 4, 2025
cc432e5
Rollup merge of #137463 - sunshowers:illumos-posix-spawn, r=Mark-Simu…
matthiaskrgr Mar 4, 2025
f29531d
Rollup merge of #137722 - yotamofek:pr/rustdoc/edition-2024, r=notriddle
matthiaskrgr Mar 4, 2025
73bea6c
Rollup merge of #137758 - jdonszelmann:fix-137662, r=nnethercote
matthiaskrgr Mar 4, 2025
18107a5
Rollup merge of #137772 - thaliaarchi:bstr-display, r=joshtriplett
matthiaskrgr Mar 4, 2025
39a405c
Rollup merge of #137805 - RalfJung:layout-debug-print, r=Noratrieb
matthiaskrgr Mar 4, 2025
3e69cba
Rollup merge of #137808 - jswrenn:droppy-unsafe-fields, r=nnethercote
matthiaskrgr Mar 4, 2025
81839ed
Rollup merge of #137913 - compiler-errors:struct-field-default-generi…
matthiaskrgr Mar 4, 2025
2c8814d
Rollup merge of #137921 - lnicola:sync-from-ra, r=lnicola
matthiaskrgr Mar 4, 2025
0683fab
Rollup merge of #137963 - Eclips4:fix-E0373, r=compiler-errors
matthiaskrgr Mar 4, 2025
70372db
Rollup merge of #137975 - Zalathar:needs-hir, r=compiler-errors
matthiaskrgr Mar 4, 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
2 changes: 1 addition & 1 deletion compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ where
f.debug_struct("Layout")
.field("size", size)
.field("align", align)
.field("abi", backend_repr)
.field("backend_repr", backend_repr)
.field("fields", fields)
.field("largest_niche", largest_niche)
.field("uninhabited", uninhabited)
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,15 @@ impl<'a> MetaItemListParserContext<'a> {
{
self.inside_delimiters.next();
return Some(MetaItemOrLitParser::Lit(lit));
} else if let Some(TokenTree::Delimited(.., Delimiter::Invisible(_), inner_tokens)) =
self.inside_delimiters.peek()
{
self.inside_delimiters.next();
return MetaItemListParserContext {
inside_delimiters: inner_tokens.iter().peekable(),
dcx: self.dcx,
}
.next();
}

// or a path.
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_data_structures/src/captures.rs

This file was deleted.

1 change: 0 additions & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pub use rustc_index::static_assert_size;
pub mod aligned;
pub mod base_n;
pub mod binary_search_util;
pub mod captures;
pub mod fingerprint;
pub mod flat_map_in_place;
pub mod flock;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0373.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A captured variable in a closure may not live long enough.
Erroneous code example:

```compile_fail,E0373
fn foo() -> Box<Fn(u32) -> u32> {
fn foo() -> Box<dyn Fn(u32) -> u32> {
let x = 0u32;
Box::new(|y| x + y)
}
Expand Down Expand Up @@ -42,7 +42,7 @@ This approach moves (or copies, where possible) data into the closure, rather
than taking references to it. For example:

```
fn foo() -> Box<Fn(u32) -> u32> {
fn foo() -> Box<dyn Fn(u32) -> u32> {
let x = 0u32;
Box::new(move |y| x + y)
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ pub enum StashKey {
MaybeFruTypo,
CallAssocMethod,
AssociatedTypeSuggestion,
MaybeForgetReturn,
/// Query cycle detected, stashing in favor of a better error.
Cycle,
UndeterminedMacroResolution,
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_hir_analysis/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,6 @@ hir_analysis_invalid_union_field =
hir_analysis_invalid_union_field_sugg =
wrap the field type in `ManuallyDrop<...>`

hir_analysis_invalid_unsafe_field =
field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be unsafe
.note = unsafe fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`

hir_analysis_invalid_unsafe_field_sugg =
wrap the field type in `ManuallyDrop<...>`

hir_analysis_late_bound_const_in_apit = `impl Trait` can only mention const parameters from an fn or impl
.label = const parameter declared here

Expand Down
32 changes: 0 additions & 32 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ fn check_struct(tcx: TyCtxt<'_>, def_id: LocalDefId) {

check_transparent(tcx, def);
check_packed(tcx, span, def);
check_unsafe_fields(tcx, def_id);
}

fn check_union(tcx: TyCtxt<'_>, def_id: LocalDefId) {
Expand Down Expand Up @@ -144,36 +143,6 @@ fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> b
true
}

/// Check that the unsafe fields do not need dropping.
fn check_unsafe_fields(tcx: TyCtxt<'_>, item_def_id: LocalDefId) {
let span = tcx.def_span(item_def_id);
let def = tcx.adt_def(item_def_id);

let typing_env = ty::TypingEnv::non_body_analysis(tcx, item_def_id);
let args = ty::GenericArgs::identity_for_item(tcx, item_def_id);

for field in def.all_fields() {
if !field.safety.is_unsafe() {
continue;
}

if !allowed_union_or_unsafe_field(tcx, field.ty(tcx, args), typing_env, span) {
let hir::Node::Field(field) = tcx.hir_node_by_def_id(field.did.expect_local()) else {
unreachable!("field has to correspond to hir field")
};
let ty_span = field.ty.span;
tcx.dcx().emit_err(errors::InvalidUnsafeField {
field_span: field.span,
sugg: errors::InvalidUnsafeFieldSuggestion {
lo: ty_span.shrink_to_lo(),
hi: ty_span.shrink_to_hi(),
},
note: (),
});
}
}
}

/// Check that a `static` is inhabited.
fn check_static_inhabited(tcx: TyCtxt<'_>, def_id: LocalDefId) {
// Make sure statics are inhabited.
Expand Down Expand Up @@ -1517,7 +1486,6 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {

detect_discriminant_duplicate(tcx, def);
check_transparent(tcx, def);
check_unsafe_fields(tcx, def_id);
}

/// Part of enum check. Given the discriminants of an enum, errors if two or more discriminants are equal
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_hir_analysis/src/collect/generics_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
Some(parent_did)
}
Node::TyPat(_) => Some(parent_did),
// Field default values inherit the ADT's generics.
Node::Field(_) => Some(parent_did),
_ => None,
}
}
Expand Down
23 changes: 0 additions & 23 deletions compiler/rustc_hir_analysis/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,17 +710,6 @@ pub(crate) struct InvalidUnionField {
pub note: (),
}

#[derive(Diagnostic)]
#[diag(hir_analysis_invalid_unsafe_field, code = E0740)]
pub(crate) struct InvalidUnsafeField {
#[primary_span]
pub field_span: Span,
#[subdiagnostic]
pub sugg: InvalidUnsafeFieldSuggestion,
#[note]
pub note: (),
}

#[derive(Diagnostic)]
#[diag(hir_analysis_return_type_notation_on_non_rpitit)]
pub(crate) struct ReturnTypeNotationOnNonRpitit<'tcx> {
Expand All @@ -742,18 +731,6 @@ pub(crate) struct InvalidUnionFieldSuggestion {
pub hi: Span,
}

#[derive(Subdiagnostic)]
#[multipart_suggestion(
hir_analysis_invalid_unsafe_field_sugg,
applicability = "machine-applicable"
)]
pub(crate) struct InvalidUnsafeFieldSuggestion {
#[suggestion_part(code = "std::mem::ManuallyDrop<")]
pub lo: Span,
#[suggestion_part(code = ">")]
pub hi: Span,
}

#[derive(Diagnostic)]
#[diag(hir_analysis_return_type_notation_equality_bound)]
pub(crate) struct ReturnTypeNotationEqualityBound {
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

if !errors.is_empty() {
self.adjust_fulfillment_errors_for_expr_obligation(&mut errors);
let errors_causecode = errors
.iter()
.map(|e| (e.obligation.cause.span, e.root_obligation.cause.code().clone()))
.collect::<Vec<_>>();
self.err_ctxt().report_fulfillment_errors(errors);
self.collect_unused_stmts_for_coerce_return_ty(errors_causecode);
}
}

Expand Down
60 changes: 1 addition & 59 deletions compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use std::{fmt, iter, mem};
use itertools::Itertools;
use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, a_or_an, listify, pluralize,
};
use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize};
use rustc_hir::def::{CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor;
Expand Down Expand Up @@ -2193,62 +2191,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

pub(super) fn collect_unused_stmts_for_coerce_return_ty(
&self,
errors_causecode: Vec<(Span, ObligationCauseCode<'tcx>)>,
) {
for (span, code) in errors_causecode {
self.dcx().try_steal_modify_and_emit_err(span, StashKey::MaybeForgetReturn, |err| {
if let Some(fn_sig) = self.body_fn_sig()
&& let ObligationCauseCode::WhereClauseInExpr(_, _, binding_hir_id, ..) = code
&& !fn_sig.output().is_unit()
{
let mut block_num = 0;
let mut found_semi = false;
for (hir_id, node) in self.tcx.hir_parent_iter(binding_hir_id) {
// Don't proceed into parent bodies
if hir_id.owner != binding_hir_id.owner {
break;
}
match node {
hir::Node::Stmt(stmt) => {
if let hir::StmtKind::Semi(expr) = stmt.kind {
let expr_ty = self.typeck_results.borrow().expr_ty(expr);
let return_ty = fn_sig.output();
if !matches!(expr.kind, hir::ExprKind::Ret(..))
&& self.may_coerce(expr_ty, return_ty)
{
found_semi = true;
}
}
}
hir::Node::Block(_block) => {
if found_semi {
block_num += 1;
}
}
hir::Node::Item(item) => {
if let hir::ItemKind::Fn { .. } = item.kind {
break;
}
}
_ => {}
}
}
if block_num > 1 && found_semi {
err.span_suggestion_verbose(
// use the span of the *whole* expr
self.tcx.hir().span(binding_hir_id).shrink_to_lo(),
"you might have meant to return this to infer its type parameters",
"return ",
Applicability::MaybeIncorrect,
);
}
}
});
}
}

/// Given a vector of fulfillment errors, try to adjust the spans of the
/// errors to more accurately point at the cause of the failure.
///
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct IsNeverPattern;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
enum AnonConstKind {
EnumDiscriminant,
FieldDefaultValue,
InlineConst,
ConstArg(IsRepeatExpr),
}
Expand Down Expand Up @@ -1406,7 +1407,7 @@ impl<'ra: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'r
visit_opt!(self, visit_ident, ident);
try_visit!(self.visit_ty(ty));
if let Some(v) = &default {
self.resolve_anon_const(v, AnonConstKind::ConstArg(IsRepeatExpr::No));
self.resolve_anon_const(v, AnonConstKind::FieldDefaultValue);
}
}
}
Expand Down Expand Up @@ -4658,6 +4659,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
AnonConstKind::EnumDiscriminant => {
ConstantHasGenerics::No(NoConstantGenericsReason::IsEnumDiscriminant)
}
AnonConstKind::FieldDefaultValue => ConstantHasGenerics::Yes,
AnonConstKind::InlineConst => ConstantHasGenerics::Yes,
AnonConstKind::ConstArg(_) => {
if self.r.tcx.features().generic_const_exprs() || is_trivial_const_arg {
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2887,14 +2887,6 @@ impl PpMode {
| StableMir => true,
}
}
pub fn needs_hir(&self) -> bool {
use PpMode::*;
match *self {
Source(_) | AstTree | AstTreeExpanded => false,

Hir(_) | HirTree | ThirTree | ThirFlat | Mir | MirCFG | StableMir => true,
}
}

pub fn needs_analysis(&self) -> bool {
use PpMode::*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::ops::ControlFlow;

use rustc_errors::{
Applicability, Diag, E0283, E0284, E0790, MultiSpan, StashKey, struct_span_code_err,
};
use rustc_errors::{Applicability, Diag, E0283, E0284, E0790, MultiSpan, struct_span_code_err};
use rustc_hir as hir;
use rustc_hir::LangItem;
use rustc_hir::def::{DefKind, Res};
Expand Down Expand Up @@ -197,7 +195,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
// be ignoring the fact that we don't KNOW the type works
// out. Though even that would probably be harmless, given that
// we're only talking about builtin traits, which are known to be
// inhabited. We used to check for `self.tcx.sess.has_errors()` to
// inhabited. We used to check for `self.tainted_by_errors()` to
// avoid inundating the user with unnecessary errors, but we now
// check upstream for type errors and don't add the obligations to
// begin with in those cases.
Expand All @@ -211,7 +209,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
TypeAnnotationNeeded::E0282,
false,
);
return err.stash(span, StashKey::MaybeForgetReturn).unwrap();
return err.emit();
}
Some(e) => return e,
}
Expand Down
4 changes: 2 additions & 2 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ dependencies = [

[[package]]
name = "libc"
version = "0.2.169"
version = "0.2.170"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down
4 changes: 3 additions & 1 deletion library/core/src/bstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ impl fmt::Display for ByteStr {
};
let nchars: usize = self
.utf8_chunks()
.map(|chunk| chunk.valid().len() + if chunk.invalid().is_empty() { 0 } else { 1 })
.map(|chunk| {
chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
})
.sum();
let padding = f.width().unwrap_or(0).saturating_sub(nchars);
let fill = f.fill();
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ impl Copy for ! {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Copy for &T {}

/// Marker trait for the types that are allowed in union fields, unsafe fields,
/// and unsafe binder types.
/// Marker trait for the types that are allowed in union fields and unsafe
/// binder types.
///
/// Implemented for:
/// * `&T`, `&mut T` for all `T`,
Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
addr2line = { version = "0.24.0", optional = true, default-features = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.169", default-features = false, features = [
libc = { version = "0.2.170", default-features = false, features = [
'rustc-dep-of-std',
], public = true }

Expand Down
8 changes: 5 additions & 3 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2857,9 +2857,11 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
///
/// See [`fs::remove_file`] and [`fs::remove_dir`].
///
/// `remove_dir_all` will fail if `remove_dir` or `remove_file` fail on any constituent paths, including the root `path`.
/// As a result, the directory you are deleting must exist, meaning that this function is not idempotent.
/// Additionally, `remove_dir_all` will also fail if the `path` is not a directory.
/// [`remove_dir_all`] will fail if [`remove_dir`] or [`remove_file`] fail on *any* constituent
/// paths, *including* the root `path`. Consequently,
///
/// - The directory you are deleting *must* exist, meaning that this function is *not idempotent*.
/// - [`remove_dir_all`] will fail if the `path` is *not* a directory.
///
/// Consider ignoring the error if validating the removal is not required for your use case.
///
Expand Down
Loading
Loading