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

Commit 1ca578e

Browse files
committed
Auto merge of rust-lang#126736 - matthiaskrgr:rollup-rb20oe3, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#126380 (Add std Xtensa targets support) - rust-lang#126636 (Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`s ) - rust-lang#126659 (More status-quo tests for the `#[coverage(..)]` attribute) - rust-lang#126711 (Make Option::as_[mut_]slice const) - rust-lang#126717 (Clean up some comments near `use` declarations) - rust-lang#126719 (Fix assertion failure for some `Expect` diagnostics.) - rust-lang#126730 (Add opaque type corner case test) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1aaab8b + b099c05 commit 1ca578e

File tree

156 files changed

+1669
-602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1669
-602
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ dependencies = [
709709
"clippy_config",
710710
"itertools 0.12.1",
711711
"rustc-semver",
712+
"rustc_apfloat",
712713
]
713714

714715
[[package]]

compiler/rustc_builtin_macros/src/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
//! The expansion from a test function to the appropriate test struct for libtest
2+
//! Ideally, this code would be in libtest but for efficiency and error messages it lives here.
3+
14
use crate::errors;
2-
/// The expansion from a test function to the appropriate test struct for libtest
3-
/// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
45
use crate::util::{check_builtin_macro_attribute, warn_on_duplicate_attribute};
56
use rustc_ast::ptr::P;
67
use rustc_ast::{self as ast, attr, GenericParamKind};

compiler/rustc_codegen_gcc/tests/lang_tests_common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! The common code for `tests/lang_tests_*.rs`
2+
23
use std::{
34
env::{self, current_dir},
45
path::{Path, PathBuf},

compiler/rustc_codegen_ssa/src/mir/locals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Locals are in a private module as updating `LocalRef::Operand` has to
22
//! be careful wrt to subtyping. To deal with this we only allow updates by using
33
//! `FunctionCx::overwrite_local` which handles it automatically.
4+
45
use crate::mir::{FunctionCx, LocalRef};
56
use crate::traits::BuilderMethods;
67
use rustc_index::IndexVec;

compiler/rustc_data_structures/src/base_n.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/// Converts unsigned integers into a string representation with some base.
2-
/// Bases up to and including 36 can be used for case-insensitive things.
1+
//! Converts unsigned integers into a string representation with some base.
2+
//! Bases up to and including 36 can be used for case-insensitive things.
3+
34
use std::ascii;
45
use std::fmt;
56

compiler/rustc_errors/src/lib.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,24 @@ impl DiagCtxtInner {
14371437

14381438
// Return value is only `Some` if the level is `Error` or `DelayedBug`.
14391439
fn emit_diagnostic(&mut self, mut diagnostic: DiagInner) -> Option<ErrorGuaranteed> {
1440+
match diagnostic.level {
1441+
Expect(expect_id) | ForceWarning(Some(expect_id)) => {
1442+
// The `LintExpectationId` can be stable or unstable depending on when it was
1443+
// created. Diagnostics created before the definition of `HirId`s are unstable and
1444+
// can not yet be stored. Instead, they are buffered until the `LintExpectationId`
1445+
// is replaced by a stable one by the `LintLevelsBuilder`.
1446+
if let LintExpectationId::Unstable { .. } = expect_id {
1447+
// We don't call TRACK_DIAGNOSTIC because we wait for the
1448+
// unstable ID to be updated, whereupon the diagnostic will be
1449+
// passed into this method again.
1450+
self.unstable_expect_diagnostics.push(diagnostic);
1451+
return None;
1452+
}
1453+
// Continue through to the `Expect`/`ForceWarning` case below.
1454+
}
1455+
_ => {}
1456+
}
1457+
14401458
if diagnostic.has_future_breakage() {
14411459
// Future breakages aren't emitted if they're `Level::Allow`,
14421460
// but they still need to be constructed and stashed below,
@@ -1512,16 +1530,8 @@ impl DiagCtxtInner {
15121530
return None;
15131531
}
15141532
Expect(expect_id) | ForceWarning(Some(expect_id)) => {
1515-
// Diagnostics created before the definition of `HirId`s are
1516-
// unstable and can not yet be stored. Instead, they are
1517-
// buffered until the `LintExpectationId` is replaced by a
1518-
// stable one by the `LintLevelsBuilder`.
15191533
if let LintExpectationId::Unstable { .. } = expect_id {
1520-
// We don't call TRACK_DIAGNOSTIC because we wait for the
1521-
// unstable ID to be updated, whereupon the diagnostic will
1522-
// be passed into this method again.
1523-
self.unstable_expect_diagnostics.push(diagnostic);
1524-
return None;
1534+
unreachable!(); // this case was handled at the top of this function
15251535
}
15261536
self.fulfilled_expectations.insert(expect_id.normalize());
15271537
if let Expect(_) = diagnostic.level {

compiler/rustc_errors/src/markdown/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! A simple markdown parser that can write formatted text to the terminal
22
//!
33
//! Entrypoint is `MdStream::parse_str(...)`
4+
45
use std::io;
56

67
use termcolor::{Buffer, BufferWriter, ColorChoice};

compiler/rustc_expand/src/mbe/macro_check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
//! Kleene operators under which a meta-variable is repeating is the concatenation of the stacks
105105
//! stored when entering a macro definition starting from the state in which the meta-variable is
106106
//! bound.
107+
107108
use crate::errors;
108109
use crate::mbe::{KleeneToken, TokenTree};
109110

compiler/rustc_fs_util/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// tidy-alphabetical-start
21
use std::ffi::CString;
32
use std::fs;
43
use std::io;
54
use std::path::{absolute, Path, PathBuf};
6-
// tidy-alphabetical-end
75

86
// Unfortunately, on windows, it looks like msvcrt.dll is silently translating
97
// verbatim paths under the hood to non-verbatim paths! This manifests itself as

compiler/rustc_hir_analysis/src/check/dropck.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// FIXME(@lcnr): Move this module out of `rustc_hir_analysis`.
22
//
33
// We don't do any drop checking during hir typeck.
4+
45
use rustc_data_structures::fx::FxHashSet;
56
use rustc_errors::{codes::*, struct_span_code_err, ErrorGuaranteed};
67
use rustc_infer::infer::outlives::env::OutlivesEnvironment;

0 commit comments

Comments
 (0)