Skip to content

Commit 08598e1

Browse files
committed
Fix warnings from .buildbot.sh
1 parent 4e68283 commit 08598e1

7 files changed

Lines changed: 12 additions & 11 deletions

File tree

cfgrammar/src/lib/markmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl<K: Ord + Clone, V> MarkMap<K, V> {
375375
}
376376

377377
/// Returns an `Entry` for `key`.
378-
pub fn entry(&mut self, key: K) -> Entry<K, V> {
378+
pub fn entry(&mut self, key: K) -> Entry<'_, K, V> {
379379
let pos = self.contents.binary_search_by(|(k, _, _)| k.cmp(&key));
380380
match pos {
381381
Err(pos) => Entry::Vacant(VacantEntry {

cfgrammar/src/lib/yacc/grammar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ where
739739
/// based on the user-defined `token_cost` function which gives the associated cost for
740740
/// generating each token (where the cost must be greater than 0). Note that multiple
741741
/// tokens can have the same score. The simplest cost function is thus `|_| 1`.
742-
pub fn sentence_generator<F>(&self, token_cost: F) -> SentenceGenerator<StorageT>
742+
pub fn sentence_generator<F>(&self, token_cost: F) -> SentenceGenerator<'_, StorageT>
743743
where
744744
F: Fn(TIdx<StorageT>) -> u8,
745745
{

cfgrammar/src/lib/yacc/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ fn add_duplicate_occurrence(
314314

315315
/// The actual parser is intended to be entirely opaque from outside users.
316316
impl YaccParser<'_> {
317-
pub(crate) fn new(yacc_kind: YaccKind, src: &str) -> YaccParser {
317+
pub(crate) fn new(yacc_kind: YaccKind, src: &str) -> YaccParser<'_> {
318318
YaccParser {
319319
yacc_kind,
320320
src,

lrlex/examples/calc_manual_lex/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() {
5151
}
5252
}
5353

54-
fn lex(s: &str) -> LRNonStreamingLexer<DefaultLexerTypes<u8>> {
54+
fn lex(s: &str) -> LRNonStreamingLexer<'_, '_, DefaultLexerTypes<u8>> {
5555
let mut lexemes = Vec::new();
5656
let mut i = 0;
5757
while i < s.len() {

lrlex/src/lib/lexer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,10 @@ where
380380
) -> (Option<HashSet<&'a str>>, Option<HashSet<(&'a str, Span)>>);
381381

382382
/// Returns an iterator over all rules in this AST.
383-
fn iter_rules(&self) -> Iter<Rule<LexerTypesT::StorageT>>;
383+
fn iter_rules(&self) -> Iter<'_, Rule<LexerTypesT::StorageT>>;
384384

385385
/// Returns an iterator over all start states in this AST.
386-
fn iter_start_states(&self) -> Iter<StartState>;
386+
fn iter_start_states(&self) -> Iter<'_, StartState>;
387387
}
388388

389389
/// This struct represents, in essence, a .l file in memory. From it one can produce an
@@ -517,11 +517,11 @@ where
517517
(missing_from_lexer, missing_from_parser)
518518
}
519519

520-
fn iter_rules(&self) -> Iter<Rule<LexerTypesT::StorageT>> {
520+
fn iter_rules(&self) -> Iter<'_, Rule<LexerTypesT::StorageT>> {
521521
self.rules.iter()
522522
}
523523

524-
fn iter_start_states(&self) -> Iter<StartState> {
524+
fn iter_start_states(&self) -> Iter<'_, StartState> {
525525
self.start_states.iter()
526526
}
527527
}

lrpar/src/lib/ctbuilder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static GENERATED_PATHS: LazyLock<Mutex<HashSet<PathBuf>>> =
5353
struct CTConflictsError<StorageT: Eq + Hash> {
5454
conflicts_diagnostic: String,
5555
#[cfg(test)]
56+
#[cfg_attr(test, allow(dead_code))]
5657
stable: StateTable<StorageT>,
5758
phantom: PhantomData<StorageT>,
5859
}

lrtable/src/lib/statetable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ where
433433
}
434434

435435
/// Return an iterator over the indexes of all non-empty actions of `stidx`.
436-
pub fn state_actions(&self, stidx: StIdx<StorageT>) -> StateActionsIterator<StorageT> {
436+
pub fn state_actions(&self, stidx: StIdx<StorageT>) -> StateActionsIterator<'_, StorageT> {
437437
let start = usize::from(stidx) * usize::from(self.tokens_len);
438438
let end = start + usize::from(self.tokens_len);
439439
StateActionsIterator {
@@ -445,7 +445,7 @@ where
445445

446446
/// Return an iterator over the indexes of all shift actions of `stidx`. By definition this
447447
/// is a subset of the indexes produced by [`state_actions`](#method.state_actions).
448-
pub fn state_shifts(&self, stidx: StIdx<StorageT>) -> StateActionsIterator<StorageT> {
448+
pub fn state_shifts(&self, stidx: StIdx<StorageT>) -> StateActionsIterator<'_, StorageT> {
449449
let start = usize::from(stidx) * usize::from(self.tokens_len);
450450
let end = start + usize::from(self.tokens_len);
451451
StateActionsIterator {
@@ -476,7 +476,7 @@ where
476476
/// And: [F -> c., $]
477477
///
478478
/// since the two [E -> ...] items both have the same effects on a parse stack.
479-
pub fn core_reduces(&self, stidx: StIdx<StorageT>) -> CoreReducesIterator<StorageT> {
479+
pub fn core_reduces(&self, stidx: StIdx<StorageT>) -> CoreReducesIterator<'_, StorageT> {
480480
let start = usize::from(stidx) * usize::from(self.prods_len);
481481
let end = start + usize::from(self.prods_len);
482482
CoreReducesIterator {

0 commit comments

Comments
 (0)