melt the ICE when lowering an impossible range
Emit a fatal error instead of panicking when HIR lowering encounters a range with no `end` point.
This involved adding a method to wire up `LoweringContext::span_fatal`.
Fixes#32245 (cc @nodakai).
r? @nrc
docs: make some text changes on Section `Macros`
(1) In contrast to `that`, `so that` expresses `result` indicated by the sentence, not `reason`;
(2) `block` is an expression, and may be have an expression, so I add `optionally an expression` to make more precise;
~~(3) When I read here, I was confused with what `the child` referred to. After modification, it would be better.~~
Fix missing console output in `Barrier` example
The `println!` calls in the previous version were never shown (at least
not in the playpen) because the main thread is finished before all the
spawned child threads were synchronized. This commit adds a join for
each thread handle to wait in the main thread until all child threads
are finished.
r? @steveklabnik
Remove trailing whitespace at the end of lines
According the rules of styling Rust code there should not be trailing whitespace at the end of lines or files. I thought that it might be good to remove trailing whitespace from other files also, if it does not break anything.
mk: Add `-C metadata` for compiling crates we ship
This should re-enable all external builds of crates with the same name. Right
now Cargo doesn't pass `-C metadata` for the top-level library being compiled,
so if that library is called `libc`, for example, then it won't be able to link
to the standard library which *also* has a `libc` library compiled without `-C
metadata`. This can result in naming conflicts which need to be resolved.
By passing `-C metadata` to the in-tree crates we ship it should add some extra
salt to all symbol names to ensure that they don't collide.
Closes#32532
This should re-enable all external builds of crates with the same name. Right
now Cargo doesn't pass `-C metadata` for the top-level library being compiled,
so if that library is called `libc`, for example, then it won't be able to link
to the standard library which *also* has a `libc` library compiled without `-C
metadata`. This can result in naming conflicts which need to be resolved.
By passing `-C metadata` to the in-tree crates we ship it should add some extra
salt to all symbol names to ensure that they don't collide.
This is the same approach taken in #24270, except that this
should not be a breaking change because it only changes the output
of hash functions, which nobody should be relying on.
add regression test for try!
Our widespread internal use of `try` was like a regression test. Now that most of `try!`s have been converted to `?`, lets add a proper regression test.
cc @bstrie
Flatten rustc and rustc_trans module hierarchy slightly.
The following moves were made, in the name of sanity/simplicity:
* `rustc::middle::{cfg, infer, traits, ty}` to `rustc::{cfg, infer, traits, ty}`
* `rustc::middle::subst` to `rustc::ty::subst`
* `rustc_trans::trans::*` to `rustc_trans::*`
* `rustc_trans::save` to `rustc_save_analysis` (cc @nrc)
I've rebased a larger WIP branch on top of this and the only conflicts were in imports, but YMMV.
Adding these "known" values to the table of used ids is only required
when embedding markdown into a rustdoc html page and may yield
unexpected results when rendering a standalone `*.md` file.
This adds checks to ensure that:
* link anchors refer to existing id's on the target page
* id's are unique within an html document
* page redirects are valid