| Age | Commit message (Collapse) | Author | Lines |
|
Fix some clippy warnings in libsyntax
This is mostly removing stray ampersands, needless returns and lifetimes. Basically a lot of small changes.
|
|
This is mostly removing stray ampersands, needless returns and lifetimes.
|
|
|
|
reproducible builds.
|
|
This initial commit provides implementations for HIR, MIR, and
everything that also needs to be supported for those two.
|
|
|
|
|
|
|
|
|
|
to a Visitor
|
|
|
|
places.
|
|
|
|
data_structures::SmallVec.
|
|
|
|
Most of the Rust community agrees that the vec! macro is clearer when
called using square brackets [] instead of regular brackets (). Most of
these ocurrences are from before macros allowed using different types of
brackets.
There is one left unchanged in a pretty-print test, as the pretty
printer still wants it to have regular brackets.
|
|
|
|
This avoids 800,000 heap allocations when compiling html5ever. It
requires tweaking `SmallVector` a little.
|
|
|
|
|
|
|
|
|
|
|
|
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
|
|
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
|
|
Miscellaneous low priority cleanup in `libsyntax`.
|
|
syntax-[breaking-change] cc #31645
(Only breaking because ast::TokenTree is now tokenstream::TokenTree.)
This pull request refactors TokenTrees into their own file as src/libsyntax/tokenstream.rs, moving them out of src/libsyntax/ast.rs, in order to prepare for an accompanying TokenStream implementation (per RFC 1566).
|
|
|
|
Modified tests to point to the new file now.
|
|
Perform `cfg` attribute processing on decorator-generated items
Fixes https://users.rust-lang.org/t/unused-attribute-warning-for-custom-derive-attribute/6180.
r? @nrc
|
|
|
|
|
|
Add an abs_path member to FileMap, use it when writing debug info.
Fixes #34179.
When items are inlined from extern crates, the filename in the debug info
is taken from the FileMap that's serialized in the rlib metadata.
Currently this is just FileMap.name, which is whatever path is passed to rustc.
Since libcore and libstd are built by invoking rustc with relative paths,
they wind up with relative paths in the rlib, and when linked into a binary
the debug info uses relative paths for the names, but since the compilation
directory for the final binary, tools trying to read source filenames
will wind up with bad paths. We noticed this in Firefox with source
filenames from libcore/libstd having bad paths.
This change stores an absolute path in FileMap.abs_path, and uses that
if available for writing debug info. This is not going to magically make
debuggers able to find the source, but it will at least provide sensible
paths.
|
|
When items are inlined from extern crates, the filename in the debug info
is taken from the FileMap that's serialized in the rlib metadata.
Currently this is just FileMap.name, which is whatever path is passed to rustc.
Since libcore and libstd are built by invoking rustc with relative paths,
they wind up with relative paths in the rlib, and when linked into a binary
the debug info uses relative paths for the names, but since the compilation
directory for the final binary, tools trying to read source filenames
will wind up with bad paths. We noticed this in Firefox with source
filenames from libcore/libstd having bad paths.
This change stores an absolute path in FileMap.abs_path, and uses that
if available for writing debug info. This is not going to magically make
debuggers able to find the source, but it will at least provide sensible
paths.
|
|
Revert a change in the scope of macros imported from crates to fix a regression
Fixes #34212.
The regression was caused by #34032, which changed the scope of macros imported from extern crates to match the scope of macros imported from modules.
r? @nrc
|
|
|
|
Casual grepping revealed some places in the codebase (some of which
antedated `if let`'s December 2014 stabilization in c200ae5a) where we
were using a match with a `None => ()` arm where (in the present
author's opinion) an `if let` conditional would be more readable. (Other
places where matching to the unit value did seem to better express the
intent were left alone.)
It's likely that we don't care about making such trivial,
non-functional, sheerly æsthetic changes.
But if we do, this is a patch.
|
|
|
|
|
|
|
|
|
|
libsyntax: be more accepting of whitespace in lexer
Fixes #29590.
Perhaps this may need more thorough testing?
r? @Aatch
|
|
|
|
|
|
|
|
This aligns with unicode recommendations and should be stable for all future
unicode releases. See http://unicode.org/reports/tr31/#R3.
This renames `libsyntax::lexer::is_whitespace` to `is_pattern_whitespace`
so potentially breaks users of libsyntax.
|
|
|
|
Fixes #29590.
|
|
|
|
fixes part of #30197
|