]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #64849 - matthiaskrgr:submodule_upd, r=Manishearth
authorbors <bors@rust-lang.org>
Fri, 27 Sep 2019 17:28:00 +0000 (17:28 +0000)
committerbors <bors@rust-lang.org>
Fri, 27 Sep 2019 17:28:00 +0000 (17:28 +0000)
submodules: update clippy from 68ff8b19 to edd90473

Changes:
````
Remove clippy::author attribute from trailing_zeroes test
Move author issue test to author subdir
Fix author lint
Rustup to rust-lang/rust#64813
Refactor `booleans`
Detect assignment ops in integer_arithmetic
````

Fixes #64843

r? @oli-obk  @Manishearth

src/librustdoc/clean/simplify.rs
src/test/rustdoc/auxiliary/issue-57180.rs [new file with mode: 0644]
src/test/rustdoc/issue-57180.rs [new file with mode: 0644]

index 8758ab19691163ab4f93e847ed21d0c31d08b459..853170542e083d8613a81bbb472aef95fa57e699 100644 (file)
@@ -35,7 +35,7 @@ pub fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> {
                 match ty {
                     clean::Generic(s) => params.entry(s).or_default()
                                                .extend(bounds),
-                    t => tybounds.push((t, ty_bounds(bounds))),
+                    t => tybounds.push((t, bounds)),
                 }
             }
             WP::RegionPredicate { lifetime, bounds } => {
@@ -45,11 +45,6 @@ pub fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> {
         }
     }
 
-    // Simplify the type parameter bounds on all the generics
-    let mut params = params.into_iter().map(|(k, v)| {
-        (k, ty_bounds(v))
-    }).collect::<BTreeMap<_, _>>();
-
     // Look for equality predicates on associated types that can be merged into
     // general bound predicates
     equalities.retain(|&(ref lhs, ref rhs)| {
@@ -73,7 +68,7 @@ pub fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> {
     // And finally, let's reassemble everything
     let mut clauses = Vec::new();
     clauses.extend(lifetimes.into_iter().map(|(lt, bounds)| {
-        WP::RegionPredicate { lifetime: lt, bounds: bounds }
+        WP::RegionPredicate { lifetime: lt, bounds }
     }));
     clauses.extend(params.into_iter().map(|(k, v)| {
         WP::BoundPredicate {
@@ -82,10 +77,10 @@ pub fn where_clauses(cx: &DocContext<'_>, clauses: Vec<WP>) -> Vec<WP> {
         }
     }));
     clauses.extend(tybounds.into_iter().map(|(ty, bounds)| {
-        WP::BoundPredicate { ty: ty, bounds: bounds }
+        WP::BoundPredicate { ty, bounds }
     }));
     clauses.extend(equalities.into_iter().map(|(lhs, rhs)| {
-        WP::EqPredicate { lhs: lhs, rhs: rhs }
+        WP::EqPredicate { lhs, rhs }
     }));
     clauses
 }
@@ -122,9 +117,9 @@ pub fn merge_bounds(
                     },
                 });
             }
-            PP::Parenthesized { ref mut output, .. } => {
-                assert!(output.is_none());
-                if *rhs != clean::Type::Tuple(Vec::new()) {
+            PP::Parenthesized { ref mut output, .. } => match output {
+                Some(o) => assert_eq!(o, rhs),
+                None => if *rhs != clean::Type::Tuple(Vec::new()) {
                     *output = Some(rhs.clone());
                 }
             }
@@ -137,7 +132,7 @@ pub fn ty_params(mut params: Vec<clean::GenericParamDef>) -> Vec<clean::GenericP
     for param in &mut params {
         match param.kind {
             clean::GenericParamDefKind::Type { ref mut bounds, .. } => {
-                *bounds = ty_bounds(mem::take(bounds));
+                *bounds = mem::take(bounds);
             }
             _ => panic!("expected only type parameters"),
         }
@@ -145,10 +140,6 @@ pub fn ty_params(mut params: Vec<clean::GenericParamDef>) -> Vec<clean::GenericP
     params
 }
 
-fn ty_bounds(bounds: Vec<clean::GenericBound>) -> Vec<clean::GenericBound> {
-    bounds
-}
-
 fn trait_is_same_or_supertrait(cx: &DocContext<'_>, child: DefId,
                                trait_: DefId) -> bool {
     if child == trait_ {
diff --git a/src/test/rustdoc/auxiliary/issue-57180.rs b/src/test/rustdoc/auxiliary/issue-57180.rs
new file mode 100644 (file)
index 0000000..4e2f4b8
--- /dev/null
@@ -0,0 +1,16 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Trait {
+}
+
+pub struct Struct<F>
+{
+    _p: ::std::marker::PhantomData<F>,
+}
+
+impl<F: Fn() -> u32>
+Trait for Struct<F>
+    where
+        F: Fn() -> u32,
+{
+}
diff --git a/src/test/rustdoc/issue-57180.rs b/src/test/rustdoc/issue-57180.rs
new file mode 100644 (file)
index 0000000..14bd2b0
--- /dev/null
@@ -0,0 +1,7 @@
+// aux-build:issue-57180.rs
+
+extern crate issue_57180;
+use issue_57180::Trait;
+
+fn main() {
+}