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 7 pull requests #136658

Merged
merged 97 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
dfd76c1
disallow `repr()` on invalid items
folkertdev Dec 5, 2024
a4bb0d4
fix issue 132391
folkertdev Dec 5, 2024
a7adb82
Move `format_push_string` and `format_collect` to pedantic
smoelius Dec 29, 2024
65b95a2
fix escaping problem in `write_literal` and `print_literal` lint
lapla-cogito Jan 12, 2025
87f7e21
Address review comments
smoelius Jan 14, 2025
bbd58d1
Do not trigger `[size_of_in_element_count]` for `u8`
samueltardieu Jan 16, 2025
5bd989a
Update version for unneeded_struct_pattern
alex-semenyuk Jan 19, 2025
7aae4f4
auto-fix for redundant_else lint
lapla-cogito Jan 3, 2025
f0b99b2
`needless_option_take`: add autofix
samueltardieu Jan 20, 2025
e485cc5
Simplify slice indexing in next trait solver
yotamofek Jan 25, 2025
13be95a
new `manual_option_as_slice` lint
llogiq Dec 29, 2024
885278b
Stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut`
Urgau Jan 27, 2025
6b7b547
Adjust compiler for `HashMap::get_many_mut` stabilization
Urgau Jan 27, 2025
9da9ddb
Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into clippy-s…
flip1995 Jan 28, 2025
9ede32f
`needless_option_take`: add autofix (#14042)
llogiq Jan 28, 2025
abb3e8e
Make item self/non-self bound naming less whack
compiler-errors Jan 22, 2025
d7874f4
Refactor FnKind variant to hold &Fn
celinval Jan 28, 2025
6a209cd
Fix escaping problem in `write_literal` and `print_literal` lint sugg…
Centri3 Jan 28, 2025
e02c885
Move `format_push_string` and `format_collect` to pedantic (#13894)
Centri3 Jan 28, 2025
0baa100
rustc_hir: replace `is_empty()`+indexing with `first()`
yotamofek Jan 28, 2025
3802225
rustc_hir: use box patterns to flatten some nested pattern matches
yotamofek Jan 28, 2025
1d4a419
rustc_hir: don't open-code `Iterator::eq`
yotamofek Jan 28, 2025
8aba730
rustc_hir: fix typo in comment
yotamofek Jan 28, 2025
6c1df36
rustc_hir: flatten nested `if`s
yotamofek Jan 28, 2025
056fe96
rustc_hir: remove some uneeded refs and derefs
yotamofek Jan 28, 2025
e84c8b8
Rollup merge of #135902 - compiler-errors:item-non-self-bound-in-new-…
fmease Jan 29, 2025
a4eff9d
Rollup merge of #136164 - celinval:chores-fnkind, r=oli-obk
fmease Jan 29, 2025
7eefa76
Eliminate PatKind::Path
oli-obk Dec 12, 2024
84fb6b1
Add new lint `return_and_then`
aaron-ang Jan 26, 2025
78d6b2e
Do not remove semicolon if it changes the block type
samueltardieu Jan 29, 2025
e4505fb
Include generic arguments when suggesting a closure η-reduction
samueltardieu Jan 29, 2025
88a00a8
autofix for `redundant_else` lint (#13936)
blyxyas Jan 30, 2025
ad05bc0
Include generic arguments when suggesting a closure η-reduction (#14105)
llogiq Jan 30, 2025
f8be518
Move mutex_integer to restriction and improve mutex_{integer,atomic} …
taiki-e Jan 30, 2025
8db9ecf
New lint: `precedence_bits`, with recent additions to `precedence`
samueltardieu Jan 30, 2025
7399338
introduce `ty::Value`
Jan 27, 2025
33bb8af
Fix expand/collapse all on site, make highlightjs lazier
Alexendoo Jan 19, 2025
d49b1ff
Implement --perf flag to lintcheck for benchmarking
blyxyas Jan 30, 2025
fc00cdc
Actually make --perf imply -j=1, review comments
blyxyas Jan 30, 2025
f51e18d
feat: new lint for `and_then` when returning Option or Result (#14051)
Centri3 Jan 30, 2025
5aa8bc1
`sliced_string_as_bytes`: fix typo in lint description
samueltardieu Jan 30, 2025
398a5c2
New lint: `precedence_bits`, with recent additions to `precedence` (#…
llogiq Jan 30, 2025
e188c7d
`sliced_string_as_bytes`: fix typo in lint description (#14117)
Centri3 Jan 30, 2025
d79f862
Do not remove semicolon if it changes the block type (#14103)
dswij Jan 31, 2025
27454db
Insert null checks for pointer dereferences when debug assertions are…
1c3t3a Dec 17, 2024
48ae7ec
Adress review comments
blyxyas Jan 31, 2025
9c8fe30
Auto merge of #134424 - 1c3t3a:null-checks, r=saethlin
bors Jan 31, 2025
62c68e1
Implement MIR, CTFE, and codegen for unsafe binders
compiler-errors Jan 31, 2025
a9434c0
Enforce unsafe binders must be Copy (for now)
compiler-errors Jan 31, 2025
64fcb00
Rename `tcx.ensure()` to `tcx.ensure_ok()`
Zalathar Jan 30, 2025
7848488
Use a better message for `toplevel_ref_arg` lint
samueltardieu Feb 1, 2025
7e5cfbe
Use a better message for `toplevel_ref_arg` lint (#14132)
Manishearth Feb 1, 2025
984cc68
Rollup merge of #130514 - compiler-errors:unsafe-binders, r=oli-obk
matthiaskrgr Feb 1, 2025
c607f78
Fix expand/collapse all on site, make highlightjs lazier (#14038)
blyxyas Feb 1, 2025
3155dab
add autofix for `cmp_null`
lapla-cogito Jan 31, 2025
b8d0b16
autofix for `cmp_null` (#14122)
Alexendoo Feb 1, 2025
d30f045
Convert two `rustc_middle::lint` functions to `Span` methods.
nnethercote Feb 2, 2025
56b5d11
Rollup merge of #136279 - Zalathar:ensure-ok, r=oli-obk
matthiaskrgr Feb 2, 2025
af18dce
remove "Known problems" of `verbose_bit_mask`
lapla-cogito Feb 2, 2025
0d3fd98
remove "Known problems" of `verbose_bit_mask` (#14137)
llogiq Feb 2, 2025
6d1482c
Implement --perf flag to lintcheck for benchmarking (#14116)
Alexendoo Feb 2, 2025
abdee77
Some cleanups around EarlyDiagCtxt
bjorn3 Feb 2, 2025
f8d702b
Rollup merge of #136422 - nnethercote:convert-lint-functions, r=Norat…
matthiaskrgr Feb 2, 2025
1a8e9b9
Rollup merge of #136445 - bjorn3:diag_ctxt_cleanup, r=oli-obk
matthiaskrgr Feb 2, 2025
3d6e090
add `SLICE_FILL` to msrv
lapla-cogito Jan 27, 2025
e82b1f4
add `manual_slice_fill` lint
lapla-cogito Jan 27, 2025
07ede9c
ignore `manual_slice_fill` in other test files
lapla-cogito Jan 30, 2025
2c51951
add `manual_slice_fill` lint (#14082)
llogiq Feb 3, 2025
c1e4249
Use a different hir type for patterns in pattern types than we use in…
oli-obk Jan 7, 2025
1112801
Contracts core intrinsics.
pnkfelix Dec 2, 2024
0a8331f
Express contracts as part of function header and lower it to the cont…
celinval Jan 9, 2025
c5218d5
new `manual_option_as_slice` lint (#13901)
blyxyas Feb 3, 2025
75e3a2e
Move mutex_integer to restriction and improve mutex_{integer,atomic} …
Jarcho Feb 4, 2025
270e52f
fix: manual_unwrap_or_default
profetia Feb 5, 2025
4c11087
Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk
fmease Feb 5, 2025
e6d9641
fix: `manual_unwrap_or_default` suggests falsely when condition type …
llogiq Feb 5, 2025
e27495c
Couple of changes to run rustc in miri
bjorn3 Feb 5, 2025
390286d
Update version for unneeded_struct_pattern (#14031)
Alexendoo Feb 5, 2025
c718ae8
Add Nursery and Deprecated lints section at Book
alex-semenyuk Dec 26, 2024
f09701a
Do not trigger `[size_of_in_element_count]` for `u8` (#14011)
blyxyas Feb 5, 2025
694b245
Fix docs for `#[clippy::format_args]`
nyurik Feb 6, 2025
ee1c15e
Add Nursery and Deprecated groups section at Book (#13926)
flip1995 Feb 6, 2025
660d861
Fix docs for `#[clippy::format_args]` (#14161)
flip1995 Feb 6, 2025
f549562
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Feb 6, 2025
9f31768
Bump nightly version -> 2025-02-06
flip1995 Feb 6, 2025
3e3715c
Rustup (#14163)
flip1995 Feb 6, 2025
daa82a1
Merge commit '3e3715c31236bff56f1c63a1de2c7bbdfcfb0923' into clippy-s…
flip1995 Feb 6, 2025
9a833de
Construct DiagCtxt a bit earlier in build_session
bjorn3 Feb 5, 2025
8a0adec
Avoid manually producing FatalError in a couple of places
bjorn3 Feb 5, 2025
b9b2c3a
Stop passing the same resource multiple times when building ParseSess
bjorn3 Feb 5, 2025
4b7e55a
Rollup merge of #133925 - folkertdev:improve-repr-warnings, r=compile…
matthiaskrgr Feb 6, 2025
ae1410e
Rollup merge of #136069 - yotamofek:next-solver-slice, r=compiler-errors
matthiaskrgr Feb 6, 2025
0fb72ee
Rollup merge of #136152 - Urgau:stabilize-map_many_mut, r=joshtriplett
matthiaskrgr Feb 6, 2025
3e54c2e
Rollup merge of #136219 - yotamofek:pr/hir-cleanup, r=compiler-errors
matthiaskrgr Feb 6, 2025
3eb1ef8
Rollup merge of #136580 - bjorn3:miri_fixes, r=lqd
matthiaskrgr Feb 6, 2025
79e5424
Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errors
matthiaskrgr Feb 6, 2025
b1be2d5
Rollup merge of #136645 - flip1995:clippy-subtree-update, r=Manishearth
matthiaskrgr Feb 6, 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
16 changes: 8 additions & 8 deletions compiler/rustc_data_structures/src/memmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use std::io;
use std::ops::{Deref, DerefMut};

/// A trivial wrapper for [`memmap2::Mmap`] (or `Vec<u8>` on WASM).
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(miri, target_arch = "wasm32")))]
pub struct Mmap(memmap2::Mmap);

