-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Implement split_pattern on slices #131340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
d3770f8
30699d5
5def45e
2abf4dd
8a6137d
7add14a
ef569a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1864,6 +1864,7 @@ symbols! { | |||
soft, | ||||
specialization, | ||||
speed, | ||||
split_pattern, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(see above) |
||||
spotlight, | ||||
sqrtf128, | ||||
sqrtf16, | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This UI test should be removed. It's only required to exist right now by tidy because you declared a library feature as a compiler feature, too. The doctest should be sufficient. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! I was following the rustc-dev-guide and thought that all unstable features should be declared in the compiler, thanks for clarifying! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pub fn main() { | ||
let a = &[1, 2, 3, 4, 5]; | ||
let b = &[2, 3]; | ||
let mut c = a.split_pattern(b); //~ ERROR use of unstable library feature 'split_pattern' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0658]: use of unstable library feature 'split_pattern' | ||
--> $DIR/feature-gate-split-pattern.rs:4:19 | ||
| | ||
LL | let mut c = a.split_pattern(b); | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #49036 <https://github.com/rust-lang/rust/issues/49036> for more information | ||
= help: add `#![feature(split_pattern)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library features shouldn't (and don't need to) be declared inside the compiler.