summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json/impls
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/rustdoc-json/impls
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json/impls')
-rw-r--r--tests/rustdoc-json/impls/auto.rs9
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility.rs7
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs6
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility_show_private.rs6
-rw-r--r--tests/rustdoc-json/impls/import_from_private.rs14
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs8
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs3
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs12
-rw-r--r--tests/rustdoc-json/impls/local_for_local.rs5
-rw-r--r--tests/rustdoc-json/impls/local_for_local_primitive.rs2
10 files changed, 26 insertions, 46 deletions
diff --git a/tests/rustdoc-json/impls/auto.rs b/tests/rustdoc-json/impls/auto.rs
index ace37e5b3..96c3ab08b 100644
--- a/tests/rustdoc-json/impls/auto.rs
+++ b/tests/rustdoc-json/impls/auto.rs
@@ -1,9 +1,12 @@
-#![feature(no_core, auto_traits, lang_items)]
+#![feature(no_core, auto_traits, lang_items, arbitrary_self_types)]
#![no_core]
#[lang = "sized"]
trait Sized {}
+#[lang = "receiver"]
+pub trait Receiver {}
+
pub auto trait Bar {}
/// has span
@@ -12,8 +15,8 @@ impl Foo {
}
// Testing spans, so all tests below code
-// @is "$.index[*][?(@.docs=='has span')].span.begin" "[10, 0]"
-// @is "$.index[*][?(@.docs=='has span')].span.end" "[12, 1]"
+// @is "$.index[*][?(@.docs=='has span')].span.begin" "[13, 0]"
+// @is "$.index[*][?(@.docs=='has span')].span.end" "[15, 1]"
// FIXME: this doesn't work due to https://github.com/freestrings/jsonpath/issues/91
// is "$.index[*][?(@.inner.impl.synthetic==true)].span" null
pub struct Foo;
diff --git a/tests/rustdoc-json/impls/impl_item_visibility.rs b/tests/rustdoc-json/impls/impl_item_visibility.rs
index efa54d91d..d3c15cd23 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
pub struct Foo;
/// impl Foo priv
@@ -9,18 +6,16 @@ impl Foo {
}
// @!has '$.index[*][?(@.docs=="impl Foo priv")]'
-
/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
-
/// impl Foo hidden
impl Foo {
#[doc(hidden)]
- pub fn __quazl(){}
+ pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
diff --git a/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs b/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
index 3c6fefc4c..fa3a36df8 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
@@ -1,6 +1,4 @@
// compile-flags: --document-hidden-items
-#![feature(no_core)]
-#![no_core]
pub struct Foo;
@@ -11,18 +9,16 @@ impl Foo {
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
-
/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
-
/// impl Foo hidden
impl Foo {
#[doc(hidden)]
- pub fn __quazl(){}
+ pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
diff --git a/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs b/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
index b98d1e416..7c68a2412 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
@@ -1,6 +1,4 @@
// compile-flags: --document-private-items
-#![feature(no_core)]
-#![no_core]
pub struct Foo;
@@ -10,18 +8,16 @@ impl Foo {
}
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
-
/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
-
/// impl Foo hidden
impl Foo {
#[doc(hidden)]
- pub fn __quazl(){}
+ pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
diff --git a/tests/rustdoc-json/impls/import_from_private.rs b/tests/rustdoc-json/impls/import_from_private.rs
index d2b0665dc..3da03df25 100644
--- a/tests/rustdoc-json/impls/import_from_private.rs
+++ b/tests/rustdoc-json/impls/import_from_private.rs
@@ -1,14 +1,12 @@
// https://github.com/rust-lang/rust/issues/100252
-#![feature(no_core)]
-#![no_core]
-
mod bar {
- // @set baz = "$.index[*][?(@.inner.struct)].id"
+ // @set baz = "$.index[*][?(@.name == 'Baz')].id"
pub struct Baz;
- // @set impl = "$.index[*][?(@.inner.impl)].id"
+ // @set impl = "$.index[*][?(@.docs == 'impl')].id"
+ /// impl
impl Baz {
- // @set doit = "$.index[*][?(@.inner.function)].id"
+ // @set doit = "$.index[*][?(@.name == 'doit')].id"
pub fn doit() {}
}
}
@@ -18,5 +16,5 @@ pub use bar::Baz;
// @is "$.index[*].inner.module.items[*]" $import
// @is "$.index[*].inner.import.id" $baz
-// @is "$.index[*].inner.struct.impls[*]" $impl
-// @is "$.index[*].inner.impl.items[*]" $doit
+// @has "$.index[*][?(@.name == 'Baz')].inner.struct.impls[*]" $impl
+// @is "$.index[*][?(@.docs=='impl')].inner.impl.items[*]" $doit
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
index d2ac316d4..7857626d6 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
@@ -1,7 +1,5 @@
-#![feature(no_core)]
-#![no_core]
-
-// @count "$.index[*][?(@.inner.impl)]" 1
+// @has "$.index[*][?(@.docs=='Here')]"
+// @!has "$.index[*][?(@.docs=='Not Here')]"
// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
// @has "$.index[*][?(@.name=='PubTrait')]"
@@ -11,5 +9,7 @@ pub trait PubTrait {}
pub struct HiddenPubStruct;
pub struct NotHiddenPubStruct;
+/// Not Here
impl PubTrait for HiddenPubStruct {}
+/// Here
impl PubTrait for NotHiddenPubStruct {}
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
index fcd27ca4b..836f1fe87 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
@@ -1,8 +1,5 @@
// compile-flags: --document-hidden-items
-#![feature(no_core)]
-#![no_core]
-
// @has "$.index[*][?(@.name == 'HiddenPubStruct')]"
// @has "$.index[*][?(@.inner.impl)]"
// @has "$.index[*][?(@.name=='PubTrait')]"
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
index 141c54a57..97db9c93a 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
@@ -1,21 +1,21 @@
-#![feature(no_core)]
-#![no_core]
-
-// @count "$.index[*][?(@.inner.impl)]" 1
-// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
-// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
// @has "$.index[*][?(@.name=='PubTrait')]"
pub trait PubTrait {}
#[doc(hidden)]
pub mod hidden {
+ // @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
pub struct HiddenPubStruct;
+ // @!has "$.index[*][?(@.docs == 'Not Here')]"
+ /// Not Here
impl crate::PubTrait for HiddenPubStruct {}
}
pub mod not_hidden {
+ // @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
pub struct NotHiddenPubStruct;
+ // @has "$.index[*][?(@.docs == 'Here')]"
+ /// Here
impl crate::PubTrait for NotHiddenPubStruct {}
}
diff --git a/tests/rustdoc-json/impls/local_for_local.rs b/tests/rustdoc-json/impls/local_for_local.rs
index 37a720003..015e89c22 100644
--- a/tests/rustdoc-json/impls/local_for_local.rs
+++ b/tests/rustdoc-json/impls/local_for_local.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
// @set struct = "$.index[*][?(@.name=='Struct')].id"
pub struct Struct;
// @set trait = "$.index[*][?(@.name=='Trait')].id"
@@ -9,7 +6,7 @@ pub trait Trait {}
/// impl
impl Trait for Struct {}
-// @is "$.index[*][?(@.name=='Struct')].inner.struct.impls[*]" $impl
+// @has "$.index[*][?(@.name=='Struct')].inner.struct.impls[*]" $impl
// @is "$.index[*][?(@.name=='Trait')].inner.trait.implementations[*]" $impl
// @is "$.index[*][?(@.docs=='impl')].inner.impl.trait.id" $trait
// @is "$.index[*][?(@.docs=='impl')].inner.impl.for.resolved_path.id" $struct
diff --git a/tests/rustdoc-json/impls/local_for_local_primitive.rs b/tests/rustdoc-json/impls/local_for_local_primitive.rs
index 769dd3f0a..acc3a879f 100644
--- a/tests/rustdoc-json/impls/local_for_local_primitive.rs
+++ b/tests/rustdoc-json/impls/local_for_local_primitive.rs
@@ -1,6 +1,4 @@
-#![feature(no_core)]
#![feature(rustc_attrs)]
-#![no_core]
// @set Local = "$.index[*][?(@.name=='Local')].id"
pub trait Local {}