The pretty printer was treating block comments with more than two
asterisks after the first slash (e.g. `/***`) as doc comments (which are
attributes), whereas in actual fact they are just regular comments.
The pretty printer was treating block comments with more than two
asterisks after the first slash (e.g. `/***`) as doc comments (which are
attributes), whereas in actual fact they are just regular comments.
This is inspired by the [question](http://www.reddit.com/r/rust/comments/1yy57k/unsolved_question_from_irc/) (re-)posted to /r/rust. The error message in this question correctly states that one should add `'static` to the trait bounds, but does not state which trait bounds. This PR makes that explicit by appending two words.
This also renames `check_durable` to `check_static` and removes the outdated comment as a cleanup.
Every method call and overloaded operator had a `callee_id` that was be used to store the method type and type substitutions, that information is now stored in the `method_map`, alongside the method's origin.
- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.
tutorial: change "--" to an em-dash.
tutorial: change instances of "--" to em-dash.
The printing of the error message on stack overflow had two sometimes false
assumptions previously. The first is that a local task was always available (it
called Local::take) and the second is that it used `println!` instead of
manually writing.
The first assumption isn't necessarily true because while stack overflow will
likely only be detected in situations that a local task is available, it's not
guaranteed to always be in TLS. For example, during a `println!` call a task
may be blocking, causing it to be unavailable. By using Local::try_take(), we
can be resilient against these occurrences.
The second assumption could lead to odd behavior because the stdout logger can
be overwritten to run arbitrary code. Currently this should be possible, but the
utility is much diminished because a stack overflow translates to an abort()
instead of a failure.
Upstream LLVM has changed slightly such that our PassWrapper.cpp no longer
comiles (travis errors). This updates the bundled LLVM to the latest nightly
which will hopefully fix the travis errors we're seeing.
The printing of the error message on stack overflow had two sometimes false
assumptions previously. The first is that a local task was always available (it
called Local::take) and the second is that it used println! instead of
manually writing.
The first assumption isn't necessarily true because while stack overflow will
likely only be detected in situations that a local task is available, it's not
guaranteed to always be in TLS. For example, during a println! call a task
may be blocking, causing it to be unavailable. By using Local::try_take(), we
can be resilient against these occurrences.
The second assumption could lead to odd behavior because the stdout logger can
be overwritten to run arbitrary code. Currently this should be possible, but the
utility is much diminished because a stack overflow translates to an abort()
instead of a failure.
This updates a number of ignore-test tests, and removes a few completely
outdated tests due to the feature being tested no longer being supported.
This brings a number of bench/shootout tests up to date so they're compiling
again. I make no claims to the performance of these benchmarks, it's just nice
to not have bitrotted code.
Closes#2604Closes#9407
Apparently weak linkage and dlopen aren't quite working out for applications
like servo on android. There appears to be a bug or two in how android loads
dynamic libraries and for some reason libservo.so isn't being found.
As a temporary solution, add an extern "C" function to libstd which can be
called if you have a handle to the crate map manually. When crawling the crate
map, we then check this manual symbol before falling back to the old solutions.
cc #11731
Upstream LLVM has changed slightly such that our PassWrapper.cpp no longer
comiles (travis errors). This updates the bundled LLVM to the latest nightly
which will hopefully fix the travis errors we're seeing.
- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.
tutorial: change "--" to an em-dash.
tutorial: change instances of "--" to em-dash.
Apparently weak linkage and dlopen aren't quite working out for applications
like servo on android. There appears to be a bug or two in how android loads
dynamic libraries and for some reason libservo.so isn't being found.
As a temporary solution, add an extern "C" function to libstd which can be
called if you have a handle to the crate map manually. When crawling the crate
map, we then check this manual symbol before falling back to the old solutions.
cc #11731
This updates a number of ignore-test tests, and removes a few completely
outdated tests due to the feature being tested no longer being supported.
This brings a number of bench/shootout tests up to date so they're compiling
again. I make no claims to the performance of these benchmarks, it's just nice
to not have bitrotted code.
Closes#2604Closes#9407
This patch series does a couple things:
* replaces manual `Hash` implementations with `#[deriving(Hash)]`
* adds `Hash` back to `std::prelude`
* minor cleanup of whitespace and variable names.
Closes#12474 (rustc: Don't error on the rlib symlinks) r=brson
Closes#12475 (Use lines_any() when parsing output form "ar") r=brson
Closes#12476 (Remove some obsolete ignored tests) r=alexcrichton
Closes#12481 (Make .swap_remove return Option<T>) r=brson
Closes#12485 (Remove some non-essential trait re-exports from the prelude.) r=brson
Closes#12489 (Handle multibyte characters in source files better) r=alexcrichton
Closes#12494 (Mark by-value parameters that are passed on the stack as nocapture) r=nmatsakis
Closes#12497 (syntax: allow stmt/expr macro invocations to be delimited by {}) r=alexcrichton
Closes#12508 (Match binding is assignment) r=nmatsakis
Closes#12513 (Run the travis build as one large command) r=huonw
Closes#12515 (Update source code layout in src/) r=alexcrichton
Closes#12521 (Tutorial: Add std::num::sqrt to the example) r=cmr
Closes#12529 (test: single-variant enum can't be dereferenced) r=huonw
In its first pass, namely gather_loans, the borrow checker tracks the
initialization sites among other things it does. It does so for let
bindings with initializers but not for bindings in match arms, which are
effectively also assignments. This patch does that for borrow checker.
Closes#12452.
The by-value argument is a copy that is only valid for the duration of
the function call, therefore keeping any pointer to it that outlives the
call is illegal.
They are still are not completely correct, since it does not handle
graphemes at all, just codepoints, but at least it handles the common
case correctly.
The calculation was previously very wrong (rather than just a little bit
wrong): it wasn't accounting for the fact that every character is 1
byte, and so multibyte characters were pretending to be zero width.
cc #8706
file.
Previously multibyte UTF-8 chars were being recorded as byte offsets
from the start of the file, and then later compared against global byte
positions, resulting in the compiler possibly thinking it had a byte
position pointing inside a multibyte character, if there were multibyte
characters in any non-crate files. (Although, sometimes the byte offsets
line up just right to not ICE, but that was a coincidence.)
Fixes#11136.
Fixes#11178.
`.reserve_exact` can cause pathological O(n^2) behaviour, so providing a
`.reserve` that ensures that capacity doubles (if you step 1, 2, ..., n)
is more efficient.
cc #11949