#[cfg(target_arch = "wasm32")]
#[cfg(any(miri, target_arch = "wasm32"))]
pub struct Mmap(Vec<u8>);

#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(miri, target_arch = "wasm32")))]
impl Mmap {
/// # Safety
///
Expand All @@ -29,7 +29,7 @@ impl Mmap {
}
}

#[cfg(target_arch = "wasm32")]
#[cfg(any(miri, target_arch = "wasm32"))]
impl Mmap {
#[inline]
pub unsafe fn map(mut file: File) -> io::Result<Self> {
Expand All @@ -56,13 +56,13 @@ impl AsRef<[u8]> for Mmap {
}
}

#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(miri, target_arch = "wasm32")))]
pub struct MmapMut(memmap2::MmapMut);

#[cfg(target_arch = "wasm32")]
#[cfg(any(miri, target_arch = "wasm32"))]
pub struct MmapMut(Vec<u8>);

#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(miri, target_arch = "wasm32")))]
impl MmapMut {
#[inline]
pub fn map_anon(len: usize) -> io::Result<Self> {
Expand All @@ -82,7 +82,7 @@ impl MmapMut {
}
}

#[cfg(target_arch = "wasm32")]
#[cfg(any(miri, target_arch = "wasm32"))]
impl MmapMut {
#[inline]
pub fn map_anon(len: usize) -> io::Result<Self> {
Expand Down
12 changes: 12 additions & 0 deletions compiler/rustc_data_structures/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ const STACK_PER_RECURSION: usize = 16 * 1024 * 1024; // 16MB
///
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
#[inline]
#[cfg(not(miri))]
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
stacker::maybe_grow(RED_ZONE, STACK_PER_RECURSION, f)
}

/// Grows the stack on demand to prevent stack overflow. Call this in strategic locations
/// to "break up" recursive calls. E.g. almost any call to `visit_expr` or equivalent can benefit
/// from this.
///
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
#[cfg(miri)]
#[inline]
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
f()
}
8 changes: 4 additions & 4 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ pub mod pretty;
#[macro_use]
mod print;
mod session_diagnostics;
#[cfg(all(unix, any(target_env = "gnu", target_os = "macos")))]
#[cfg(all(not(miri), unix, any(target_env = "gnu", target_os = "macos")))]
mod signal_handler;

#[cfg(not(all(unix, any(target_env = "gnu", target_os = "macos"))))]
#[cfg(not(all(not(miri), unix, any(target_env = "gnu", target_os = "macos"))))]
mod signal_handler {
/// On platforms which don't support our signal handler's requirements,
/// simply use the default signal handler provided by std.
Expand Down Expand Up @@ -1024,7 +1024,7 @@ pub fn describe_flag_categories(early_dcx: &EarlyDiagCtxt, matches: &Matches) ->
let wall = matches.opt_strs("W");
if wall.iter().any(|x| *x == "all") {
print_wall_help();
rustc_errors::FatalError.raise();
return true;
}

// Don't handle -W help here, because we might first load additional lints.
Expand Down Expand Up @@ -1474,7 +1474,7 @@ pub fn init_logger(early_dcx: &EarlyDiagCtxt, cfg: rustc_log::LoggerConfig) {
/// Install our usual `ctrlc` handler, which sets [`rustc_const_eval::CTRL_C_RECEIVED`].
/// Making this handler optional lets tools can install a different handler, if they wish.
pub fn install_ctrlc_handler() {
#[cfg(not(target_family = "wasm"))]
#[cfg(all(not(miri), not(target_family = "wasm")))]
ctrlc::set_handler(move || {
// Indicate that we have been signaled to stop, then give the rest of the compiler a bit of
// time to check CTRL_C_RECEIVED and run its own shutdown logic, but after a short amount
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ impl HumanEmitter {

let column_width = if let Some(width) = self.diagnostic_width {
width.saturating_sub(code_offset)
} else if self.ui_testing {
} else if self.ui_testing || cfg!(miri) {
DEFAULT_COLUMN_WIDTH
} else {
termize::dimensions()
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,8 @@ impl<'a> DiagCtxtHandle<'a> {
/// bad results, such as spurious/uninteresting additional errors -- when
/// returning an error `Result` is difficult.
pub fn abort_if_errors(&self) {
if self.has_errors().is_some() {
FatalError.raise();
if let Some(guar) = self.has_errors() {
guar.raise_fatal();
}
}

Expand Down
92 changes: 36 additions & 56 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ pub type UsePath<'hir> = Path<'hir, SmallVec<[Res; 3]>>;

impl Path<'_> {
pub fn is_global(&self) -> bool {
!self.segments.is_empty() && self.segments[0].ident.name == kw::PathRoot
self.segments.first().is_some_and(|segment| segment.ident.name == kw::PathRoot)
}
}

Expand Down Expand Up @@ -1061,10 +1061,7 @@ impl Attribute {

pub fn value_lit(&self) -> Option<&MetaItemLit> {
match &self.kind {
AttrKind::Normal(n) => match n.as_ref() {
AttrItem { args: AttrArgs::Eq { expr, .. }, .. } => Some(expr),
_ => None,
},
AttrKind::Normal(box AttrItem { args: AttrArgs::Eq { expr, .. }, .. }) => Some(expr),
_ => None,
}
}
Expand All @@ -1077,12 +1074,9 @@ impl AttributeExt for Attribute {

fn meta_item_list(&self) -> Option<ThinVec<ast::MetaItemInner>> {
match &self.kind {
AttrKind::Normal(n) => match n.as_ref() {
AttrItem { args: AttrArgs::Delimited(d), .. } => {
ast::MetaItemKind::list_from_tokens(d.tokens.clone())
}
_ => None,
},
AttrKind::Normal(box AttrItem { args: AttrArgs::Delimited(d), .. }) => {
ast::MetaItemKind::list_from_tokens(d.tokens.clone())
}
_ => None,
}
}
Expand All @@ -1098,23 +1092,16 @@ impl AttributeExt for Attribute {
/// For a single-segment attribute, returns its name; otherwise, returns `None`.
fn ident(&self) -> Option<Ident> {
match &self.kind {
AttrKind::Normal(n) => {
if let [ident] = n.path.segments.as_ref() {
Some(*ident)
} else {
None
}
}
AttrKind::DocComment(..) => None,
AttrKind::Normal(box AttrItem {
path: AttrPath { segments: box [ident], .. }, ..
}) => Some(*ident),
_ => None,
}
}

fn path_matches(&self, name: &[Symbol]) -> bool {
match &self.kind {
AttrKind::Normal(n) => {
n.path.segments.len() == name.len()
&& n.path.segments.iter().zip(name).all(|(s, n)| s.name == *n)
}
AttrKind::Normal(n) => n.path.segments.iter().map(|segment| &segment.name).eq(name),
AttrKind::DocComment(..) => false,
}
}
Expand All @@ -1128,12 +1115,7 @@ impl AttributeExt for Attribute {
}

fn is_word(&self) -> bool {
match &self.kind {
AttrKind::Normal(n) => {
matches!(n.args, AttrArgs::Empty)
}
AttrKind::DocComment(..) => false,
}
matches!(self.kind, AttrKind::Normal(box AttrItem { args: AttrArgs::Empty, .. }))
}

fn ident_path(&self) -> Option<SmallVec<[Ident; 1]>> {
Expand Down Expand Up @@ -1990,7 +1972,7 @@ impl fmt::Display for ConstContext {
}

// NOTE: `IntoDiagArg` impl for `ConstContext` lives in `rustc_errors`
// due to a cyclical dependency between hir that crate.
// due to a cyclical dependency between hir and that crate.

/// A literal.
pub type Lit = Spanned<LitKind>;
Expand Down Expand Up @@ -3604,10 +3586,10 @@ impl<'hir> FnRetTy<'hir> {
}

pub fn is_suggestable_infer_ty(&self) -> Option<&'hir Ty<'hir>> {
if let Self::Return(ty) = self {
if ty.is_suggestable_infer_ty() {
return Some(*ty);
}
if let Self::Return(ty) = self
&& ty.is_suggestable_infer_ty()
{
return Some(*ty);
}
None
}
Expand Down Expand Up @@ -3976,11 +3958,11 @@ pub struct FnHeader {

impl FnHeader {
pub fn is_async(&self) -> bool {
matches!(&self.asyncness, IsAsync::Async(_))
matches!(self.asyncness, IsAsync::Async(_))
}

pub fn is_const(&self) -> bool {
matches!(&self.constness, Constness::Const)
matches!(self.constness, Constness::Const)
}

pub fn is_unsafe(&self) -> bool {
Expand Down Expand Up @@ -4076,16 +4058,16 @@ pub struct Impl<'hir> {

impl ItemKind<'_> {
pub fn generics(&self) -> Option<&Generics<'_>> {
Some(match *self {
ItemKind::Fn { ref generics, .. }
| ItemKind::TyAlias(_, ref generics)
| ItemKind::Const(_, ref generics, _)
| ItemKind::Enum(_, ref generics)
| ItemKind::Struct(_, ref generics)
| ItemKind::Union(_, ref generics)
| ItemKind::Trait(_, _, ref generics, _, _)
| ItemKind::TraitAlias(ref generics, _)
| ItemKind::Impl(Impl { ref generics, .. }) => generics,
Some(match self {
ItemKind::Fn { generics, .. }
| ItemKind::TyAlias(_, generics)
| ItemKind::Const(_, generics, _)
| ItemKind::Enum(_, generics)
| ItemKind::Struct(_, generics)
| ItemKind::Union(_, generics)
| ItemKind::Trait(_, _, generics, _, _)
| ItemKind::TraitAlias(generics, _)
| ItemKind::Impl(Impl { generics, .. }) => generics,
_ => return None,
})
}
Expand Down Expand Up @@ -4484,16 +4466,14 @@ impl<'hir> Node<'hir> {

/// Get a `hir::Impl` if the node is an impl block for the given `trait_def_id`.
pub fn impl_block_of_trait(self, trait_def_id: DefId) -> Option<&'hir Impl<'hir>> {
match self {
Node::Item(Item { kind: ItemKind::Impl(impl_block), .. })
if impl_block
.of_trait
.and_then(|trait_ref| trait_ref.trait_def_id())
.is_some_and(|trait_id| trait_id == trait_def_id) =>
{
Some(impl_block)
}
_ => None,
if let Node::Item(Item { kind: ItemKind::Impl(impl_block), .. }) = self
&& let Some(trait_ref) = impl_block.of_trait
&& let Some(trait_id) = trait_ref.trait_def_id()
&& trait_id == trait_def_id
{
Some(impl_block)
} else {
None
}
}

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(closure_track_caller)]
#![feature(debug_closure_helpers)]
#![feature(exhaustive_patterns)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
locale_resources.push(codegen_backend.locale_resource());

let mut sess = rustc_session::build_session(
early_dcx,
config.opts,
CompilerIO {
input: config.input,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ where
static USING_INTERNAL_FEATURES: AtomicBool = AtomicBool::new(false);

let sess = build_session(
early_dcx,
sessopts,
io,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,11 @@ where
{
// In case any fresh inference variables have been created between `state`
// and the previous instantiation, extend `orig_values` for it.
assert!(orig_values.len() <= state.value.var_values.len());
for &arg in &state.value.var_values.var_values.as_slice()
[orig_values.len()..state.value.var_values.len()]
{
let unconstrained = delegate.fresh_var_for_kind_with_span(arg, span);
orig_values.push(unconstrained);
}
orig_values.extend(
state.value.var_values.var_values.as_slice()[orig_values.len()..]
.iter()
.map(|&arg| delegate.fresh_var_for_kind_with_span(arg, span)),
);

let instantiation =
EvalCtxt::compute_query_response_instantiation_values(delegate, orig_values, &state, span);
Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_parse/src/parser/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::parser::{ForceCollect, Parser};
use crate::{new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal};

fn psess() -> ParseSess {
ParseSess::new(vec![crate::DEFAULT_LOCALE_RESOURCE, crate::DEFAULT_LOCALE_RESOURCE])
ParseSess::new(vec![crate::DEFAULT_LOCALE_RESOURCE])
}

/// Map string to parser (via tts).
Expand All @@ -41,10 +41,8 @@ fn string_to_parser(psess: &ParseSess, source_str: String) -> Parser<'_> {
fn create_test_handler(theme: OutputTheme) -> (DiagCtxt, Arc<SourceMap>, Arc<Mutex<Vec<u8>>>) {
let output = Arc::new(Mutex::new(Vec::new()));
let source_map = Arc::new(SourceMap::new(FilePathMapping::empty()));
let fallback_bundle = rustc_errors::fallback_fluent_bundle(
vec![crate::DEFAULT_LOCALE_RESOURCE, crate::DEFAULT_LOCALE_RESOURCE],
false,
);
let fallback_bundle =
rustc_errors::fallback_fluent_bundle(vec![crate::DEFAULT_LOCALE_RESOURCE], false);
let mut emitter = HumanEmitter::new(Box::new(Shared { data: output.clone() }), fallback_bundle)
.sm(Some(source_map.clone()))
.diagnostic_width(Some(140));
Expand Down
Loading
Loading