Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #65070

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8e3b9d2
Stabilize todo macro
Jun 15, 2019
560bf1b
Update src/libcore/macros.rs
Sep 4, 2019
711f673
Update macros.rs
Sep 4, 2019
445e735
Prevent rustdoc feature to be passed down to doctests
GuillaumeGomez Sep 25, 2019
366fdeb
Add new rustdoc-ui test to ensuire that rustdoc feature isn't passed …
GuillaumeGomez Sep 30, 2019
2ab7a67
Replace mentions of IRC with Discord
Oct 2, 2019
9fbb2a9
Fix missing calls to drop on unwind with lto=fat; issue 64655.
pnkfelix Oct 2, 2019
a371972
Regression tests for issue 64655.
pnkfelix Oct 2, 2019
3adcc3e
fix typo
pnkfelix Oct 2, 2019
c80ffcb
metadata: Remove `CrateMetadata::imported_name`
petrochenkov Sep 29, 2019
45d168a
metadata: Do not pass crate name after renaming to `register_crate`
petrochenkov Sep 29, 2019
cea2462
metadata: Remove `locator::Context::ident`
petrochenkov Sep 29, 2019
2293bdd
metadata: Simplify interface of `resolve_crate`
petrochenkov Sep 29, 2019
61a75af
metadata: Remove `CrateMetadata::host_lib`
petrochenkov Oct 1, 2019
498d908
metadata: Remove `CrateMetadata::name`
petrochenkov Oct 2, 2019
2d827b0
metadata: Remove unused `Option` from `fn dlsym_proc_macros`
petrochenkov Oct 2, 2019
94525e5
Dual proc macros: Use crate disambiguator from the target crate
petrochenkov Oct 2, 2019
a8d70d1
Add visit_projection_elem method to visitors
spastorino Oct 2, 2019
287ceed
Deprecate `#![plugin]` and `#[plugin_registrar]`.
Centril Sep 21, 2019
1b8ec97
plugin_registrary: use normal deprecation instead of hard coded warning.
Centril Oct 3, 2019
d1f95ef
--bless ui-fulldeps tests
Centril Oct 3, 2019
e7e6dec
Apply suggestions from code review
pnkfelix Oct 3, 2019
5e7e8cd
Update attributes.rs
pnkfelix Oct 3, 2019
71e5f78
Update issue-64655-extern-rust-must-allow-unwind.rs
pnkfelix Oct 3, 2019
4396a1c
add regression test for #60218
nikomatsakis Sep 20, 2019
e86af1b
Add long error explanation for E0556
GuillaumeGomez Oct 3, 2019
1d49f9a
update ui tests
GuillaumeGomez Oct 3, 2019
126bf3b
typo: fix typo in E0392
mathstuf Oct 3, 2019
b9ed642
Make visit_projection iterative
spastorino Oct 2, 2019
25c6376
Rollup merge of #61879 - stjepang:stabilize-todo, r=withoutboats
Centril Oct 3, 2019
fd7b2f8
Rollup merge of #64675 - Centril:deprecate-plugin, r=oli-obk
Centril Oct 3, 2019
e82d1d7
Rollup merge of #64706 - nikomatsakis:issue-60218-test-case, r=centril
Centril Oct 3, 2019
3c31eb3
Rollup merge of #64741 - GuillaumeGomez:prevent-rustdoc-feature-docte…
Centril Oct 3, 2019
38d76d8
Rollup merge of #65004 - BO41:mentions, r=alexcrichton
Centril Oct 3, 2019
527a747
Rollup merge of #65020 - pnkfelix:targetted-fix-for-always-marking-ru…
Centril Oct 3, 2019
7af56ad
Rollup merge of #65026 - petrochenkov:ice1, r=eddyb
Centril Oct 3, 2019
f258e49
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r…
Centril Oct 3, 2019
320b931
Rollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk
Centril Oct 3, 2019
dd97e17
Rollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril
Centril Oct 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In the Rust community we strive to go the extra step to look out for each other.

And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.

The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
The enforcement policies listed above apply to all official Rust venues; including all communication channels (Rust Discord server, Rust Zulip server); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.

