| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
fixes #51212
|
|
Don't accept non-string literals for the format string in writeln
This is to improve diagnostics.
`println` and `eprintln` were already fixed by #52394.
Fixes #30143
|
|
For move errors, suggest match ergonomics instead of `ref`
Partially fixes issue #52423. Also makes errors and suggestions more consistent between move-from-place and move-from-value errors.
Limitations:
- Only the first pattern in a match arm can have a "consider removing this borrow operator" suggestion.
- Suggestions don't always compile as-is (see the TODOs in the test for details).
Sorry for the really long test. I wanted to make sure I handled every case I could think of, and it turned out there were a lot of them.
Questions:
- Is there any particular applicability I should set on those suggestions?
- Are the notes about the `Copy` trait excessive?
|
|
Various changes to `rustc_on_unimplemented`
- Add `from_method` and `from_desugaring` to formatting options
- Change wording of errors slightly
|
|
|
|
|
|
syntax: Enforce attribute grammar in the parser
Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken.
cc https://github.com/rust-lang/rust/pull/50911
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The suggestion logic gave up too early, which kept it from suggesting
borrowing index expressions.
|
|
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #52453 (improve diagnostics for tests with custom return values)
- #53271 (use ? to simplify `TransitiveRelation.maybe_map`)
- #53279 (Extend documentation of `rustc_on_unimplemented`)
- #53342 (fix error for unsized packed struct field)
- #53344 (Add doc examples for std::alloc::{alloc,alloc_zeroed}.)
- #53368 (Ignore test that fails on stage1)
- #53388 (Fix links' color)
- #53396 (Fix since of Iterator::flatten to be a proper semver)
Failed merges:
r? @ghost
|
|
Ignore test that fails on stage1
The error code is not emitted on stage1, so ignore this test there.
|
|
fix error for unsized packed struct field
It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.
|
|
r=nikomatsakis
Provide span for declaration of captured variables
Part of #52663.
r? @nikomatsakis
|
|
Record adjustments and original type for expressions in the generator interior
Fixes https://github.com/rust-lang/rust/issues/50878 and https://github.com/rust-lang/rust/issues/52398.
r? @eddyb
|
|
|
|
NLL - Prevent where clauses from extending the lifetime of bindings
Fixes https://github.com/rust-lang/rust/issues/53123
r? @nikomatsakis
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #53112 (pretty print BTreeSet)
- #53208 (Don't panic on std::env::vars() when env is null.)
- #53226 (driver: set the syntax edition in phase 1)
- #53229 (Make sure rlimit is only ever increased)
- #53233 (targets: aarch64: Add bare-metal aarch64 target)
- #53239 (rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.)
- #53246 (A few cleanups)
- #53257 (Idiomatic improvements to IP method)
- #53274 (Remove statics field from CodegenCx)
- #53290 (Make LLVM emit assembly comments with -Z asm-comments)
- #53317 (Mark prior failure to avoid ICE)
|
|
|
|
Mark prior failure to avoid ICE
Fix #53251
|
|
driver: set the syntax edition in phase 1
Fixes https://github.com/rust-lang/rust/issues/53203
It seems the way libsyntax handles the desired edition is to use a global, set via `syntax_pos::hygiene::set_default_edition`. Right now, this is set in the driver in `run_compiler`, which is the entry point for running the compiler all the way through to emitting files. Since rustdoc doesn't use this function, it wasn't properly setting this global. (When initially setting up editions in rustdoc, i'd assumed that setting `sessopts.edition` would have done this... `>_>`) This was "fixed" for doctests in https://github.com/rust-lang/rust/pull/52385, but rather than patching in a call to `set_default_edition` in all the places rustdoc sets up the compiler, i've instead moved the call in the driver to be farther in the process. This means that any use of `phase_1_parse_input` with the right session options will have the edition properly set without having to also remember to set libsyntax up separately.
r? @rust-lang/compiler
|
|
Don't panic on std::env::vars() when env is null.
Fixes #53200.
Reviewer(s):
* Do I need to do any `#[cfg()]` here?
* Is this use of libc ok for a dev-dependency?
|
|
pretty print BTreeSet
I want pretty printing for BTreeSet.
```rust
use std::collections::*;
fn main() {
let mut s = BTreeSet::new();
s.insert(5);
s.insert(3);
s.insert(7);
s.remove(&3);
println!("{:?}", s);
}
```
```
(gdb) b 9
(gdb) p s
$1 = BTreeSet<i32> with 2 elements = {[0] = 5, [1] = 7}
```
This is analogy of pretty printing for C++ std::set.
|
|
|
|
Move SmallVector and ThinVec out of libsyntax
- move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec`
- remove `libsyntax::util::SmallVector`
- move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec`
Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.
|
|
Move `compile-fail` tests to `ui`
Fixes #46841, #52531, #44844.
r? @nikomatsakis
|
|
rustc_resolve: crates only exist in the type namespace.
Fixes #53333 by resolving `::crate_name` in `TypeNS` alone, which was overlooked in #52923 and didn't break tests, since having `use crate_name;` and a `crate_name` value in the same scope is rare.
|
|
|
|
|
|
|