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 #92053

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d9f82f9
Remove Select trait
calebzulawski Dec 4, 2021
81484a3
Merge portable-simd#207 - ./feature/simplify-select
workingjubilee Dec 5, 2021
533f0fc
Use relative intrinsics paths for bitmasks
workingjubilee Dec 11, 2021
c771970
:arrow_up: rust-analyzer
lnicola Dec 14, 2021
c4bafaf
Remove `in_band_lifetimes` for `rustc_passes`
pitaj Dec 14, 2021
fed881a
Remove `in_band_lifetimes` from `rustc_mir_dataflow`
LegionMammal978 Dec 14, 2021
9c83b56
Mark defaulted `PartialEq`/`PartialOrd` methods as const
ecstatic-morse Nov 30, 2021
1606335
Test const impl of `cmp` traits
ecstatic-morse Dec 1, 2021
2049287
Disable test on bootstrap compiler
ecstatic-morse Dec 17, 2021
23c172f
Merge commit '533f0fc81ab9ba097779fcd27c8f9ea12261fef5' into psimd
petrochenkov Dec 17, 2021
57c0cb7
Use debug section for .rustc
nikic Dec 17, 2021
b656384
Update stdlib to the 2021 edition
rukai Dec 17, 2021
12745ac
Rollup merge of #91439 - ecstatic-morse:const-cmp-trait-default-metho…
matthiaskrgr Dec 18, 2021
a5732ac
Rollup merge of #91896 - pitaj:91867-passes, r=michaelwoerister
matthiaskrgr Dec 18, 2021
c72b921
Rollup merge of #91909 - lnicola:rust-analyzer-2021-12-14, r=lnicola
matthiaskrgr Dec 18, 2021
91d3b73
Rollup merge of #91922 - LegionMammal978:less-inband-mir_dataflow, r=…
matthiaskrgr Dec 18, 2021
7c059d0
Rollup merge of #92028 - petrochenkov:psimd, r=Mark-Simulacrum
matthiaskrgr Dec 18, 2021
b8d0fa7
Rollup merge of #92029 - nikic:section-flags-fix, r=davidtwco
matthiaskrgr Dec 18, 2021
f3bf520
Rollup merge of #92030 - rukai:stdlib2021, r=m-ou-se
matthiaskrgr Dec 18, 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
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ pub fn create_compressed_metadata_file(
return compressed.to_vec();
};
let section = file.add_section(
file.segment_name(StandardSegment::Data).to_vec(),
file.segment_name(StandardSegment::Debug).to_vec(),
b".rustc".to_vec(),
SectionKind::Data,
SectionKind::Debug,
);
let offset = file.append_section_data(section, &compressed, 1);

