This was parsed by the parser but completely ignored; not even stored in
the AST!
This breaks code that looks like:
static X: &'static [u8] = &'static [1, 2, 3];
Change this code to the shorter:
static X: &'static [u8] = &[1, 2, 3];
Closes#15312.
[breaking-change]
r? @nick29581
This implementation does have the minor issue of not handling things correctly when a codepoint is split across multiple writes or reads, but its better than not having unicode support at all.
Adds a Windows specific struct `WindowsTTY` in `libnative` and make `tty_open` create that struct on Windows. Adds needed functions and constants to `c_win32.rs`.
Libuv still needs to be updated before #15028 can be closed.
It was required to get iOS compilable but since
that time a couple of changes were introduced
which cause the same bug to re-appear and broke
build anyway. Fixing all of them doesn’t look a
viable alternative to me as it will pollute the
code too much.
So it should be fixed from LLVM side and I hope
LLVM will upstream corresponding changes in a
month.
Meanwhile, who wants to play with Rust on iOS is
better to use a fork which uses patched LLVM:
https://github.com/vhbit/rust/tree/ios . It may
lag behind master a bit, but it is Travis-checked
to compile successfully.
Here's the issue: https://github.com/rust-lang/rust/issues/15333
Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
This was parsed by the parser but completely ignored; not even stored in
the AST!
This breaks code that looks like:
static X: &'static [u8] = &'static [1, 2, 3];
Change this code to the shorter:
static X: &'static [u8] = &[1, 2, 3];
Closes#15312.
[breaking-change]
It was required to get iOS compilable but since
that time a couple of changes were introduced
which cause the same bug to re-appear and broke
build anyway. Fixing all of them doesn’t look a
viable alternative to me as it will pollute the
code too much.
So it should be fixed from LLVM side and I hope
LLVM will upstream corresponding changes in a
month.
Meanwhile, who wants to play with Rust on iOS is
better to use a fork which uses patched LLVM:
https://github.com/vhbit/rust/tree/ios . It may
lag behind master a bit, but it is Travis-checked
to compile successfully.
In C, `ctime(t)` is equivalent to `asctime(localtime(t))`, so the result should depend on the local timezone. Current `ctime` is compatible with `asctime` in C, not `ctime`.
This commit renames `ctime` to `asctime` and adds `ctime` which converts the time to the local timezone before formatting it.
This commit also fixes the documentation of them. Current documentation of `ctime` says it returns "a string of the current time." However, it actually returns a string of the time represented as `self`, not the time when it is called.
parameters.
This can break code that mistakenly used type parameters in place of
`Self`. For example, this will break:
trait Foo {
fn bar<X>(u: X) -> Self {
u
}
}
Change this code to not contain a type error. For example:
trait Foo {
fn bar<X>(_: X) -> Self {
self
}
}
Closes#15172.
[breaking-change]
r? @alexcrichton
Closes#15276 (Guide: if)
Closes#15280 (std::os - Add join_paths, make setenv non-utf8 capable)
Closes#15314 (Guide: functions)
Closes#15327 (Simplify PatIdent to contain an Ident rather than a Path)
Closes#15340 (Guide: add mutable binding section)
Closes#15342 (Fix ICE with nested macro_rules!-style macros)
Closes#15350 (Remove duplicated slash in install script path)
Closes#15351 (correct a few spelling mistakes in the tutorial)
Closes#15352 (librustc: Have the kind checker check sub-bounds in trait casts.)
Closes#15359 (Fix spelling errors.)
Closes#15361 (Rename set_broadast() to set_broadcast().)
Closes#15366 (Simplify creating a parser from a token tree)
Closes#15367 (Add examples for StrVector methods)
Closes#15372 (Vec::grow should use reserve_additional, Vec::reserve should check against capacity)
Closes#15373 (Fix minor issues in the documentation of libtime.)
- When the timezone is UTC, the "zone" field of the RFC 822 format is
"GMT" (or "UT"), not "UTC."
- Although the name of `rfc3999` refers to RFC 3999, the documentation
of it refers only to ISO 8601. This commit adds a description of the
relation between ISO 8601 and RFC 3999.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This can break code that looked like:
struct S<T> {
val: T,
}
trait Gettable<T> {
...
}
impl<T: Copy> Gettable<T> for S<T> {
...
}
let t: Box<S<String>> = box S {
val: "one".to_string(),
};
let a = t as Box<Gettable<String>>;
// ^ note no `Copy` bound
Change this code to:
impl<T> Gettable<T> for S<T> {
// ^ remove `Copy` bound
...
}
Closes#14061.
[breaking-change]
Rationale: for what appear to be historical reasons only, the PatIdent contains
a Path rather than an Ident. This means that there are many places in the code
where an ident is artificially promoted to a path, and---much more problematically---
a bunch of elements from a path are simply thrown away, which seems like an invitation
to some really nasty bugs.
This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident
and a span.
This commit changes `os` in three ways:
* It adds a `join_paths` function that is the converse to `split_paths`,
easing manipulation of the `PATH` environment variable according to
platform conventions.
* **Breaking change**: It changes `split_paths` to no longer drop empty paths, since they are
meaningful to some shells (where they are synonymous with the current
working directory).
* It changes `setenv` to take a `BytesContainer` rather than a `&str`
value, since environment variables may have non-utf8 values on some
platforms. Since `&str` is a `BytesContainer`, this is *not* a
breaking change.
Along the way, it also refactors the `split_paths` function so that
`cfg` switches are applied internally (and the function header is given
only once). This fixes a bug: the doc comment had an example for only
one platform.
[breaking-change]
This was causing lots of ICEs in cargo. I sadly wasn't ever able to reduce the
test case down, but I presume that's because it has to do with node id
collisions which are pretty difficult to turn up...
This was causing lots of ICEs in cargo. I sadly wasn't ever able to reduce the
test case down, but I presume that's because it has to do with node id
collisions which are pretty difficult to turn up...
In C, `ctime(t)` is equivalent to `asctime(localtime(t))`, so the result
should depend on the local timezone. Current `ctime` is compatible with
`asctime` in C, not `ctime`.
This commit renames `ctime` to `asctime` and adds `ctime` which converts
the time to the local timezone before formatting it.
This commit also fixes the documentation of them. Current documentation
of `ctime` says it returns "a string of the current time." However, it
actually returns a string of the time represented as `self`, not the
time when it is called.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
One of the examples in the docs on adding documentation to rust code has an error that will cause the function to run endlessly rather than return the desired result, should someone actually implement this for some reason. While the error does not hinder the explanation of documenting code, it does look better if it is corrected.
So far, type names generated for debuginfo where a bit sketchy. It was not clearly defined when a name should be fully qualified and when not, if region parameters should be shown or not, and other things like that.
This commit makes the debuginfo module responsible for creating type names instead of using `ppaux::ty_to_str()` and brings type names (as they show up in the DWARF information) in line with GCC and Clang:
* The name of the type being described is unqualified. It's path is defined by its position in the namespace hierarchy.
* Type arguments are always fully qualified, no matter if they would actually be in scope at the type definition location.
Care is also taken to make type names consistent across crate boundaries. That is, the code now tries make the type name the same, regardless if the type is in the local crate or reconstructed from metadata. Otherwise LLVM will complain about violating the one-definition-rule when using link-time-optimization.
This commit also removes all source location information from type descriptions because these cannot be reconstructed for types instantiated from metadata. Again, with LTO enabled, this can lead to two versions of the debuginfo type description, one with and one without source location information, which then triggers the LLVM ODR assertion.
Fortunately, source location information about types is rarely used, so this has little impact. Once source location information is preserved in metadata (#1972) it can also be re-enabled for type descriptions.
`RUSTFLAGS=-g make check` no works again for me locally, including the LTO test cases (note that I've taken care of #15156 by reverting the change in LLVM that @luqmana identified as the culprit for that issue).
I believe there's more commonality to be found there but maybe small steps are better. I'm also in the process of documenting what I can, I will see if I can add it to this PR.
It also seems to me that ideally some of this stuff (especially the pattern sanity check) could live as a separate compiler-agnostic module but I understand this may not be the right time (if not the worst) to start the process of modularising rustc.
The current implementation of `rotate_left` and `rotate_right` are incorrect when the rotation amount is 0, or a multiple of the input's bitsize. When `n = 0`, the expression
(self >> n) | (self << ($BITS - n))
results in a shift left by `$BITS` bits, which is undefined behavior (see https://github.com/rust-lang/rust/issues/10183), and currently results in a hardcoded `-1` value, instead of the original input value. Reducing `($BITS - n)` modulo `$BITS`, simplified to `(-n % $BITS)`, fixes this problem.