Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a62ffec

Browse files
committedMay 26, 2024
Auto merge of rust-lang#125588 - workingjubilee:rollup-yr47gxo, r=workingjubilee
Rollup of 10 pull requests Successful merges: - rust-lang#125046 (Only allow immutable statics with #[linkage]) - rust-lang#125466 (Don't continue probing for method if in suggestion and autoderef hits ambiguity) - rust-lang#125469 (Don't skip out of inner const when looking for body for suggestion) - rust-lang#125530 (cleanup dependence of `ExtCtxt` in transcribe when macro expansion) - rust-lang#125535 (clean-up: remove deprecated field `dist.missing-tools`) - rust-lang#125539 (crashes: increment the number of tracked ones) - rust-lang#125544 (Also mention my-self for other check-cfg docs changes) - rust-lang#125559 (Simplify the `unchecked_sh[lr]` ub-checks a bit) - rust-lang#125566 (Notify T-rustdoc for beta-accepted and stable-accepted too) - rust-lang#125582 (Avoid a `FieldIdx::from_usize` in InstSimplify) r? `@ghost` `@rustbot` modify labels: rollup
2 parents bdbbb6c + b2d7f77 commit a62ffec

37 files changed

+348
-67
lines changed
 

‎compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
327327
} else {
328328
codegen_fn_attrs.linkage = linkage;
329329
}
330+
if tcx.is_mutable_static(did.into()) {
331+
let mut diag = tcx.dcx().struct_span_err(
332+
attr.span,
333+
"mutable statics are not allowed with `#[linkage]`",
334+
);
335+
diag.note(
336+
"making the static mutable would allow changing which symbol the \
337+
static references rather than make the target of the symbol \
338+
mutable",
339+
);
340+
diag.emit();
341+
}
330342
}
331343
}
332344
sym::link_section => {

‎compiler/rustc_expand/src/mbe/macro_rules.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ fn expand_macro<'cx>(
223223
let arm_span = rhses[i].span();
224224

225225
// rhs has holes ( `$id` and `$(...)` that need filled)
226-
let tts = match transcribe(cx, &named_matches, rhs, rhs_span, transparency) {
226+
let id = cx.current_expansion.id;
227+
let tts = match transcribe(psess, &named_matches, rhs, rhs_span, transparency, id) {
227228
Ok(tts) => tts,
228229
Err(err) => {
229230
let guar = err.emit();

‎compiler/rustc_expand/src/mbe/transcribe.rs

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::base::ExtCtxt;
21
use crate::errors::{
32
CountRepetitionMisplaced, MetaVarExprUnrecognizedVar, MetaVarsDifSeqMatchers, MustRepeatOnce,
43
NoSyntaxVarsExprRepeat, VarStillRepeating,
@@ -9,12 +8,13 @@ use rustc_ast::mut_visit::{self, MutVisitor};
98
use rustc_ast::token::{self, Delimiter, Token, TokenKind};
109
use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree};
1110
use rustc_data_structures::fx::FxHashMap;
12-
use rustc_errors::{pluralize, Diag, PResult};
11+
use rustc_errors::{pluralize, Diag, DiagCtxt, PResult};
1312
use rustc_parse::parser::ParseNtResult;
1413
use rustc_span::hygiene::{LocalExpnId, Transparency};
1514
use rustc_span::symbol::{sym, Ident, MacroRulesNormalizedIdent};
1615
use rustc_span::{with_metavar_spans, Span, SyntaxContext};
1716

17+
use rustc_session::parse::ParseSess;
1818
use smallvec::{smallvec, SmallVec};
1919
use std::mem;
2020

@@ -99,11 +99,12 @@ impl<'a> Iterator for Frame<'a> {
9999
///
100100
/// Along the way, we do some additional error checking.
101101
pub(super) fn transcribe<'a>(
102-
cx: &ExtCtxt<'a>,
102+
psess: &'a ParseSess,
103103
interp: &FxHashMap<MacroRulesNormalizedIdent, NamedMatch>,
104104
src: &mbe::Delimited,
105105
src_span: DelimSpan,
106106
transparency: Transparency,
107+
expand_id: LocalExpnId,
107108
) -> PResult<'a, TokenStream> {
108109
// Nothing for us to transcribe...
109110
if src.tts.is_empty() {
@@ -137,8 +138,9 @@ pub(super) fn transcribe<'a>(
137138
// again, and we are done transcribing.
138139
let mut result: Vec<TokenTree> = Vec::new();
139140
let mut result_stack = Vec::new();
140-
let mut marker = Marker(cx.current_expansion.id, transparency, Default::default());
141+
let mut marker = Marker(expand_id, transparency, Default::default());
141142

143+
let dcx = &psess.dcx;
142144
loop {
143145
// Look at the last frame on the stack.
144146
// If it still has a TokenTree we have not looked at yet, use that tree.
@@ -201,19 +203,17 @@ pub(super) fn transcribe<'a>(
201203
seq @ mbe::TokenTree::Sequence(_, seq_rep) => {
202204
match lockstep_iter_size(seq, interp, &repeats) {
203205
LockstepIterSize::Unconstrained => {
204-
return Err(cx
205-
.dcx()
206-
.create_err(NoSyntaxVarsExprRepeat { span: seq.span() }));
206+
return Err(dcx.create_err(NoSyntaxVarsExprRepeat { span: seq.span() }));
207207
}
208208

209209
LockstepIterSize::Contradiction(msg) => {
210210
// FIXME: this really ought to be caught at macro definition time... It
211211
// happens when two meta-variables are used in the same repetition in a
212212
// sequence, but they come from different sequence matchers and repeat
213213
// different amounts.
214-
return Err(cx
215-
.dcx()
216-
.create_err(MetaVarsDifSeqMatchers { span: seq.span(), msg }));
214+
return Err(
215+
dcx.create_err(MetaVarsDifSeqMatchers { span: seq.span(), msg })
216+
);
217217
}
218218

219219
LockstepIterSize::Constraint(len, _) => {
@@ -227,9 +227,7 @@ pub(super) fn transcribe<'a>(
227227
// FIXME: this really ought to be caught at macro definition
228228
// time... It happens when the Kleene operator in the matcher and
229229
// the body for the same meta-variable do not match.
230-
return Err(cx
231-
.dcx()
232-
.create_err(MustRepeatOnce { span: sp.entire() }));
230+
return Err(dcx.create_err(MustRepeatOnce { span: sp.entire() }));
233231
}
234232
} else {
235233
// 0 is the initial counter (we have done 0 repetitions so far). `len`
@@ -274,7 +272,7 @@ pub(super) fn transcribe<'a>(
274272
MatchedSingle(ParseNtResult::Tt(tt)) => {
275273
// `tt`s are emitted into the output stream directly as "raw tokens",
276274
// without wrapping them into groups.
277-
maybe_use_metavar_location(cx, &stack, sp, tt, &mut marker)
275+
maybe_use_metavar_location(psess, &stack, sp, tt, &mut marker)
278276
}
279277
MatchedSingle(ParseNtResult::Ident(ident, is_raw)) => {
280278
marker.visit_span(&mut sp);
@@ -295,7 +293,7 @@ pub(super) fn transcribe<'a>(
295293
}
296294
MatchedSeq(..) => {
297295
// We were unable to descend far enough. This is an error.
298-
return Err(cx.dcx().create_err(VarStillRepeating { span: sp, ident }));
296+
return Err(dcx.create_err(VarStillRepeating { span: sp, ident }));
299297
}
300298
};
301299
result.push(tt)
@@ -314,7 +312,7 @@ pub(super) fn transcribe<'a>(
314312

315313
// Replace meta-variable expressions with the result of their expansion.
316314
mbe::TokenTree::MetaVarExpr(sp, expr) => {
317-
transcribe_metavar_expr(cx, expr, interp, &mut marker, &repeats, &mut result, sp)?;
315+
transcribe_metavar_expr(dcx, expr, interp, &mut marker, &repeats, &mut result, sp)?;
318316
}
319317

320318
// If we are entering a new delimiter, we push its contents to the `stack` to be
@@ -374,7 +372,7 @@ pub(super) fn transcribe<'a>(
374372
/// combine with each other and not with tokens outside of the sequence.
375373
/// - The metavariable span comes from a different crate, then we prefer the more local span.
376374
fn maybe_use_metavar_location(
377-
cx: &ExtCtxt<'_>,
375+
psess: &ParseSess,
378376
stack: &[Frame<'_>],
379377
mut metavar_span: Span,
380378
orig_tt: &TokenTree,
@@ -412,7 +410,7 @@ fn maybe_use_metavar_location(
412410
&& insert(mspans, dspan.entire(), metavar_span)
413411
}),
414412
};
415-
if no_collision || cx.source_map().is_imported(metavar_span) {
413+
if no_collision || psess.source_map().is_imported(metavar_span) {
416414
return orig_tt.clone();
417415
}
418416

@@ -573,7 +571,7 @@ fn lockstep_iter_size(
573571
/// * `[ $( ${count(foo, 1)} ),* ]` will return an error because `${count(foo, 1)}` is
574572
/// declared inside a single repetition and the index `1` implies two nested repetitions.
575573
fn count_repetitions<'a>(
576-
cx: &ExtCtxt<'a>,
574+
dcx: &'a DiagCtxt,
577575
depth_user: usize,
578576
mut matched: &NamedMatch,
579577
repeats: &[(usize, usize)],
@@ -610,7 +608,7 @@ fn count_repetitions<'a>(
610608
.and_then(|el| el.checked_sub(repeats.len()))
611609
.unwrap_or_default();
612610
if depth_user > depth_max {
613-
return Err(out_of_bounds_err(cx, depth_max + 1, sp.entire(), "count"));
611+
return Err(out_of_bounds_err(dcx, depth_max + 1, sp.entire(), "count"));
614612
}
615613

616614
// `repeats` records all of the nested levels at which we are currently
@@ -626,15 +624,15 @@ fn count_repetitions<'a>(
626624
}
627625

628626
if let MatchedSingle(_) = matched {
629-
return Err(cx.dcx().create_err(CountRepetitionMisplaced { span: sp.entire() }));
627+
return Err(dcx.create_err(CountRepetitionMisplaced { span: sp.entire() }));
630628
}
631629

632630
count(depth_user, depth_max, matched)
633631
}
634632

635633
/// Returns a `NamedMatch` item declared on the LHS given an arbitrary [Ident]
636634
fn matched_from_ident<'ctx, 'interp, 'rslt>(
637-
cx: &ExtCtxt<'ctx>,
635+
dcx: &'ctx DiagCtxt,
638636
ident: Ident,
639637
interp: &'interp FxHashMap<MacroRulesNormalizedIdent, NamedMatch>,
640638
) -> PResult<'ctx, &'rslt NamedMatch>
@@ -643,12 +641,12 @@ where
643641
{
644642
let span = ident.span;
645643
let key = MacroRulesNormalizedIdent::new(ident);
646-
interp.get(&key).ok_or_else(|| cx.dcx().create_err(MetaVarExprUnrecognizedVar { span, key }))
644+
interp.get(&key).ok_or_else(|| dcx.create_err(MetaVarExprUnrecognizedVar { span, key }))
647645
}
648646

649647
/// Used by meta-variable expressions when an user input is out of the actual declared bounds. For
650648
/// example, index(999999) in an repetition of only three elements.
651-
fn out_of_bounds_err<'a>(cx: &ExtCtxt<'a>, max: usize, span: Span, ty: &str) -> Diag<'a> {
649+
fn out_of_bounds_err<'a>(dcx: &'a DiagCtxt, max: usize, span: Span, ty: &str) -> Diag<'a> {
652650
let msg = if max == 0 {
653651
format!(
654652
"meta-variable expression `{ty}` with depth parameter \
@@ -660,11 +658,11 @@ fn out_of_bounds_err<'a>(cx: &ExtCtxt<'a>, max: usize, span: Span, ty: &str) ->
660658
must be less than {max}"
661659
)
662660
};
663-
cx.dcx().struct_span_err(span, msg)
661+
dcx.struct_span_err(span, msg)
664662
}
665663

666664
fn transcribe_metavar_expr<'a>(
667-
cx: &ExtCtxt<'a>,
665+
dcx: &'a DiagCtxt,
668666
expr: &MetaVarExpr,
669667
interp: &FxHashMap<MacroRulesNormalizedIdent, NamedMatch>,
670668
marker: &mut Marker,
@@ -679,8 +677,8 @@ fn transcribe_metavar_expr<'a>(
679677
};
680678
match *expr {
681679
MetaVarExpr::Count(original_ident, depth) => {
682-
let matched = matched_from_ident(cx, original_ident, interp)?;
683-
let count = count_repetitions(cx, depth, matched, repeats, sp)?;
680+
let matched = matched_from_ident(dcx, original_ident, interp)?;
681+
let count = count_repetitions(dcx, depth, matched, repeats, sp)?;
684682
let tt = TokenTree::token_alone(
685683
TokenKind::lit(token::Integer, sym::integer(count), None),
686684
visited_span(),
@@ -689,7 +687,7 @@ fn transcribe_metavar_expr<'a>(
689687
}
690688
MetaVarExpr::Ignore(original_ident) => {
691689
// Used to ensure that `original_ident` is present in the LHS
692-
let _ = matched_from_ident(cx, original_ident, interp)?;
690+
let _ = matched_from_ident(dcx, original_ident, interp)?;
693691
}
694692
MetaVarExpr::Index(depth) => match repeats.iter().nth_back(depth) {
695693
Some((index, _)) => {
@@ -698,7 +696,7 @@ fn transcribe_metavar_expr<'a>(
698696
visited_span(),
699697
));
700698
}
701-
None => return Err(out_of_bounds_err(cx, repeats.len(), sp.entire(), "index")),
699+
None => return Err(out_of_bounds_err(dcx, repeats.len(), sp.entire(), "index")),
702700
},
703701
MetaVarExpr::Len(depth) => match repeats.iter().nth_back(depth) {
704702
Some((_, length)) => {
@@ -707,7 +705,7 @@ fn transcribe_metavar_expr<'a>(
707705
visited_span(),
708706
));
709707
}
710-
None => return Err(out_of_bounds_err(cx, repeats.len(), sp.entire(), "len")),
708+
None => return Err(out_of_bounds_err(dcx, repeats.len(), sp.entire(), "len")),
711709
},
712710
}
713711
Ok(())

