Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
584ec95
btree: add `{Entry,VacantEntry}::insert_entry`
cuviper Nov 14, 2024
e5f1555
Inline ExprPrecedence::order into Expr::precedence
dtolnay Nov 17, 2024
ae9ac0e
Remove the `DefinitelyInitializedPlaces` analysis.
nnethercote Nov 22, 2024
c1707aa
Shorten the `MaybeUninit` `Debug` implementation
tgross35 Nov 21, 2024
b5fc3a1
No need to re-sort existential preds
compiler-errors Nov 23, 2024
898ccdb
Dont create object type when more than one principal is present
compiler-errors Nov 23, 2024
cfa8fcb
Dont create trait object if it has errors in it
compiler-errors Nov 23, 2024
28970a2
Simplify array length mismatch error reporting
compiler-errors Nov 23, 2024
5d42f64
target check_consistency: ensure target feature string makes some bas…
RalfJung Nov 24, 2024
98777b4
Merge `TokenTreesReader` into `StringReader`.
nnethercote Nov 14, 2024
593cf68
Split `Lexer::bump`.
nnethercote Nov 14, 2024
ba1a1dd
Fix some formatting.
nnethercote Nov 14, 2024
11c96cf
Improve `strip_shebang` testing.
nnethercote Nov 15, 2024
4cd2840
Clean up `c_or_byte_string`.
nnethercote Nov 15, 2024
16a39bb
Streamline `lex_token_trees` error handling.
nnethercote Nov 15, 2024
c9b56b9
miri: disable test_downgrade_observe test on macOS
RalfJung Nov 25, 2024
4a230bb
Support ranges in `<[T]>::get_many_mut()`
ChayimFriedman2 Nov 17, 2024
0066acf
Merge `apply_effects_in_block` and `join_state_into_successors_of`.
nnethercote Nov 18, 2024
7e704af
Add some useful comments.
nnethercote Nov 18, 2024
dae019d
Remove `self` param for `MaybeBorrowedLocals::transfer_function`.
nnethercote Nov 18, 2024
1914dbe
Tweak `MaybeBorrowedLocals::transfer_function` usage.
nnethercote Nov 18, 2024
be7c6a3
Make it possible for `ResultsCursor` to borrow a `Results`.
nnethercote Nov 18, 2024
5915190
Rollup merge of #133042 - cuviper:btreemap-insert_entry, r=Amanieu
compiler-errors Nov 26, 2024
9d6a11a
Rollup merge of #133070 - nnethercote:lexer-tweaks, r=chenyukang
compiler-errors Nov 26, 2024
42459a7
Rollup merge of #133136 - ChayimFriedman2:get-many-mut, r=Amanieu
compiler-errors Nov 26, 2024
6e5bac1
Rollup merge of #133140 - dtolnay:precedence, r=fmease
compiler-errors Nov 26, 2024
f010e2d
Rollup merge of #133155 - nnethercote:yet-more-rustc_mir_dataflow-cle…
compiler-errors Nov 26, 2024
3013cd8
Rollup merge of #133282 - tgross35:maybe-uninit-debug, r=Amanieu
compiler-errors Nov 26, 2024
3e1a089
Rollup merge of #133326 - nnethercote:rm-DefinitelyInitializedPlaces,…
compiler-errors Nov 26, 2024
479de1f
Rollup merge of #133362 - compiler-errors:existential-preds, r=BoxyUwU
compiler-errors Nov 26, 2024
cf09718
Rollup merge of #133367 - compiler-errors:array-len-mismatch, r=BoxyUwU
compiler-errors Nov 26, 2024
b0ed5ac
Rollup merge of #133394 - compiler-errors:dyn-more-errors, r=lcnr
compiler-errors Nov 26, 2024
f5c1f7f
Rollup merge of #133410 - RalfJung:target-feature-consistency, r=comp…
compiler-errors Nov 26, 2024
c4e2b0c
Rollup merge of #133435 - RalfJung:test_downgrade_observe, r=tgross35
compiler-errors Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some formatting.
Must be one of those cases where the function is too long and rustfmt
bails out.
  • Loading branch information
nnethercote committed Nov 25, 2024
commit ba1a1ddc3f8c8007061c6f915448b22880da61ca
20 changes: 15 additions & 5 deletions compiler/rustc_parse/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
.push(span);
token::Ident(sym, IdentIsRaw::No)
}
// split up (raw) c string literals to an ident and a string literal when edition < 2021.
// split up (raw) c string literals to an ident and a string literal when edition <
// 2021.
rustc_lexer::TokenKind::Literal {
kind: kind @ (LiteralKind::CStr { .. } | LiteralKind::RawCStr { .. }),
suffix_start: _,
Expand All @@ -261,7 +262,9 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
let prefix_span = self.mk_sp(start, lit_start);
return (Token::new(self.ident(start), prefix_span), preceded_by_whitespace);
}
rustc_lexer::TokenKind::GuardedStrPrefix => self.maybe_report_guarded_str(start, str_before),
rustc_lexer::TokenKind::GuardedStrPrefix => {
self.maybe_report_guarded_str(start, str_before)
}
rustc_lexer::TokenKind::Literal { kind, suffix_start } => {
let suffix_start = start + BytePos(suffix_start);
let (kind, symbol) = self.cook_lexer_literal(start, suffix_start, kind);
Expand Down Expand Up @@ -305,13 +308,20 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
if prefix_span.at_least_rust_2021() {
let span = self.mk_sp(start, self.pos);

let lifetime_name_without_tick = Symbol::intern(&self.str_from(ident_start));
let lifetime_name_without_tick =
Symbol::intern(&self.str_from(ident_start));
if !lifetime_name_without_tick.can_be_raw() {
self.dcx().emit_err(errors::CannotBeRawLifetime { span, ident: lifetime_name_without_tick });
self.dcx().emit_err(
errors::CannotBeRawLifetime {
span,
ident: lifetime_name_without_tick
}
);
}

// Put the `'` back onto the lifetime name.
let mut lifetime_name = String::with_capacity(lifetime_name_without_tick.as_str().len() + 1);
let mut lifetime_name =
String::with_capacity(lifetime_name_without_tick.as_str().len() + 1);
lifetime_name.push('\'');
lifetime_name += lifetime_name_without_tick.as_str();
let sym = Symbol::intern(&lifetime_name);
Expand Down