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

Commit 537e9e5

Browse files
committed
Auto merge of rust-lang#130100 - matthiaskrgr:rollup-nk36g91, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#129337 (rustdoc rfc#3662 changes under unstable flags) - rust-lang#129473 (use `download-ci-llvm=true` in the default compiler config) - rust-lang#129529 (Add test to build crates used by r-a on stable) - rust-lang#130025 (Also emit `missing_docs` lint with `--test` to fulfil expectations) - rust-lang#130070 (Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowRegion`) - rust-lang#130087 (remove 'const' from 'Option::iter') - rust-lang#130092 (Fixes typo in wasm32-wasip2 doc comment) r? `@ghost` `@rustbot` modify labels: rollup
2 parents adf8d16 + e4f8824 commit 537e9e5

File tree

71 files changed

+1047
-195
lines changed

Some content is hidden

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

71 files changed

+1047
-195
lines changed

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
447447
// this time with enough precision to check that the value
448448
// whose address was taken can actually be made to live as long
449449
// as it needs to live.
450-
let region = self.next_region_var(infer::AddrOfRegion(expr.span));
450+
let region = self.next_region_var(infer::BorrowRegion(expr.span));
451451
Ty::new_ref(self.tcx, region, ty, mutbl)
452452
}
453453
}

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ pub enum RegionVariableOrigin {
458458
PatternRegion(Span),
459459

460460
/// Regions created by `&` operator.
461-
///
462-
AddrOfRegion(Span),
461+
BorrowRegion(Span),
462+
463463
/// Regions created as part of an autoref of a method receiver.
464464
Autoref(Span),
465465

@@ -1741,7 +1741,7 @@ impl RegionVariableOrigin {
17411741
match *self {
17421742
MiscVariable(a)
17431743
| PatternRegion(a)
1744-
| AddrOfRegion(a)
1744+
| BorrowRegion(a)
17451745
| Autoref(a)
17461746
| Coercion(a)
17471747
| RegionParameterDefinition(a, ..)

compiler/rustc_lint/src/builtin.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,6 @@ impl MissingDoc {
426426
article: &'static str,
427427
desc: &'static str,
428428
) {
429-
// If we're building a test harness, then warning about
430-
// documentation is probably not really relevant right now.
431-
if cx.sess().opts.test {
432-
return;
433-
}
434-
435429
// Only check publicly-visible items, using the result from the privacy pass.
436430
// It's an option so the crate root can also use this function (it doesn't
437431
// have a `NodeId`).
@@ -444,11 +438,10 @@ impl MissingDoc {
444438
let attrs = cx.tcx.hir().attrs(cx.tcx.local_def_id_to_hir_id(def_id));
445439
let has_doc = attrs.iter().any(has_doc);
446440
if !has_doc {
447-
cx.emit_span_lint(
448-
MISSING_DOCS,
449-
cx.tcx.def_span(def_id),
450-
BuiltinMissingDoc { article, desc },
451-
);
441+
let sp = cx.tcx.def_span(def_id);
442+
if !sp.is_dummy() {
443+
cx.emit_span_lint(MISSING_DOCS, sp, BuiltinMissingDoc { article, desc });
444+
}
452445
}
453446
}
454447
}

compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! The `wasm32-wasip2` target is the next evolution of the
22
//! wasm32-wasi target. While the wasi specification is still under
3-
//! active development, the {review 2 iteration is considered an "island
3+
//! active development, the preview 2 iteration is considered an "island
44
//! of stability" that should allow users to rely on it indefinitely.
55
//!
66
//! The `wasi` target is a proposal to define a standardized set of WebAssembly

compiler/rustc_trait_selection/src/error_reporting/infer/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
10181018
let var_description = match var_origin {
10191019
infer::MiscVariable(_) => String::new(),
10201020
infer::PatternRegion(_) => " for pattern".to_string(),
1021-
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
1021+
infer::BorrowRegion(_) => " for borrow expression".to_string(),
10221022
infer::Autoref(_) => " for autoref".to_string(),
10231023
infer::Coercion(_) => " for automatic coercion".to_string(),
10241024
infer::BoundRegion(_, br, infer::FnCall) => {

compiler/rustc_type_ir/src/elaborate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn supertrait_def_ids<I: Interner>(
237237
cx: I,
238238
trait_def_id: I::DefId,
239239
) -> impl Iterator<Item = I::DefId> {
240-
let mut set: HashSet<I::DefId> = HashSet::default();
240+
let mut set = HashSet::default();
241241
let mut stack = vec![trait_def_id];
242242

243243
set.insert(trait_def_id);

config.example.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
# Unless you're developing for a target where Rust CI doesn't build a compiler
4343
# toolchain or changing LLVM locally, you probably want to leave this enabled.
4444
#
45+
# Set this to `true` to download if CI llvm available otherwise it builds
46+
# from `src/llvm-project`.
47+
#
4548
# Set this to `"if-unchanged"` to download only if the llvm-project has not
4649
# been modified. You can also use this if you are unsure whether you're on a
4750
# tier 1 target. All tier 1 targets are currently supported.
@@ -236,7 +239,7 @@
236239
# Instead of downloading the src/stage0 version of cargo-clippy specified,
237240
# use this cargo-clippy binary instead as the stage0 snapshot cargo-clippy.
238241
#
239-
# Note that this option should be used with the same toolchain as the `rustc` option above.
242+
# Note that this option should be used with the same toolchain as the `rustc` option above.
240243
# Otherwise, clippy is likely to fail due to a toolchain conflict.
241244
#cargo-clippy = "/path/to/cargo-clippy"
242245

library/alloc/src/slice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ pub(crate) mod hack {
9696
// We shouldn't add inline attribute to this since this is used in
9797
// `vec!` macro mostly and causes perf regression. See #71204 for
9898
// discussion and perf results.
99+
#[allow(missing_docs)]
99100
pub fn into_vec<T, A: Allocator>(b: Box<[T], A>) -> Vec<T, A> {
100101
unsafe {
101102
let len = b.len();
@@ -105,6 +106,7 @@ pub(crate) mod hack {
105106
}
106107

107108
#[cfg(not(no_global_oom_handling))]
109+
#[allow(missing_docs)]
108110
#[inline]
109111
pub fn to_vec<T: ConvertVec, A: Allocator>(s: &[T], alloc: A) -> Vec<T, A> {
110112
T::to_vec(s, alloc)

library/alloc/src/string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ impl String {
508508
// NB see the slice::hack module in slice.rs for more information
509509
#[inline]
510510
#[cfg(test)]
511+
#[allow(missing_docs)]
511512
pub fn from_str(_: &str) -> String {
512513
panic!("not available with cfg(test)");
513514
}

library/core/src/option.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,9 +1338,8 @@ impl<T> Option<T> {
13381338
/// assert_eq!(x.iter().next(), None);
13391339
/// ```
13401340
#[inline]
1341-
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
13421341
#[stable(feature = "rust1", since = "1.0.0")]
1343-
pub const fn iter(&self) -> Iter<'_, T> {
1342+
pub fn iter(&self) -> Iter<'_, T> {
13441343
Iter { inner: Item { opt: self.as_ref() } }
13451344
}
13461345

0 commit comments

Comments
 (0)