Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4098859

Browse files
authoredDec 10, 2021
Rollup merge of rust-lang#91625 - est31:remove_indexes, r=oli-obk
Remove redundant [..]s
2 parents 6cfe9af + 15de4cb commit 4098859

File tree

45 files changed

+123
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+123
-127
lines changed
 

‎compiler/rustc_ast/src/util/literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl LitKind {
5757
// string in the token.
5858
let s = symbol.as_str();
5959
let symbol =
60-
if s.contains(&['\\', '\r'][..]) {
60+
if s.contains(&['\\', '\r']) {
6161
let mut buf = String::with_capacity(s.len());
6262
let mut error = Ok(());
6363
unescape_literal(&s, Mode::Str, &mut |_, unescaped_char| {

‎compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
347347

348348
if let Some(modifiers) = nested_meta.value_str() {
349349
for modifier in modifiers.as_str().split(',') {
350-
if let Some(modifier) = modifier.strip_prefix(&['+', '-'][..]) {
350+
if let Some(modifier) = modifier.strip_prefix(&['+', '-']) {
351351
macro_rules! gate_modifier { ($($name:literal => $feature:ident)*) => {
352352
$(if modifier == $name {
353353
let msg = concat!("`#[link(modifiers=\"", $name, "\")]` is unstable");
@@ -383,7 +383,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
383383
}
384384

385385
ast::ItemKind::Fn(..) => {
386-
if self.sess.contains_name(&i.attrs[..], sym::start) {
386+
if self.sess.contains_name(&i.attrs, sym::start) {
387387
gate_feature_post!(
388388
&self,
389389
start,
@@ -396,7 +396,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
396396
}
397397

398398
ast::ItemKind::Struct(..) => {
399-
for attr in self.sess.filter_by_name(&i.attrs[..], sym::repr) {
399+
for attr in self.sess.filter_by_name(&i.attrs, sym::repr) {
400400
for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
401401
if item.has_name(sym::simd) {
402402
gate_feature_post!(

0 commit comments

Comments
 (0)
This repository has been archived.