Auto merge of #46829 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests - Successful merges: #46700, #46786, #46790, #46800, #46801, #46802, #46804, #46805, #46812, #46824, #46825 - Failed merges:
This commit is contained in:
commit
c8b94c6aa1
45 changed files with 328 additions and 467 deletions
16
src/test/run-pass/align-offset-sign.rs
Normal file
16
src/test/run-pass/align-offset-sign.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(align_offset)]
|
||||
|
||||
fn main() {
|
||||
let x = 1 as *const u8;
|
||||
assert_eq!(x.align_offset(8), 7);
|
||||
}
|
||||
16
src/test/rustdoc/where-sized.rs
Normal file
16
src/test/rustdoc/where-sized.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.foo.html
|
||||
// @has - '//*[@class="rust fn"]' 'pub fn foo<X, Y: ?Sized>(_: &X)'
|
||||
// @has - '//*[@class="rust fn"]' 'where X: ?Sized,'
|
||||
pub fn foo<X, Y: ?Sized>(_: &X) where X: ?Sized {}
|
||||
|
|
@ -2,7 +2,7 @@ error[E0255]: the name `foo` is defined multiple times
|
|||
--> $DIR/blind-item-item-shadow.rs:13:5
|
||||
|
|
||||
11 | mod foo { pub mod foo { } }
|
||||
| ---------------------------- previous definition of the module `foo` here
|
||||
| ------- previous definition of the module `foo` here
|
||||
12 |
|
||||
13 | use foo::foo;
|
||||
| ^^^^^^^^ `foo` reimported here
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
|
||||
--> $DIR/issue-26046-fn-mut.rs:14:19
|
||||
|
|
||||
14 | let closure = || { //~ ERROR expected a closure that
|
||||
| ___________________^
|
||||
15 | | num += 1;
|
||||
16 | | };
|
||||
| |_____^
|
||||
17 |
|
||||
18 | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
|
||||
note: closure is `FnMut` because it mutates the variable `num` here
|
||||
--> $DIR/issue-26046-fn-mut.rs:15:9
|
||||
|
|
||||
14 | let closure = || { //~ ERROR expected a closure that
|
||||
| ^^ this closure implements `FnMut`, not `Fn`
|
||||
15 | num += 1;
|
||||
| ^^^
|
||||
| --- closure is `FnMut` because it mutates the variable `num` here
|
||||
...
|
||||
18 | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
|
||||
--> $DIR/issue-26046-fn-once.rs:14:19
|
||||
|
|
||||
14 | let closure = move || { //~ ERROR expected a closure
|
||||
| ___________________^
|
||||
15 | | vec
|
||||
16 | | };
|
||||
| |_____^
|
||||
17 |
|
||||
18 | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
|
||||
note: closure is `FnOnce` because it moves the variable `vec` out of its environment
|
||||
--> $DIR/issue-26046-fn-once.rs:15:9
|
||||
|
|
||||
14 | let closure = move || { //~ ERROR expected a closure
|
||||
| ^^^^^^^ this closure implements `FnOnce`, not `Fn`
|
||||
15 | vec
|
||||
| ^^^
|
||||
| --- closure is `FnOnce` because it moves the variable `vec` out of its environment
|
||||
...
|
||||
18 | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
||||
|
|
|
|||
|
|
@ -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<_>`
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| --------------------- definition of `foo` from trait
|
||||
...
|
||||
19 | fn foo() where U: 'a { } //~ ERROR E0276
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/region-extra-2.rs:19:5
|
||||
|
|
||||
15 | fn renew<'b: 'a>(self) -> &'b mut [T];
|
||||
| -------------------------------------- definition of `renew` from trait
|
||||
15 | fn renew<'b: 'a>(self) -> &'b mut [T];
|
||||
| -------------------------------------- definition of `renew` from trait
|
||||
...
|
||||
19 | / fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
|
||||
20 | | //~^ ERROR E0276
|
||||
21 | | &mut self[..]
|
||||
22 | | }
|
||||
| |_____^ impl has extra requirement `'a: 'b`
|
||||
19 | fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| --------- definition of `foo` from trait
|
||||
...
|
||||
19 | fn foo() where 'a: 'b { } //~ ERROR impl has stricter
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| --------------------- definition of `foo` from trait
|
||||
...
|
||||
19 | fn foo() where V: 'a { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| ---------------------------- definition of `b` from trait
|
||||
...
|
||||
25 | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() } //~ ERROR E0276
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: std::marker::Sync`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: std::marker::Sync`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| -------------------------------- definition of `test_error1_fn` from trait
|
||||
...
|
||||
36 | fn test_error1_fn<T: Ord>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: std::cmp::Ord`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: std::cmp::Ord`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:40:5
|
||||
|
|
@ -14,7 +14,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| -------------------------------------- definition of `test_error2_fn` from trait
|
||||
...
|
||||
40 | fn test_error2_fn<T: Eq + B>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:44:5
|
||||
|
|
@ -23,7 +23,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| -------------------------------------- definition of `test_error3_fn` from trait
|
||||
...
|
||||
44 | fn test_error3_fn<T: B + Eq>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:54:5
|
||||
|
|
@ -32,7 +32,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| ------------------------------- definition of `test_error5_fn` from trait
|
||||
...
|
||||
54 | fn test_error5_fn<T: B>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:60:5
|
||||
|
|
@ -41,7 +41,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| ------------------------------- definition of `test_error7_fn` from trait
|
||||
...
|
||||
60 | fn test_error7_fn<T: A + Eq>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: std::cmp::Eq`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: std::cmp::Eq`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:63:5
|
||||
|
|
@ -50,7 +50,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| ------------------------------- definition of `test_error8_fn` from trait
|
||||
...
|
||||
63 | fn test_error8_fn<T: C>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: C`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: C`
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-1.rs:76:5
|
||||
|
|
@ -59,7 +59,7 @@ error[E0276]: impl has stricter requirements than trait
|
|||
| ---------------------------------- definition of `method` from trait
|
||||
...
|
||||
76 | fn method<G: Getter<usize>>(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/traits-misc-mismatch-2.rs:23:5
|
||||
|
|
||||
19 | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
|
||||
| ------------------------------------------------------------------ definition of `zip` from trait
|
||||
19 | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
|
||||
| ------------------------------------------------------------------ definition of `zip` from trait
|
||||
...
|
||||
23 | / fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
|
||||
24 | | //~^ ERROR E0276
|
||||
25 | | ZipIterator{a: self, b: other}
|
||||
26 | | }
|
||||
| |_____^ impl has extra requirement `U: Iterator<B>`
|
||||
23 | fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: Iterator<B>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -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>)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
error[E0428]: the name `Foo` is defined multiple times
|
||||
--> $DIR/enum-and-module-in-same-scope.rs:15:1
|
||||
|
|
||||
11 | / enum Foo {
|
||||
12 | | X
|
||||
13 | | }
|
||||
| |_- previous definition of the type `Foo` here
|
||||
14 |
|
||||
15 | / mod Foo { //~ ERROR the name `Foo` is defined multiple times
|
||||
16 | | pub static X: isize = 42;
|
||||
17 | | fn f() { f() } // Check that this does not result in a resolution error
|
||||
18 | | }
|
||||
| |_^ `Foo` redefined here
|
||||
11 | enum Foo {
|
||||
| -------- previous definition of the type `Foo` here
|
||||
...
|
||||
15 | mod Foo { //~ ERROR the name `Foo` is defined multiple times
|
||||
| ^^^^^^^ `Foo` redefined here
|
||||
|
|
||||
= note: `Foo` must be defined only once in the type namespace of this module
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0255]: the name `A` is defined multiple times
|
|||
| ------- previous import of the module `A` here
|
||||
12 | use self::B;
|
||||
13 | mod A {} //~ ERROR the name `A` is defined multiple times
|
||||
| ^^^^^^^^ `A` redefined here
|
||||
| ^^^^^ `A` redefined here
|
||||
|
|
||||
= note: `A` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
@ -20,7 +20,7 @@ error[E0255]: the name `B` is defined multiple times
|
|||
| ------- previous import of the module `B` here
|
||||
...
|
||||
15 | pub mod B {} //~ ERROR the name `B` is defined multiple times
|
||||
| ^^^^^^^^^^^^ `B` redefined here
|
||||
| ^^^^^^^^^ `B` redefined here
|
||||
|
|
||||
= note: `B` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
@ -34,7 +34,7 @@ error[E0255]: the name `D` is defined multiple times
|
|||
18 | use C::D;
|
||||
| ---- previous import of the module `D` here
|
||||
19 | mod D {} //~ ERROR the name `D` is defined multiple times
|
||||
| ^^^^^^^^ `D` redefined here
|
||||
| ^^^^^ `D` redefined here
|
||||
|
|
||||
= note: `D` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0428]: the name `Foo` is defined multiple times
|
|||
--> $DIR/issue-21546.rs:17:1
|
||||
|
|
||||
14 | mod Foo { }
|
||||
| ----------- previous definition of the module `Foo` here
|
||||
| ------- previous definition of the module `Foo` here
|
||||
...
|
||||
17 | struct Foo;
|
||||
| ^^^^^^^^^^^ `Foo` redefined here
|
||||
|
|
@ -13,7 +13,7 @@ error[E0428]: the name `Bar` is defined multiple times
|
|||
--> $DIR/issue-21546.rs:24:1
|
||||
|
|
||||
21 | mod Bar { }
|
||||
| ----------- previous definition of the module `Bar` here
|
||||
| ------- previous definition of the module `Bar` here
|
||||
...
|
||||
24 | struct Bar(i32);
|
||||
| ^^^^^^^^^^^^^^^^ `Bar` redefined here
|
||||
|
|
@ -27,7 +27,7 @@ error[E0428]: the name `Baz` is defined multiple times
|
|||
| ---------------- previous definition of the type `Baz` here
|
||||
...
|
||||
32 | mod Baz { }
|
||||
| ^^^^^^^^^^^ `Baz` redefined here
|
||||
| ^^^^^^^ `Baz` redefined here
|
||||
|
|
||||
= note: `Baz` must be defined only once in the type namespace of this module
|
||||
|
||||
|
|
@ -35,10 +35,10 @@ error[E0428]: the name `Qux` is defined multiple times
|
|||
--> $DIR/issue-21546.rs:40:1
|
||||
|
|
||||
37 | struct Qux { x: bool }
|
||||
| ---------------------- previous definition of the type `Qux` here
|
||||
| ---------- previous definition of the type `Qux` here
|
||||
...
|
||||
40 | mod Qux { }
|
||||
| ^^^^^^^^^^^ `Qux` redefined here
|
||||
| ^^^^^^^ `Qux` redefined here
|
||||
|
|
||||
= note: `Qux` must be defined only once in the type namespace of this module
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ error[E0428]: the name `Quux` is defined multiple times
|
|||
| ------------ previous definition of the type `Quux` here
|
||||
...
|
||||
48 | mod Quux { }
|
||||
| ^^^^^^^^^^^^ `Quux` redefined here
|
||||
| ^^^^^^^^ `Quux` redefined here
|
||||
|
|
||||
= note: `Quux` must be defined only once in the type namespace of this module
|
||||
|
||||
|
|
@ -57,10 +57,10 @@ error[E0428]: the name `Corge` is defined multiple times
|
|||
--> $DIR/issue-21546.rs:56:1
|
||||
|
|
||||
53 | enum Corge { A, B }
|
||||
| ------------------- previous definition of the type `Corge` here
|
||||
| ---------- previous definition of the type `Corge` here
|
||||
...
|
||||
56 | mod Corge { }
|
||||
| ^^^^^^^^^^^^^ `Corge` redefined here
|
||||
| ^^^^^^^^^ `Corge` redefined here
|
||||
|
|
||||
= note: `Corge` must be defined only once in the type namespace of this module
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0255]: the name `Sub` is defined multiple times
|
|||
| ------------- previous import of the trait `Sub` here
|
||||
...
|
||||
19 | struct Sub { x: f32 } //~ ERROR the name `Sub` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ `Sub` redefined here
|
||||
| ^^^^^^^^^^ `Sub` redefined here
|
||||
|
|
||||
= note: `Sub` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
@ -35,7 +35,7 @@ error[E0255]: the name `Mul` is defined multiple times
|
|||
| ------------- previous import of the trait `Mul` here
|
||||
...
|
||||
21 | enum Mul { A, B } //~ ERROR the name `Mul` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^ `Mul` redefined here
|
||||
| ^^^^^^^^ `Mul` redefined here
|
||||
|
|
||||
= note: `Mul` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
@ -50,7 +50,7 @@ error[E0255]: the name `Div` is defined multiple times
|
|||
| ------------- previous import of the trait `Div` here
|
||||
...
|
||||
23 | mod Div { } //~ ERROR the name `Div` is defined multiple times
|
||||
| ^^^^^^^^^^^ `Div` redefined here
|
||||
| ^^^^^^^ `Div` redefined here
|
||||
|
|
||||
= note: `Div` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
@ -65,7 +65,7 @@ error[E0255]: the name `Rem` is defined multiple times
|
|||
| ------------- previous import of the trait `Rem` here
|
||||
...
|
||||
25 | trait Rem { } //~ ERROR the name `Rem` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^ `Rem` redefined here
|
||||
| ^^^^^^^^^ `Rem` redefined here
|
||||
|
|
||||
= note: `Rem` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,72 +1,35 @@
|
|||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:17:13
|
||||
|
|
||||
17 | / unsafe { //~ ERROR unnecessary `unsafe`
|
||||
18 | | v.set_len(24);
|
||||
19 | | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
||||
20 | | w.set_len(32);
|
||||
21 | | } };
|
||||
22 | | }
|
||||
| |_____________^ unnecessary `unsafe` block
|
||||
15 | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
16 | let f = |v: &mut Vec<_>| {
|
||||
17 | unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:11:8
|
||||
|
|
||||
11 | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
note: because it's nested under this `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
||||
|
|
||||
15 | / unsafe {
|
||||
16 | | let f = |v: &mut Vec<_>| {
|
||||
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
||||
18 | | v.set_len(24);
|
||||
... |
|
||||
29 | | f(&mut v);
|
||||
30 | | }
|
||||
| |_____^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:19:38
|
||||
|
|
||||
19 | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| ______________________________________^
|
||||
20 | | w.set_len(32);
|
||||
21 | | } };
|
||||
| |_________________^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
||||
|
|
||||
15 | / unsafe {
|
||||
16 | | let f = |v: &mut Vec<_>| {
|
||||
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
||||
18 | | v.set_len(24);
|
||||
... |
|
||||
29 | | f(&mut v);
|
||||
30 | | }
|
||||
| |_____^
|
||||
15 | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
19 | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:23:34
|
||||
|
|
||||
23 | |x: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| __________________________________^
|
||||
24 | | x.set_len(40);
|
||||
25 | | } };
|
||||
| |_____________^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` block
|
||||
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
||||
|
|
||||
15 | / unsafe {
|
||||
16 | | let f = |v: &mut Vec<_>| {
|
||||
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
||||
18 | | v.set_len(24);
|
||||
... |
|
||||
29 | | f(&mut v);
|
||||
30 | | }
|
||||
| |_____^
|
||||
15 | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
23 | |x: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,239 +1,156 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error[E0255]: the name `transmute` is defined multiple times
|
|||
| ------------------- previous import of the value `transmute` here
|
||||
12 |
|
||||
13 | fn transmute() {}
|
||||
| ^^^^^^^^^^^^^^^^^ `transmute` redefined here
|
||||
| ^^^^^^^^^^^^^^ `transmute` redefined here
|
||||
|
|
||||
= note: `transmute` must be defined only once in the value namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unnecessary `unsafe` block
|
|||
--> $DIR/lint-unused-unsafe.rs:26:13
|
||||
|
|
||||
26 | fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^ unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:14:9
|
||||
|
|
@ -14,97 +14,54 @@ error: unnecessary `unsafe` block
|
|||
--> $DIR/lint-unused-unsafe.rs:27:13
|
||||
|
|
||||
27 | fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:28:20
|
||||
|
|
||||
28 | unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` fn
|
||||
--> $DIR/lint-unused-unsafe.rs:28:1
|
||||
|
|
||||
28 | unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ---------------- ^^^^^^ unnecessary `unsafe` block
|
||||
| |
|
||||
| because it's nested under this `unsafe` fn
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:29:13
|
||||
|
|
||||
29 | fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:30:20
|
||||
|
|
||||
30 | unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^^^^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` fn
|
||||
--> $DIR/lint-unused-unsafe.rs:30:1
|
||||
|
|
||||
30 | unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ---------------- ^^^^^^ unnecessary `unsafe` block
|
||||
| |
|
||||
| because it's nested under this `unsafe` fn
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:33:9
|
||||
|
|
||||
33 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
34 | | unsf()
|
||||
35 | | }
|
||||
| |_________^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:32:5
|
||||
|
|
||||
32 | / unsafe { // don't put the warning here
|
||||
33 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
34 | | unsf()
|
||||
35 | | }
|
||||
36 | | }
|
||||
| |_____^
|
||||
32 | unsafe { // don't put the warning here
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
33 | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:39:5
|
||||
|
|
||||
39 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
41 | | unsf()
|
||||
42 | | }
|
||||
43 | | }
|
||||
| |_____^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` fn
|
||||
--> $DIR/lint-unused-unsafe.rs:38:1
|
||||
|
|
||||
38 | / unsafe fn bad7() {
|
||||
39 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
41 | | unsf()
|
||||
42 | | }
|
||||
43 | | }
|
||||
44 | | }
|
||||
| |_^
|
||||
38 | unsafe fn bad7() {
|
||||
| ---------------- because it's nested under this `unsafe` fn
|
||||
39 | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:40:9
|
||||
|
|
||||
40 | / unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
41 | | unsf()
|
||||
42 | | }
|
||||
| |_________^ unnecessary `unsafe` block
|
||||
|
|
||||
note: because it's nested under this `unsafe` fn
|
||||
--> $DIR/lint-unused-unsafe.rs:38:1
|
||||
|
|
||||
38 | / unsafe fn bad7() {
|
||||
39 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
40 | | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
41 | | unsf()
|
||||
42 | | }
|
||||
43 | | }
|
||||
44 | | }
|
||||
| |_^
|
||||
38 | unsafe fn bad7() {
|
||||
| ---------------- because it's nested under this `unsafe` fn
|
||||
39 | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
40 | unsafe { //~ ERROR: unnecessary `unsafe` block
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ error[E0525]: expected a closure that implements the `Fn` trait, but this closur
|
|||
--> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:24:13
|
||||
|
|
||||
24 | let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^-^^^
|
||||
| | |
|
||||
| | closure is `FnOnce` because it moves the variable `y` out of its environment
|
||||
| this closure implements `FnOnce`, not `Fn`
|
||||
25 | foo(c);
|
||||
| --- the requirement to implement `Fn` derives from here
|
||||
|
|
||||
note: closure is `FnOnce` because it moves the variable `y` out of its environment
|
||||
--> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:24:21
|
||||
|
|
||||
24 | let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue