about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-08 21:37:26 +0000
committerbors <bors@rust-lang.org>2022-05-08 21:37:26 +0000
commitcb121987158d69bb894ba1bcc21dc45d1e0a488f (patch)
tree43682525402a2eaf768866386ed5e14afc3310fd /src
parent68461648bf20a230898404d2231d386fbcc09b73 (diff)
parent43b3a491f51caa2fe3ddb27c85e2e00c296cf177 (diff)
downloadrust-cb121987158d69bb894ba1bcc21dc45d1e0a488f.tar.gz
rust-cb121987158d69bb894ba1bcc21dc45d1e0a488f.zip
Auto merge of #96846 - matthiaskrgr:rollup-yxu9ot9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #96617 (Fix incorrect syntax suggestion with `pub async fn`)
 - #96828 (Further elaborate the lack of guarantees from `Hasher`)
 - #96829 (Fix the `x.py clippy` command)
 - #96830 (Add and tweak const-generics tests)
 - #96835 (Add more eslint rules)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/builder.rs4
-rw-r--r--src/librustdoc/html/static/.eslintrc.js5
-rw-r--r--src/test/ui/const-generics/issues/issue-77357.rs (renamed from src/test/ui/const-generics/issues/issue-775377.rs)0
-rw-r--r--src/test/ui/const-generics/issues/issue-77357.stderr (renamed from src/test/ui/const-generics/issues/issue-775377.stderr)2
-rw-r--r--src/test/ui/const-generics/issues/issue-96654.rs15
-rw-r--r--src/test/ui/suggestions/issue-96555.rs19
-rw-r--r--src/test/ui/suggestions/issue-96555.stderr66
7 files changed, 108 insertions, 3 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index bc5af79e0c6..7d838c0a61d 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -534,7 +534,7 @@ impl<'a> Builder<'a> {
                 native::Lld,
                 native::CrtBeginEnd
             ),
-            Kind::Check => describe!(
+            Kind::Check | Kind::Clippy | Kind::Fix => describe!(
                 check::Std,
                 check::Rustc,
                 check::Rustdoc,
@@ -664,7 +664,7 @@ impl<'a> Builder<'a> {
             ),
             Kind::Run => describe!(run::ExpandYamlAnchors, run::BuildManifest, run::BumpStage0),
             // These commands either don't use paths, or they're special-cased in Build::build()
-            Kind::Clean | Kind::Clippy | Kind::Fix | Kind::Format | Kind::Setup => vec![],
+            Kind::Clean | Kind::Format | Kind::Setup => vec![],
         }
     }
 
diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js
index 5fcffe715b1..52577b228aa 100644
--- a/src/librustdoc/html/static/.eslintrc.js
+++ b/src/librustdoc/html/static/.eslintrc.js
@@ -21,6 +21,11 @@ module.exports = {
             "error",
             "double"
         ],
+        "linebreak-style": [
+            "error",
+            "unix"
+        ],
+        "no-trailing-spaces": "error",
         "no-var": ["error"],
         "prefer-const": ["error"],
         "prefer-arrow-callback": ["error"],
diff --git a/src/test/ui/const-generics/issues/issue-775377.rs b/src/test/ui/const-generics/issues/issue-77357.rs
index 3cb8d3846ab..3cb8d3846ab 100644
--- a/src/test/ui/const-generics/issues/issue-775377.rs
+++ b/src/test/ui/const-generics/issues/issue-77357.rs
diff --git a/src/test/ui/const-generics/issues/issue-775377.stderr b/src/test/ui/const-generics/issues/issue-77357.stderr
index 83946df4203..804c0ae5175 100644
--- a/src/test/ui/const-generics/issues/issue-775377.stderr
+++ b/src/test/ui/const-generics/issues/issue-77357.stderr
@@ -1,5 +1,5 @@
 error: overly complex generic constant
-  --> $DIR/issue-775377.rs:6:46
+  --> $DIR/issue-77357.rs:6:46
    |
 LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant
diff --git a/src/test/ui/const-generics/issues/issue-96654.rs b/src/test/ui/const-generics/issues/issue-96654.rs
new file mode 100644
index 00000000000..8cf786dbe40
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-96654.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+struct A<const M: u32> {}
+
+struct B<const M: u32> {}
+
+impl<const M: u32> B<M> {
+    const M: u32 = M;
+}
+
+struct C<const M: u32> {
+    a: A<{ B::<1>::M }>,
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-96555.rs b/src/test/ui/suggestions/issue-96555.rs
new file mode 100644
index 00000000000..9f0a047c6e9
--- /dev/null
+++ b/src/test/ui/suggestions/issue-96555.rs
@@ -0,0 +1,19 @@
+// edition:2018
+
+async fn f() {
+    m::f1().await; //~ ERROR `()` is not a future
+    m::f2().await; //~ ERROR `()` is not a future
+    m::f3().await; //~ ERROR `()` is not a future
+}
+
+mod m {
+    pub fn f1() {}
+
+    pub(crate) fn f2() {}
+
+    pub
+    fn
+    f3() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-96555.stderr b/src/test/ui/suggestions/issue-96555.stderr
new file mode 100644
index 00000000000..6d3b8844d95
--- /dev/null
+++ b/src/test/ui/suggestions/issue-96555.stderr
@@ -0,0 +1,66 @@
+error[E0277]: `()` is not a future
+  --> $DIR/issue-96555.rs:4:12
+   |
+LL |     m::f1().await;
+   |     -------^^^^^^ `()` is not a future
+   |     |
+   |     this call returns `()`
+   |
+   = help: the trait `Future` is not implemented for `()`
+   = note: () must be a future or must implement `IntoFuture` to be awaited
+   = note: required because of the requirements on the impl of `IntoFuture` for `()`
+help: remove the `.await`
+   |
+LL -     m::f1().await;
+LL +     m::f1();
+   | 
+help: alternatively, consider making `fn f1` asynchronous
+   |
+LL |     pub async fn f1() {}
+   |         +++++
+
+error[E0277]: `()` is not a future
+  --> $DIR/issue-96555.rs:5:12
+   |
+LL |     m::f2().await;
+   |     -------^^^^^^ `()` is not a future
+   |     |
+   |     this call returns `()`
+   |
+   = help: the trait `Future` is not implemented for `()`
+   = note: () must be a future or must implement `IntoFuture` to be awaited
+   = note: required because of the requirements on the impl of `IntoFuture` for `()`
+help: remove the `.await`
+   |
+LL -     m::f2().await;
+LL +     m::f2();
+   | 
+help: alternatively, consider making `fn f2` asynchronous
+   |
+LL |     pub(crate) async fn f2() {}
+   |                +++++
+
+error[E0277]: `()` is not a future
+  --> $DIR/issue-96555.rs:6:12
+   |
+LL |     m::f3().await;
+   |     -------^^^^^^ `()` is not a future
+   |     |
+   |     this call returns `()`
+   |
+   = help: the trait `Future` is not implemented for `()`
+   = note: () must be a future or must implement `IntoFuture` to be awaited
+   = note: required because of the requirements on the impl of `IntoFuture` for `()`
+help: remove the `.await`
+   |
+LL -     m::f3().await;
+LL +     m::f3();
+   | 
+help: alternatively, consider making `fn f3` asynchronous
+   |
+LL |     pub async
+   |         +++++
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0277`.