parenthesized_params_in_types_and_modules -> error
This commit is contained in:
parent
98d2c510dd
commit
b54c5781b8
12 changed files with 59 additions and 158 deletions
|
@ -122,31 +122,6 @@ error: literal out of range for u8
|
||||||
|
|
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## parenthesized-params-in-types-and-modules
|
|
||||||
|
|
||||||
This lint detects incorrect parentheses. Some example code that triggers this
|
|
||||||
lint:
|
|
||||||
|
|
||||||
```rust,ignore
|
|
||||||
let x = 5 as usize();
|
|
||||||
```
|
|
||||||
|
|
||||||
This will produce:
|
|
||||||
|
|
||||||
```text
|
|
||||||
error: parenthesized parameters may only be used with a trait
|
|
||||||
--> src/main.rs:2:21
|
|
||||||
|
|
|
||||||
2 | let x = 5 as usize();
|
|
||||||
| ^^
|
|
||||||
|
|
|
||||||
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
```
|
|
||||||
|
|
||||||
To fix it, remove the `()`s.
|
|
||||||
|
|
||||||
## pub-use-of-private-extern-crate
|
## pub-use-of-private-extern-crate
|
||||||
|
|
||||||
This lint detects a specific situation of re-exporting a private `extern crate`;
|
This lint detects a specific situation of re-exporting a private `extern crate`;
|
||||||
|
|
|
@ -44,8 +44,7 @@ use crate::hir::def::{Namespace, Res, DefKind, PartialRes, PerNS};
|
||||||
use crate::hir::{GenericArg, ConstArg};
|
use crate::hir::{GenericArg, ConstArg};
|
||||||
use crate::hir::ptr::P;
|
use crate::hir::ptr::P;
|
||||||
use crate::lint;
|
use crate::lint;
|
||||||
use crate::lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
|
use crate::lint::builtin::{self, ELIDED_LIFETIMES_IN_PATHS};
|
||||||
ELIDED_LIFETIMES_IN_PATHS};
|
|
||||||
use crate::middle::cstore::CrateStore;
|
use crate::middle::cstore::CrateStore;
|
||||||
use crate::session::Session;
|
use crate::session::Session;
|
||||||
use crate::session::config::nightly_options;
|
use crate::session::config::nightly_options;
|
||||||
|
@ -298,7 +297,6 @@ enum ParamMode {
|
||||||
|
|
||||||
enum ParenthesizedGenericArgs {
|
enum ParenthesizedGenericArgs {
|
||||||
Ok,
|
Ok,
|
||||||
Warn,
|
|
||||||
Err,
|
Err,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1695,29 +1693,19 @@ impl<'a> LoweringContext<'a> {
|
||||||
};
|
};
|
||||||
let parenthesized_generic_args = match partial_res.base_res() {
|
let parenthesized_generic_args = match partial_res.base_res() {
|
||||||
// `a::b::Trait(Args)`
|
// `a::b::Trait(Args)`
|
||||||
Res::Def(DefKind::Trait, _)
|
Res::Def(DefKind::Trait, _) if i + 1 == proj_start => {
|
||||||
if i + 1 == proj_start => ParenthesizedGenericArgs::Ok,
|
ParenthesizedGenericArgs::Ok
|
||||||
|
}
|
||||||
// `a::b::Trait(Args)::TraitItem`
|
// `a::b::Trait(Args)::TraitItem`
|
||||||
Res::Def(DefKind::Method, _)
|
Res::Def(DefKind::Method, _) |
|
||||||
| Res::Def(DefKind::AssocConst, _)
|
Res::Def(DefKind::AssocConst, _) |
|
||||||
| Res::Def(DefKind::AssocTy, _)
|
Res::Def(DefKind::AssocTy, _) if i + 2 == proj_start => {
|
||||||
if i + 2 == proj_start =>
|
|
||||||
{
|
|
||||||
ParenthesizedGenericArgs::Ok
|
ParenthesizedGenericArgs::Ok
|
||||||
}
|
}
|
||||||
// Avoid duplicated errors.
|
// Avoid duplicated errors.
|
||||||
Res::Err => ParenthesizedGenericArgs::Ok,
|
Res::Err => ParenthesizedGenericArgs::Ok,
|
||||||
// An error
|
// An error
|
||||||
Res::Def(DefKind::Struct, _)
|
_ => ParenthesizedGenericArgs::Err,
|
||||||
| Res::Def(DefKind::Enum, _)
|
|
||||||
| Res::Def(DefKind::Union, _)
|
|
||||||
| Res::Def(DefKind::TyAlias, _)
|
|
||||||
| Res::Def(DefKind::Variant, _) if i + 1 == proj_start =>
|
|
||||||
{
|
|
||||||
ParenthesizedGenericArgs::Err
|
|
||||||
}
|
|
||||||
// A warning for now, for compatibility reasons.
|
|
||||||
_ => ParenthesizedGenericArgs::Warn,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let num_lifetimes = type_def_id.map_or(0, |def_id| {
|
let num_lifetimes = type_def_id.map_or(0, |def_id| {
|
||||||
|
@ -1780,7 +1768,7 @@ impl<'a> LoweringContext<'a> {
|
||||||
segment,
|
segment,
|
||||||
param_mode,
|
param_mode,
|
||||||
0,
|
0,
|
||||||
ParenthesizedGenericArgs::Warn,
|
ParenthesizedGenericArgs::Err,
|
||||||
itctx.reborrow(),
|
itctx.reborrow(),
|
||||||
None,
|
None,
|
||||||
));
|
));
|
||||||
|
@ -1856,15 +1844,6 @@ impl<'a> LoweringContext<'a> {
|
||||||
}
|
}
|
||||||
GenericArgs::Parenthesized(ref data) => match parenthesized_generic_args {
|
GenericArgs::Parenthesized(ref data) => match parenthesized_generic_args {
|
||||||
ParenthesizedGenericArgs::Ok => self.lower_parenthesized_parameter_data(data),
|
ParenthesizedGenericArgs::Ok => self.lower_parenthesized_parameter_data(data),
|
||||||
ParenthesizedGenericArgs::Warn => {
|
|
||||||
self.resolver.lint_buffer().buffer_lint(
|
|
||||||
PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
|
|
||||||
CRATE_NODE_ID,
|
|
||||||
data.span,
|
|
||||||
msg.into(),
|
|
||||||
);
|
|
||||||
(hir::GenericArgs::none(), true)
|
|
||||||
}
|
|
||||||
ParenthesizedGenericArgs::Err => {
|
ParenthesizedGenericArgs::Err => {
|
||||||
let mut err = struct_span_err!(self.sess, data.span, E0214, "{}", msg);
|
let mut err = struct_span_err!(self.sess, data.span, E0214, "{}", msg);
|
||||||
err.span_label(data.span, "only `Fn` traits may use parentheses");
|
err.span_label(data.span, "only `Fn` traits may use parentheses");
|
||||||
|
|
|
@ -207,16 +207,6 @@ declare_lint! {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_lint! {
|
|
||||||
pub PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
|
|
||||||
Deny,
|
|
||||||
"detects parenthesized generic parameters in type and module names",
|
|
||||||
@future_incompatible = FutureIncompatibleInfo {
|
|
||||||
reference: "issue #42238 <https://github.com/rust-lang/rust/issues/42238>",
|
|
||||||
edition: None,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
declare_lint! {
|
declare_lint! {
|
||||||
pub LATE_BOUND_LIFETIME_ARGUMENTS,
|
pub LATE_BOUND_LIFETIME_ARGUMENTS,
|
||||||
Warn,
|
Warn,
|
||||||
|
@ -528,7 +518,6 @@ declare_lint_pass! {
|
||||||
SAFE_PACKED_BORROWS,
|
SAFE_PACKED_BORROWS,
|
||||||
PATTERNS_IN_FNS_WITHOUT_BODY,
|
PATTERNS_IN_FNS_WITHOUT_BODY,
|
||||||
MISSING_FRAGMENT_SPECIFIER,
|
MISSING_FRAGMENT_SPECIFIER,
|
||||||
PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
|
|
||||||
LATE_BOUND_LIFETIME_ARGUMENTS,
|
LATE_BOUND_LIFETIME_ARGUMENTS,
|
||||||
ORDER_DEPENDENT_TRAIT_OBJECTS,
|
ORDER_DEPENDENT_TRAIT_OBJECTS,
|
||||||
DEPRECATED,
|
DEPRECATED,
|
||||||
|
|
|
@ -340,6 +340,8 @@ fn register_builtins(store: &mut lint::LintStore, no_interleave_lints: bool) {
|
||||||
"converted into hard error, see https://github.com/rust-lang/rust/issues/37872");
|
"converted into hard error, see https://github.com/rust-lang/rust/issues/37872");
|
||||||
store.register_removed("safe_extern_statics",
|
store.register_removed("safe_extern_statics",
|
||||||
"converted into hard error, see https://github.com/rust-lang/rust/issues/36247");
|
"converted into hard error, see https://github.com/rust-lang/rust/issues/36247");
|
||||||
|
store.register_removed("parenthesized_params_in_types_and_modules",
|
||||||
|
"converted into hard error, see https://github.com/rust-lang/rust/issues/42238");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn register_internals(store: &mut lint::LintStore) {
|
fn register_internals(store: &mut lint::LintStore) {
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
#![allow(unused)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
{ fn f<X: ::std::marker()::Send>() {} }
|
{ fn f<X: ::std::marker()::Send>() {} }
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
{ fn f() -> impl ::std::marker()::Send { } }
|
{ fn f() -> impl ::std::marker()::Send { } }
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -15,4 +11,3 @@ struct X;
|
||||||
|
|
||||||
impl ::std::marker()::Copy for X {}
|
impl ::std::marker()::Copy for X {}
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
|
@ -1,30 +1,21 @@
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995-2.rs:4:22
|
--> $DIR/issue-32995-2.rs:2:22
|
||||||
|
|
|
|
||||||
LL | { fn f<X: ::std::marker()::Send>() {} }
|
LL | { fn f<X: ::std::marker()::Send>() {} }
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995-2.rs:8:29
|
--> $DIR/issue-32995-2.rs:5:29
|
||||||
|
|
|
|
||||||
LL | { fn f() -> impl ::std::marker()::Send { } }
|
LL | { fn f() -> impl ::std::marker()::Send { } }
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995-2.rs:16:13
|
--> $DIR/issue-32995-2.rs:12:13
|
||||||
|
|
|
|
||||||
LL | impl ::std::marker()::Copy for X {}
|
LL | impl ::std::marker()::Copy for X {}
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0214`.
|
||||||
|
|
|
@ -1,33 +1,24 @@
|
||||||
#![allow(unused)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: usize() = 1;
|
let x: usize() = 1;
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
let b: ::std::boxed()::Box<_> = Box::new(1);
|
let b: ::std::boxed()::Box<_> = Box::new(1);
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
let p = ::std::str::()::from_utf8(b"foo").unwrap();
|
let p = ::std::str::()::from_utf8(b"foo").unwrap();
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
let p = ::std::str::from_utf8::()(b"foo").unwrap();
|
let p = ::std::str::from_utf8::()(b"foo").unwrap();
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
|
let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
|
|
||||||
let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
|
let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn foo<X:Default>() {
|
fn foo<X:Default>() {
|
||||||
let d : X() = Default::default();
|
let d : X() = Default::default();
|
||||||
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| WARN previously accepted
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +1,45 @@
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:4:12
|
--> $DIR/issue-32995.rs:2:12
|
||||||
|
|
|
|
||||||
LL | let x: usize() = 1;
|
LL | let x: usize() = 1;
|
||||||
| ^^^^^^^
|
| ^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:8:19
|
--> $DIR/issue-32995.rs:5:19
|
||||||
|
|
|
|
||||||
LL | let b: ::std::boxed()::Box<_> = Box::new(1);
|
LL | let b: ::std::boxed()::Box<_> = Box::new(1);
|
||||||
| ^^^^^^^
|
| ^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:12:20
|
--> $DIR/issue-32995.rs:8:20
|
||||||
|
|
|
|
||||||
LL | let p = ::std::str::()::from_utf8(b"foo").unwrap();
|
LL | let p = ::std::str::()::from_utf8(b"foo").unwrap();
|
||||||
| ^^^^^^^
|
| ^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:16:25
|
--> $DIR/issue-32995.rs:11:25
|
||||||
|
|
|
|
||||||
LL | let p = ::std::str::from_utf8::()(b"foo").unwrap();
|
LL | let p = ::std::str::from_utf8::()(b"foo").unwrap();
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:20:29
|
--> $DIR/issue-32995.rs:14:29
|
||||||
|
|
|
|
||||||
LL | let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
|
LL | let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:24:35
|
--> $DIR/issue-32995.rs:17:35
|
||||||
|
|
|
|
||||||
LL | let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
|
LL | let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-32995.rs:30:13
|
--> $DIR/issue-32995.rs:22:13
|
||||||
|
|
|
|
||||||
LL | let d : X() = Default::default();
|
LL | let d : X() = Default::default();
|
||||||
| ^^^
|
| ^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error: aborting due to 7 previous errors
|
error: aborting due to 7 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0214`.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
pub fn foo(num: i32) -> i32 {
|
pub fn foo(num: i32) -> i32 {
|
||||||
let foo: i32::from_be(num);
|
let foo: i32::from_be(num);
|
||||||
//~^ ERROR expected type, found local variable `num`
|
//~^ ERROR expected type, found local variable `num`
|
||||||
|
//~| ERROR type arguments are not allowed for this type
|
||||||
//~| ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~| ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| ERROR ambiguous associated type
|
//~| ERROR ambiguous associated type
|
||||||
//~| WARNING this was previously accepted by the compiler but is being phased out
|
|
||||||
foo
|
foo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,20 @@ LL | let foo: i32::from_be(num);
|
||||||
| |
|
| |
|
||||||
| help: use `=` if you meant to assign
|
| help: use `=` if you meant to assign
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/let-binding-init-expr-as-ty.rs:2:19
|
--> $DIR/let-binding-init-expr-as-ty.rs:2:19
|
||||||
|
|
|
|
||||||
LL | let foo: i32::from_be(num);
|
LL | let foo: i32::from_be(num);
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
|
| |
|
||||||
|
| only `Fn` traits may use parentheses
|
||||||
|
| help: use angle brackets instead: `from_be<num>`
|
||||||
|
|
||||||
|
error[E0109]: type arguments are not allowed for this type
|
||||||
|
--> $DIR/let-binding-init-expr-as-ty.rs:2:27
|
||||||
|
|
|
|
||||||
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
|
LL | let foo: i32::from_be(num);
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
| ^^^ type argument not allowed
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error[E0223]: ambiguous associated type
|
error[E0223]: ambiguous associated type
|
||||||
--> $DIR/let-binding-init-expr-as-ty.rs:2:14
|
--> $DIR/let-binding-init-expr-as-ty.rs:2:14
|
||||||
|
@ -22,7 +27,7 @@ error[E0223]: ambiguous associated type
|
||||||
LL | let foo: i32::from_be(num);
|
LL | let foo: i32::from_be(num);
|
||||||
| ^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<i32 as Trait>::from_be`
|
| ^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<i32 as Trait>::from_be`
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0223, E0573.
|
Some errors have detailed explanations: E0109, E0214, E0223, E0573.
|
||||||
For more information about an error, try `rustc --explain E0223`.
|
For more information about an error, try `rustc --explain E0109`.
|
||||||
|
|
|
@ -8,7 +8,6 @@ impl Reactor {
|
||||||
//~^ ERROR cannot find value `input_cells` in this scope
|
//~^ ERROR cannot find value `input_cells` in this scope
|
||||||
//~| ERROR parenthesized type parameters may only be used with a `Fn` trait
|
//~| ERROR parenthesized type parameters may only be used with a `Fn` trait
|
||||||
//~| ERROR wrong number of type arguments: expected 1, found 0
|
//~| ERROR wrong number of type arguments: expected 1, found 0
|
||||||
//~| WARNING this was previously accepted by the compiler but is being phased out
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,11 @@ error[E0425]: cannot find value `input_cells` in this scope
|
||||||
LL | input_cells: Vec::new()
|
LL | input_cells: Vec::new()
|
||||||
| ^^^^^^^^^^^ a field by this name exists in `Self`
|
| ^^^^^^^^^^^ a field by this name exists in `Self`
|
||||||
|
|
||||||
error: parenthesized type parameters may only be used with a `Fn` trait
|
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||||
--> $DIR/issue-34255-1.rs:7:27
|
--> $DIR/issue-34255-1.rs:7:27
|
||||||
|
|
|
|
||||||
LL | input_cells: Vec::new()
|
LL | input_cells: Vec::new()
|
||||||
| ^^^^^
|
| ^^^^^ only `Fn` traits may use parentheses
|
||||||
|
|
|
||||||
= note: `#[deny(parenthesized_params_in_types_and_modules)]` on by default
|
|
||||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
||||||
= note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
|
|
||||||
|
|
||||||
error[E0107]: wrong number of type arguments: expected 1, found 0
|
error[E0107]: wrong number of type arguments: expected 1, found 0
|
||||||
--> $DIR/issue-34255-1.rs:7:22
|
--> $DIR/issue-34255-1.rs:7:22
|
||||||
|
@ -22,5 +18,5 @@ LL | input_cells: Vec::new()
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0107, E0425.
|
Some errors have detailed explanations: E0107, E0214, E0425.
|
||||||
For more information about an error, try `rustc --explain E0107`.
|
For more information about an error, try `rustc --explain E0107`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue