Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
108bfc1
Update opaque-types-type-alias-impl-trait.md
smanilov May 30, 2025
8a50a15
make sentence more clear
tshepang Aug 30, 2025
e548d77
Remove an attempted error annotation
theemathas Oct 21, 2025
a2d1d14
Make `const BorrowMut` require `const Borrow`
theemathas Oct 21, 2025
28819e0
Make `const Fn` require `const FnMut`
theemathas Oct 21, 2025
63ca804
add debuginfo subsection
Walnut356 Nov 18, 2025
aca2dc0
fix typos and footnotes
Walnut356 Nov 23, 2025
5d997ff
Add section for `#![debugger_visualizer]`
Walnut356 Nov 23, 2025
c15b8f6
Add additional LLDB plugin example
Walnut356 Nov 24, 2025
0f5b29a
add invariant
lcnr Dec 1, 2025
b338190
Update src/solve/invariants.md
lcnr Dec 1, 2025
bbb2f27
Mention sharing the solver with rust-analyzer
ShoyuVanilla Dec 2, 2025
ac2a424
Remove `[no-mentions]` handler in our triagebot config
Urgau Dec 8, 2025
2cfe225
Merge pull request #2675 from Urgau/triagebot-remove-no-mentions
Urgau Dec 8, 2025
d1d1181
chore: fix some minor issues in the comments
xiaolinny Dec 9, 2025
852299d
Merge pull request #2668 from ShoyuVanilla/ra-solver
lcnr Dec 9, 2025
92f21a8
moved tests
reddevilmidzy Dec 7, 2025
49a6c11
Merge pull request #2667 from lcnr/type-system-invariants
lcnr Dec 10, 2025
f4ee932
initial const generics docs
BoxyUwU Dec 10, 2025
c17a0f4
move docs about ambig ty and consts
BoxyUwU Dec 10, 2025
6672a89
Fix broken link for 'Uniqueness and Reference Immutability'
reddevilmidzy Dec 11, 2025
2bc3e68
Merge pull request #2678 from reddevilmidzy/main
Noratrieb Dec 11, 2025
a22e0a3
Basic const generics docs
BoxyUwU Dec 11, 2025
30eb6ad
say "certain"
BoxyUwU Dec 11, 2025
294d304
Merge pull request #2649 from Walnut356/debuginfo
Kobzol Dec 11, 2025
5d056fa
Merge pull request #2561 from rust-lang/tshepang-patch-1
tshepang Dec 11, 2025
0e81edc
fix help wanted search
BoxyUwU Dec 11, 2025
1e4d530
Fix help wanted link
BoxyUwU Dec 11, 2025
e58de3a
clarify why define_opaque isnt needed
BoxyUwU Dec 11, 2025
25cb251
Merge pull request #2429 from smanilov/patch-18
BoxyUwU Dec 11, 2025
8e77f36
make more clear code snippet is supposed to error
BoxyUwU Dec 11, 2025
31f801e
clarify test suite is not formatted
BoxyUwU Dec 11, 2025
3662b4c
Add LoongArch notification group instructions
heiher Dec 11, 2025
1e9e5c9
clarify test suite is not formatted
BoxyUwU Dec 11, 2025
ce822cd
remove dashboard :(
BoxyUwU Dec 11, 2025
298a9d3
remove CI dashboard :(
BoxyUwU Dec 11, 2025
2b195c3
Add LoongArch notification group instructions
BoxyUwU Dec 11, 2025
bceccc2
link to forge policy
BoxyUwU Dec 12, 2025
a9fe1b4
link to rust forge review policy in readme
BoxyUwU Dec 12, 2025
97b8681
Merge pull request #2680 from BoxyUwU/binders_example_error
BoxyUwU Dec 12, 2025
7897102
Make test suite formatting remark more precise
jieyouxu Dec 12, 2025
599806a
Merge pull request #2685 from jieyouxu/fix-fmt
jieyouxu Dec 12, 2025
73c682a
Add link to needs test issues in getting-started.md
reddevilmidzy Dec 12, 2025
f51f094
Merge pull request #2686 from reddevilmidzy/needs-test-issue-link
tshepang Dec 12, 2025
49db9ec
Update and add more details for Providers
xizheyin Jun 15, 2025
f936b9f
Refinement of Providers into Providers and ExternProviders
BoxyUwU Dec 12, 2025
900c79a
update some outdated infos on error codes
cyrgani Dec 12, 2025
9f4a972
Merge pull request #2688 from cyrgani/errorcode
BoxyUwU Dec 13, 2025
42334f7
sembr README.md
tshepang Dec 13, 2025
12c2c05
Prepare for merging from rust-lang/rust
invalid-email-address Dec 13, 2025
cf9c20b
Merge ref 'ce63e5d9ea20' from rust-lang/rust
invalid-email-address Dec 13, 2025
ef04de5
sembr nit (missed by tool)
tshepang Dec 13, 2025
48782eb
small README improvements
tshepang Dec 13, 2025
8a78150
Merge pull request #2689 from rust-lang/rustc-pull
tshepang Dec 13, 2025
bf1f3eb
point to the "main crate", instead of a list of crates
tshepang Dec 13, 2025
06ba83e
Merge pull request #2690 from rust-lang/tshepang/sembr
tshepang Dec 13, 2025
dd91e00
whitespace
tshepang Dec 13, 2025
745a0fb
does not work for some reason
tshepang Dec 13, 2025
ce0f8c9
test is hard to follow
tshepang Dec 13, 2025
9d62f73
fix corner case
tshepang Dec 13, 2025
3d73b32
sembr fuzzing.md
tshepang Dec 13, 2025
e513e48
Merge pull request #2691 from rust-lang/tshepang/sembr
tshepang Dec 13, 2025
cfe2be4
make more readable
tshepang Dec 13, 2025
a1b57f4
remove unclear text
tshepang Dec 13, 2025
d79d0ae
horizontal scroll is excessive for these examples
tshepang Dec 13, 2025
6f5454a
guidance is clear enough
tshepang Dec 13, 2025
d8d8dbd
feels appropriate
tshepang Dec 13, 2025
cc28bef
fluff
tshepang Dec 13, 2025
86f18b3
use compact format, as this is what is in bootstrap.example.toml
tshepang Dec 13, 2025
da01b35
redundant
tshepang Dec 13, 2025
cc8cfcc
fails link checks
tshepang Dec 13, 2025
c9301df
Merge pull request #2692 from rust-lang/tshepang/fuzzing
tshepang Dec 13, 2025
0def182
Updated titles and links for two references in the bibliography
reddevilmidzy Dec 13, 2025
78337fc
Merge pull request #2693 from reddevilmidzy/fix
jyn514 Dec 13, 2025
69ba7c5
about-this-guide.md: make more clear
tshepang Dec 14, 2025
1a68b94
Merge pull request #2694 from rust-lang/tshepang-patch-1
tshepang Dec 14, 2025
164eec7
Add rust-analyzer book link to the guide
reddevilmidzy Dec 14, 2025
a56a4ff
less text for same effect
tshepang Dec 14, 2025
46db677
Merge pull request #2697 from rust-lang/tshepang/link-to-ra-guide
tshepang Dec 14, 2025
1bd997a
Cleaned up some tests
reddevilmidzy Dec 10, 2025
023f38f
custom `VaList` layout for Hexagon
folkertdev Dec 13, 2025
dbfc8c2
dont create unnecessary `DefId`s under mgca
BoxyUwU Dec 15, 2025
63cdf93
Prepare for merging from rust-lang/rust
invalid-email-address Dec 16, 2025
98a964a
Merge ref 'cec70080fd44' from rust-lang/rust
invalid-email-address Dec 16, 2025
c2aeeaf
Merge pull request #2699 from rust-lang/rustc-pull
tshepang Dec 16, 2025
fca8611
Mirror GCC
Kobzol Dec 16, 2025
d5bf1a4
Introduce `vtable_for` intrinsic and use it to implement `try_as_dyn`…
ivarflakstad Jul 13, 2025
6d6068f
stabilize annotate-snippet as default formatter
Kivooeo Dec 16, 2025
a47c8b2
remove human-annotate-rs
Kivooeo Dec 16, 2025
84f2854
remove fixme & update stderr files
Kivooeo Dec 16, 2025
0004d8d
Remove deny of manual-let-else
workingjubilee Dec 16, 2025
4efe268
std: io: error: Add comment for UEFI unpacked repr use
Ayush1325 Dec 16, 2025
d93b93b
Rollup merge of #147939 - theemathas:add-const-supertrait, r=oli-obk
JonathanBrouwer Dec 16, 2025
6c7ee7d
Rollup merge of #149734 - Kobzol:gcc-9.2.0, r=marcoieni
JonathanBrouwer Dec 16, 2025
f108cd7
Rollup merge of #149767 - reddevilmidzy:t11, r=Kivooeo
JonathanBrouwer Dec 16, 2025
297cdc8
Rollup merge of #149804 - xiaolinny:main, r=lcnr
JonathanBrouwer Dec 16, 2025
ef2c71c
Rollup merge of #149967 - folkertdev:va-list-hexagon, r=workingjubilee
JonathanBrouwer Dec 16, 2025
9308518
Rollup merge of #150025 - BoxyUwU:mgca_no_unused_defids, r=oli-obk
JonathanBrouwer Dec 16, 2025
f3fa567
Rollup merge of #150032 - Kivooeo:annotate-snippets-stable, r=Muscraft
JonathanBrouwer Dec 16, 2025
25b73c4
Rollup merge of #150033 - izagawd:try_as_dyn, r=oli-obk
JonathanBrouwer Dec 16, 2025
926c2e6
Rollup merge of #150042 - tshepang:rdg-sync, r=tshepang
JonathanBrouwer Dec 16, 2025
02c0e8f
Rollup merge of #150063 - workingjubilee:remove-let-else-deny, r=Kivooeo
JonathanBrouwer Dec 16, 2025
ff84058
Rollup merge of #150064 - Ayush1325:uefi-io-repr-comment, r=bjorn3
JonathanBrouwer Dec 16, 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: 0 additions & 1 deletion compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(array_windows))]
#![deny(clippy::manual_let_else)]
#![doc(test(attr(deny(warnings), allow(internal_features))))]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![deny(clippy::manual_let_else)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(file_buffered)]
Expand Down
50 changes: 48 additions & 2 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ mod simd;

