Skip to content

Rollup of 8 pull requests #131768

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

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
73fc00f
Delay ambiguous intra-doc link resolution after `Cache` has been popu…
GuillaumeGomez Oct 14, 2024
d540e72
Add regression tests for #130233
GuillaumeGomez Oct 14, 2024
f708d6d
Fix match_same_arms in stable_mir
practicalrs Oct 14, 2024
918dc38
Combine impl_int and impl_uint
zlfn Oct 15, 2024
0637517
Rename debug! macro to impl_Debug!
zlfn Oct 15, 2024
99af761
Refactor `floating` macro and nofloat panic message
zlfn Oct 15, 2024
2b9e41c
Improve documentation for intra-doc links computation
GuillaumeGomez Oct 14, 2024
10f2395
Remove `AmbiguousLinks::disambiguator`
GuillaumeGomez Oct 15, 2024
05dec8f
`ImpliedOutlivesBounds` to `rustc_middle`
lcnr Oct 15, 2024
044ce0c
remove type_op constructors
lcnr Oct 15, 2024
e457466
`DropckOutlives` to `rustc_middle`
lcnr Oct 15, 2024
a5e280e
remove Canonical::unchecked_rebind, it's unused
lcnr Oct 15, 2024
0630c5d
move `defining_opaque_types` out of `Canonical`
lcnr Oct 15, 2024
6888521
Don't report bivariance error when nesting a struct with field errors…
compiler-errors Oct 15, 2024
e744e22
bless mir-opt tests
lcnr Oct 15, 2024
50b8029
Always recurse on predicates in BestObligation
compiler-errors Oct 14, 2024
fd2038d
Make sure the alias is actually rigid
compiler-errors Oct 14, 2024
8528387
Be better at reporting alias errors
compiler-errors Oct 14, 2024
0ead25c
Register a dummy candidate for failed structural normalization during…
compiler-errors Oct 14, 2024
f956dc2
Bless tests
compiler-errors Oct 16, 2024
b4e9aad
Rename can_coerce to may_coerce
compiler-errors Oct 15, 2024
e3eba2d
Don't structurally resolve in may_coerce
compiler-errors Oct 15, 2024
9070aba
Structurally resolve in may_coerce
compiler-errors Oct 15, 2024
c773098
Don't check unsize goal in MIR validation when opaques remain
compiler-errors Sep 28, 2024
2acc7ec
Rollup merge of #130989 - compiler-errors:unsize-opaque, r=estebank
matthiaskrgr Oct 16, 2024
ce1c8ec
Rollup merge of #131691 - GuillaumeGomez:intra-doc-link-filter-out-2,…
matthiaskrgr Oct 16, 2024
0dfa834
Rollup merge of #131699 - compiler-errors:better-errors-for-projectio…
matthiaskrgr Oct 16, 2024
cd78e1e
Rollup merge of #131700 - practicalrs:fix_match_same_arms, r=celinval
matthiaskrgr Oct 16, 2024
3158dd6
Rollup merge of #131730 - zlfn:master, r=tgross35
matthiaskrgr Oct 16, 2024
4b43960
Rollup merge of #131748 - lcnr:typing-mode, r=compiler-errors
matthiaskrgr Oct 16, 2024
8ab5293
Rollup merge of #131751 - compiler-errors:structurally-resolve, r=lcnr
matthiaskrgr Oct 16, 2024
f69d8db
Rollup merge of #131754 - compiler-errors:bivariance-bivariance, r=es…
matthiaskrgr Oct 16, 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
Prev Previous commit
Next Next commit
Add regression tests for #130233
  • Loading branch information
GuillaumeGomez committed Oct 14, 2024
commit d540e7285ca14393d2b51f486ecc0f26d2f986c7
15 changes: 15 additions & 0 deletions tests/rustdoc-ui/intra-doc/filter-out-private-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This test ensures that ambiguities (not) resolved at a later stage still emit an error.

#![deny(rustdoc::broken_intra_doc_links)]
#![crate_name = "foo"]

#[doc(hidden)]
pub struct Thing {}

#[allow(non_snake_case)]
#[doc(hidden)]
pub fn Thing() {}

/// Do stuff with [`Thing`].
//~^ ERROR all items matching `Thing` are either private or doc(hidden)
pub fn repro(_: Thing) {}
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/intra-doc/filter-out-private-2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: all items matching `Thing` are either private or doc(hidden)
--> $DIR/filter-out-private-2.rs:13:21
|
LL | /// Do stuff with [`Thing`].
| ^^^^^ unresolved link
|
note: the lint level is defined here
--> $DIR/filter-out-private-2.rs:3:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

13 changes: 13 additions & 0 deletions tests/rustdoc-ui/intra-doc/filter-out-private.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This test ensures that ambiguities resolved at a later stage still emit an error.

#![deny(rustdoc::broken_intra_doc_links)]
#![crate_name = "foo"]

pub struct Thing {}

#[allow(non_snake_case)]
pub fn Thing() {}

/// Do stuff with [`Thing`].
//~^ ERROR `Thing` is both a function and a struct
pub fn repro(_: Thing) {}
22 changes: 22 additions & 0 deletions tests/rustdoc-ui/intra-doc/filter-out-private.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
error: `Thing` is both a function and a struct
--> $DIR/filter-out-private.rs:11:21
|
LL | /// Do stuff with [`Thing`].
| ^^^^^ ambiguous link
|
note: the lint level is defined here
--> $DIR/filter-out-private.rs:3:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to link to the function, add parentheses
|
LL | /// Do stuff with [`Thing()`].
| ++
help: to link to the struct, prefix with `struct@`
|
LL | /// Do stuff with [`struct@Thing`].
| +++++++

error: aborting due to 1 previous error

26 changes: 26 additions & 0 deletions tests/rustdoc/intra-doc/filter-out-private.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This test ensures that private/hidden items don't create ambiguity.
// This is a regression test for <https://github.com/rust-lang/rust/issues/130233>.

#![deny(rustdoc::broken_intra_doc_links)]
#![crate_name = "foo"]

pub struct Thing {}

#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Thing() {}

pub struct Bar {}

#[allow(non_snake_case)]
fn Bar() {}

//@ has 'foo/fn.repro.html'
//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]//a/@href' 'struct.Thing.html'
/// Do stuff with [`Thing`].
pub fn repro(_: Thing) {}

//@ has 'foo/fn.repro2.html'
//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]//a/@href' 'struct.Bar.html'
/// Do stuff with [`Bar`].
pub fn repro2(_: Bar) {}
Loading