‎compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,11 +1871,8 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
18711871
// If this is due to a block, then maybe we forgot a `return`/`break`.
18721872
if due_to_block
18731873
&& let Some(expr) = expression
1874-
&& let Some((parent_fn_decl, parent_id)) = fcx
1875-
.tcx
1876-
.hir()
1877-
.parent_iter(block_or_return_id)
1878-
.find_map(|(_, node)| Some((node.fn_decl()?, node.associated_body()?.0)))
1874+
&& let Some(parent_fn_decl) =
1875+
fcx.tcx.hir().fn_decl_by_hir_id(fcx.tcx.local_def_id_to_hir_id(fcx.body_id))
18791876
{
18801877
fcx.suggest_missing_break_or_return_expr(
18811878
&mut err,
@@ -1884,7 +1881,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
18841881
expected,
18851882
found,
18861883
block_or_return_id,
1887-
parent_id,
1884+
fcx.body_id,
18881885
);
18891886
}
18901887

‎compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
395395
// ambiguous.
396396
if let Some(bad_ty) = &steps.opt_bad_ty {
397397
if is_suggestion.0 {
398-
// Ambiguity was encountered during a suggestion. Just keep going.
399-
debug!("ProbeContext: encountered ambiguity in suggestion");
398+
// Ambiguity was encountered during a suggestion. There's really
399+
// not much use in suggesting methods in this case.
400+
return Err(MethodError::NoMatch(NoMatchData {
401+
static_candidates: Vec::new(),
402+
unsatisfied_predicates: Vec::new(),
403+
out_of_scope_traits: Vec::new(),
404+
similar_candidate: None,
405+
mode,
406+
}));
400407
} else if bad_ty.reached_raw_pointer
401408
&& !self.tcx.features().arbitrary_self_types
402409
&& !self.tcx.sess.at_least_rust_2018()

‎compiler/rustc_mir_transform/src/dataflow_const_prop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
142142
_ => return,
143143
};
144144
if let Some(variant_target_idx) = variant_target {
145-
for (field_index, operand) in operands.iter().enumerate() {
145+
for (field_index, operand) in operands.iter_enumerated() {
146146
if let Some(field) = self.map().apply(
147147
variant_target_idx,
148-
TrackElem::Field(FieldIdx::from_usize(field_index)),
148+
TrackElem::Field(field_index),
149149
) {
150150
self.assign_operand(state, field, operand);
151151
}

‎compiler/rustc_mir_transform/src/instsimplify.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_middle::ty::layout::ValidityRequirement;
99
use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt};
1010
use rustc_span::sym;
1111
use rustc_span::symbol::Symbol;
12-
use rustc_target::abi::FieldIdx;
1312
use rustc_target::spec::abi::Abi;
1413

1514
pub struct InstSimplify;
@@ -217,11 +216,11 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> {
217216
&& let Some(place) = operand.place()
218217
{
219218
let variant = adt_def.non_enum_variant();
220-
for (i, field) in variant.fields.iter().enumerate() {
219+
for (i, field) in variant.fields.iter_enumerated() {
221220
let field_ty = field.ty(self.tcx, args);
222221
if field_ty == *cast_ty {
223222
let place = place.project_deeper(
224-
&[ProjectionElem::Field(FieldIdx::from_usize(i), *cast_ty)],
223+
&[ProjectionElem::Field(i, *cast_ty)],
225224
self.tcx,
226225
);
227226
let operand = if operand.is_move() {

‎config.example.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,6 @@
904904
# on linux
905905
#src-tarball = true
906906

907-
# Whether to allow failures when building tools
908-
#missing-tools = false
909-
910907
# List of compression formats to use when generating dist tarballs. The list of
911908
# formats is provided to rust-installer, which must support all of them.
912909
#

‎library/core/src/num/int_macros.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,7 @@ macro_rules! int_impl {
12821282
concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"),
12831283
(
12841284
rhs: u32 = rhs,
1285-
bits: u32 = Self::BITS,
1286-
) => rhs < bits,
1285+
) => rhs < <$ActualT>::BITS,
12871286
);
12881287

12891288
// SAFETY: this is guaranteed to be safe by the caller.
@@ -1381,8 +1380,7 @@ macro_rules! int_impl {
13811380
concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"),
13821381
(
13831382
rhs: u32 = rhs,
1384-
bits: u32 = Self::BITS,
1385-
) => rhs < bits,
1383+
) => rhs < <$ActualT>::BITS,
13861384
);
13871385

13881386
// SAFETY: this is guaranteed to be safe by the caller.

‎library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,7 @@ macro_rules! uint_impl {
13691369
concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"),
13701370
(
13711371
rhs: u32 = rhs,
1372-
bits: u32 = Self::BITS,
1373-
) => rhs < bits,
1372+
) => rhs < <$ActualT>::BITS,
13741373
);
13751374

13761375
// SAFETY: this is guaranteed to be safe by the caller.
@@ -1468,8 +1467,7 @@ macro_rules! uint_impl {
14681467
concat!(stringify!($SelfT), "::unchecked_shr cannot overflow"),
14691468
(
14701469
rhs: u32 = rhs,
1471-
bits: u32 = Self::BITS,
1472-
) => rhs < bits,
1470+
) => rhs < <$ActualT>::BITS,
14731471
);
14741472

14751473
// SAFETY: this is guaranteed to be safe by the caller.

‎src/bootstrap/src/core/config/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ pub struct Config {
314314
pub save_toolstates: Option<PathBuf>,
315315
pub print_step_timings: bool,
316316
pub print_step_rusage: bool,
317-
pub missing_tools: bool, // FIXME: Deprecated field. Remove it at 2024.
318317

319318
// Fallback musl-root for all targets
320319
pub musl_root: Option<PathBuf>,
@@ -905,7 +904,6 @@ define_config! {
905904
sign_folder: Option<String> = "sign-folder",
906905
upload_addr: Option<String> = "upload-addr",
907906
src_tarball: Option<bool> = "src-tarball",
908-
missing_tools: Option<bool> = "missing-tools",
909907
compression_formats: Option<Vec<String>> = "compression-formats",
910908
compression_profile: Option<String> = "compression-profile",
911909
include_mingw_linker: Option<bool> = "include-mingw-linker",
@@ -1936,7 +1934,6 @@ impl Config {
19361934
sign_folder,
19371935
upload_addr,
19381936
src_tarball,
1939-
missing_tools,
19401937
compression_formats,
19411938
compression_profile,
19421939
include_mingw_linker,
@@ -1946,7 +1943,6 @@ impl Config {
19461943
config.dist_compression_formats = compression_formats;
19471944
set(&mut config.dist_compression_profile, compression_profile);
19481945
set(&mut config.rust_dist_src, src_tarball);
1949-
set(&mut config.missing_tools, missing_tools);
19501946
set(&mut config.dist_include_mingw_linker, include_mingw_linker)
19511947
}
19521948

‎src/bootstrap/src/utils/change_tracker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
190190
severity: ChangeSeverity::Warning,
191191
summary: "`rust.lld` has a new default value of `true` on `x86_64-unknown-linux-gnu`. Starting at stage1, `rust-lld` will thus be this target's default linker. No config changes should be necessary.",
192192
},
193+
ChangeInfo {
194+
change_id: 125535,
195+
severity: ChangeSeverity::Warning,
196+
summary: "Removed `dist.missing-tools` configuration as it was deprecated long time ago.",
197+
},
193198
];

‎tests/crashes/123255.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: rust-lang/rust#123255
2+
//@ edition:2021
3+
#![crate_type = "lib"]
4+
5+
pub fn a() {}
6+
7+
mod handlers {
8+
pub struct C(&());
9+
pub fn c() -> impl Fn() -> C {
10+
let a1 = ();
11+
|| C((crate::a(), a1).into())
12+
}
13+
}

‎tests/crashes/123276.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ known-bug: rust-lang/rust#123276
2+
//@ edition:2021
3+
4+
async fn create_task() {
5+
_ = Some(async { bind(documentation_filter()) });
6+
}
7+
8+
async fn bind<Fut, F: Filter<Future = Fut>>(_: F) {}
9+
10+
fn documentation_filter() -> impl Filter {
11+
AndThen
12+
}
13+
14+
trait Filter {
15+
type Future;
16+
}
17+
18+
struct AndThen;
19+
20+
impl Filter for AndThen
21+
where
22+
Foo: Filter,
23+
{
24+
type Future = ();
25+
}

‎tests/crashes/123887.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: rust-lang/rust#123887
2+
//@ compile-flags: -Clink-dead-code
3+
4+
#![feature(extern_types)]
5+
#![feature(unsized_fn_params)]
6+
7+
extern "C" {
8+
pub type ExternType;
9+
}
10+
11+
impl ExternType {
12+
pub fn f(self) {}
13+
}
14+
15+
pub fn main() {}

‎tests/crashes/125013-1.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#125013
2+
//@ edition:2021
3+
use io::{self as std};
4+
use std::ops::Deref::{self as io};
5+
pub fn main() {}

‎tests/crashes/125013-2.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: rust-lang/rust#125013
2+
//@ edition:2021
3+
mod a {
4+
pub mod b {
5+
pub mod c {
6+
pub trait D {}
7+
}
8+
}
9+
}
10+
11+
use a::*;
12+
13+
use e as b;
14+
use b::c::D as e;
15+
16+
fn main() { }

‎tests/crashes/125014.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: rust-lang/rust#125014
2+
//@ compile-flags: -Znext-solver=coherence
3+
#![feature(specialization)]
4+
5+
trait Foo {}
6+
7+
impl Foo for <u16 as Assoc>::Output {}
8+
9+
impl Foo for u32 {}
10+
11+
trait Assoc {
12+
type Output;
13+
}
14+
impl Output for u32 {}
15+
impl Assoc for <u16 as Assoc>::Output {
16+
default type Output = bool;
17+
}

‎tests/crashes/125059.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: rust-lang/rust#125059
2+
#![feature(deref_patterns)]
3+
#![allow(incomplete_features)]
4+
5+
fn simple_vec(vec: Vec<u32>) -> u32 {
6+
(|| match Vec::<u32>::new() {
7+
deref!([]) => 100,
8+
_ => 2000,
9+
})()
10+
}
11+
12+
fn main() {}

‎tests/crashes/125323.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: rust-lang/rust#125323
2+
fn main() {
3+
for _ in 0..0 {
4+
[(); loop {}];
5+
}
6+
}

‎tests/crashes/125370.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: rust-lang/rust#125370
2+
3+
type Field3 = i64;
4+
5+
#[repr(C)]
6+
union DummyUnion {
7+
field3: Field3,
8+
}
9+
10+
const UNION: DummyUnion = loop {};
11+
12+
const fn read_field2() -> Field2 {
13+
const FIELD2: Field2 = loop {
14+
UNION.field3
15+
};
16+
}

‎tests/crashes/125432.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: rust-lang/rust#125432
2+
3+
fn separate_arms() {
4+
// Here both arms perform assignments, but only one is illegal.
5+
6+
let mut x = None;
7+
match x {
8+
None => {
9+
// It is ok to reassign x here, because there is in
10+
// fact no outstanding loan of x!
11+
x = Some(0);
12+
}
13+
Some(right) => consume(right),
14+
}
15+
}
16+
17+
fn main() {}

‎tests/crashes/125476.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//@ known-bug: rust-lang/rust#125476
2+
pub struct Data([u8; usize::MAX >> 16]);
3+
const _: &'static [Data] = &[];

‎tests/crashes/125512.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: rust-lang/rust#125512
2+
//@ edition:2021
3+
#![feature(object_safe_for_dispatch)]
4+
trait B {
5+
fn f(a: A) -> A;
6+
}
7+
trait A {
8+
fn concrete(b: B) -> B;
9+
}
10+
fn main() {}

‎tests/crashes/125520.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #125520
2+
#![feature(generic_const_exprs)]
3+
4+
struct Outer<const A: i64, const B: i64>();
5+
impl<const A: usize, const B: usize> Outer<A, B>
6+
where
7+
[(); A + (B * 2)]:,
8+
{
9+
fn i() -> Self {
10+
Self
11+
}
12+
}
13+
14+
fn main() {
15+
Outer::<1, 1>::o();
16+
}

‎tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
bb1: {
32-
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4, const core::num::<impl u16>::BITS) -> [return: bb2, unwind unreachable];
32+
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable];
3333
+ }
3434
+
3535
+ bb2: {

‎tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
bb1: {
32-
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4, const core::num::<impl u16>::BITS) -> [return: bb2, unwind unreachable];
32+
+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable];
3333
+ }
3434
+
3535
+ bb2: {

‎tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
bb1: {
32-
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4, const core::num::<impl i64>::BITS) -> [return: bb2, unwind unreachable];
32+
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable];
3333
+ }
3434
+
3535
+ bb2: {

‎tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
bb1: {
32-
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4, const core::num::<impl i64>::BITS) -> [return: bb2, unwind unreachable];
32+
+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable];
3333
+ }
3434
+
3535
+ bb2: {

‎tests/ui/issues/issue-33992.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
#![feature(linkage)]
77

8-
#[linkage = "common"]
9-
pub static mut TEST1: u32 = 0u32;
10-
118
#[linkage = "external"]
129
pub static TEST2: bool = true;
1310

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! The symbols are resolved by the linker. It doesn't make sense to change
2+
//! them at runtime, so deny mutable statics with #[linkage].
3+
4+
#![feature(linkage)]
5+
6+
fn main() {
7+
extern "C" {
8+
#[linkage = "weak"] //~ ERROR mutable statics are not allowed with `#[linkage]`
9+
static mut ABC: *const u8;
10+
}
11+
12+
unsafe {
13+
assert_eq!(ABC as usize, 0);
14+
}
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: mutable statics are not allowed with `#[linkage]`
2+
--> $DIR/linkage-attr-mutable-static.rs:8:9
3+
|
4+
LL | #[linkage = "weak"]
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: making the static mutable would allow changing which symbol the static references rather than make the target of the symbol mutable
8+
9+
error: aborting due to 1 previous error
10+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Fix for <https://github.com/rust-lang/rust/issues/125432>.
2+
3+
fn separate_arms() {
4+
let mut x = None;
5+
match x {
6+
None => {
7+
x = Some(0);
8+
}
9+
Some(right) => {
10+
consume(right);
11+
//~^ ERROR cannot find function `consume` in this scope
12+
}
13+
}
14+
}
15+
16+
fn main() {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find function `consume` in this scope
2+
--> $DIR/suggest-method-on-call-for-ambig-receiver.rs:10:13
3+
|
4+
LL | consume(right);
5+
| ^^^^^^^ not found in this scope
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const fn f() -> usize {
2+
//~^ ERROR mismatched types
3+
const FIELD: usize = loop {
4+
0
5+
//~^ ERROR mismatched types
6+
};
7+
}
8+
9+
fn main() {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/dont-suggest-through-inner-const.rs:4:9
3+
|
4+
LL | 0
5+
| ^ expected `()`, found integer
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/dont-suggest-through-inner-const.rs:1:17
9+
|
10+
LL | const fn f() -> usize {
11+
| - ^^^^^ expected `usize`, found `()`
12+
| |
13+
| implicitly returns `()` as its body has no tail or `return` expression
14+
15+
error: aborting due to 2 previous errors
16+
17+
For more information about this error, try `rustc --explain E0308`.

‎triagebot.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,19 @@ message_on_remove = "PR #{number}'s beta-nomination has been removed."
468468
message_on_close = "PR #{number} has been closed. Thanks for participating!"
469469
message_on_reopen = "PR #{number} has been reopened. Pinging @*T-rustdoc*."
470470

471+
# FIXME: Patch triagebot to support `notify-zulip.<label>` getting mapped to an array of actions.
472+
# At the moment, the beta-accepted+T-rustdoc action fully occupies the beta-accepted slot
473+
# preventing others from adding more beta-accepted actions.
474+
[notify-zulip."beta-accepted"]
475+
required_labels = ["T-rustdoc"]
476+
zulip_stream = 266220 # #t-rustdoc
477+
# Put it in the same thread as beta-nominated.
478+
topic = "beta-nominated: #{number}"
479+
message_on_add = "PR #{number} has been **accepted** for beta backport."
480+
message_on_remove = "PR #{number}'s beta-acceptance has been **removed**."
481+
message_on_close = "PR #{number} has been closed. Thanks for participating!"
482+
message_on_reopen = "PR #{number} has been reopened. Pinging @*T-rustdoc*."
483+
471484
# FIXME: Patch triagebot to support `notify-zulip.<label>` getting mapped to an array of actions.
472485
# At the moment, the stable-nominated+T-rustdoc action fully occupies the stable-nominated slot
473486
# preventing others from adding more stable-nominated actions.
@@ -492,6 +505,19 @@ message_on_remove = "PR #{number}'s stable-nomination has been removed."
492505
message_on_close = "PR #{number} has been closed. Thanks for participating!"
493506
message_on_reopen = "PR #{number} has been reopened. Pinging @*T-rustdoc*."
494507

508+
# FIXME: Patch triagebot to support `notify-zulip.<label>` getting mapped to an array of actions.
509+
# At the moment, the stable-accepted+T-rustdoc action fully occupies the stable-accepted slot
510+
# preventing others from adding more stable-accepted actions.
511+
[notify-zulip."stable-accepted"]
512+
required_labels = ["T-rustdoc"]
513+
zulip_stream = 266220 # #t-rustdoc
514+
# Put it in the same thread as stable-nominated.
515+
topic = "stable-nominated: #{number}"
516+
message_on_add = "PR #{number} has been **accepted** for stable backport."
517+
message_on_remove = "PR #{number}'s stable-acceptance has been **removed**."
518+
message_on_close = "PR #{number} has been closed. Thanks for participating!"
519+
message_on_reopen = "PR #{number} has been reopened. Pinging @*T-rustdoc*."
520+
495521
[notify-zulip."I-types-nominated"]
496522
zulip_stream = 326866 # #T-types/nominated
497523
topic = "#{number}: {title}"
@@ -810,6 +836,9 @@ cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"]
810836
[mentions."src/doc/rustc/src/check-cfg.md"]
811837
cc = ["@Urgau"]
812838

839+
[mentions."src/doc/rustc/src/check-cfg"]
840+
cc = ["@Urgau"]
841+
813842
[mentions."src/doc/rustc/src/platform-support"]
814843
cc = ["@Nilstrieb"]
815844

0 commit comments

Comments
 (0)
This repository has been archived.