use std::assert_matches::assert_matches;

use rustc_abi::{FieldIdx, HasDataLayout, Size, VariantIdx};
use rustc_abi::{FIRST_VARIANT, FieldIdx, HasDataLayout, Size, VariantIdx};
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
use rustc_hir::def_id::CRATE_DEF_ID;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::mir::interpret::{CTFE_ALLOC_SALT, read_target_uint, write_target_uint};
use rustc_middle::mir::{self, BinOp, ConstValue, NonDivergingIntrinsic};
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::{FloatTy, Ty, TyCtxt};
use rustc_middle::ty::{FloatTy, PolyExistentialPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_middle::{bug, span_bug, ty};
use rustc_span::{Symbol, sym};
use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt};
use tracing::trace;

use super::memory::MemoryKind;
Expand Down Expand Up @@ -219,6 +222,49 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {

self.write_scalar(Scalar::from_target_usize(offset, self), dest)?;
}
sym::vtable_for => {
let tp_ty = instance.args.type_at(0);
let result_ty = instance.args.type_at(1);

ensure_monomorphic_enough(tcx, tp_ty)?;
ensure_monomorphic_enough(tcx, result_ty)?;
let ty::Dynamic(preds, _) = result_ty.kind() else {
span_bug!(
self.find_closest_untracked_caller_location(),
"Invalid type provided to vtable_for::<T, U>. U must be dyn Trait, got {result_ty}."
);
};

let (infcx, param_env) =
self.tcx.infer_ctxt().build_with_typing_env(self.typing_env);

let ocx = ObligationCtxt::new(&infcx);
ocx.register_obligations(preds.iter().map(|pred: PolyExistentialPredicate<'_>| {
let pred = pred.with_self_ty(tcx, tp_ty);
// Lifetimes can only be 'static because of the bound on T
let pred = pred.fold_with(&mut ty::BottomUpFolder {
tcx,
ty_op: |ty| ty,
lt_op: |lt| {
if lt == tcx.lifetimes.re_erased { tcx.lifetimes.re_static } else { lt }
},
ct_op: |ct| ct,
});
Obligation::new(tcx, ObligationCause::dummy(), param_env, pred)
}));
let type_impls_trait = ocx.evaluate_obligations_error_on_ambiguity().is_empty();
// Since `assumed_wf_tys=[]` the choice of LocalDefId is irrelevant, so using the "default"
let regions_are_valid = ocx.resolve_regions(CRATE_DEF_ID, param_env, []).is_empty();

