Skip to content

Commit

Permalink
feature(const_generics) -> feature(const_param_types)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Aug 30, 2021
1 parent 0b526fd commit fd8b150
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
3 changes: 0 additions & 3 deletions tests/ui/crashes/ice-4775.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(const_generics)]
#![allow(incomplete_features)]

pub struct ArrayWrapper<const N: usize>([usize; N]);

impl<const N: usize> ArrayWrapper<{ N }> {
Expand Down
3 changes: 0 additions & 3 deletions tests/ui/crashes/ice-5223.rs
Original file line number Diff line number Diff line change
@@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/doc/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/missing_const_for_fn/cant_be_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion tests/ui/missing_const_for_fn/could_be_const.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/missing_const_for_fn/could_be_const.stderr
Original file line number Diff line number Diff line change
@@ -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 }
Expand All @@ -9,23 +9,23 @@ 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
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
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;
Expand All @@ -34,39 +34,39 @@ 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()
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
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
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
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();
Expand Down

0 comments on commit fd8b150

Please sign in to comment.