gdb: Fix pretty-printing special-cased Rust types
gdb trunk now reports fully qualified type names, just like lldb. Move lldb code for extracting unqualified names to shared file.
For current releases of gdb, `extract_type_name` should just be a no-op.
Fixes#35155
Use monotonic time in condition variables.
Configure condition variables to use monotonic time using
pthread_condattr_setclock on systems where this is possible.
This fixes the issue when thread waiting on condition variable is
woken up too late when system time is moved backwards.
Update E0194 to new error format
Fixes#35280 to update E0194 to support new error message format. Part of #35233.
A separate Github issue #36057 tracks the bonus portion of the original ticket.
r? @jonathandturner
improve `BitAnd` trait documentation
This pull request is based on the discussion in PR #35927.
Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.
Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.
Make `BooleanVector` a struct tuple.
Derive `PartialEq` for `BooleanVector` instead of implementing it.
Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
Updated code sample in chapter on syntax extensions.
The affected API apparently had changed with commit d59accfb06.
---
Further more I had to add
```toml
[lib]
name = "roman_numerals"
crate-type = ["dylib"]
```
to `Cargo.toml` as I otherwise got this compiler error (despite `#![crate_type="dylib"]`):
[E0457]: plugin `roman_numerals` only found in rlib format, but must be available in dylib format
Might be worth adding a note about that?
improve documentation for `Fn*` traits
This PR is not yet a serious attempt at contribution. Rather, I'm opening this for discussion. I can think of a few things we may want to accomplish with the documentation of the `Fn`, `FnMut`, and `FnOnce` traits:
- the relationship between these traits and the closures that implement them
- examples of non-closure implementations
- the relationship between these traits and Rust's ownership semantics
show how iterating over `RangeTo` and `RangeToInclusive` fails
Feedback on PR #35701 seems to be positive, so this does the same thing for `RangeTo` and `RangeToInclusive`.
Doc: explain why Box/Rc/Arc methods do not take self
This can be confusing for newcomers, especially due to the argument name `this` that is used for Rc and Arc.
Batch up libsyntax breaking changes
Batch of the following syntax-[breaking-change] changes:
- #35591: Add a field `span: Span` to `ast::Generics`.
- #35618: Remove variant `Mod` of `ast::PathListItemKind` and refactor the remaining variant `ast::PathListKind::Ident` to a struct `ast::PathListKind_`.
- #35480: Change uses of `Constness` in the AST to `Spanned<Constness>`.
- c.f. `MethodSig`, `ItemKind`
- #35728: Refactor `cx.pat_enum()` into `cx.pat_tuple_struct()` and `cx.pat_path()`.
- #35850: Generalize the elements of lists in attributes from `MetaItem` to a new type `NestedMetaItem` that can represent a `MetaItem` or a literal.
- #35917: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`.
- Besides removing imports of these traits, this won't cause fallout.
- Add a variant `Union` to `ItemKind` to future proof for `union` (c.f. #36016).
- Remove inherent methods `attrs` and `fold_attrs` of `Annotatable`.
- Use methods `attrs` and `map_attrs` of `HasAttrs` instead.
r? @Manishearth
rustbuild: smarter `git submodule`-ing
With this commit, if one bootstraps rust against system llvm then the
src/llvm submodule is not updated/checked-out. This saves considerable
network bandwith when starting from a fresh clone of rust-lang/rust as
the llvm submodule is never cloned.
cc #30107
r? @alexcrichton
cc @petevine
~~We could also avoid updating the jemalloc submodule if --disable-jemalloc is used. It just hasn't been implemented.~~ Done
This probably doesn't handle "recursive" submodules correctly but I think we don't have any of those right now.
I'm still testing a bootstrap but already confirmed that the llvm submodule doesn't get updated when `--llvm-root` is passed to `configure`.
Improve Demangling of Rust Symbols
This turns `..` into `::`, handles some more escapes and gets rid of unwanted underscores at the beginning of path elements.
![Image of Diff](http://puu.sh/qQIN3.png)
Fix lifetime rules for 'if' conditions
Fixes#12033.
Changes the temporary scope rules to make the condition of an if-then-else a terminating scope. This is a [breaking-change].
Steps towards reproducible builds
cc #34902
Running `make dist` twice will result in a rustc tarball where only `librustc_back.so`, `librustc_llvm.so` and `librustc_trans.so` differ. Building `libstd` and `libcore` twice with the same compiler and flags produces identical artifacts.
The third commit should close#24473