-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #51587 - mark-i-m:at_most_once_rep_2018, r=alexcrichton
2018 edition `?` Kleene operator This is my first attempt at implementing the migration lint + 2018 behavior as discussed in #48075 r? @nikomatsakis
- Loading branch information
Showing
32 changed files
with
769 additions
and
303 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! Allows the buffering of lints for later. | ||
//! | ||
//! Since we cannot have a dependency on `librustc`, we implement some types here that are somewhat | ||
//! redundant. Later, these types can be converted to types for use by the rest of the compiler. | ||
|
||
use syntax::ast::NodeId; | ||
use syntax_pos::MultiSpan; | ||
|
||
/// Since we cannot import `LintId`s from `rustc::lint`, we define some Ids here which can later be | ||
/// passed to `rustc::lint::Lint::from_parser_lint_id` to get a `rustc::lint::Lint`. | ||
pub enum BufferedEarlyLintId { | ||
/// Usage of `?` as a macro separator is deprecated. | ||
QuestionMarkMacroSep, | ||
} | ||
|
||
/// Stores buffered lint info which can later be passed to `librustc`. | ||
pub struct BufferedEarlyLint { | ||
/// The span of code that we are linting on. | ||
pub span: MultiSpan, | ||
|
||
/// The lint message. | ||
pub msg: String, | ||
|
||
/// The `NodeId` of the AST node that generated the lint. | ||
pub id: NodeId, | ||
|
||
/// A lint Id that can be passed to `rustc::lint::Lint::from_parser_lint_id`. | ||
pub lint_id: BufferedEarlyLintId, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.