about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-24 01:48:02 +0000
committerbors <bors@rust-lang.org>2021-09-24 01:48:02 +0000
commit293b8f2c11cbec03f0d4daae6b82ed7541ebbf4e (patch)
tree8b2059d304cdf68e31a428247287d154f02c75fa /src
parent900cf5e8905ba8a2a9c99a1dfc9cb2cf4754d77a (diff)
parent1875cecfd46a347dac9c9e23910e4b39be3a9d5f (diff)
downloadrust-293b8f2c11cbec03f0d4daae6b82ed7541ebbf4e.tar.gz
rust-293b8f2c11cbec03f0d4daae6b82ed7541ebbf4e.zip
Auto merge of #89211 - workingjubilee:rollup-fj4eduk, r=workingjubilee
Rollup of 7 pull requests

Successful merges:

 - #88612 (Add a better error message for #39364)
 - #89023 (Resolve issue : Somewhat confusing error with extended_key_value_attributes)
 - #89148 (Suggest `_` in turbofish if param will be inferred from fn argument)
 - #89171 (Run `no_core` rustdoc tests only on Linux)
 - #89176 (Change singular to plural)
 - #89184 (Temporarily rename int_roundings functions to avoid conflicts)
 - #89200 (Fix typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/test/rustdoc/cross-crate-primitive-doc.rs2
-rw-r--r--src/test/rustdoc/intra-doc/prim-methods-external-core.rs2
-rw-r--r--src/test/ui/attributes/extented-attribute-macro-error.rs8
-rw-r--r--src/test/ui/attributes/extented-attribute-macro-error.stderr10
-rw-r--r--src/test/ui/suggestions/missing-type-param-used-in-param.fixed8
-rw-r--r--src/test/ui/suggestions/missing-type-param-used-in-param.rs8
-rw-r--r--src/test/ui/suggestions/missing-type-param-used-in-param.stderr21
7 files changed, 57 insertions, 2 deletions
diff --git a/src/test/rustdoc/cross-crate-primitive-doc.rs b/src/test/rustdoc/cross-crate-primitive-doc.rs
index 120b6e9747f..4ba296ee04a 100644
--- a/src/test/rustdoc/cross-crate-primitive-doc.rs
+++ b/src/test/rustdoc/cross-crate-primitive-doc.rs
@@ -1,6 +1,6 @@
 // aux-build:primitive-doc.rs
 // compile-flags: --extern-html-root-url=primitive_doc=../ -Z unstable-options
-// ignore-windows
+// only-linux
 
 #![feature(no_core)]
 #![no_core]
diff --git a/src/test/rustdoc/intra-doc/prim-methods-external-core.rs b/src/test/rustdoc/intra-doc/prim-methods-external-core.rs
index 5a92a28556e..9d869984bbd 100644
--- a/src/test/rustdoc/intra-doc/prim-methods-external-core.rs
+++ b/src/test/rustdoc/intra-doc/prim-methods-external-core.rs
@@ -1,7 +1,7 @@
 // aux-build:my-core.rs
 // build-aux-docs
 // ignore-cross-compile
-// ignore-windows
+// only-linux
 
 #![deny(broken_intra_doc_links)]
 #![feature(no_core, lang_items)]
diff --git a/src/test/ui/attributes/extented-attribute-macro-error.rs b/src/test/ui/attributes/extented-attribute-macro-error.rs
new file mode 100644
index 00000000000..f5f75f9f4da
--- /dev/null
+++ b/src/test/ui/attributes/extented-attribute-macro-error.rs
@@ -0,0 +1,8 @@
+// normalize-stderr-test: "couldn't read.*" -> "couldn't read the file"
+
+#![feature(extended_key_value_attributes)]
+#![doc = include_str!("../not_existing_file.md")]
+struct Documented {}
+//~^^ ERROR couldn't read
+
+fn main() {}
diff --git a/src/test/ui/attributes/extented-attribute-macro-error.stderr b/src/test/ui/attributes/extented-attribute-macro-error.stderr
new file mode 100644
index 00000000000..e4deeacd0ff
--- /dev/null
+++ b/src/test/ui/attributes/extented-attribute-macro-error.stderr
@@ -0,0 +1,10 @@
+error: couldn't read the file
+  --> $DIR/extented-attribute-macro-error.rs:4:10
+   |
+LL | #![doc = include_str!("../not_existing_file.md")]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.fixed b/src/test/ui/suggestions/missing-type-param-used-in-param.fixed
new file mode 100644
index 00000000000..cc4120041b9
--- /dev/null
+++ b/src/test/ui/suggestions/missing-type-param-used-in-param.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn two_type_params<A, B>(_: B) {}
+
+fn main() {
+    two_type_params::<String, _>(100); //~ ERROR this function takes 2 generic arguments
+    two_type_params::<String, _>(100);
+}
diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.rs b/src/test/ui/suggestions/missing-type-param-used-in-param.rs
new file mode 100644
index 00000000000..19286331b60
--- /dev/null
+++ b/src/test/ui/suggestions/missing-type-param-used-in-param.rs
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn two_type_params<A, B>(_: B) {}
+
+fn main() {
+    two_type_params::<String>(100); //~ ERROR this function takes 2 generic arguments
+    two_type_params::<String, _>(100);
+}
diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.stderr b/src/test/ui/suggestions/missing-type-param-used-in-param.stderr
new file mode 100644
index 00000000000..4f7058a6492
--- /dev/null
+++ b/src/test/ui/suggestions/missing-type-param-used-in-param.stderr
@@ -0,0 +1,21 @@
+error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+  --> $DIR/missing-type-param-used-in-param.rs:6:5
+   |
+LL |     two_type_params::<String>(100);
+   |     ^^^^^^^^^^^^^^^   ------ supplied 1 generic argument
+   |     |
+   |     expected 2 generic arguments
+   |
+note: function defined here, with 2 generic parameters: `A`, `B`
+  --> $DIR/missing-type-param-used-in-param.rs:3:4
+   |
+LL | fn two_type_params<A, B>(_: B) {}
+   |    ^^^^^^^^^^^^^^^ -  -
+help: add missing generic argument
+   |
+LL |     two_type_params::<String, _>(100);
+   |                             +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.