]> git.lizzy.rs Git - rust.git/commitdiff
sort strings on output
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 17 Apr 2018 10:06:33 +0000 (06:06 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Mon, 23 Apr 2018 17:28:15 +0000 (13:28 -0400)
src/librustc_traits/lowering.rs
src/test/ui/chalkify/lower_env1.stderr
src/test/ui/chalkify/lower_trait.stderr
src/test/ui/chalkify/lower_trait_higher_rank.stderr
src/test/ui/chalkify/lower_trait_where_clause.stderr

index 8acc77be60d4f9426d2eacd685e6b75b45993fc4..b6a086f609d0494245fe883c6cdcf64323b8a889 100644 (file)
@@ -382,13 +382,22 @@ fn process_attrs(&mut self, node_id: ast::NodeId, attrs: &[ast::Attribute]) {
                     .sess
                     .struct_span_err(attr.span, "program clause dump");
 
-                for clause in clauses.iter() {
-                    // Skip the top-level binder for a less verbose output
-                    let program_clause = match clause {
-                        Clause::Implies(program_clause) => program_clause,
-                        Clause::ForAll(program_clause) => program_clause.skip_binder(),
-                    };
-                    err.note(&format!("{}", program_clause));
+                let mut strings: Vec<_> = clauses
+                    .iter()
+                    .map(|clause| {
+                        // Skip the top-level binder for a less verbose output
+                        let program_clause = match clause {
+                            Clause::Implies(program_clause) => program_clause,
+                            Clause::ForAll(program_clause) => program_clause.skip_binder(),
+                        };
+                        format!("{}", program_clause)
+                    })
+                    .collect();
+
+                strings.sort();
+
+                for string in strings {
+                    err.note(&string);
                 }
 
                 err.emit();
index aaf74f1095a4bc2bd22efd79b743fe51cd40e837..3a280f85e76949e0e862df6135838f7a74e1ecf4 100644 (file)
@@ -4,9 +4,9 @@ error: program clause dump
 LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
    = note: FromEnv(Self: Bar) :- FromEnv(Self: Bar).
    = note: FromEnv(Self: Foo) :- FromEnv(Self: Bar).
+   = note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
 
 error: program clause dump
   --> $DIR/lower_env1.rs:19:1
@@ -14,11 +14,11 @@ error: program clause dump
 LL | #[rustc_dump_env_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: Implemented(Self: std::marker::Sized) :- FromEnv(Self: std::marker::Sized).
-   = note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
    = note: FromEnv(Self: Bar) :- FromEnv(Self: Bar).
    = note: FromEnv(Self: Foo) :- FromEnv(Self: Bar).
+   = note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
    = note: Implemented(Self: Foo) :- FromEnv(Self: Foo).
+   = note: Implemented(Self: std::marker::Sized) :- FromEnv(Self: std::marker::Sized).
 
 error: aborting due to 2 previous errors
 
index 2bd836a8fc1431d54122febeac9104f749b9f2f6..55cd9699b06164de3fc62518a0c2c3666748d854 100644 (file)
@@ -4,10 +4,10 @@ error: program clause dump
 LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: Implemented(Self: Foo<S, T, U>) :- FromEnv(Self: Foo<S, T, U>).
    = note: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
    = note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
    = note: FromEnv(U: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
+   = note: Implemented(Self: Foo<S, T, U>) :- FromEnv(Self: Foo<S, T, U>).
 
 error: aborting due to previous error
 
index 11dc87401802a29fe565d9e017b694ebbbf7335c..7f6f503c6ff7235fbae3a441abbae71d45f8c6fb 100644 (file)
@@ -4,10 +4,10 @@ error: program clause dump
 LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: Implemented(Self: Foo<F>) :- FromEnv(Self: Foo<F>).
+   = note: FromEnv(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) :- FromEnv(Self: Foo<F>).
    = note: FromEnv(F: std::marker::Sized) :- FromEnv(Self: Foo<F>).
    = note: FromEnv(F: std::ops::Fn<(&'a (u8, u16),)>) :- FromEnv(Self: Foo<F>).
-   = note: FromEnv(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) :- FromEnv(Self: Foo<F>).
+   = note: Implemented(Self: Foo<F>) :- FromEnv(Self: Foo<F>).
 
 error: aborting due to previous error
 
index cfea1379dabefdd324a26f1255f37e8d57ca0711..68bc2ddf2930ebf3276b15d7393eba89f6f1fb3f 100644 (file)
@@ -4,11 +4,11 @@ error: program clause dump
 LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: Implemented(Self: Foo<'a, 'b, S, T, U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-   = note: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-   = note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
    = note: FromEnv(S: std::fmt::Debug) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
    = note: FromEnv(T: std::borrow::Borrow<U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: Implemented(Self: Foo<'a, 'b, S, T, U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
    = note: RegionOutlives('a : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
    = note: TypeOutlives(U : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).