mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
feature(const_generics)
-> feature(const_param_types)
This commit is contained in:
parent
0b526fd7fb
commit
fd8b150959
6 changed files with 11 additions and 19 deletions
|
@ -1,6 +1,3 @@
|
|||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub struct ArrayWrapper<const N: usize>([usize; N]);
|
||||
|
||||
impl<const N: usize> ArrayWrapper<{ N }> {
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
// Regression test for #5233
|
||||
|
||||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
#![warn(clippy::indexing_slicing, clippy::iter_cloned_collect)]
|
||||
|
||||
pub struct KotomineArray<T, const N: usize> {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#![allow(dead_code, incomplete_features)]
|
||||
#![warn(clippy::doc_markdown)]
|
||||
#![feature(custom_inner_attributes, const_generics, generic_const_exprs, const_option)]
|
||||
#![feature(custom_inner_attributes, generic_const_exprs, const_option)]
|
||||
#![rustfmt::skip]
|
||||
|
||||
/// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
// aux-build:helper.rs
|
||||
|
||||
#![warn(clippy::missing_const_for_fn)]
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(start, const_generics)]
|
||||
#![feature(start)]
|
||||
#![feature(custom_inner_attributes)]
|
||||
|
||||
extern crate helper;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#![warn(clippy::missing_const_for_fn)]
|
||||
#![allow(incomplete_features, clippy::let_and_return)]
|
||||
#![feature(const_generics)]
|
||||
#![feature(custom_inner_attributes)]
|
||||
|
||||
use std::mem::transmute;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:14:5
|
||||
--> $DIR/could_be_const.rs:13:5
|
||||
|
|
||||
LL | / pub fn new() -> Self {
|
||||
LL | | Self { guess: 42 }
|
||||
|
@ -9,7 +9,7 @@ LL | | }
|
|||
= note: `-D clippy::missing-const-for-fn` implied by `-D warnings`
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:18:5
|
||||
--> $DIR/could_be_const.rs:17:5
|
||||
|
|
||||
LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] {
|
||||
LL | | b
|
||||
|
@ -17,7 +17,7 @@ LL | | }
|
|||
| |_____^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:24:1
|
||||
--> $DIR/could_be_const.rs:23:1
|
||||
|
|
||||
LL | / fn one() -> i32 {
|
||||
LL | | 1
|
||||
|
@ -25,7 +25,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:29:1
|
||||
--> $DIR/could_be_const.rs:28:1
|
||||
|
|
||||
LL | / fn two() -> i32 {
|
||||
LL | | let abc = 2;
|
||||
|
@ -34,7 +34,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:35:1
|
||||
--> $DIR/could_be_const.rs:34:1
|
||||
|
|
||||
LL | / fn string() -> String {
|
||||
LL | | String::new()
|
||||
|
@ -42,7 +42,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:40:1
|
||||
--> $DIR/could_be_const.rs:39:1
|
||||
|
|
||||
LL | / unsafe fn four() -> i32 {
|
||||
LL | | 4
|
||||
|
@ -50,7 +50,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:45:1
|
||||
--> $DIR/could_be_const.rs:44:1
|
||||
|
|
||||
LL | / fn generic<T>(t: T) -> T {
|
||||
LL | | t
|
||||
|
@ -58,7 +58,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:68:9
|
||||
--> $DIR/could_be_const.rs:67:9
|
||||
|
|
||||
LL | / pub fn b(self, a: &A) -> B {
|
||||
LL | | B
|
||||
|
@ -66,7 +66,7 @@ LL | | }
|
|||
| |_________^
|
||||
|
||||
error: this could be a `const fn`
|
||||
--> $DIR/could_be_const.rs:78:5
|
||||
--> $DIR/could_be_const.rs:77:5
|
||||
|
|
||||
LL | / fn const_fn_stabilized_before_msrv(byte: u8) {
|
||||
LL | | byte.is_ascii_digit();
|
||||
|
|
Loading…
Add table
Reference in a new issue