if regions_are_valid && type_impls_trait {
let vtable_ptr = self.get_vtable_ptr(tp_ty, preds)?;
// Writing a non-null pointer into an `Option<NonNull>` will automatically make it `Some`.
self.write_pointer(vtable_ptr, dest)?;
} else {
// Write `None`
self.write_discriminant(FIRST_VARIANT, dest)?;
}
}
sym::variant_count => {
let tp_ty = instance.args.type_at(0);
let ty = match tp_ty.kind() {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// tidy-alphabetical-start
#![allow(rustc::diagnostic_outside_of_impl)]
#![deny(clippy::manual_let_else)]
#![feature(array_try_map)]
#![feature(assert_matches)]
#![feature(box_patterns)]
Expand Down
17 changes: 0 additions & 17 deletions compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,6 @@ impl AnnotateSnippetEmitter {
}
}

let suggestions_expected = suggestions
.iter()
.filter(|s| {
matches!(
s.style,
SuggestionStyle::HideCodeInline
| SuggestionStyle::ShowCode
| SuggestionStyle::ShowAlways
)
})
.count();
for suggestion in suggestions {
match suggestion.style {
SuggestionStyle::CompletelyHidden => {
Expand Down Expand Up @@ -526,12 +515,6 @@ impl AnnotateSnippetEmitter {
}
}

// FIXME: This hack should be removed once annotate_snippets is the
// default emitter.
if suggestions_expected > 0 && report.is_empty() {
group = group.element(Padding);
}

if !group.is_empty() {
report.push(group);
}
Expand Down
13 changes: 5 additions & 8 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ const DEFAULT_COLUMN_WIDTH: usize = 140;

/// Describes the way the content of the `rendered` field of the json output is generated
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HumanReadableErrorType {
Default { short: bool },
AnnotateSnippet { short: bool, unicode: bool },
pub struct HumanReadableErrorType {
pub short: bool,
pub unicode: bool,
}

impl HumanReadableErrorType {
pub fn short(&self) -> bool {
match self {
HumanReadableErrorType::Default { short }
| HumanReadableErrorType::AnnotateSnippet { short, .. } => *short,
}
self.short
}
}

Expand Down Expand Up @@ -607,7 +604,7 @@ pub enum OutputTheme {
Unicode,
}

/// Handles the writing of `HumanReadableErrorType::Default` and `HumanReadableErrorType::Short`
/// Handles the writing of `HumanReadableErrorType`
#[derive(Setters)]
pub struct HumanEmitter {
#[setters(skip)]
Expand Down
47 changes: 13 additions & 34 deletions compiler/rustc_errors/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use serde::Serialize;
use crate::annotate_snippet_emitter_writer::AnnotateSnippetEmitter;
use crate::diagnostic::IsLint;
use crate::emitter::{
ColorConfig, Destination, Emitter, HumanEmitter, HumanReadableErrorType, OutputTheme,
TimingEvent, should_show_source_code,
ColorConfig, Destination, Emitter, HumanReadableErrorType, OutputTheme, TimingEvent,
should_show_source_code,
};
use crate::registry::Registry;
use crate::timings::{TimingRecord, TimingSection};
Expand Down Expand Up @@ -378,38 +378,17 @@ impl Diagnostic {
choice => choice,
},
);
match je.json_rendered {
HumanReadableErrorType::AnnotateSnippet { short, unicode } => {
AnnotateSnippetEmitter::new(dst, je.translator.clone())
.short_message(short)
.sm(je.sm.clone())
.diagnostic_width(je.diagnostic_width)
.macro_backtrace(je.macro_backtrace)
.track_diagnostics(je.track_diagnostics)
.terminal_url(je.terminal_url)
.ui_testing(je.ui_testing)
.ignored_directories_in_source_blocks(
je.ignored_directories_in_source_blocks.clone(),
)
.theme(if unicode { OutputTheme::Unicode } else { OutputTheme::Ascii })
.emit_diagnostic(diag, registry)
}
HumanReadableErrorType::Default { short } => {
HumanEmitter::new(dst, je.translator.clone())
.short_message(short)
.sm(je.sm.clone())
.diagnostic_width(je.diagnostic_width)
.macro_backtrace(je.macro_backtrace)
.track_diagnostics(je.track_diagnostics)
.terminal_url(je.terminal_url)
.ui_testing(je.ui_testing)
.ignored_directories_in_source_blocks(
je.ignored_directories_in_source_blocks.clone(),
)
.theme(OutputTheme::Ascii)
.emit_diagnostic(diag, registry)
}
}
AnnotateSnippetEmitter::new(dst, je.translator.clone())
.short_message(je.json_rendered.short)
.sm(je.sm.clone())
.diagnostic_width(je.diagnostic_width)
.macro_backtrace(je.macro_backtrace)
.track_diagnostics(je.track_diagnostics)
.terminal_url(je.terminal_url)
.ui_testing(je.ui_testing)
.ignored_directories_in_source_blocks(je.ignored_directories_in_source_blocks.clone())
.theme(if je.json_rendered.unicode { OutputTheme::Unicode } else { OutputTheme::Ascii })
.emit_diagnostic(diag, registry);

let buf = Arc::try_unwrap(buf.0).unwrap().into_inner().unwrap();
let buf = String::from_utf8(buf).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/json/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
Some(sm),
translator,
true, // pretty
HumanReadableErrorType::Default { short: true },
HumanReadableErrorType { short: true, unicode: false },
ColorConfig::Never,
);

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![deny(clippy::manual_let_else)]
#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
#![feature(const_default)]
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::type_name
| sym::ub_checks
| sym::variant_count
| sym::vtable_for
| sym::wrapping_add
| sym::wrapping_mul
| sym::wrapping_sub
Expand Down Expand Up @@ -643,6 +644,20 @@ pub(crate) fn check_intrinsic_type(
(0, 0, vec![Ty::new_imm_ptr(tcx, tcx.types.unit)], tcx.types.usize)
}

sym::vtable_for => {
let dyn_metadata = tcx.require_lang_item(LangItem::DynMetadata, span);
let dyn_metadata_adt_ref = tcx.adt_def(dyn_metadata);
let dyn_metadata_args = tcx.mk_args(&[param(1).into()]);
let dyn_ty = Ty::new_adt(tcx, dyn_metadata_adt_ref, dyn_metadata_args);

let option_did = tcx.require_lang_item(LangItem::Option, span);
let option_adt_ref = tcx.adt_def(option_did);
let option_args = tcx.mk_args(&[dyn_ty.into()]);
let ret_ty = Ty::new_adt(tcx, option_adt_ref, option_args);

(2, 0, vec![], ret_ty)
}

// This type check is not particularly useful, but the `where` bounds
// on the definition in `core` do the heavy lifting for checking it.
sym::aggregate_raw_ptr => (3, 0, vec![param(1), param(2)], param(0)),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ This API is completely unstable and subject to change.
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![deny(clippy::manual_let_else)]
#![feature(assert_matches)]
#![feature(gen_blocks)]
#![feature(if_let_guard)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// tidy-alphabetical-start
#![deny(clippy::manual_let_else)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn test_search_paths_tracking_hash_different_order() {
let early_dcx = EarlyDiagCtxt::new(JSON);
const JSON: ErrorOutputType = ErrorOutputType::Json {
pretty: false,
json_rendered: HumanReadableErrorType::Default { short: false },
json_rendered: HumanReadableErrorType { short: false, unicode: false },
color_config: ColorConfig::Never,
};

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![deny(clippy::manual_let_else)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
_ => false,
}
{
continue;
// MGCA doesn't have unnecessary DefIds
if !tcx.features().min_generic_const_args() {
continue;
}
}

if def_kind == DefKind::Field
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![deny(clippy::manual_let_else)]
#![feature(allocator_api)]
#![feature(assert_matches)]
#![feature(associated_type_defaults)]
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_resolve/src/def_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,16 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
}

fn visit_anon_const(&mut self, constant: &'a AnonConst) {
// `MgcaDisambiguation::Direct` is set even when MGCA is disabled, so
// to avoid affecting stable we have to feature gate the not creating
// anon consts
if let MgcaDisambiguation::Direct = constant.mgca_disambiguation
&& self.resolver.tcx.features().min_generic_const_args()
{
visit::walk_anon_const(self, constant);
return;
}

let parent = self.create_def(constant.id, None, DefKind::AnonConst, constant.value.span);
self.with_parent(parent, |this| visit::walk_anon_const(this, constant));
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![deny(clippy::manual_let_else)]
#![feature(arbitrary_self_types)]
#![feature(assert_matches)]
#![feature(box_patterns)]
Expand Down
Loading
Loading