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 7 pull requests #115537

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
456007a
Emit error instead of ICE when optimized MIR is missing
Enselic Aug 29, 2023
7a6b52b
RPITITs are considered object-safe, they're always on Self:Sized methods
compiler-errors Sep 2, 2023
07fc644
Do not require associated types with Self: Sized to uphold bounds whe…
compiler-errors Sep 2, 2023
f686bd8
Take `&mut Results` in `ResultsVisitor`
Jarcho Sep 2, 2023
789451b
Allow `large_assignments` for Box/Arc/Rc initialization
Enselic Sep 3, 2023
8c667fe
Don't ICE on associated type projection without feature gate
compiler-errors Sep 3, 2023
eba5b44
Add OnceHelp lint level (same as OnceNote, except for help)
Urgau Jul 25, 2023
efbe445
Add help to allow lint for the implied by suggestion
Urgau Jul 25, 2023
9190e96
Adjust clippy tests with new rustc help suggestion for lints
Urgau Aug 1, 2023
56d10a8
provide more useful info for DefId Debug
ouz-a Sep 4, 2023
acefeb7
Rollup merge of #114089 - Urgau:allow-with-implied-by, r=petrochenkov
matthiaskrgr Sep 4, 2023
773b785
Rollup merge of #115353 - Enselic:no-optimized-mir, r=oli-obk
matthiaskrgr Sep 4, 2023
257e5ec
Rollup merge of #115467 - compiler-errors:assoc-ty-object-safety, r=o…
matthiaskrgr Sep 4, 2023
5adacdf
Rollup merge of #115488 - Jarcho:mut_result_visitor, r=oli-obk
matthiaskrgr Sep 4, 2023
f04dcd5
Rollup merge of #115492 - Enselic:large-box-move, r=oli-obk
matthiaskrgr Sep 4, 2023
7f93014
Rollup merge of #115519 - compiler-errors:next-solver-assoc-ice, r=lcnr
matthiaskrgr Sep 4, 2023
9e26c90
Rollup merge of #115534 - ouz-a:smir_def, r=oli-obk
matthiaskrgr Sep 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro

fn visit_statement_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
flow_state: &Flows<'cx, 'tcx>,
stmt: &'cx Statement<'tcx>,
location: Location,
Expand Down Expand Up @@ -673,7 +673,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro

fn visit_terminator_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
flow_state: &Flows<'cx, 'tcx>,
term: &'cx Terminator<'tcx>,
loc: Location,
Expand Down Expand Up @@ -784,7 +784,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro

fn visit_terminator_after_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
flow_state: &Flows<'cx, 'tcx>,
term: &'cx Terminator<'tcx>,
loc: Location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn annotation_type_for_level(level: Level) -> AnnotationType {
}
Level::Warning(_) => AnnotationType::Warning,
Level::Note | Level::OnceNote => AnnotationType::Note,
Level::Help => AnnotationType::Help,
Level::Help | Level::OnceHelp => AnnotationType::Help,
// FIXME(#59346): Not sure how to map this level
Level::FailureNote => AnnotationType::Error,
Level::Allow => panic!("Should not call with Allow"),
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ impl Diagnostic {
| Level::Note
| Level::OnceNote
| Level::Help
| Level::OnceHelp
| Level::Allow
| Level::Expect(_) => false,
}
Expand Down Expand Up @@ -532,6 +533,13 @@ impl Diagnostic {
self
}

/// Prints the span with a help above it.
/// This is like [`Diagnostic::help()`], but it gets its own span.
pub fn help_once(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.sub(Level::OnceHelp, msg, MultiSpan::new(), None);
self
}

