Skip to content

Rollup of 6 pull requests #86601

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

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
048fe53
Don't invoke the default panic hook from report_ice
bjorn3 May 24, 2021
0bc60c0
Change the ice hook for cg_clif to refer to cg_clif's issue tracker
bjorn3 May 24, 2021
bdfcb88
Use HTTPS links where possible
syvb Jun 23, 2021
49877dc
Use https for sourceforge during CI
dns2utf8 Jun 23, 2021
bcb7b39
Fetch expat from github because the project switched
dns2utf8 Jun 23, 2021
157898e
Point to the updated version of some dead links
syvb Jun 23, 2021
a141d29
Do not panic in `return_type_impl_trait`
JohnTitor Jun 21, 2021
462c740
Rename function name in comments
JohnTitor Jun 24, 2021
9323a28
Prefer "allow list" structure to check a type
JohnTitor Jun 24, 2021
3f14f4b
Use `#[non_exhaustive]` where appropriate
jhpratt Jun 24, 2021
a66fe66
Change how edition based future compatibility warnings are handled
rylev Jun 15, 2021
c345980
Address PR feedback
rylev Jun 16, 2021
8f3a16e
Add back missing doc
rylev Jun 17, 2021
56a7719
Fix new lints
rylev Jun 23, 2021
e7adb02
Fix new broken tests
rylev Jun 24, 2021
5c18ed3
Rollup merge of #85640 - bjorn3:custom_ice_hook, r=jackh726
m-ou-se Jun 24, 2021
3eaf6e4
Rollup merge of #86330 - rylev:update-fcw-handling, r=nikomatsakis
m-ou-se Jun 24, 2021
4138cf4
Rollup merge of #86505 - JohnTitor:fix-86483, r=jackh726
m-ou-se Jun 24, 2021
6041a32
Rollup merge of #86583 - dns2utf8:use_https, r=pietroalbini
m-ou-se Jun 24, 2021
7b661a6
Rollup merge of #86586 - Smittyvb:https-everywhere, r=petrochenkov
m-ou-se Jun 24, 2021
67b9a5b
Rollup merge of #86592 - jhpratt:non_exhaustive, r=JohnTitor
m-ou-se Jun 24, 2021
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 compiler/rustc_apfloat/tests/ieee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn fma() {
assert!(f1.is_negative() && f1.is_zero());
}

// Test x87 extended precision case from http://llvm.org/PR20728.
// Test x87 extended precision case from https://llvm.org/PR20728.
{
let mut m1 = X87DoubleExtended::from_u128(1).value;
let m2 = X87DoubleExtended::from_u128(1).value;
Expand Down
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
#![feature(rustc_private)]
#![feature(rustc_private, once_cell)]

extern crate rustc_data_structures;
extern crate rustc_driver;
extern crate rustc_interface;
extern crate rustc_session;
extern crate rustc_target;

use std::panic;
use std::lazy::SyncLazy;

use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry};
use rustc_interface::interface;
use rustc_session::config::ErrorOutputType;
use rustc_session::early_error;
use rustc_target::spec::PanicStrategy;

const BUG_REPORT_URL: &str = "https://github.com/bjorn3/rustc_codegen_cranelift/issues/new";

static DEFAULT_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> =
SyncLazy::new(|| {
let hook = panic::take_hook();
panic::set_hook(Box::new(|info| {
// Invoke the default handler, which prints the actual panic message and optionally a backtrace
(*DEFAULT_HOOK)(info);

// Separate the output with an empty line
eprintln!();

// Print the ICE message
rustc_driver::report_ice(info, BUG_REPORT_URL);
}));
hook
});

