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

Commit 00f677d

Browse files
committed
Auto merge of rust-lang#71424 - Dylan-DPC:rollup-iunh61a, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - rust-lang#70970 (Detect mistyped associated consts in `Instance::resolve`.) - rust-lang#71203 (Correct await span for async-await error reporting) - rust-lang#71214 (Add error code for inner doc error) - rust-lang#71337 (Moving all rustdoc-ui tests to check-pass) - rust-lang#71412 (Clarify unused_doc_comments note on macro invocations) - rust-lang#71414 (More diagnostic items for Clippy usage) Failed merges: r? @ghost
2 parents 4bfd62a + 01fdc88 commit 00f677d

Some content is hidden

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

57 files changed

+297
-103
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4295,6 +4295,7 @@ version = "0.0.0"
42954295
dependencies = [
42964296
"log",
42974297
"rustc_data_structures",
4298+
"rustc_errors",
42984299
"rustc_hir",
42994300
"rustc_infer",
43004301
"rustc_middle",

src/liballoc/collections/vec_deque.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const MAXIMUM_ZST_CAPACITY: usize = 1 << (64 - 1); // Largest possible power of
5050
/// [`pop_front`]: #method.pop_front
5151
/// [`extend`]: #method.extend
5252
/// [`append`]: #method.append
53+
#[cfg_attr(not(test), rustc_diagnostic_item = "vecdeque_type")]
5354
#[stable(feature = "rust1", since = "1.0.0")]
5455
pub struct VecDeque<T> {
5556
// tail and head are pointers into the buffer. Tail always points

src/liballoc/string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ use crate::vec::Vec;
278278
/// [`Deref`]: ../../std/ops/trait.Deref.html
279279
/// [`as_str()`]: struct.String.html#method.as_str
280280
#[derive(PartialOrd, Eq, Ord)]
281+
#[cfg_attr(not(test), rustc_diagnostic_item = "string_type")]
281282
#[stable(feature = "rust1", since = "1.0.0")]
282283
pub struct String {
283284
vec: Vec<u8>,

src/librustc_codegen_llvm/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
376376
def_id,
377377
tcx.intern_substs(&[]),
378378
)
379+
.unwrap()
379380
.unwrap(),
380381
),
381382
_ => {

src/librustc_codegen_ssa/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
465465
start_def_id,
466466
cx.tcx().intern_substs(&[main_ret_ty.into()]),
467467
)
468+
.unwrap()
468469
.unwrap(),
469470
);
470471
(

src/librustc_codegen_ssa/mir/block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
537537
ty::FnDef(def_id, substs) => (
538538
Some(
539539
ty::Instance::resolve(bx.tcx(), ty::ParamEnv::reveal_all(), def_id, substs)
540+
.unwrap()
540541
.unwrap(),
541542
),
542543
None,

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ E0749: include_str!("./error_codes/E0749.md"),
432432
E0750: include_str!("./error_codes/E0750.md"),
433433
E0751: include_str!("./error_codes/E0751.md"),
434434
E0752: include_str!("./error_codes/E0752.md"),
435+
E0753: include_str!("./error_codes/E0753.md"),
435436
;
436437
// E0006, // merged with E0005
437438
// E0008, // cannot bind by-move into a pattern guard
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
An inner doc comment was used in an invalid context.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0753
6+
fn foo() {}
7+
//! foo
8+
// ^ error!
9+
fn main() {}
10+
```
11+
12+
Inner document can only be used before items. For example:
13+
14+
```
15+
//! A working comment applied to the module!
16+
fn foo() {
17+
//! Another working comment!
18+
}
19+
fn main() {}
20+
```
21+
22+
In case you want to document the item following the doc comment, you might want
23+
to use outer doc comment:
24+
25+
```
26+
/// I am an outer doc comment
27+
#[doc = "I am also an outer doc comment!"]
28+
fn foo() {
29+
// ...
30+
}
31+
```

src/librustc_lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ pub trait LintContext: Sized {
566566
stability::deprecation_suggestion(&mut db, suggestion, span)
567567
}
568568
BuiltinLintDiagnostics::UnusedDocComment(span) => {
569-
db.span_label(span, "rustdoc does not generate documentation for macros");
569+
db.span_label(span, "rustdoc does not generate documentation for macro invocations");
570570
db.help("to document an item produced by a macro, \
571571
the macro must produce the documentation as part of its expansion");
572572
}

src/librustc_middle/mir/interpret/queries.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ impl<'tcx> TyCtxt<'tcx> {
3939
promoted: Option<mir::Promoted>,
4040
span: Option<Span>,
4141
) -> ConstEvalResult<'tcx> {
42-
let instance = ty::Instance::resolve(self, param_env, def_id, substs);
43-
if let Some(instance) = instance {
44-
let cid = GlobalId { instance, promoted };
45-
self.const_eval_global_id(param_env, cid, span)
46-
} else {
47-
Err(ErrorHandled::TooGeneric)
42+
match ty::Instance::resolve(self, param_env, def_id, substs) {
43+
Ok(Some(instance)) => {
44+
let cid = GlobalId { instance, promoted };
45+
self.const_eval_global_id(param_env, cid, span)
46+
}
47+
Ok(None) => Err(ErrorHandled::TooGeneric),
48+
Err(error_reported) => Err(ErrorHandled::Reported(error_reported)),
4849
}
4950
}
5051

0 commit comments

Comments
 (0)