/// Add a help message attached to this diagnostic with a customizable highlighted message.
pub fn highlighted_help(&mut self, msg: Vec<(String, Style)>) -> &mut Self {
self.sub_with_highlights(Level::Help, msg, MultiSpan::new(), None);
Expand Down
8 changes: 5 additions & 3 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ impl HandlerInner {
debug!(?self.emitted_diagnostics);
let already_emitted_sub = |sub: &mut SubDiagnostic| {
debug!(?sub);
if sub.level != Level::OnceNote {
if sub.level != Level::OnceNote && sub.level != Level::OnceHelp {
return false;
}
let mut hasher = StableHasher::new();
Expand Down Expand Up @@ -1792,6 +1792,8 @@ pub enum Level {
/// A note that is only emitted once.
OnceNote,
Help,
/// A help that is only emitted once.
OnceHelp,
FailureNote,
Allow,
Expect(LintExpectationId),
Expand All @@ -1816,7 +1818,7 @@ impl Level {
Note | OnceNote => {
spec.set_fg(Some(Color::Green)).set_intense(true);
}
Help => {
Help | OnceHelp => {
spec.set_fg(Some(Color::Cyan)).set_intense(true);
}
FailureNote => {}
Expand All @@ -1831,7 +1833,7 @@ impl Level {
Fatal | Error { .. } => "error",
Warning(_) => "warning",
Note | OnceNote => "note",
Help => "help",
Help | OnceHelp => "help",
FailureNote => "failure-note",
Allow => panic!("Shouldn't call on allowed error"),
Expect(_) => panic!("Shouldn't call on expected error"),
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_middle/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ pub fn explain_lint_level_source(
err.note_once(format!(
"`{flag} {hyphen_case_lint_name}` implied by `{flag} {hyphen_case_flag_val}`"
));
err.help_once(format!(
"to override `{flag} {hyphen_case_flag_val}` add `#[allow({name})]`"
));
}
}
LintLevelSource::Node { name: lint_attr_name, span, reason, .. } => {
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_mir_dataflow/src/framework/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ where

fn visit_block_start(
&mut self,
_results: &Results<'tcx, A>,
_results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_block_data: &mir::BasicBlockData<'tcx>,
_block: BasicBlock,
Expand All @@ -550,7 +550,7 @@ where

fn visit_block_end(
&mut self,
_results: &Results<'tcx, A>,
_results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_block_data: &mir::BasicBlockData<'tcx>,
_block: BasicBlock,
Expand All @@ -562,7 +562,7 @@ where

fn visit_statement_before_primary_effect(
&mut self,
results: &Results<'tcx, A>,
results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_statement: &mir::Statement<'tcx>,
_location: Location,
Expand All @@ -575,7 +575,7 @@ where

fn visit_statement_after_primary_effect(
&mut self,
results: &Results<'tcx, A>,
results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_statement: &mir::Statement<'tcx>,
_location: Location,
Expand All @@ -586,7 +586,7 @@ where

fn visit_terminator_before_primary_effect(
&mut self,
results: &Results<'tcx, A>,
results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
Expand All @@ -599,7 +599,7 @@ where

fn visit_terminator_after_primary_effect(
&mut self,
results: &Results<'tcx, A>,
results: &mut Results<'tcx, A>,
state: &Self::FlowState,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_mir_dataflow/src/framework/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {

fn visit_block_start(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_block_data: &'mir mir::BasicBlockData<'tcx>,
_block: BasicBlock,
Expand All @@ -46,7 +46,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
/// its `statement_effect`.
fn visit_statement_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_statement: &'mir mir::Statement<'tcx>,
_location: Location,
Expand All @@ -57,7 +57,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
/// statement applied to `state`.
fn visit_statement_after_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_statement: &'mir mir::Statement<'tcx>,
_location: Location,
Expand All @@ -68,7 +68,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
/// its `terminator_effect`.
fn visit_terminator_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_terminator: &'mir mir::Terminator<'tcx>,
_location: Location,
Expand All @@ -81,7 +81,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
/// The `call_return_effect` (if one exists) will *not* be applied to `state`.
fn visit_terminator_after_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_terminator: &'mir mir::Terminator<'tcx>,
_location: Location,
Expand All @@ -90,7 +90,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {

fn visit_block_end(
&mut self,
_results: &R,
_results: &mut R,
_state: &Self::FlowState,
_block_data: &'mir mir::BasicBlockData<'tcx>,
_block: BasicBlock,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/dataflow_const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ impl<'mir, 'tcx>

fn visit_statement_before_primary_effect(
&mut self,
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
statement: &'mir Statement<'tcx>,
location: Location,
Expand All @@ -417,7 +417,7 @@ impl<'mir, 'tcx>

fn visit_statement_after_primary_effect(
&mut self,
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
statement: &'mir Statement<'tcx>,
location: Location,
Expand All @@ -443,7 +443,7 @@ impl<'mir, 'tcx>

fn visit_terminator_before_primary_effect(
&mut self,
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
terminator: &'mir Terminator<'tcx>,
location: Location,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ impl<'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>

fn visit_statement_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
state: &Self::FlowState,
_statement: &'mir Statement<'tcx>,
loc: Location,
Expand All @@ -824,7 +824,7 @@ impl<'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>

fn visit_terminator_before_primary_effect(
&mut self,
_results: &R,
_results: &mut R,
state: &Self::FlowState,
_terminator: &'mir Terminator<'tcx>,
loc: Location,
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_monomorphize/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ monomorphize_large_assignments =
.label = value moved from here
.note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`

monomorphize_no_optimized_mir =
missing optimized MIR for an item in the crate `{$crate_name}`
.note = missing optimized MIR for this item (was the crate `{$crate_name}` compiled with `--emit=metadata`?)

monomorphize_recursion_limit =
reached the recursion limit while instantiating `{$shrunk}`
.note = `{$def_path_str}` defined here
Expand Down
Loading
Loading