Re-use the vector iterator to implement the chars iterator.
The iterator uses our guarantee that the string contains valid UTF-8,
but its only unsafe code is transmuting the decoded u32 into char.
5.2 Simplify example to remove hidden #[deriving(Show)].
Add example for constructing the enums.
8 Reference later sections describing rc, gc and send.
Fix for #15293.
13 Simplify BananaMania example to remove hidden code.
17 Gave an example using the derived Rand trait.
Removed references to removed 'extra' crate.
The default code model is usually unsuitable for kernels,
so we add an option to specify which model we want.
Testing for this would be fragile and very architecture specific and is better left to LLVM.
Someone asked for an example usage of this on IRC, so I tossed together the simplest one. Obviously, this isn't up to snuff, but it's better than nothing.
This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.
This relates to #13885. This does not remove `~self` from the language
yet, however.
[breaking-change]
Disabling the redzone is required in x86-64's kernel mode to avoid interrupts trashing the stack.
I'm not sure if decl_fn is the right place to tag all functions with noredzone. It might have interactions with external functions when linking with bitcode built without -C no-redzone although I see no reason to do that.
I'm not sure how to write a test inspecting the bitcode output for noredzone attributes on all functions either.
This small patch causes the stability lint to bail out when traversing
any AST produced via a macro expansion. Ultimately, we would like to
lint the contents of the macro at the place where the macro is defined,
but regardless we should not be linting it at the use site.
Closes#15703
This PR adds the LLDB autotests to the debuginfo test suite so I don't have to keep rebasing them locally. They are still disabled by default in `tests.mk`. One of the commits also contains a Python pretty printer which can make LLDB print values with Rust syntax. This was mainly added to deal with output format differences between LLDB versions but you can also use it for your normal LLDB debugging sessions.
```
// The following LLDB commands will load and activate the Rust printers
command script import ./src/etc/lldb_rust_formatters.py
type summary add --no-value --python-function lldb_rust_formatters.print_val -x .* --category Rust
type category enable Rust
```
Expect some rough edges with these, they have not been tested apart from there use in the autotests...
Tweak the text editing settings (softtabstop, textwidth, etc).
Add some settings to turn on folding and colorcolumn.
Add the undo_ftplugin changes that my previous patch forgot.
This patch applies the excellent suggestion of @pnkfelix to group the helper methods for method field access into a Trait, making the code much more readable, and much more similar to the way it was before.
Closes#15525
The important bit of this are the changes from line 445 in mem_categorization.rs. Most of the other changes are about adding an Implicit PointerKind, and this is only necessary for getting a decent error message :-s An alternative would have been to add an implciti/explicit flag to cat_deref, which could be mostly ignored and so would mean much fewer changes. However, the implicit state would only be valid if the PointerKind was BorrowedPtr, so it felt like it ought to be another kind of PointerKind. I still don't know which is the better design.
This branch has a fix for #15557 (a2bcef9) as well as a variety of patches I found useful while debugging this issue. These include adding `Show` impls to a variety of types, including the majority of `syntax::ast` and some of `middle::ty`.