| Age | Commit message (Collapse) | Author | Lines |
|
This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
|
|
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
|
|
- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitely stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
match, treat as implicit block error to give a more appropriate error.
|
|
rustdoc: wrap stability tags in colored spans
A cosmetic change to make the stability tags stand out a bit against the docs. Opening for discussion.
Before:


After:


r? @QuietMisdreavus
|
|
r=QuietMisdreavus
Fix image link in the settings menu
Fixes #57892.
r? @QuietMisdreavus
|
|
rustdoc: remove blank unstable spans
Rustdoc generates blank unstable spans for unstable struct fields: 
This PR removes them:

r? @QuietMisdreavus
|
|
Move privacy checking later in the pipeline and make some passes run in parallel
r? @michaelwoerister
|
|
|
|
|
|
|
|
|
|
|
|
Delay unmatched delimiter errors until after the parser has run to
deduplicate them when parsing and attempt recovering intelligently.
|
|
Rollup of 23 pull requests
Successful merges:
- #58118 (Transition libtest to 2018 edition)
- #58119 (libproc_macro => 2018)
- #58123 (Avoid some bounds checks in binary_heap::{PeekMut,Hole})
- #58124 (libsyntax_pos => 2018)
- #58133 (libsyntax_ext => 2018)
- #58136 (Improve error message and docs for non-UTF-8 bytes in stdio on Windows)
- #58156 (update submodule: rust-installer from 27dec6c to ccdc47b)
- #58192 (Do not ICE in codegen when using a extern_type static)
- #58193 (Move librustc to 2018)
- #58210 (Make an assert debug-only in `find_constraint_paths_between_regions`.)
- #58217 (librustc_tsan => 2018)
- #58218 (librustc_msan => 2018)
- #58219 (librustc_asan => 2018)
- #58220 (libprofiler_builtins => 2018)
- #58223 (librustc_lsan => 2018)
- #58225 (librustc_fs_util => 2018)
- #58228 (librustc_plugin => 2018)
- #58236 (librustc_resolve => 2018)
- #58237 (Fix broken grammar in iter::from_fn() docs)
- #58239 (librustc_apfloat => 2018)
- #58240 (librustc_errors => 2018)
- #58241 (librustc_llvm => 2018)
- #58242 (Document the one TyKind that isn't documented)
Failed merges:
- #58185 (Remove images' url to make it work even without internet connection)
r? @ghost
|
|
|
|
Do not ICE in codegen when using a extern_type static
The layout of a extern_type static is unsized, but may pass the
Well-Formed check in typeck (See #55257). As a result, we
cannot assume that a static is sized when generating the `Place`
for an r-value.
Fixes: #57876
r? @oli-obk
|
|
Allow #[repr(align(x))] on enums (#57996)
Tracking issue: #57996
Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999.
It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs).
cc @bitshifter
|
|
|
|
|
|
This commit fixes a bug introduced by #55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
`PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType`
with a `PatternKind::Constant` inside, this commit unwraps that to
access the constant pattern inside and behaves as before.
|
|
|
|
|
|
Add a forever unstable opt-out of const qualification checks
r? @eddyb
cc @RalfJung @Centril
basically a forever unstable way to screw with const things in horribly unsafe, unsound and incoherent ways.
Note that this does *not* affect miri except by maybe violating assumptions that miri makes. But there's no change in how miri evaluates things.
|
|
Overhaul `syntax::fold::Folder`.
This PR changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&mut T`), and
renames it `syntax::mut_visit::MutVisitor`.
This makes the code faster and more concise.
|
|
|
|
rustdoc: don't try to get a DefId for a Def that doesn't have one
Fixes https://github.com/rust-lang/rust/issues/58054
The compiler allows you to write a `use` statement for a built-in non-macro attribute, since `use proc_macro` can apply to both the `proc_macro` crate and the `#[proc_macro]` attribute. However, if you write a use statement for something that *doesn't* have this crossover, rustdoc will try to use it the same way as anything else... which resulted in an ICE because it tried to pull a DefId for something that didn't have one. This PR makes rustdoc skip those lookups when it encounters them, allowing it to properly process and render these imports.
|
|
This commit changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&mut T`), and
renames it `syntax::mut_visit::MutVisitor`.
The first benefit is speed. The functional style does not require any
reallocations, due to the use of `P::map` and
`MoveMap::move_{,flat_}map`. However, every field in the AST must be
overwritten; even those fields that are unchanged are overwritten with
the same value. This causes a lot of unnecessary memory writes. The
imperative style reduces instruction counts by 1--3% across a wide range
of workloads, particularly incremental workloads.
The second benefit is conciseness; the imperative style is usually more
concise. E.g. compare the old functional style:
```
fn fold_abc(&mut self, abc: ABC) {
ABC {
a: fold_a(abc.a),
b: fold_b(abc.b),
c: abc.c,
}
}
```
with the imperative style:
```
fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) {
visit_a(a);
visit_b(b);
}
```
(The reductions get larger in more complex examples.)
Overall, the patch removes over 200 lines of code -- even though the new
code has more comments -- and a lot of the remaining lines have fewer
characters.
Some notes:
- The old style used methods called `fold_*`. The new style mostly uses
methods called `visit_*`, but there are a few methods that map a `T`
to something other than a `T`, which are called `flat_map_*` (`T` maps
to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s).
- `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed
`map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to
reflect their slightly changed signatures.
- Although this commit renames the `fold` module as `mut_visit`, it
keeps it in the `fold.rs` file, so as not to confuse git. The next
commit will rename the file.
|
|
|
|
The layout of a extern_type static is unsized, but may pass the
Well-Formed check in typeck. As a result, we cannot assume that
a static is sized when generating the `Place` for an r-value.
|
|
|
|
|
|
|
|
|
|
Fix #58101
|
|
|
|
This commit adjusts the span used to label closure return types so that
if the user specifies the return type, i.e. `|_| -> X {}` instead of
`|_| {}`, we correctly highlight all of it and not just the last
character.
|
|
Add suggestion for duplicated import.
Fixes #52891.
This PR adds a suggestion when a import is duplicated (ie. the same name
is used twice trying to import the same thing) to remove the second
import.
|