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 a1bea15

Browse files
committedAug 23, 2022
Auto merge of rust-lang#100920 - Dylan-DPC:rollup-vlcw3sr, r=Dylan-DPC
Rollup of 9 pull requests Successful merges: - rust-lang#99249 (Do not re-parse function signatures to suggest generics) - rust-lang#100309 (Extend comma suggestion to cases where fields arent missing) - rust-lang#100368 (InferCtxt tainted_by_errors_flag should be Option<ErrorGuaranteed>) - rust-lang#100768 (Migrate `rustc_plugin_impl` to `SessionDiagnostic`) - rust-lang#100835 (net listen backlog update, follow-up from rust-lang#97963.) - rust-lang#100851 (Fix rustc_parse_format precision & width spans) - rust-lang#100857 (Refactor query modifier parsing) - rust-lang#100907 (Fix typo in UnreachableProp) - rust-lang#100909 (Minor `ast::LitKind` improvements) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1cff564 + 28ead17 commit a1bea15

File tree

51 files changed

+509
-622
lines changed

Some content is hidden

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

51 files changed

+509
-622
lines changed
 

‎Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,6 +4321,7 @@ dependencies = [
43214321
"rustc_ast",
43224322
"rustc_errors",
43234323
"rustc_lint",
4324+
"rustc_macros",
43244325
"rustc_metadata",
43254326
"rustc_session",
43264327
"rustc_span",

‎compiler/rustc_ast/src/ast.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,8 @@ pub enum LitFloatType {
17511751
/// E.g., `"foo"`, `42`, `12.34`, or `bool`.
17521752
#[derive(Clone, Encodable, Decodable, Debug, Hash, Eq, PartialEq, HashStable_Generic)]
17531753
pub enum LitKind {
1754-
/// A string literal (`"foo"`).
1754+
/// A string literal (`"foo"`). The symbol is unescaped, and so may differ
1755+
/// from the original token's symbol.
17551756
Str(Symbol, StrStyle),
17561757
/// A byte string (`b"foo"`).
17571758
ByteStr(Lrc<[u8]>),
@@ -1761,12 +1762,13 @@ pub enum LitKind {
17611762
Char(char),
17621763
/// An integer literal (`1`).
17631764
Int(u128, LitIntType),
1764-
/// A float literal (`1f64` or `1E10f64`).
1765+
/// A float literal (`1f64` or `1E10f64`). Stored as a symbol rather than
1766+
/// `f64` so that `LitKind` can impl `Eq` and `Hash`.
17651767
Float(Symbol, LitFloatType),
17661768
/// A boolean literal.
17671769
Bool(bool),
17681770
/// Placeholder for a literal that wasn't well-formed in some way.
1769-
Err(Symbol),
1771+
Err,
17701772
}
17711773

17721774
impl LitKind {
@@ -1805,7 +1807,7 @@ impl LitKind {
18051807
| LitKind::Int(_, LitIntType::Unsuffixed)
18061808
| LitKind::Float(_, LitFloatType::Unsuffixed)
18071809
| LitKind::Bool(..)
1808-
| LitKind::Err(..) => false,
1810+
| LitKind::Err => false,
18091811
}
18101812
}
18111813
}

0 commit comments

Comments
 (0)
This repository has been archived.