summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-ui/scrape-examples
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-ui/scrape-examples')
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.rs7
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.stderr14
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-ice.rs4
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.rs1
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.stderr2
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.rs1
-rw-r--r--tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.stderr2
7 files changed, 31 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.rs b/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.rs
new file mode 100644
index 000000000..8f4fde96d
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.rs
@@ -0,0 +1,7 @@
+// check-fail
+// compile-flags: -Z unstable-options --scrape-examples-output-path {{build-base}}/t.calls --scrape-examples-target-crate foobar
+
+pub fn foo() {
+ INVALID_FUNC();
+ //~^ ERROR could not resolve path
+}
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.stderr b/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.stderr
new file mode 100644
index 000000000..750aa3207
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-fail-if-type-error.stderr
@@ -0,0 +1,14 @@
+error[E0433]: failed to resolve: could not resolve path `INVALID_FUNC`
+ --> $DIR/scrape-examples-fail-if-type-error.rs:5:3
+ |
+LL | INVALID_FUNC();
+ | ^^^^^^^^^^^^ could not resolve path `INVALID_FUNC`
+ |
+ = note: this error was originally ignored because you are running `rustdoc`
+ = note: try running again with `rustc` or `cargo check` and you may get a more detailed error
+
+error: Compilation failed, aborting rustdoc
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-ice.rs b/tests/rustdoc-ui/scrape-examples/scrape-examples-ice.rs
new file mode 100644
index 000000000..d629b62a7
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-ice.rs
@@ -0,0 +1,4 @@
+// compile-flags: -Z unstable-options --scrape-examples-output-path {{build-base}}/t.calls --scrape-examples-target-crate foobar
+// check-pass
+#![no_std]
+use core as _;
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.rs b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.rs
new file mode 100644
index 000000000..a1f005c32
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.rs
@@ -0,0 +1 @@
+// compile-flags: -Z unstable-options --scrape-examples-target-crate foobar
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.stderr b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.stderr
new file mode 100644
index 000000000..eb8e9f799
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-1.stderr
@@ -0,0 +1,2 @@
+error: must use --scrape-examples-output-path and --scrape-examples-target-crate together
+
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.rs b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.rs
new file mode 100644
index 000000000..4aacec7f0
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.rs
@@ -0,0 +1 @@
+// compile-flags: -Z unstable-options --scrape-examples-output-path ex.calls
diff --git a/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.stderr b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.stderr
new file mode 100644
index 000000000..eb8e9f799
--- /dev/null
+++ b/tests/rustdoc-ui/scrape-examples/scrape-examples-wrong-options-2.stderr
@@ -0,0 +1,2 @@
+error: must use --scrape-examples-output-path and --scrape-examples-target-crate together
+