rust/src/test/ui/privacy/private-in-public.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

299 lines
9.7 KiB
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:13:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub const C: Priv = Priv;
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:14:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub static S: Priv = Priv;
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:15:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f1(arg: Priv) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:16:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f2() -> Priv { panic!() }
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:17:19
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub struct S1(pub Priv);
2018-08-08 12:28:26 +00:00
| ^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:18:21
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub struct S2 { pub field: Priv }
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:20:9
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub const C: Priv = Priv;
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:21:9
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f1(arg: Priv) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `types::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:22:9
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `types::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f2() -> Priv { panic!() }
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `traits::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:31:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits::PrivTr` declared as private
...
2019-03-09 12:03:44 +00:00
LL | pub enum E<T: PrivTr> { V(T) }
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:32:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits::PrivTr` declared as private
...
2019-03-09 12:03:44 +00:00
LL | pub fn f<T: PrivTr>(arg: T) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `traits::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:33:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits::PrivTr` declared as private
...
2019-03-09 12:03:44 +00:00
LL | pub struct S1<T: PrivTr>(T);
2018-08-08 12:28:26 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:34:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits::PrivTr` declared as private
...
2019-03-09 12:03:44 +00:00
LL | / impl<T: PrivTr> Pub<T> {
LL | | pub fn f<U: PrivTr>(arg: U) {}
2018-08-08 12:28:26 +00:00
LL | | }
| |_____^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:35:9
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits::PrivTr` declared as private
...
2019-03-09 12:03:44 +00:00
LL | pub fn f<U: PrivTr>(arg: U) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `traits_where::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:44:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits_where::PrivTr` declared as private
...
2018-08-08 12:28:26 +00:00
LL | pub enum E<T> where T: PrivTr { V(T) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:46:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits_where::PrivTr` declared as private
...
2018-08-08 12:28:26 +00:00
LL | pub fn f<T>(arg: T) where T: PrivTr {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `traits_where::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:48:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits_where::PrivTr` declared as private
...
2018-08-08 12:28:26 +00:00
LL | pub struct S1<T>(T) where T: PrivTr;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:50:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits_where::PrivTr` declared as private
...
2018-08-08 12:28:26 +00:00
LL | / impl<T> Pub<T> where T: PrivTr {
2019-03-09 12:03:44 +00:00
LL | |
2018-08-08 12:28:26 +00:00
LL | | pub fn f<U>(arg: U) where U: PrivTr {}
2019-03-09 12:03:44 +00:00
LL | |
2018-08-08 12:28:26 +00:00
LL | | }
| |_____^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:52:9
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {}
| ------------ `traits_where::PrivTr` declared as private
...
2018-08-08 12:28:26 +00:00
LL | pub fn f<U>(arg: U) where U: PrivTr {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0446]: private type `generics::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:63:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv<T = u8>(T);
| ----------------------- `generics::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f1(arg: [Priv; 1]) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `generics::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:64:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv<T = u8>(T);
| ----------------------- `generics::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f2(arg: Pub<Priv>) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `generics::Priv<generics::Pub>` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:65:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv<T = u8>(T);
| ----------------------- `generics::Priv<generics::Pub>` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f3(arg: Priv<Pub>) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `impls::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:80:9
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `impls::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f(arg: Priv) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `aliases_pub::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:104:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {
| ------------ `aliases_pub::PrivTr` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0446]: private type `aliases_pub::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:104:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `aliases_pub::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `aliases_pub::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:109:9
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `aliases_pub::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f(arg: Priv) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `Priv1` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:131:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv1;
| ------------- `Priv1` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f1(arg: PrivUseAlias) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `Priv2` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:132:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv2;
| ------------- `Priv2` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f2(arg: PrivAlias) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0445]: private trait `aliases_priv::PrivTr` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:133:5
2018-08-08 12:28:26 +00:00
|
LL | trait PrivTr {
| ------------ `aliases_priv::PrivTr` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
2018-08-08 12:28:26 +00:00
error[E0446]: private type `aliases_priv::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:133:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `aliases_priv::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `aliases_params::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:143:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `aliases_params::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
LL | pub fn f2(arg: PrivAliasGeneric) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error[E0446]: private type `aliases_params::Priv` in public interface
2018-12-25 15:56:47 +00:00
--> $DIR/private-in-public.rs:145:5
2018-08-08 12:28:26 +00:00
|
LL | struct Priv;
| ------------ `aliases_params::Priv` declared as private
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | pub fn f3(arg: Result<u8>) {}
Use smaller def span for functions Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-12 21:02:14 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
2018-08-08 12:28:26 +00:00
error: aborting due to 32 previous errors
Some errors have detailed explanations: E0445, E0446.
2018-08-08 12:28:26 +00:00
For more information about an error, try `rustc --explain E0445`.