Skip to content

Update MSRV to 1.81 #8529

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

Merged
merged 10 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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 .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.80.0
toolchain: 1.81.0

- run: cargo build -p rerun

Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ cd rerun

Now install the `pixi` package manager: <https://github.com/prefix-dev/pixi?tab=readme-ov-file#installation>

Make sure `cargo --version` prints `1.80.0` once you are done.
Make sure `cargo --version` prints `1.81.0` once you are done.

If you are using an Apple-silicon Mac (M1, M2), make sure `rustc -vV` outputs `host: aarch64-apple-darwin`. If not, this should fix it:

```sh
rustup set default-host aarch64-apple-darwin && rustup install 1.80.0
rustup set default-host aarch64-apple-darwin && rustup install 1.81.0
```

## Git-lfs
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include = [
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rerun-io/rerun"
rust-version = "1.80"
rust-version = "1.81"
version = "0.22.0-alpha.1+dev"

[workspace.dependencies]
Expand Down Expand Up @@ -383,6 +383,7 @@ rust_2021_prelude_collisions = "warn"
semicolon_in_expressions_from_macros = "warn"
trivial_numeric_casts = "warn"
unsafe_op_in_unsafe_fn = "warn" # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
unexpected_cfgs = "deny"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
Expand Down Expand Up @@ -467,7 +468,6 @@ match_same_arms = "warn"
match_wild_err_arm = "warn"
match_wildcard_for_single_variants = "warn"
mem_forget = "warn"
mismatched_target_os = "warn"
mismatching_type_param_order = "warn"
missing_enforced_import_renames = "warn"
missing_safety_doc = "warn"
Expand Down Expand Up @@ -496,6 +496,7 @@ ref_option_ref = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
set_contains_or_insert = "warn"
should_panic_without_expect = "warn"
single_char_pattern = "warn"
single_match_else = "warn"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# -----------------------------------------------------------------------------
# Section identical to the main scripts/clippy_wasm/clippy.toml:

msrv = "1.80"
msrv = "1.81"

allow-unwrap-in-tests = true

Expand Down
2 changes: 1 addition & 1 deletion crates/build/re_dev_tools/src/build_web_viewer/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn build(
cmd.arg("--no-default-features");
}
if !features.is_empty() {
cmd.arg(&format!("--features={features}"));
cmd.arg(format!("--features={features}"));
}
if profile == Profile::Release {
cmd.arg("--release");
Expand Down
7 changes: 4 additions & 3 deletions crates/utils/re_analytics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,13 @@ pub struct Analytics {
fn load_config() -> Result<Config, ConfigError> {
let config = match Config::load() {
Ok(config) => config,
#[allow(unused_variables)]

Err(err) => {
// NOTE: This will cause the first run disclaimer to show up again on native,
// and analytics will be disabled for the rest of the session.
#[cfg(not(target_arch = "wasm32"))]
re_log::warn!("failed to load analytics config file: {err}");
if !cfg!(target_arch = "wasm32") {
re_log::warn!("failed to load analytics config file: {err}");
}
None
}
};
Expand Down
107 changes: 55 additions & 52 deletions crates/utils/re_crash_handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,69 +28,72 @@ pub fn install_crash_handlers(build_info: BuildInfo) {
fn install_panic_hook(_build_info: BuildInfo) {
let previous_panic_hook = std::panic::take_hook();

std::panic::set_hook(Box::new(move |panic_info: &std::panic::PanicInfo<'_>| {
let callstack = callstack_from(&["panicking::panic_fmt\n"]);

let file_line = panic_info.location().map(|location| {
let file = anonymize_source_file_path(&std::path::PathBuf::from(location.file()));
format!("{file}:{}", location.line())
});

let msg = panic_info_message(panic_info);

if let Some(msg) = &msg {
// Print our own panic message.
// Our formatting is nicer than `std` since we shorten the file paths (for privacy reasons).
// This also makes it easier for users to copy-paste the callstack into an issue
// without having any sensitive data in it.

let thread = std::thread::current();
let thread_name = thread
.name()
.map_or_else(|| format!("{:?}", thread.id()), |name| name.to_owned());

eprintln!("\nthread '{thread_name}' panicked at '{msg}'");
if let Some(file_line) = &file_line {
eprintln!("{file_line}");
std::panic::set_hook(Box::new(
move |panic_info: &std::panic::PanicHookInfo<'_>| {
let callstack = callstack_from(&["panicking::panic_fmt\n"]);

let file_line = panic_info.location().map(|location| {
let file = anonymize_source_file_path(&std::path::PathBuf::from(location.file()));
format!("{file}:{}", location.line())
});

let msg = panic_info_message(panic_info);

if let Some(msg) = &msg {
// Print our own panic message.
// Our formatting is nicer than `std` since we shorten the file paths (for privacy reasons).
// This also makes it easier for users to copy-paste the callstack into an issue
// without having any sensitive data in it.

let thread = std::thread::current();
let thread_name = thread
.name()
.map_or_else(|| format!("{:?}", thread.id()), |name| name.to_owned());

eprintln!("\nthread '{thread_name}' panicked at '{msg}'");
if let Some(file_line) = &file_line {
eprintln!("{file_line}");
}
eprintln!("stack backtrace:\n{callstack}");
} else {
// This prints the panic message and callstack:
(*previous_panic_hook)(panic_info);
}
eprintln!("stack backtrace:\n{callstack}");
} else {
// This prints the panic message and callstack:
(*previous_panic_hook)(panic_info);
}

econtext::print_econtext(); // Print additional error context, if any
econtext::print_econtext(); // Print additional error context, if any

eprintln!(
"\n\
eprintln!(
"\n\
Troubleshooting Rerun: https://www.rerun.io/docs/getting-started/troubleshooting \n\
Report bugs: https://github.com/rerun-io/rerun/issues"
);
);

#[cfg(feature = "analytics")]
{
if let Ok(analytics) = re_analytics::Analytics::new(std::time::Duration::from_millis(1))
#[cfg(feature = "analytics")]
{
analytics.record(re_analytics::event::CrashPanic {
build_info: _build_info,
callstack,
// Don't include panic message, because it can contain sensitive information,
// e.g. `panic!("Couldn't read {sensitive_file_path}")`.
message: None,
file_line,
});

std::thread::sleep(std::time::Duration::from_secs(1)); // Give analytics time to send the event
if let Ok(analytics) =
re_analytics::Analytics::new(std::time::Duration::from_millis(1))
{
analytics.record(re_analytics::event::CrashPanic {
build_info: _build_info,
callstack,
// Don't include panic message, because it can contain sensitive information,
// e.g. `panic!("Couldn't read {sensitive_file_path}")`.
message: None,
file_line,
});

std::thread::sleep(std::time::Duration::from_secs(1)); // Give analytics time to send the event
}
}
}

// We compile with `panic = "abort"`, but we don't want to report the same problem twice, so just exit:
#[allow(clippy::exit)]
std::process::exit(102);
}));
// We compile with `panic = "abort"`, but we don't want to report the same problem twice, so just exit:
#[allow(clippy::exit)]
std::process::exit(102);
},
));
}

fn panic_info_message(panic_info: &std::panic::PanicInfo<'_>) -> Option<String> {
fn panic_info_message(panic_info: &std::panic::PanicHookInfo<'_>) -> Option<String> {
// `panic_info.message` is unstable, so this is the recommended way of getting
// the panic message out. We need both the `&str` and `String` variants.

Expand Down
4 changes: 4 additions & 0 deletions crates/viewer/re_ui/src/color_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,25 @@ impl ColorTable {
}

#[inline]
#[allow(dead_code)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the color table pub

pub fn green(&self, shade: Scale) -> egui::Color32 {
self.get(ColorToken::green(shade))
}

#[inline]
#[allow(dead_code)]
pub fn red(&self, shade: Scale) -> egui::Color32 {
self.get(ColorToken::red(shade))
}

#[inline]
#[allow(dead_code)]
pub fn blue(&self, shade: Scale) -> egui::Color32 {
self.get(ColorToken::blue(shade))
}

#[inline]
#[allow(dead_code)]
pub fn purple(&self, shade: Scale) -> egui::Color32 {
self.get(ColorToken::purple(shade))
}
Expand Down
19 changes: 3 additions & 16 deletions crates/viewer/re_view_graph/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ impl Node {
}
}

/// The original [`components::GraphNode`] id that was logged by the user.
pub fn graph_node(&self) -> &components::GraphNode {
match self {
Self::Explicit { instance, .. } => &instance.graph_node,
Self::Implicit { graph_node, .. } => graph_node,
}
}

pub fn label(&self) -> &DrawableLabel {
match self {
Self::Explicit { label, .. } | Self::Implicit { label, .. } => label,
Expand All @@ -81,6 +73,7 @@ pub struct Graph {
entity: EntityPath,
nodes: Vec<Node>,
edges: Vec<EdgeTemplate>,
#[expect(unused)]
kind: GraphType,
}

Expand Down Expand Up @@ -110,21 +103,19 @@ impl Graph {

let (edges, kind) = if let Some(data) = edge_data {
for edge in &data.edges {
if !seen.contains(&edge.source_index) {
if seen.insert(edge.source_index) {
nodes.push(Node::Implicit {
id: edge.source_index,
graph_node: edge.source.clone(),
label: DrawableLabel::implicit_circle(ui),
});
seen.insert(edge.source_index);
}
if !seen.contains(&edge.target_index) {
if seen.insert(edge.target_index) {
nodes.push(Node::Implicit {
id: edge.target_index,
graph_node: edge.target.clone(),
label: DrawableLabel::implicit_circle(ui),
});
seen.insert(edge.target_index);
}
}

Expand Down Expand Up @@ -155,10 +146,6 @@ impl Graph {
&self.edges
}

pub fn kind(&self) -> GraphType {
self.kind
}

pub fn entity(&self) -> &EntityPath {
&self.entity
}
Expand Down
2 changes: 2 additions & 0 deletions crates/viewer/re_view_graph/src/layout/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl EdgeGeometry {
}

/// The starting position of an edge.
#[expect(unused)]
pub fn source_pos(&self) -> Pos2 {
match self.path {
PathGeometry::Line { source, .. } | PathGeometry::CubicBezier { source, .. } => source,
Expand All @@ -53,6 +54,7 @@ impl EdgeGeometry {
}

/// The direction of the edge at the source node (normalized).
#[expect(unused)]
pub fn source_arrow_direction(&self) -> Vec2 {
use PathGeometry::{CubicBezier, Line};
match self.path {
Expand Down
1 change: 1 addition & 0 deletions crates/viewer/re_view_graph/src/layout/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl Layout {
}

/// Gets the shape of an edge in the final layout.
#[expect(unused)]
pub fn get_edge(&self, edge: &EdgeId) -> Option<&[EdgeGeometry]> {
self.edges.get(edge).map(|es| es.as_slice())
}
Expand Down
4 changes: 0 additions & 4 deletions crates/viewer/re_view_graph/src/ui/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ impl LayoutState {
*self = Self::None;
}

pub fn is_none(&self) -> bool {
matches!(self, Self::None)
}

pub fn is_in_progress(&self) -> bool {
matches!(self, Self::InProgress { .. })
}
Expand Down
2 changes: 0 additions & 2 deletions crates/viewer/re_view_graph/src/visualizers/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pub enum Label {
/// A [`NodeInstance`] is the output of the [`NodeVisualizer`] and represents a single node in the graph.
#[derive(Clone)]
pub struct NodeInstance {
pub graph_node: components::GraphNode,
pub instance_index: Instance,
pub id: NodeId,
pub position: Option<egui::Pos2>,
Expand Down Expand Up @@ -128,7 +127,6 @@ impl VisualizerSystem for NodeVisualizer {
};

NodeInstance {
graph_node: node.clone(),
instance_index: instance,
id: NodeId::from_entity_node(&data_result.entity_path, node),
position: position.map(|[x, y]| egui::Pos2::new(x, y)),
Expand Down
2 changes: 2 additions & 0 deletions crates/viewer/re_view_tensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ impl TensorDimension {
.collect()
}

#[allow(dead_code)] // Used for tests
pub fn unnamed(size: u64) -> Self {
Self { size, name: None }
}

#[allow(dead_code)] // Used for tests
pub fn named(size: u64, name: impl Into<re_types::ArrowString>) -> Self {
Self {
size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Let's try it out in a brand-new Rust project:
cargo init cube && cd cube && cargo add rerun --features native_viewer
```

Note that the Rerun SDK requires a working installation of Rust 1.80+.
Note that the Rerun SDK requires a working installation of Rust 1.81+.

## Logging your own data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Let's try it out in a brand-new Rust project:
cargo init cube && cd cube && cargo add rerun
```

Note that the Rerun SDK requires a working installation of Rust 1.80+.
Note that the Rerun SDK requires a working installation of Rust 1.81+.

## Logging your own data

Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/installing-viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ There are many ways to install the viewer. Please pick whatever works best for y
- Download `rerun-cli` for your platform from the [GitHub Release artifacts](https://github.com/rerun-io/rerun/releases/latest/).
- Via Cargo
- `cargo binstall rerun-cli` - download binaries via [`cargo binstall`](https://github.com/cargo-bins/cargo-binstall)
- `cargo install rerun-cli --locked` - build it from source (this requires Rust 1.80+)
- `cargo install rerun-cli --locked` - build it from source (this requires Rust 1.81+)
- Together with the Rerun [Python SDK](./quick-start/python.md):
- `pip3 install rerun-sdk` - download it via pip
- `conda install -c conda-forge rerun-sdk` - download via Conda
Expand Down
Loading
Loading