Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0f706af

Browse files
committed
Auto merge of rust-lang#122763 - matthiaskrgr:rollup-o8a2mye, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#121543 (various clippy fixes) - rust-lang#122540 (Do not use `?`-induced skewing of type inference in the compiler) - rust-lang#122730 (Expose `ucred::peer_cred` on QNX targets to enable dist builds) - rust-lang#122732 (Remove redundant coroutine captures note) - rust-lang#122739 (Add "put" as a confusable for insert on hash map/set) - rust-lang#122748 (Reduce `pub` usage in `rustc_session`.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b7dcabe + 53a753e commit 0f706af

File tree

38 files changed

+335
-264
lines changed

38 files changed

+335
-264
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1111
use rustc_data_structures::sync::Lrc;
1212
use rustc_macros::HashStable_Generic;
1313
use rustc_span::symbol::{kw, sym};
14+
#[allow(clippy::useless_attribute)] // FIXME: following use of `hidden_glob_reexports` incorrectly triggers `useless_attribute` lint.
1415
#[allow(hidden_glob_reexports)]
1516
use rustc_span::symbol::{Ident, Symbol};
1617
use rustc_span::{edition::Edition, ErrorGuaranteed, Span, DUMMY_SP};

compiler/rustc_builtin_macros/src/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub fn parse_asm_args<'a>(
189189
args.templates.push(template);
190190
continue;
191191
} else {
192-
return p.unexpected();
192+
p.unexpected_any()?
193193
};
194194

195195
allow_templates = false;

compiler/rustc_builtin_macros/src/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn parse_assert<'a>(cx: &mut ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PRes
151151
};
152152

153153
if parser.token != token::Eof {
154-
return parser.unexpected();
154+
parser.unexpected()?;
155155
}
156156

157157
Ok(Assert { cond_expr, custom_message })

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ pub unsafe fn create_module<'ll>(
315315
//
316316
// On the wasm targets it will get hooked up to the "producer" sections
317317
// `processed-by` information.
318+
#[allow(clippy::option_env_unwrap)]
318319
let rustc_producer =
319320
format!("rustc version {}", option_env!("CFG_VERSION").expect("CFG_VERSION"));
320321
let name_metadata = llvm::LLVMMDStringInContext(

compiler/rustc_const_eval/src/interpret/intern.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ pub fn intern_const_alloc_for_constprop<
293293
return Ok(());
294294
}
295295
// Move allocation to `tcx`.
296-
for _ in intern_shallow(ecx, alloc_id, Mutability::Not).map_err(|()| err_ub!(DeadLocal))? {
296+
if let Some(_) =
297+
(intern_shallow(ecx, alloc_id, Mutability::Not).map_err(|()| err_ub!(DeadLocal))?).next()
298+
{
297299
// We are not doing recursive interning, so we don't currently support provenance.
298300
// (If this assertion ever triggers, we should just implement a
299301
// proper recursive interning loop -- or just call `intern_const_alloc_recursive`.

compiler/rustc_expand/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(proc_macro_internals)]
1313
#![feature(proc_macro_span)]
1414
#![feature(try_blocks)]
15+
#![feature(yeet_expr)]
1516
#![allow(rustc::diagnostic_outside_of_impl)]
1617
#![allow(internal_features)]
1718

compiler/rustc_expand/src/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub(crate) fn parse_external_mod(
6262

6363
// Ensure file paths are acyclic.
6464
if let Some(pos) = module.file_path_stack.iter().position(|p| p == &mp.file_path) {
65-
Err(ModError::CircularInclusion(module.file_path_stack[pos..].to_vec()))?;
65+
do yeet ModError::CircularInclusion(module.file_path_stack[pos..].to_vec());
6666
}
6767

6868
// Actually parse the external file as a module.

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
990990
let generics_def_id = tcx.res_generics_def_id(path.res)?;
991991
let generics = tcx.generics_of(generics_def_id);
992992
if generics.has_impl_trait() {
993-
None?;
993+
do yeet ();
994994
}
995995
let insert_span =
996996
path.segments.last().unwrap().ident.span.shrink_to_hi().with_hi(path.span.hi());
@@ -1044,7 +1044,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
10441044
let generics = tcx.generics_of(def_id);
10451045
let segment: Option<_> = try {
10461046
if !segment.infer_args || generics.has_impl_trait() {
1047-
None?;
1047+
do yeet ();
10481048
}
10491049
let span = tcx.hir().span(segment.hir_id);
10501050
let insert_span = segment.ident.span.shrink_to_hi().with_hi(span.hi());

compiler/rustc_infer/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#![feature(iterator_try_collect)]
2828
#![cfg_attr(bootstrap, feature(min_specialization))]
2929
#![feature(try_blocks)]
30+
#![feature(yeet_expr)]
3031
#![recursion_limit = "512"] // For rustdoc
3132

3233
#[macro_use]

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ impl<D: Decoder> Decodable<D> for EncodedMetadata {
21982198
let mmap = if len > 0 {
21992199
let mut mmap = MmapMut::map_anon(len).unwrap();
22002200
for _ in 0..len {
2201-
(&mut mmap[..]).write(&[d.read_u8()]).unwrap();
2201+
(&mut mmap[..]).write_all(&[d.read_u8()]).unwrap();
22022202
}
22032203
mmap.flush().unwrap();
22042204
Some(mmap.make_read_only().unwrap())

0 commit comments

Comments
 (0)