#[derive(Default)]
pub struct CraneliftPassesCallbacks {
time_passes: bool,
Expand All @@ -37,7 +58,7 @@ fn main() {
let start_rss = get_resident_set_size();
rustc_driver::init_rustc_env_logger();
let mut callbacks = CraneliftPassesCallbacks::default();
rustc_driver::install_ice_hook();
SyncLazy::force(&DEFAULT_HOOK); // Install ice hook
let exit_code = rustc_driver::catch_with_exit_code(|| {
let args = std::env::args_os()
.enumerate()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
// According to LLVM [1] building a nontemporal store must
// *always* point to a metadata value of the integer 1.
//
// [1]: http://llvm.org/docs/LangRef.html#store-instruction
// [1]: https://llvm.org/docs/LangRef.html#store-instruction
let one = self.cx.const_i32(1);
let node = llvm::LLVMMDNodeInContext(self.cx.llcx, &one, 1);
llvm::LLVMSetMetadata(store, llvm::MD_nontemporal as c_uint, node);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct CodegenCx<'ll, 'tcx> {
pub statics_to_rauw: RefCell<Vec<(&'ll Value, &'ll Value)>>,

/// Statics that will be placed in the llvm.used variable
/// See <http://llvm.org/docs/LangRef.html#the-llvm-used-global-variable> for details
/// See <https://llvm.org/docs/LangRef.html#the-llvm-used-global-variable> for details
pub used_statics: RefCell<Vec<&'ll Value>>,

pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn SetFunctionCallConv(fn_: &'a Value, cc: CallConv) {
// example happen for generics when using multiple codegen units. This function simply uses the
// value's name as the comdat value to make sure that it is in a 1-to-1 relationship to the
// function.
// For more details on COMDAT sections see e.g., http://www.airs.com/blog/archives/52
// For more details on COMDAT sections see e.g., https://www.airs.com/blog/archives/52
pub fn SetUniqueComdat(llmod: &Module, val: &'a Value) {
unsafe {
let name = get_value_name(val);
Expand Down
19 changes: 11 additions & 8 deletions compiler/rustc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,23 +1167,26 @@ pub fn catch_with_exit_code(f: impl FnOnce() -> interface::Result<()>) -> i32 {
static DEFAULT_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> =
SyncLazy::new(|| {
let hook = panic::take_hook();
panic::set_hook(Box::new(|info| report_ice(info, BUG_REPORT_URL)));
panic::set_hook(Box::new(|info| {
// Invoke the default handler, which prints the actual panic message and optionally a backtrace
(*DEFAULT_HOOK)(info);

// Separate the output with an empty line
eprintln!();

// Print the ICE message
report_ice(info, BUG_REPORT_URL);
}));
hook
});

/// Prints the ICE message, including backtrace and query stack.
/// Prints the ICE message, including query stack, but without backtrace.
///
/// The message will point the user at `bug_report_url` to report the ICE.
///
/// When `install_ice_hook` is called, this function will be called as the panic
/// hook.
pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
// Invoke the default handler, which prints the actual panic message and optionally a backtrace
(*DEFAULT_HOOK)(info);

// Separate the output with an empty line
eprintln!();

let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr(
rustc_errors::ColorConfig::Auto,
None,
Expand Down
22 changes: 11 additions & 11 deletions compiler/rustc_graphviz/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
//! Generate files suitable for use with [Graphviz](http://www.graphviz.org/)
//! Generate files suitable for use with [Graphviz](https://www.graphviz.org/)
//!
//! The `render` function generates output (e.g., an `output.dot` file) for
//! use with [Graphviz](http://www.graphviz.org/) by walking a labeled
//! use with [Graphviz](https://www.graphviz.org/) by walking a labeled
//! graph. (Graphviz can then automatically lay out the nodes and edges
//! of the graph, and also optionally render the graph as an image or
//! other [output formats](
//! http://www.graphviz.org/content/output-formats), such as SVG.)
//! https://www.graphviz.org/content/output-formats), such as SVG.)
//!
//! Rather than impose some particular graph data structure on clients,
//! this library exposes two traits that clients can implement on their
//! own structs before handing them over to the rendering function.
//!
//! Note: This library does not yet provide access to the full
//! expressiveness of the [DOT language](
//! http://www.graphviz.org/doc/info/lang.html). For example, there are
//! many [attributes](http://www.graphviz.org/content/attrs) related to
//! https://www.graphviz.org/doc/info/lang.html). For example, there are
//! many [attributes](https://www.graphviz.org/content/attrs) related to
//! providing layout hints (e.g., left-to-right versus top-down, which
//! algorithm to use, etc). The current intention of this library is to
//! emit a human-readable .dot file with very regular structure suitable
Expand Down Expand Up @@ -267,9 +267,9 @@
//!
//! # References
//!
//! * [Graphviz](http://www.graphviz.org/)
//! * [Graphviz](https://www.graphviz.org/)
//!
//! * [DOT language](http://www.graphviz.org/doc/info/lang.html)
//! * [DOT language](https://www.graphviz.org/doc/info/lang.html)

#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
Expand All @@ -292,7 +292,7 @@ pub enum LabelText<'a> {
LabelStr(Cow<'a, str>),

/// This kind of label uses the graphviz label escString type:
/// <http://www.graphviz.org/content/attrs#kescString>
/// <https://www.graphviz.org/content/attrs#kescString>
///
/// Occurrences of backslashes (`\`) are not escaped; instead they
/// are interpreted as initiating an escString escape sequence.
Expand All @@ -307,12 +307,12 @@ pub enum LabelText<'a> {
/// printed exactly as given, but between `<` and `>`. **No
/// escaping is performed.**
///
/// [html]: http://www.graphviz.org/content/node-shapes#html
/// [html]: https://www.graphviz.org/content/node-shapes#html
HtmlStr(Cow<'a, str>),
}

/// The style for a node or edge.
/// See <http://www.graphviz.org/doc/info/attrs.html#k:style> for descriptions.
/// See <https://www.graphviz.org/doc/info/attrs.html#k:style> for descriptions.
/// Note that some of these are not valid for edges.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum Style {
Expand Down Expand Up @@ -439,7 +439,7 @@ pub trait Labeller<'a> {
/// Maps `n` to one of the [graphviz `shape` names][1]. If `None`
/// is returned, no `shape` attribute is specified.
///
/// [1]: http://www.graphviz.org/content/node-shapes
/// [1]: https://www.graphviz.org/content/node-shapes
fn node_shape(&'a self, _node: &Self::Node) -> Option<LabelText<'a>> {
None
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ fn output_conflicts_with_dir(output_paths: &[PathBuf]) -> Option<PathBuf> {

fn escape_dep_filename(filename: &String) -> String {
// Apparently clang and gcc *only* escape spaces:
// http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
// https://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
filename.replace(" ", "\\ ")
}

Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_lint/src/array_into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_middle::ty;
use rustc_middle::ty::adjustment::{Adjust, Adjustment};
use rustc_session::lint::FutureBreakage;
use rustc_session::lint::FutureIncompatibilityReason;
use rustc_span::edition::Edition;
use rustc_span::symbol::sym;

declare_lint! {
Expand Down Expand Up @@ -37,10 +38,7 @@ declare_lint! {
"detects calling `into_iter` on arrays",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #66145 <https://github.com/rust-lang/rust/issues/66145>",
edition: None,
future_breakage: Some(FutureBreakage {
date: None
})
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
};
}

Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::subst::{GenericArgKind, Subst};
use rustc_middle::ty::Instance;
use rustc_middle::ty::{self, layout::LayoutError, Ty, TyCtxt};
use rustc_session::lint::FutureIncompatibilityReason;
use rustc_session::Session;
use rustc_span::edition::Edition;
use rustc_span::source_map::Spanned;
Expand Down Expand Up @@ -874,7 +875,7 @@ declare_lint! {
"detects anonymous parameters",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
edition: Some(Edition::Edition2018),
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
};
}

Expand Down Expand Up @@ -1663,7 +1664,7 @@ declare_lint! {
"`...` range patterns are deprecated",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
edition: Some(Edition::Edition2021),
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
}

Expand Down Expand Up @@ -1891,7 +1892,7 @@ declare_lint! {
"detects edition keywords being used as an identifier",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
edition: Some(Edition::Edition2018),
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
};
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ impl LintStore {
bug!("duplicate specification of lint {}", lint.name_lower())
}

if let Some(FutureIncompatibleInfo { edition, .. }) = lint.future_incompatible {
if let Some(edition) = edition {
if let Some(FutureIncompatibleInfo { reason, .. }) = lint.future_incompatible {
if let Some(edition) = reason.edition() {
self.lint_groups
.entry(edition.lint_name())
.or_insert(LintGroup {
Expand Down
Loading