Fix a variety of minor issues
CSS:
- use integer values for font-size in CSS
- use correct ordering of @import
- "invisible" isn't a tag - presume its a class
- "border-color" defines the complete border
python:
- use "not" instead of == "[]" for python
- prefer triple quoted docstrings
- prefer static functions where possible
- prefer modern style classes where possible
- remove semicolons;
global:
- remove duplicated words words
Fix wording for out-of-crate macro error
This fixes the wording of the note for out-of-crate macro errors to fix https://github.com/rust-lang/rust/issues/36469
The previous wording came from older logic in the PR that was replaced without updating the note.
This is about the gray area at the top of a trait's documentation page,
that lists all methods and their signatures. A big trait page like
Iterator is very crowded without this tweak.
Don't let a type parameter named "Self" unchanged past HIR lowering.
Fixes#36638 by rewriting `Self` type parameters (which are a parse error) to a `gensym("Self")`.
Background: #35605 introduced code across rustc that determines `Self` by its keyword name.
Reverting the sanity checks around that would inadvertently cause confusion between the true `Self` of a `trait` and other type parameters named `Self` (which have caused parse errors already).
I do not like to use `gensym`, and we may do something different here in the future, but this should work.
I am using `ThinAttributes` rather than a vector for attributes
attached to generics, since I expect almost all lifetime and types
parameters to not carry any attributes.
Fix ICE test in compiletest fail-tests
While working on Clippy which uses *compiletest*, I noticed that as long as all expected error are found, *compile-fail* tests will be marked *ok* even if there is an ICE. One function seems to have not been updated with JSON errors because ICEs are now reported like this:
```json
{"message":"../src/librustc/ty/context.rs:161: Attempted to intern `_` which contains inference types/regions in the global type context","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":null}
```
I don't think I can add a test for that.
I guess:
r? @nikomatsakis
Adds a `ProcMacro` form of syntax extension
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too.
Supports both attribute-like and function-like macros.
Note that RFC #1566 has not been accepted yet, but I think there is consensus that we want to head in vaguely that direction and so this PR will be useful in any case. It is also fairly easy to undo and does not break any existing programs.
This is related to #35957 in that I hope it can be used in the implementation of macros 1.1, however, there is no direct overlap and is more of a complement than a competing proposal. There is still a fair bit of work to do before the two can be combined.
r? @jseyfried
cc @alexcrichton, @cgswords, @eddyb, @aturon
The function is unused by rustc. Also, it doesn't really follow the
usual meaning of a `with_capacity` function because the first chunk
allocation is now delayed until the first `alloc` call.
This change reduces the size of `TypedArena` by one `usize`.
Fix outdated Doc Comment on BufReader::seek
A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149
Looks like this doc comment was not updated however.
Updated E0560 to new error format
Added a small bit of code to add a label for E0560.
Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.
Closes#36199
Fix documentation with 'soft-float' codegen option
This option doesn't cause software FP routines
to be called, it only changes the float ABI.
Additionally, this option is ignored by all targets,
except the ARM eabihf ones.
Lazily allocate TypedArena's first chunk
Currently `TypedArena` allocates its first chunk, which is usually 4096
bytes, as soon as it is created. If no allocations are ever made from
the arena then this allocation (and the corresponding deallocation) is
wasted effort.
This commit changes `TypedArena` so it doesn't allocate the first chunk
until the first allocation is made.
This change speeds up rustc by a non-trivial amount because rustc uses
`TypedArena` heavily: compilation speed (producing debug builds) on
several of the rustc-benchmarks increases by 1.02--1.06x. The change
should never cause a slow-down because the hot `alloc` function is
unchanged. It does increase the size of `TypedArena` by one `usize`
field, however.
The commit also fixes some out-of-date comments.