]> git.lizzy.rs Git - rust.git/commitdiff
Use def span for conflicting impls and recursive fn
authorEsteban Küber <esteban@kuber.com.ar>
Mon, 18 Dec 2017 07:46:55 +0000 (23:46 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 18 Dec 2017 07:46:55 +0000 (23:46 -0800)
15 files changed:
src/librustc/traits/specialize/mod.rs
src/librustc_lint/builtin.rs
src/test/ui/coherence-overlap-downstream.stderr
src/test/ui/coherence-overlap-issue-23516.stderr
src/test/ui/coherence-overlap-upstream.stderr
src/test/ui/e0119/complex-impl.stderr
src/test/ui/e0119/conflict-with-std.stderr
src/test/ui/e0119/issue-23563.stderr
src/test/ui/e0119/issue-27403.stderr
src/test/ui/e0119/issue-28981.stderr
src/test/ui/e0119/so-37347311.stderr
src/test/ui/feature-gate-overlapping_marker_traits.stderr
src/test/ui/issue-28568.stderr
src/test/ui/lint-unconditional-recursion.stderr
src/test/ui/specialization-feature-gate-overlap.stderr

index 6a96d01d5f92a498c272e82cb3ecb34b4de47f54..afe29cc0e7baf0b11de869e40644663cf7ce6d14 100644 (file)
@@ -341,15 +341,18 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
                         }),
                     if used_to_be_allowed { " (E0119)" } else { "" }
                 );
