Skip to content

Rollup of 9 pull requests #131275

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

Merged
merged 22 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
97fbcf6
Allow reborrowing Pin<&mut Self>
eholk Sep 20, 2024
3dfb30c
Allow reborrowing pinned self methods
eholk Sep 20, 2024
30ff400
update `Literal`'s intro
slanterns Oct 1, 2024
9b52fb5
Split out method receivers in feature gate test
eholk Oct 1, 2024
0dc250c
Stabilize `const_slice_from_raw_parts_mut`
eduardosm Sep 15, 2024
8918a9d
Fix needless_lifetimes in stable_mir
practicalrs Oct 3, 2024
3686e59
rustdoc: cleaner errors on disambiguator/namespace mismatches
notriddle Oct 4, 2024
e08002f
Stabilize `BufRead::skip_until`
okaneco Oct 4, 2024
ae5f58d
Check elaborated projections from dyn don't mention unconstrained lat…
compiler-errors Sep 14, 2024
fd7ee48
Elaborate supertrait span correctly to label the error better
compiler-errors Sep 14, 2024
e057c43
Account for `impl Trait {` when `impl Trait for Type {` was intended
estebank Oct 4, 2024
6b67c46
Compute array length from type for unconditional panic.
cjgillot Aug 24, 2024
479779d
Bless clippy.
cjgillot Aug 25, 2024
f09e5a7
Rollup merge of #129517 - cjgillot:known-panic-array, r=pnkfelix
workingjubilee Oct 5, 2024
9510c73
Rollup merge of #130367 - compiler-errors:super-unconstrained, r=spas…
workingjubilee Oct 5, 2024
49c6d78
Rollup merge of #130403 - eduardosm:stabilize-const_slice_from_raw_pa…
workingjubilee Oct 5, 2024
68de7d1
Rollup merge of #130633 - eholk:pin-reborrow-self, r=compiler-errors
workingjubilee Oct 5, 2024
5bad4e9
Rollup merge of #131105 - slanterns:literal_c_str, r=petrochenkov
workingjubilee Oct 5, 2024
bc2f732
Rollup merge of #131194 - practicalrs:fix_needless_lifetimes, r=celinval
workingjubilee Oct 5, 2024
f66aa60
Rollup merge of #131260 - notriddle:notriddle/disambiguator-error, r=…
workingjubilee Oct 5, 2024
3078b23
Rollup merge of #131267 - okaneco:bufread_skip_until, r=tgross35
workingjubilee Oct 5, 2024
08689af
Rollup merge of #131273 - estebank:issue-131051, r=compiler-errors
workingjubilee Oct 5, 2024
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
21 changes: 16 additions & 5 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1996,11 +1996,22 @@ fn resolution_failure(
&diag_info,
);

format!(
"this link resolves to {}, which is not in the {} namespace",
item(res),
expected_ns.descr()
)
if let Some(disambiguator) = disambiguator
&& !matches!(disambiguator, Disambiguator::Namespace(..))
{
format!(
"this link resolves to {}, which is not {} {}",
item(res),
disambiguator.article(),
disambiguator.descr()
)
} else {
format!(
"this link resolves to {}, which is not in the {} namespace",
item(res),
expected_ns.descr()
)
}
}
};
if let Some(span) = sp {
Expand Down
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ error: unresolved link to `m`
--> $DIR/disambiguator-mismatch.rs:52:14
|
LL | /// Link to [m()]
| ^^^ this link resolves to the macro `m`, which is not in the value namespace
| ^^^ this link resolves to the macro `m`, which is not a function
|
help: to link to the macro, add an exclamation mark
|
Expand Down Expand Up @@ -142,7 +142,7 @@ error: unresolved link to `std`
--> $DIR/disambiguator-mismatch.rs:83:14
|
LL | /// Link to [fn@std]
| ^^^^^^ this link resolves to the crate `std`, which is not in the value namespace
| ^^^^^^ this link resolves to the crate `std`, which is not a function
|
help: to link to the crate, prefix with `mod@`
|
Expand All @@ -164,7 +164,7 @@ error: unresolved link to `S::A`
--> $DIR/disambiguator-mismatch.rs:93:14
|
LL | /// Link to [field@S::A]
| ^^^^^^^^^^ this link resolves to the variant `A`, which is not in the value namespace
| ^^^^^^^^^^ this link resolves to the variant `A`, which is not a field
|
help: to link to the variant, prefix with `variant@`
|
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/intra-doc/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub trait T {
/// [m()]
//~^ ERROR unresolved link
//~| HELP to link to the macro
//~| NOTE not in the value namespace
//~| NOTE not a function
#[macro_export]
macro_rules! m {
() => {};
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/intra-doc/errors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ error: unresolved link to `S`
--> $DIR/errors.rs:68:6
|
LL | /// [S!]
| ^^ this link resolves to the struct `S`, which is not in the macro namespace
| ^^ this link resolves to the struct `S`, which is not a macro
|
help: to link to the struct, prefix with `struct@`
|
Expand Down Expand Up @@ -158,7 +158,7 @@ error: unresolved link to `m`
--> $DIR/errors.rs:98:6
|
LL | /// [m()]
| ^^^ this link resolves to the macro `m`, which is not in the value namespace
| ^^^ this link resolves to the macro `m`, which is not a function
|
help: to link to the macro, add an exclamation mark
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: unresolved link to `Clone`
--> $DIR/issue-110495-suffix-with-space.rs:3:6
|
LL | //! [Clone ()].
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
note: the lint level is defined here
--> $DIR/issue-110495-suffix-with-space.rs:2:9
Expand Down Expand Up @@ -31,7 +31,7 @@ error: unresolved link to `Clone`
--> $DIR/issue-110495-suffix-with-space.rs:5:7
|
LL | //! [`Clone ()`].
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand Down
20 changes: 10 additions & 10 deletions tests/rustdoc-ui/intra-doc/weird-syntax.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:27:9
|
LL | /// [ `Clone ()` ]
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -52,7 +52,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:30:7
|
LL | /// [`Clone ()` ]
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -64,7 +64,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:33:9
|
LL | /// [ `Clone ()`]
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -76,7 +76,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:36:9
|
LL | /// [```Clone ()```]
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -88,7 +88,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:42:13
|
LL | /// [ ``` Clone () ``` ]
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand Down Expand Up @@ -122,7 +122,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:74:9
|
LL | /// [x][Clone()]
| ^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -134,7 +134,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:77:9
|
LL | /// [x][Clone ()]
| ^^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand Down Expand Up @@ -176,7 +176,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:97:9
|
LL | /// [w](Clone\(\))
| ^^^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand All @@ -188,7 +188,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:103:9
|
LL | /// [w](Clone())
| ^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^^^ this link resolves to the trait `Clone`, which is not a function
|
help: to link to the trait, prefix with `trait@`
|
Expand Down Expand Up @@ -256,7 +256,7 @@ error: unresolved link to `Clone`
--> $DIR/weird-syntax.rs:132:9
|
LL | /// The [cln][] link here will produce a plain text suggestion
| ^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
| ^^^^^ this link resolves to the trait `Clone`, which is not a function
|
= help: to link to the trait, prefix with `trait@`: trait@Clone

Expand Down