| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Better diagnostics and recovery for `mut ref` in patterns
Fixes https://github.com/rust-lang/rust/issues/43286
Supersedes https://github.com/rust-lang/rust/pull/43451
r? @GuillaumeGomez
|
|
Switch to begin_panic again
In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.
|
|
Stabilize more APIs for the 1.20.0 release
In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
|
|
|
|
Fix the spans of catch blocks to include the `do`
|
|
In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.
|
|
Stabilizes:
* `compile_error!` as a macro defined by rustc
Closes #40872
|
|
|
|
rustc: Add some build scripts for librustc crates
This commit adds some "boilerplate" build scripts to librustc/libsyntax crates
to declare dependencies on various environment variables that are configured
throughout the build. Cargo recently gained the ability to depend on environment
variables in build scripts which can help trigger recompilation of a crate.
This should fix weird bugs where after you make a commit or a few days later
you'll get weird "not built with the same compiler" errors hopefully.
|
|
|
|
Point at `:` when using it instead of `;`
When triggering type ascription in such a way that we can infer a
statement end was intended, add a suggestion for the change. Always
point out the reason for the expectation of a type is due to type
ascription.
Fix #42057, #41928.
|
|
Adjust new suggestions to the suggestion guidelines
Addresses https://github.com/rust-lang/rust/pull/42033#discussion_r127694915
guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224
|
|
|
|
This commit adds some "boilerplate" build scripts to librustc/libsyntax crates
to declare dependencies on various environment variables that are configured
throughout the build. Cargo recently gained the ability to depend on environment
variables in build scripts which can help trigger recompilation of a crate.
This should fix weird bugs where after you make a commit or a few days later
you'll get weird "not built with the same compiler" errors hopefully.
|
|
Use the macro structure spans instead of the invocation
Fix #42104, CC #2887.
|
|
The `hi` and `lo` offsets in a span are relative to a `CodeMap`, but this
doesn't seem to be terribly useful for tool consumers who don't have the
codemap, but might want the byte offset within an actual file?
Resolves #35164.
|
|
|
|
|
|
|
|
|
|
|
|
Now there's a way to add suggestions that hide the suggested code when
presented inline, to avoid weird wording when short code snippets are
added at the end.
|
|
|
|
When triggering type ascription in such a way that we can infer a
statement end was intended, add a suggestion for the change. Always
point out the reason for the expectation of a type is due to type
ascription.
|
|
macros: fix regression involving identifiers in `macro_rules!` patterns.
Fixes #42019.
r? @nrc
|
|
support pub(restricted) in thread_local! (round 2)
Resurrected #40984 now that the issue blocking it was fixed. Original description:
`pub(restricted)` was stabilized in #40556 so let's go!
Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1).
I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov @jseyfried), so this may be an issue.
|
|
|
|
|
|
|
|
The literal index was increased in only next_lit, so it isn't
necessary: code now uses an iterator. The cur_cmnt field is also moved
to be increased in print_comment instead of after each call to
print_comment.
|
|
No (intentional) changes to behavior. This is intended to avoid the
anti-pattern of having to import individual methods throughout code.
|
|
Only match a fragment specifier the if it starts with certain tokens.
When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838).
In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future.
Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.
|
|
Fix feature gate for `#[link_args(..)]` attribute
Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute.
See also #29596 and #43106
|
|
regardless of context of attribute.
Extend the gating test to include the attribute in "weird" places.
|
|
|
|
Raise alignment limit from 2^15 to 2^31 - 1
Fixes #42960
|
|
Remove unused code from librustc_errors
While extracting librustc_errors into a [reusable library](https://github.com/kevinmehall/codemap-diagnostic), I noticed some obsolete code that the `dead_code` warning missed because it was marked `pub` but not used elsewhere.
|
|
|
|
|
|
remove associated_consts feature gate
Currently struggling to run tests locally (something about jemalloc target missing).
cc #29646
|
|
Fix spans, add some comments
|
|
|
|
Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.
|
|
|
|
|
|
|
|
|
|
|