*Adapted from the [Node.js Policy on Trolling](https://blog.izs.me/2012/08/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*

Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ links to the major sections:
* [Helpful Links and Information](#helpful-links-and-information)

If you have questions, please make a post on [internals.rust-lang.org][internals] or
hop on the [Rust Discord server][rust-discord], [Rust Zulip server][rust-zulip] or [#rust-internals][pound-rust-internals].
hop on the [Rust Discord server][rust-discord] or [Rust Zulip server][rust-zulip].

As a reminder, all contributors are expected to follow our [Code of Conduct][coc].

Expand All @@ -25,7 +25,6 @@ to contribute to it in more detail than this document.
If this is your first time contributing, the [walkthrough] chapter of the guide
can give you a good example of how a typical contribution would go.

[pound-rust-internals]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
[internals]: https://internals.rust-lang.org
[rust-discord]: http://discord.gg/rust-lang
[rust-zulip]: https://rust-lang.zulipchat.com
Expand Down Expand Up @@ -404,7 +403,7 @@ If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.
There are a number of other ways to contribute to Rust that don't deal with
this repository.

Answer questions in [#rust][pound-rust], or on [users.rust-lang.org][users],
Answer questions in the _Get Help!_ channels from the [Rust Discord server][rust-discord], on [users.rust-lang.org][users],
or on [StackOverflow][so].

Participate in the [RFC process](https://github.com/rust-lang/rfcs).
Expand All @@ -413,7 +412,7 @@ Find a [requested community library][community-library], build it, and publish
it to [Crates.io](http://crates.io). Easier said than done, but very, very
valuable!

[pound-rust]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
[rust-discord]: https://discord.gg/rust-lang
[users]: https://users.rust-lang.org/
[so]: http://stackoverflow.com/questions/tagged/rust
[community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,17 @@ The Rust community congregates in a few places:

To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).

Rust has an [IRC] culture and most real-time collaboration happens in a
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
most popular channel is [#rust], a venue for general discussion about
Rust. And a good place to ask for help would be [#rust-beginners].
Most real-time collaboration happens in a variety of channels on the
[Rust Discord server][rust-discord], with channels dedicated for getting help,
community, documentation, and all major contribution areas in the Rust ecosystem.
A good place to ask for help would be the #help channel.

The [rustc guide] might be a good place to start if you want to find out how
various parts of the compiler work.

Also, you may find the [rustdocs for the compiler itself][rustdocs] useful.

[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
[rust-discord]: https://discord.gg/rust-lang
[rustc guide]: https://rust-lang.github.io/rustc-guide/about-this-guide.html
[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/

Expand Down
8 changes: 5 additions & 3 deletions src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ are:
`Config` struct.
* Adding a sanity check? Take a look at `bootstrap/sanity.rs`.

If you have any questions feel free to reach out on `#rust-infra` on IRC or ask on
internals.rust-lang.org. When you encounter bugs, please file issues on the
rust-lang/rust issue tracker.
If you have any questions feel free to reach out on `#infra` channel in the
[Rust Discord server][rust-discord] or ask on internals.rust-lang.org. When
you encounter bugs, please file issues on the rust-lang/rust issue tracker.

[rust-discord]: https://discord.gg/rust-lang
16 changes: 10 additions & 6 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ macro_rules! writeln {
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
/// will cause undefined behavior if the code is reached.
///
/// [`panic!`]: ../std/macro.panic.html
/// [`panic!`]: ../std/macro.panic.html
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
/// [`std::hint`]: ../std/hint/index.html
///
Expand All @@ -474,6 +474,7 @@ macro_rules! writeln {
/// This will always [`panic!`]
///
/// [`panic!`]: ../std/macro.panic.html
///
/// # Examples
///
/// Match arms:
Expand Down Expand Up @@ -525,6 +526,9 @@ macro_rules! unreachable {
/// code type-check, or if you're implementing a trait that requires multiple
/// methods, and you're only planning on using one of them.
///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
///
/// # Panics
///
/// This will always [panic!](macro.panic.html)
Expand Down Expand Up @@ -579,8 +583,10 @@ macro_rules! unimplemented {
/// Indicates unfinished code.
///
/// This can be useful if you are prototyping and are just looking to have your
/// code typecheck. `todo!` works exactly like `unimplemented!`. The only
/// difference between the two macros is the name.
/// code typecheck.
///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
///
/// # Panics
///
Expand All @@ -602,8 +608,6 @@ macro_rules! unimplemented {
/// `baz()`, so we can use `todo!`:
///
/// ```
/// #![feature(todo_macro)]
///
/// # trait Foo {
/// # fn bar(&self);
/// # fn baz(&self);
Expand All @@ -629,7 +633,7 @@ macro_rules! unimplemented {
/// }
/// ```
#[macro_export]
#[unstable(feature = "todo_macro", issue = "59277")]
#[stable(feature = "todo_macro", since = "1.39.0")]
macro_rules! todo {
() => (panic!("not yet implemented"));
($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
Expand Down
4 changes: 1 addition & 3 deletions src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ pub enum ExternCrateSource {
/// such ids
DefId,
),
// Crate is loaded by `use`.
Use,
/// Crate is implicitly loaded by an absolute path.
/// Crate is implicitly loaded by a path resolving through extern prelude.
Path,
}

Expand Down
58 changes: 38 additions & 20 deletions src/librustc/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ macro_rules! make_mir_visitor {
self.super_projection(base, projection, context, location);
}

fn visit_projection_elem(&mut self,
base: & $($mutability)? PlaceBase<'tcx>,
proj_base: & $($mutability)? [PlaceElem<'tcx>],
elem: & $($mutability)? PlaceElem<'tcx>,
context: PlaceContext,
location: Location) {
self.super_projection_elem(base, proj_base, elem, context, location);
}

fn visit_constant(&mut self,
constant: & $($mutability)? Constant<'tcx>,
location: Location) {
Expand Down Expand Up @@ -725,27 +734,36 @@ macro_rules! make_mir_visitor {
projection: & $($mutability)? [PlaceElem<'tcx>],
context: PlaceContext,
location: Location) {
if let [proj_base @ .., elem] = projection {
self.visit_projection(base, proj_base, context, location);
let mut cursor = projection;
while let [proj_base @ .., elem] = cursor {
cursor = proj_base;
self.visit_projection_elem(base, cursor, elem, context, location);
}
}

match elem {
ProjectionElem::Field(_field, ty) => {
self.visit_ty(ty, TyContext::Location(location));
}
ProjectionElem::Index(local) => {
self.visit_local(
local,
PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy),
location
);
}
ProjectionElem::Deref |
ProjectionElem::Subslice { from: _, to: _ } |
ProjectionElem::ConstantIndex { offset: _,
min_length: _,
from_end: _ } |
ProjectionElem::Downcast(_, _) => {
}
fn super_projection_elem(&mut self,
_base: & $($mutability)? PlaceBase<'tcx>,
_proj_base: & $($mutability)? [PlaceElem<'tcx>],
elem: & $($mutability)? PlaceElem<'tcx>,
_context: PlaceContext,
location: Location) {
match elem {
ProjectionElem::Field(_field, ty) => {
self.visit_ty(ty, TyContext::Location(location));
}
ProjectionElem::Index(local) => {
self.visit_local(
local,
PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy),
location
);
}
ProjectionElem::Deref |
ProjectionElem::Subslice { from: _, to: _ } |
ProjectionElem::ConstantIndex { offset: _,
min_length: _,
from_end: _ } |
ProjectionElem::Downcast(_, _) => {
}
}
}
Expand Down
52 changes: 39 additions & 13 deletions src/librustc_codegen_llvm/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,25 +273,51 @@ pub fn from_fn_attrs(
} else if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_ALLOCATOR_NOUNWIND) {
// Special attribute for allocator functions, which can't unwind
false
} else if let Some(id) = id {
} else if let Some(_) = id {
// rust-lang/rust#64655, rust-lang/rust#63909: to minimize
// risk associated with changing cases where nounwind
// attribute is attached, this code is deliberately mimicking
// old control flow based on whether `id` is `Some` or `None`.
//
// However, in the long term we should either:
// - fold this into final else (i.e. stop inspecting `id`)
// - or, adopt Rust PR #63909.
//
// see also Rust RFC 2753.

let sig = cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
if cx.tcx.is_foreign_item(id) {
// Foreign items like `extern "C" { fn foo(); }` are assumed not to
// unwind
false
} else if sig.abi != Abi::Rust && sig.abi != Abi::RustCall {
// Any items defined in Rust that *don't* have the `extern` ABI are
// defined to not unwind. We insert shims to abort if an unwind
// happens to enforce this.
false
} else {
// Anything else defined in Rust is assumed that it can possibly
// unwind
if sig.abi == Abi::Rust || sig.abi == Abi::RustCall {
// Any Rust method (or `extern "Rust" fn` or `extern
// "rust-call" fn`) is explicitly allowed to unwind
// (unless it has no-unwind attribute, handled above).
true
} else {
// Anything else is either:
//
// 1. A foreign item using a non-Rust ABI (like `extern "C" { fn foo(); }`), or
//
// 2. A Rust item using a non-Rust ABI (like `extern "C" fn foo() { ... }`).
//
// Foreign items (case 1) are assumed to not unwind; it is
// UB otherwise. (At least for now; see also
// rust-lang/rust#63909 and Rust RFC 2753.)
//
// Items defined in Rust with non-Rust ABIs (case 2) are also
// not supposed to unwind. Whether this should be enforced
// (versus stating it is UB) and *how* it would be enforced
// is currently under discussion; see rust-lang/rust#58794.
//
// In either case, we mark item as explicitly nounwind.
false
}
} else {
// assume this can possibly unwind, avoiding the application of a
// `nounwind` attribute below.
//
// (But: See comments in previous branch. Specifically, it is
// unclear whether there is real value in the assumption this
// can unwind. The conservatism here may just be papering over
// a real problem by making some UB a bit harder to hit.)
true
});

Expand Down
Loading