Expand Down
32 changes: 16 additions & 16 deletions compiler/rustc_mir_dataflow/src/framework/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait Direction {
/// Applies all effects between the given `EffectIndex`s.
///
/// `effects.start()` must precede or equal `effects.end()` in this direction.
fn apply_effects_in_range<A>(
fn apply_effects_in_range<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
Expand All @@ -27,23 +27,23 @@ pub trait Direction {
) where
A: Analysis<'tcx>;

fn apply_effects_in_block<A>(
fn apply_effects_in_block<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
block_data: &mir::BasicBlockData<'tcx>,
) where
A: Analysis<'tcx>;

fn gen_kill_effects_in_block<A>(
fn gen_kill_effects_in_block<'tcx, A>(
analysis: &A,
trans: &mut GenKillSet<A::Idx>,
block: BasicBlock,
block_data: &mir::BasicBlockData<'tcx>,
) where
A: GenKillAnalysis<'tcx>;

fn visit_results_in_block<F, R>(
fn visit_results_in_block<'mir, 'tcx, F, R>(
state: &mut F,
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
Expand All @@ -52,7 +52,7 @@ pub trait Direction {
) where
R: ResultsVisitable<'tcx, FlowState = F>;

fn join_state_into_successors_of<A>(
fn join_state_into_successors_of<'tcx, A>(
analysis: &A,
tcx: TyCtxt<'tcx>,
body: &mir::Body<'tcx>,
Expand All @@ -72,7 +72,7 @@ impl Direction for Backward {
false
}

fn apply_effects_in_block<A>(
fn apply_effects_in_block<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
Expand All @@ -92,7 +92,7 @@ impl Direction for Backward {
}
}

fn gen_kill_effects_in_block<A>(
fn gen_kill_effects_in_block<'tcx, A>(
analysis: &A,
trans: &mut GenKillSet<A::Idx>,
block: BasicBlock,
Expand All @@ -112,7 +112,7 @@ impl Direction for Backward {
}
}

fn apply_effects_in_range<A>(
fn apply_effects_in_range<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
Expand Down Expand Up @@ -189,7 +189,7 @@ impl Direction for Backward {
analysis.apply_statement_effect(state, statement, location);
}

fn visit_results_in_block<F, R>(
fn visit_results_in_block<'mir, 'tcx, F, R>(
state: &mut F,
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
Expand Down Expand Up @@ -221,7 +221,7 @@ impl Direction for Backward {
vis.visit_block_start(state, block_data, block);
}

fn join_state_into_successors_of<A>(
fn join_state_into_successors_of<'tcx, A>(
analysis: &A,
_tcx: TyCtxt<'tcx>,
body: &mir::Body<'tcx>,
Expand Down Expand Up @@ -294,7 +294,7 @@ impl Direction for Forward {
true
}

fn apply_effects_in_block<A>(
fn apply_effects_in_block<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
Expand All @@ -314,7 +314,7 @@ impl Direction for Forward {
analysis.apply_terminator_effect(state, terminator, location);
}

fn gen_kill_effects_in_block<A>(
fn gen_kill_effects_in_block<'tcx, A>(
analysis: &A,
trans: &mut GenKillSet<A::Idx>,
block: BasicBlock,
Expand All @@ -334,7 +334,7 @@ impl Direction for Forward {
analysis.terminator_effect(trans, terminator, location);
}

fn apply_effects_in_range<A>(
fn apply_effects_in_range<'tcx, A>(
analysis: &A,
state: &mut A::Domain,
block: BasicBlock,
Expand Down Expand Up @@ -407,7 +407,7 @@ impl Direction for Forward {
}
}

fn visit_results_in_block<F, R>(
fn visit_results_in_block<'mir, 'tcx, F, R>(
state: &mut F,
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
Expand Down Expand Up @@ -438,7 +438,7 @@ impl Direction for Forward {
vis.visit_block_end(state, block_data, block);
}

fn join_state_into_successors_of<A>(
fn join_state_into_successors_of<'tcx, A>(
analysis: &A,
_tcx: TyCtxt<'tcx>,
_body: &mir::Body<'tcx>,
Expand Down Expand Up @@ -591,7 +591,7 @@ where
//
// FIXME: Figure out how to express this using `Option::clone_from`, or maybe lift it into the
// standard library?
fn opt_clone_from_or_clone<T: Clone>(opt: &'a mut Option<T>, val: &T) -> &'a mut T {
fn opt_clone_from_or_clone<'a, T: Clone>(opt: &'a mut Option<T>, val: &T) -> &'a mut T {
if opt.is_some() {
let ret = opt.as_mut().unwrap();
ret.clone_from(val);
Expand Down
21 changes: 12 additions & 9 deletions compiler/rustc_mir_dataflow/src/framework/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ where
pub(super) entry_sets: IndexVec<BasicBlock, A::Domain>,
}

impl<A> Results<'tcx, A>
impl<'tcx, A> Results<'tcx, A>
where
A: Analysis<'tcx>,
{
/// Creates a `ResultsCursor` that can inspect these `Results`.
pub fn into_results_cursor(self, body: &'mir mir::Body<'tcx>) -> ResultsCursor<'mir, 'tcx, A> {
pub fn into_results_cursor<'mir>(
self,
body: &'mir mir::Body<'tcx>,
) -> ResultsCursor<'mir, 'tcx, A> {
ResultsCursor::new(body, self)
}

Expand All @@ -45,7 +48,7 @@ where
&self.entry_sets[block]
}

pub fn visit_with(
pub fn visit_with<'mir>(
&self,
body: &'mir mir::Body<'tcx>,
blocks: impl IntoIterator<Item = BasicBlock>,
Expand All @@ -54,7 +57,7 @@ where
visit_results(body, blocks, self, vis)
}

pub fn visit_reachable_with(
pub fn visit_reachable_with<'mir>(
&self,
body: &'mir mir::Body<'tcx>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, FlowState = A::Domain>,
Expand Down Expand Up @@ -85,7 +88,7 @@ where
apply_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>,
}

impl<A, D, T> Engine<'a, 'tcx, A>
impl<'a, 'tcx, A, D, T> Engine<'a, 'tcx, A>
where
A: GenKillAnalysis<'tcx, Idx = T, Domain = D>,
D: Clone + JoinSemiLattice + GenKill<T> + BorrowMut<BitSet<T>>,
Expand Down Expand Up @@ -119,7 +122,7 @@ where
}
}

impl<A, D> Engine<'a, 'tcx, A>
impl<'a, 'tcx, A, D> Engine<'a, 'tcx, A>
where
A: Analysis<'tcx, Domain = D>,
D: Clone + JoinSemiLattice,
Expand Down Expand Up @@ -257,7 +260,7 @@ where

/// Writes a DOT file containing the results of a dataflow analysis if the user requested it via
/// `rustc_mir` attributes.
fn write_graphviz_results<A>(
fn write_graphviz_results<'tcx, A>(
tcx: TyCtxt<'tcx>,
body: &mir::Body<'tcx>,
results: &Results<'tcx, A>,
Expand Down Expand Up @@ -330,7 +333,7 @@ struct RustcMirAttrs {
}

impl RustcMirAttrs {
fn parse(tcx: TyCtxt<'tcx>, def_id: DefId) -> Result<Self, ()> {
fn parse(tcx: TyCtxt<'_>, def_id: DefId) -> Result<Self, ()> {
let attrs = tcx.get_attrs(def_id);

let mut result = Ok(());
Expand Down Expand Up @@ -373,7 +376,7 @@ impl RustcMirAttrs {

fn set_field<T>(
field: &mut Option<T>,
tcx: TyCtxt<'tcx>,
tcx: TyCtxt<'_>,
attr: &ast::NestedMetaItem,
mapper: impl FnOnce(Symbol) -> Result<T, ()>,
) -> Result<(), ()> {
Expand Down
26 changes: 13 additions & 13 deletions compiler/rustc_mir_dataflow/src/framework/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where
style: OutputStyle,
}

impl<A> Formatter<'a, 'tcx, A>
impl<'a, 'tcx, A> Formatter<'a, 'tcx, A>
where
A: Analysis<'tcx>,
{
Expand All @@ -52,7 +52,7 @@ pub struct CfgEdge {
index: usize,
}

fn dataflow_successors(body: &Body<'tcx>, bb: BasicBlock) -> Vec<CfgEdge> {
fn dataflow_successors(body: &Body<'_>, bb: BasicBlock) -> Vec<CfgEdge> {
body[bb]
.terminator()
.successors()
Expand All @@ -61,7 +61,7 @@ fn dataflow_successors(body: &Body<'tcx>, bb: BasicBlock) -> Vec<CfgEdge> {
.collect()
}

impl<A> dot::Labeller<'_> for Formatter<'a, 'tcx, A>
impl<'tcx, A> dot::Labeller<'_> for Formatter<'_, 'tcx, A>
where
A: Analysis<'tcx>,
A::Domain: DebugWithContext<A>,
Expand Down Expand Up @@ -100,7 +100,7 @@ where
}
}

impl<A> dot::GraphWalk<'a> for Formatter<'a, 'tcx, A>
impl<'a, 'tcx, A> dot::GraphWalk<'a> for Formatter<'a, 'tcx, A>
where
A: Analysis<'tcx>,
{
Expand Down Expand Up @@ -138,7 +138,7 @@ where
style: OutputStyle,
}

impl<A> BlockFormatter<'a, 'tcx, A>
impl<'a, 'tcx, A> BlockFormatter<'a, 'tcx, A>
where
A: Analysis<'tcx>,
A::Domain: DebugWithContext<A>,
Expand Down Expand Up @@ -491,7 +491,7 @@ where
after: Vec<String>,
}

impl<A> StateDiffCollector<'a, 'tcx, A>
impl<'a, 'tcx, A> StateDiffCollector<'a, 'tcx, A>
where
A: Analysis<'tcx>,
A::Domain: DebugWithContext<A>,
Expand All @@ -514,7 +514,7 @@ where
}
}

impl<A> ResultsVisitor<'a, 'tcx> for StateDiffCollector<'a, 'tcx, A>
impl<'a, 'tcx, A> ResultsVisitor<'a, 'tcx> for StateDiffCollector<'a, 'tcx, A>
where
A: Analysis<'tcx>,
A::Domain: DebugWithContext<A>,
Expand All @@ -524,7 +524,7 @@ where
fn visit_block_start(
&mut self,
state: &Self::FlowState,
_block_data: &'mir mir::BasicBlockData<'tcx>,
_block_data: &mir::BasicBlockData<'tcx>,
_block: BasicBlock,
) {
if A::Direction::is_forward() {
Expand All @@ -535,7 +535,7 @@ where
fn visit_block_end(
&mut self,
state: &Self::FlowState,
_block_data: &'mir mir::BasicBlockData<'tcx>,
_block_data: &mir::BasicBlockData<'tcx>,
_block: BasicBlock,
) {
if A::Direction::is_backward() {
Expand All @@ -546,7 +546,7 @@ where
fn visit_statement_before_primary_effect(
&mut self,
state: &Self::FlowState,
_statement: &'mir mir::Statement<'tcx>,
_statement: &mir::Statement<'tcx>,
_location: Location,
) {
if let Some(before) = self.before.as_mut() {
Expand All @@ -558,7 +558,7 @@ where
fn visit_statement_after_primary_effect(
&mut self,
state: &Self::FlowState,
_statement: &'mir mir::Statement<'tcx>,
_statement: &mir::Statement<'tcx>,
_location: Location,
) {
self.after.push(diff_pretty(state, &self.prev_state, self.analysis));
Expand All @@ -568,7 +568,7 @@ where
fn visit_terminator_before_primary_effect(
&mut self,
state: &Self::FlowState,
_terminator: &'mir mir::Terminator<'tcx>,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
) {
if let Some(before) = self.before.as_mut() {
Expand All @@ -580,7 +580,7 @@ where
fn visit_terminator_after_primary_effect(
&mut self,
state: &Self::FlowState,
_terminator: &'mir mir::Terminator<'tcx>,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
) {
self.after.push(diff_pretty(state, &self.prev_state, self.analysis));
Expand Down
14 changes: 11 additions & 3 deletions compiler/rustc_mir_dataflow/src/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ pub trait Analysis<'tcx>: AnalysisDomain<'tcx> {
/// .iterate_to_fixpoint()
/// .into_results_cursor(body);
/// ```
fn into_engine(self, tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>) -> Engine<'mir, 'tcx, Self>
fn into_engine<'mir>(
self,
tcx: TyCtxt<'tcx>,
body: &'mir mir::Body<'tcx>,
) -> Engine<'mir, 'tcx, Self>
where
Self: Sized,
{
Expand Down Expand Up @@ -296,7 +300,7 @@ pub trait GenKillAnalysis<'tcx>: Analysis<'tcx> {
}
}

impl<A> Analysis<'tcx> for A
impl<'tcx, A> Analysis<'tcx> for A
where
A: GenKillAnalysis<'tcx>,
A::Domain: GenKill<A::Idx> + BorrowMut<BitSet<A::Idx>>,
Expand Down Expand Up @@ -368,7 +372,11 @@ where

/* Extension methods */

fn into_engine(self, tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>) -> Engine<'mir, 'tcx, Self>
fn into_engine<'mir>(
self,
tcx: TyCtxt<'tcx>,
body: &'mir mir::Body<'tcx>,
) -> Engine<'mir, 'tcx, Self>
where
Self: Sized,
{
Expand Down
Loading