+                let impl_span = tcx.sess.codemap().def_span(
+                    tcx.span_of_impl(impl_def_id).unwrap()
+                );
                 let mut err = if used_to_be_allowed {
                     tcx.struct_span_lint_node(
                         lint::builtin::INCOHERENT_FUNDAMENTAL_IMPLS,
                         tcx.hir.as_local_node_id(impl_def_id).unwrap(),
-                        tcx.span_of_impl(impl_def_id).unwrap(),
+                        impl_span,
                         &msg)
                 } else {
                     struct_span_err!(tcx.sess,
-                                     tcx.span_of_impl(impl_def_id).unwrap(),
+                                     impl_span,
                                      E0119,
                                      "{}",
                                      msg)
@@ -357,8 +360,9 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
 
                 match tcx.span_of_impl(overlap.with_impl) {
                     Ok(span) => {
-                        err.span_label(span, format!("first implementation here"));
-                        err.span_label(tcx.span_of_impl(impl_def_id).unwrap(),
+                        err.span_label(tcx.sess.codemap().def_span(span),
+                                       format!("first implementation here"));
+                        err.span_label(impl_span,
                                        format!("conflicting implementation{}",
                                                 overlap.self_desc
                                                     .map_or(String::new(),
index 07874a8cc69dd0eaae4b3319d6d514f5425dec27..5417634144bb3fadb8428932b9b1dd56ed1c8a4f 100644 (file)
@@ -352,7 +352,7 @@ fn check_missing_docs_attrs(&self,
         let has_doc = attrs.iter().any(|a| a.is_value_str() && a.check_name("doc"));
         if !has_doc {
             cx.span_lint(MISSING_DOCS,
-                         sp,
+                         cx.tcx.sess.codemap().def_span(sp),
                          &format!("missing documentation for {}", desc));
         }
     }
@@ -914,15 +914,16 @@ fn check_fn(&mut self,
         // no break */ }`) shouldn't be linted unless it actually
         // recurs.
         if !reached_exit_without_self_call && !self_call_spans.is_empty() {
+            let sp = cx.tcx.sess.codemap().def_span(sp);
             let mut db = cx.struct_span_lint(UNCONDITIONAL_RECURSION,
                                              sp,
                                              "function cannot return without recurring");
+            db.span_label(sp, "cannot return without recurring");
             // offer some help to the programmer.
             for call in &self_call_spans {
-                db.span_note(*call, "recursive call site");
+                db.span_label(*call, "recursive call site");
             }
-            db.help("a `loop` may express intention \
-                     better if this is on purpose");
+            db.help("a `loop` may express intention better if this is on purpose");
             db.emit();
         }
 
index 8a3ef97fd5564b90de27f4152ffab62c5108125e..c94ffd60d261feb2d901f8c10c8ae45eb296fb33 100644 (file)
@@ -2,17 +2,17 @@ error[E0119]: conflicting implementations of trait `Sweet`:
   --> $DIR/coherence-overlap-downstream.rs:18:1
    |
 17 | impl<T:Sugar> Sweet for T { }
-   | ----------------------------- first implementation here
+   | ------------------------- first implementation here
 18 | impl<T:Fruit> Sweet for T { }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
   --> $DIR/coherence-overlap-downstream.rs:24:1
    |
 23 | impl<X, T> Foo<X> for T where T: Bar<X> {}
-   | ------------------------------------------ first implementation here
+   | --------------------------------------- first implementation here
 24 | impl<X> Foo<X> for i32 {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
+   | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
    |
    = note: downstream crates may implement trait `Bar<_>` for type `i32`
 
index 8e107e06a9e04460af65fc8113c56323e5027331..c27e1ad76200c750cbd686e3085099b1e2fc70d3 100644 (file)
@@ -2,9 +2,9 @@ error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed:
   --> $DIR/coherence-overlap-issue-23516.rs:18:1
    |
 17 | impl<T:Sugar> Sweet for T { }
-   | ----------------------------- first implementation here
+   | ------------------------- first implementation here
 18 | impl<U:Sugar> Sweet for Box<U> { }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
    |
    = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
 
index 48961572b72ca48858ad80419ad2d20f25f1444f..9b5b67fe9c7dd3ae24cc845167b9a7f088bff083 100644 (file)
@@ -2,9 +2,9 @@ error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
   --> $DIR/coherence-overlap-upstream.rs:22:1
    |
 21 | impl<T> Foo for T where T: Remote {}
-   | ------------------------------------ first implementation here
+   | --------------------------------- first implementation here
 22 | impl Foo for i16 {}
-   | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
+   | ^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
    |
    = note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
 
index e4f8020145c65d296d7b49d622fc59f0d601732e..926dac3f9b132a21d143647a069f74344a42bb7a 100644 (file)
@@ -2,7 +2,7 @@ error[E0119]: conflicting implementations of trait `complex_impl_support::Extern
   --> $DIR/complex-impl.rs:19:1
    |
 19 | impl<R> External for (Q, R) {} //~ ERROR must be used
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `complex_impl_support`:
            - impl<'a, 'b, 'c, T, U, V, W> complex_impl_support::External for (T, complex_impl_support::M<'a, 'b, 'c, std::boxed::Box<U>, V, W>)
index 21f2dd05b4d797b7ef28cbf73b0b49fd6de5b847..4c1f9405fb96203b67f66b44a40f2c763b4b6389 100644 (file)
@@ -1,12 +1,8 @@
 error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:
   --> $DIR/conflict-with-std.rs:17:1
    |
-17 | / impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
-18 | |     fn as_ref(&self) -> &Q {
-19 | |         &**self
-20 | |     }
-21 | | }
-   | |_^
+17 | impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
+   | ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `alloc`:
            - impl<T> std::convert::AsRef<T> for std::boxed::Box<T>
@@ -15,12 +11,8 @@ error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for
 error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
   --> $DIR/conflict-with-std.rs:24:1
    |
-24 | / impl From<S> for S { //~ ERROR conflicting implementations
-25 | |     fn from(s: S) -> S {
-26 | |         s
-27 | |     }
-28 | | }
-   | |_^
+24 | impl From<S> for S { //~ ERROR conflicting implementations
+   | ^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
            - impl<T> std::convert::From<T> for T;
@@ -28,13 +20,8 @@ error[E0119]: conflicting implementations of trait `std::convert::From<S>` for t
 error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:
   --> $DIR/conflict-with-std.rs:31:1
    |
-31 | / impl TryFrom<X> for X { //~ ERROR conflicting implementations
-32 | |     type Error = ();
-33 | |     fn try_from(u: X) -> Result<X, ()> {
-34 | |         Ok(u)
-35 | |     }
-36 | | }
-   | |_^
+31 | impl TryFrom<X> for X { //~ ERROR conflicting implementations
+   | ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
index 9dddf193063fbbe8966a1dff62d6733d6dd0fcbb..8bbae56d8436de5eece5d8fb1b459b5fcddfb787 100644 (file)
@@ -1,10 +1,8 @@
 error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`:
   --> $DIR/issue-23563.rs:23:1
    |
-23 | / impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
-24 | |     fn from(_: &'a [T]) -> LocalType<T> { LocalType(None) }
-25 | | }
-   | |_^
+23 | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `issue_23563_a`:
            - impl<T, U> a::LolFrom<T> for U
index 68d7235f6aaee63c90a97f6d50e222abe434905a..4417ea9099fa8b6c3250270562a5ae76ed44a074 100644 (file)
@@ -1,12 +1,8 @@
 error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`:
   --> $DIR/issue-27403.rs:15:1
    |
-15 | / impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
-16 | |     fn into(self) -> S {
-17 | |         self.inner
-18 | |     }
-19 | | }
-   | |_^
+15 | impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::Into<U> for T
index aac9f7ae964a4bbda5746023d4a19cc7984fe455..3ea1c9adc9b46cd9c8f806e8b0f288dcdf6e66c4 100644 (file)
@@ -2,7 +2,7 @@ error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&
   --> $DIR/issue-28981.rs:15:1
    |
 15 | impl<Foo> Deref for Foo { } //~ ERROR must be used
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
            - impl<'a, T> std::ops::Deref for &'a T
index 351c0e1bbb626bcf54768d63e19b86c529760721..84fb049df357d286b30fef65ef448af9be3a7b6a 100644 (file)
@@ -1,12 +1,8 @@
 error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`:
   --> $DIR/so-37347311.rs:21:1
    |
-21 | / impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
-22 | |     fn from(error: S::Error) -> MyError<S> {
-23 | |         MyError::StorageProblem(error)
-24 | |     }
-25 | | }
-   | |_^
+21 | impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
            - impl<T> std::convert::From<T> for T;
index 9028b14fcd7ad3a3dd5ccf54b67c8df534521e6e..c1725a62adaf49944590ec4a2c871c11c804e70e 100644 (file)
@@ -2,9 +2,9 @@ error[E0119]: conflicting implementations of trait `MyMarker`:
   --> $DIR/feature-gate-overlapping_marker_traits.rs:16:1
    |
 15 | impl<T: Display> MyMarker for T {}
-   | ---------------------------------- first implementation here
+   | ------------------------------- first implementation here
 16 | impl<T: Debug> MyMarker for T {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error: aborting due to previous error
 
index 2b4025ac122571e20120f7585eb06a7e7eee0377..61717ee60ff309a8d31a1c4902ef54d988d230ab 100644 (file)
@@ -1,16 +1,11 @@
 error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`:
   --> $DIR/issue-28568.rs:17:1
    |
-13 | / impl Drop for MyStruct {
-14 | |     fn drop(&mut self) { }
-15 | | }
-   | |_- first implementation here
-16 | 
-17 | / impl Drop for MyStruct {
-18 | | //~^ ERROR conflicting implementations of trait
-19 | |     fn drop(&mut self) { }
-20 | | }
-   | |_^ conflicting implementation for `MyStruct`
+13 | impl Drop for MyStruct {
+   | ---------------------- first implementation here
+...
+17 | impl Drop for MyStruct {
+   | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct`
 
 error: aborting due to previous error
 
index 40eaab1437f113cab3efe1b5cca2c577e4681cf7..f6f97654b57fd5709b9c764fa27ebb18bd4909ed 100644 (file)
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:14:1
    |
-14 | fn foo() { //~ ERROR function cannot return without recurring
-15 | |     foo();
-16 | | }
-   | |_^
+14 | fn foo() { //~ ERROR function cannot return without recurring
+   | ^^^^^^^^ cannot return without recurring
+15 |     foo();
+   |     ----- recursive call site
    |
 note: lint level defined here
   --> $DIR/lint-unconditional-recursion.rs:11:9
    |
 11 | #![deny(unconditional_recursion)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:15:5
-   |
-15 |     foo();
-   |     ^^^^^
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:24:1
    |
-24 | / fn baz() { //~ ERROR function cannot return without recurring
-25 | |     if true {
-26 | |         baz()
-27 | |     } else {
-28 | |         baz()
-29 | |     }
-30 | | }
-   | |_^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:26:9
-   |
+24 | fn baz() { //~ ERROR function cannot return without recurring
+   | ^^^^^^^^ cannot return without recurring
+25 |     if true {
 26 |         baz()
-   |         ^^^^^
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:28:9
-   |
+   |         ----- recursive call site
+27 |     } else {
 28 |         baz()
-   |         ^^^^^
+   |         ----- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:36:1
    |
-36 | / fn quz() -> bool { //~ ERROR function cannot return without recurring
-37 | |     if true {
-38 | |         while quz() {}
-39 | |         true
-...  |
-42 | |     }
-43 | | }
-   | |_^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:38:15
-   |
+36 | fn quz() -> bool { //~ ERROR function cannot return without recurring
+   | ^^^^^^^^^^^^^^^^ cannot return without recurring
+37 |     if true {
 38 |         while quz() {}
-   |               ^^^^^
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:41:16
-   |
+   |               ----- recursive call site
+...
 41 |         loop { quz(); }
-   |                ^^^^^
+   |                ----- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:47:5
    |
-47 | /     fn bar(&self) { //~ ERROR function cannot return without recurring
-48 | |         self.bar()
-49 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:48:9
-   |
+47 |     fn bar(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
 48 |         self.bar()
-   |         ^^^^^^^^^^
+   |         ---------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:53:5
    |
-53 | /     fn bar(&self) { //~ ERROR function cannot return without recurring
-54 | |         loop {
-55 | |             self.bar()
-56 | |         }
-57 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:55:13
-   |
+53 |     fn bar(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
+54 |         loop {
 55 |             self.bar()
-   |             ^^^^^^^^^^
+   |             ---------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:62:5
    |
-62 | /     fn bar(&self) { //~ ERROR function cannot return without recurring
-63 | |         0.bar()
-64 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:63:9
-   |
+62 |     fn bar(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
 63 |         0.bar()
-   |         ^^^^^^^
+   |         ------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:75:5
    |
-75 | /     fn bar(&self) { //~ ERROR function cannot return without recurring
-76 | |         Foo2::bar(self)
-77 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:76:9
-   |
+75 |     fn bar(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
 76 |         Foo2::bar(self)
-   |         ^^^^^^^^^^^^^^^
+   |         --------------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:81:5
    |
-81 | /     fn bar(&self) { //~ ERROR function cannot return without recurring
-82 | |         loop {
-83 | |             Foo2::bar(self)
-84 | |         }
-85 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:83:13
-   |
+81 |     fn bar(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
+82 |         loop {
 83 |             Foo2::bar(self)
-   |             ^^^^^^^^^^^^^^^
+   |             --------------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:91:5
    |
-91 | /     fn qux(&self) { //~ ERROR function cannot return without recurring
-92 | |         self.qux();
-93 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:92:9
-   |
+91 |     fn qux(&self) { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^ cannot return without recurring
 92 |         self.qux();
-   |         ^^^^^^^^^^
+   |         ---------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
   --> $DIR/lint-unconditional-recursion.rs:96:5
    |
-96 | /     fn as_ref(&self) -> &Self { //~ ERROR function cannot return without recurring
-97 | |         Baz::as_ref(self)
-98 | |     }
-   | |_____^
-   |
-note: recursive call site
-  --> $DIR/lint-unconditional-recursion.rs:97:9
-   |
+96 |     fn as_ref(&self) -> &Self { //~ ERROR function cannot return without recurring
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recurring
 97 |         Baz::as_ref(self)
-   |         ^^^^^^^^^^^^^^^^^
+   |         ----------------- recursive call site
+   |
    = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
    --> $DIR/lint-unconditional-recursion.rs:103:5
     |
-103 | /     fn default() -> Baz { //~ ERROR function cannot return without recurring
-104 | |         let x = Default::default();
-105 | |         x
-106 | |     }
-    | |_____^
-    |
-note: recursive call site
-   --> $DIR/lint-unconditional-recursion.rs:104:17
-    |
+103 |     fn default() -> Baz { //~ ERROR function cannot return without recurring
+    |     ^^^^^^^^^^^^^^^^^^^ cannot return without recurring
 104 |         let x = Default::default();
-    |                 ^^^^^^^^^^^^^^^^^^
+    |                 ------------------ recursive call site
+    |
     = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
    --> $DIR/lint-unconditional-recursion.rs:112:5
     |
-112 | /     fn deref(&self) -> &() { //~ ERROR function cannot return without recurring
-113 | |         &**self
-114 | |     }
-    | |_____^
-    |
-note: recursive call site
-   --> $DIR/lint-unconditional-recursion.rs:113:10
-    |
+112 |     fn deref(&self) -> &() { //~ ERROR function cannot return without recurring
+    |     ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recurring
 113 |         &**self
-    |          ^^^^^^
+    |          ------ recursive call site
+    |
     = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
    --> $DIR/lint-unconditional-recursion.rs:119:5
     |
-119 | /     fn index(&self, x: usize) -> &Baz { //~ ERROR function cannot return without recurring
-120 | |         &self[x]
-121 | |     }
-    | |_____^
-    |
-note: recursive call site
-   --> $DIR/lint-unconditional-recursion.rs:120:10
-    |
+119 |     fn index(&self, x: usize) -> &Baz { //~ ERROR function cannot return without recurring
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recurring
 120 |         &self[x]
-    |          ^^^^^^^
+    |          ------- recursive call site
+    |
     = help: a `loop` may express intention better if this is on purpose
 
 error: function cannot return without recurring
    --> $DIR/lint-unconditional-recursion.rs:128:5
     |
-128 | /     fn deref(&self) -> &Baz { //~ ERROR function cannot return without recurring
-129 | |         self.as_ref()
-130 | |     }
-    | |_____^
-    |
-note: recursive call site
-   --> $DIR/lint-unconditional-recursion.rs:129:9
-    |
+128 |     fn deref(&self) -> &Baz { //~ ERROR function cannot return without recurring
+    |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recurring
 129 |         self.as_ref()
-    |         ^^^^
+    |         ---- recursive call site
+    |
     = help: a `loop` may express intention better if this is on purpose
 
 error: aborting due to 14 previous errors
index 7fe2891c9082de316f8020f531c04a86e1de87eb..6ff261c696d30fab7bdcdee9e179da566cea1113 100644 (file)
@@ -1,15 +1,11 @@
 error[E0119]: conflicting implementations of trait `Foo` for type `u8`:
   --> $DIR/specialization-feature-gate-overlap.rs:23:1
    |
-19 | / impl<T> Foo for T {
-20 | |     fn foo(&self) {}
-21 | | }
-   | |_- first implementation here
-22 | 
-23 | / impl Foo for u8 { //~ ERROR E0119
-24 | |     fn foo(&self) {}
-25 | | }
-   | |_^ conflicting implementation for `u8`
+19 | impl<T> Foo for T {
+   | ----------------- first implementation here
+...
+23 | impl Foo for u8 { //~ ERROR E0119
+   | ^^^^^^^^^^^^^^^ conflicting implementation for `u8`
 
 error: aborting due to previous error