| Age | Commit message (Collapse) | Author | Lines |
|
They are now library features.
|
|
Implement RFC 2707 + Parser recovery for range patterns
Implement https://github.com/rust-lang/rfcs/pull/2707.
- Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result.
- Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later).
- Refactor `parser.rs` wrt. parsing sequences and lists of things in the process.
- Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`.
This should make it easy to actually support these patterns semantically later if we so desire.
cc https://github.com/rust-lang/rust/issues/62254
r? @petrochenkov
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make more informative error on outer attribute after inner
Fixes #61218.
?r @estebank
|
|
Break dependencies between `syntax_ext` and other crates
Move `source_util` macros into `syntax_ext`.
Move other early code generation facilities like standard library injection into `syntax_ext`.
The only crate that depends on `syntax_ext` now is `rustc_interface` which is one of the "final" crates that depend on everything.
Minor: Cleanup dependencies of `rustc_driver`, many of them are no longer used after introduction of `rustc_interface`.
r? @eddyb
|
|
|
|
|
|
Few other minor renamings for consistency.
Remove one unused dependency from `rustc_passes`.
Fix libsyntax tests.
Fix rebase.
|
|
|
|
|
|
|
|
Move `source_uitil` macros into `syntax_ext`
Cleanup dependencies of `rustc_driver`
|
|
|
|
|
|
|
|
Define built-in macros through libcore
This PR defines built-in macros through libcore using a scheme similar to lang items (attribute `#[rustc_builtin_macro]`).
All the macro properties (stability, visibility, etc.) are taken from the source code in libcore, with exception of the expander function transforming input tokens/AST into output tokens/AST, which is still provided by the compiler.
The macros are made available to user code through the standard library prelude (`{core,std}::prelude::v1`), so they are still always in scope.
As a result **built-in macros now have stable absolute addresses in the library**, like `core::prelude::v1::line!()`, this is an insta-stable change.
Right now `prelude::v1` is the only publicly available absolute address for these macros, but eventually they can be moved into more appropriate locations with library team approval (e.g. `Clone` derive -> `core::clone::Clone`).
Now when built-in macros have canonical definitions they can be imported or reexported without issues (https://github.com/rust-lang/rust/issues/61687).
Other changes:
- You can now define a derive macro with a name matching one of the built-in derives (https://github.com/rust-lang/rust/issues/52269). This was an artificial restriction that could be worked around with import renaming anyway.
Known regressions:
- Empty library crate with a crate-level `#![test]` attribute no longer compiles without `--test`. Previously it didn't compile *with* `--test` or with the bin crate type.
Fixes https://github.com/rust-lang/rust/issues/61687
Fixes https://github.com/rust-lang/rust/issues/61804
r? @eddyb
|
|
Remove needless indirection through Rc
NamedMatch is already cheap to clone due to Lrc's inside.
|
|
Allow lexer to recover from some homoglyphs
|
|
Implement slow-path for FirstSets::first
When 2 or more sequences share the same span, we can't use the precomputed map
for their first set. So we compute it recursively.
Fixes #62831.
|
|
|
|
When 2 or more sequences share the same span, we can't use the precomputed map
for their first set. So we compute it recursively.
Fixes #62831.
|
|
Make the parser TokenStream more resilient after mismatched delimiter recovery
Fix #62881, fix #62895.
|
|
Turn `#[global_allocator]` into a regular attribute macro
It was a 99% macro with exception of some diagnostic details.
As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks.
Fixes https://github.com/rust-lang/rust/issues/44113
Fixes https://github.com/rust-lang/rust/issues/58072
|
|
rustdoc: make #[doc(include)] relative to the containing file
This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.
Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380
Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239
cc #44732
This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
|
|
|
|
NamedMatch is already cheap to clone due to Lrc's inside.
|
|
|
|
cleanup: Remove `extern crate serialize as rustc_serialize`s
|
|
Always emit trailing slash error
Fix #62913.
r? @petrochenkov
|
|
fakenine:normalize_use_of_backticks_compiler_messages_p15, r=Centril
Normalize use of backticks in compiler messages for libsyntax/*
https://github.com/rust-lang/rust/issues/60532
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https://github.com/rust-lang/rust/issues/60532
|