Bump rustc nightly-2022-11-22 (#3911)

This commit is contained in:
Michael Mauderer 2022-11-30 02:16:25 +00:00 committed by GitHub
parent 4518f8303d
commit c7c555314a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 725 additions and 445 deletions

996
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,7 @@ wasm-bindgen = { version = "=0.2.78" }
wasm-bindgen-futures = "0.4"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
websocket = "0.23.0"
websocket = "0.26.5"
[dev-dependencies]
regex = { version = "1.3.6" }

View File

@ -248,7 +248,7 @@ mod test {
apply_code_change_to_id_map(&mut id_map, &self.change, &self.code);
let code2 = self.resulting_code();
let ast2 = parser.parse_module(&code2, id_map.clone()).unwrap();
let ast2 = parser.parse_module(code2, id_map.clone()).unwrap();
self.assert_same_node_ids(&ast1, &ast2);
}

View File

@ -86,7 +86,7 @@ impl ApiProvider {
/// Generates rust files from FlatBuffers schemas.
pub fn generate_files(&self) {
let fbs_dir = self.out_dir.join(ZIP_CONTENT);
for entry in fs::read_dir(&fbs_dir).expect("Could not read content of dir") {
for entry in fs::read_dir(fbs_dir).expect("Could not read content of dir") {
let path = entry.expect("Invalid content of dir").path();
let result = flatc_rust::run(flatc_rust::Args {
inputs: &[&path],

View File

@ -269,7 +269,7 @@ mod tests {
fn new() -> ClientFixture {
let logger = Logger::new("ClientFixture");
let transport = MockTransport::new();
let client = Client::new(&logger, transport.clone());
let client = Client::new(logger, transport.clone());
let executor = futures::executor::LocalPool::new();
executor.spawner().spawn_local(client.runner()).unwrap();
ClientFixture { transport, client, executor }

View File

@ -108,7 +108,7 @@ impl Path {
// ====================
/// Notification generated by the Language Server.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, IntoStaticStr, Eq)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, IntoStaticStr)]
#[serde(tag = "method", content = "params")]
pub enum Notification {
/// Filesystem event occurred for a watched path.
@ -190,7 +190,7 @@ pub struct VisualisationEvaluationFailed {
/// Sent from the server to the client to inform about new information for certain expressions
/// becoming available.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Eq)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[allow(missing_docs)]
#[serde(rename_all = "camelCase")]
pub struct ExpressionUpdates {
@ -199,7 +199,7 @@ pub struct ExpressionUpdates {
}
/// An update about the computed expression.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Eq)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[allow(missing_docs)]
#[serde(rename_all = "camelCase")]
pub struct ExpressionUpdate {
@ -223,7 +223,7 @@ pub enum ProfilingInfo {
ExecutionTime { nano_time: u64 },
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Eq)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[allow(missing_docs)]
#[serde(tag = "type")]
pub enum ExpressionUpdatePayload {

View File

@ -92,8 +92,8 @@ impl JsonIdMap {
let mut cursor = xi_rope::Cursor::new(&code.rope, 0);
let char_offsets = iter::once(0).chain(cursor.iter::<Utf16CodeUnitsMetric>()).collect_vec();
let mapped_vec = id_map.vec.iter().map(|(range, id)| {
let byte_start = range.start.value as usize;
let byte_end = range.end.value as usize;
let byte_start = range.start.value;
let byte_end = range.end.value;
let start = char_offsets.binary_search(&byte_start).unwrap_both();
let end = char_offsets.binary_search(&byte_end).unwrap_both();
let size = end - start;

View File

@ -35,4 +35,4 @@ reqwest = { version = "0.11.12" }
tokio = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
websocket = "0.23.0"
websocket = "0.26.5"

View File

@ -581,7 +581,7 @@ mod tests {
// Set two errors. One of old values is overridden
let update1 = value_update_with_dataflow_error(expr2);
let update2 = value_update_with_dataflow_panic(expr3, &error_msg);
let update2 = value_update_with_dataflow_panic(expr3, error_msg);
registry.apply_updates(vec![update1, update2]);
assert_eq!(registry.get(&expr1).unwrap().typename, Some(typename1.into()));
assert!(matches!(registry.get(&expr1).unwrap().payload, ExpressionUpdatePayload::Value));

View File

@ -248,8 +248,8 @@ impl FocusedEdge {
fn fill<C: Into<Var<color::Rgba>>>(&self, focused_color: C, unfocused_color: C) -> AnyShape {
let focused_color = focused_color.into();
let unfocused_color = unfocused_color.into();
let focused = self.focused.fill(&focused_color);
let unfocused = self.unfocused.fill(&unfocused_color);
let focused = self.focused.fill(focused_color);
let unfocused = self.unfocused.fill(unfocused_color);
(focused + unfocused).into()
}
}

View File

@ -114,7 +114,7 @@ pub mod background {
let width = width - PADDING.px() * 2.0;
let height = height - PADDING.px() * 2.0;
let radius = RADIUS.px();
let shape = Rect((&width,&height)).corners_radius(&radius);
let shape = Rect((&width,&height)).corners_radius(radius);
let shape = shape.fill(bg_color);
shape.into()
}
@ -151,12 +151,12 @@ pub mod backdrop {
let sel_width = &width - 2.px() + &sel_offset.px() * 2.0 * &selection;
let sel_height = &height - 2.px() + &sel_offset.px() * 2.0 * &selection;
let sel_radius = &sel_height / 2.0;
let select = Rect((&sel_width,&sel_height)).corners_radius(&sel_radius);
let select = Rect((&sel_width,&sel_height)).corners_radius(sel_radius);
let sel2_width = &width - 2.px() + &(sel_size + sel_offset).px() * 2.0 * &selection;
let sel2_height = &height - 2.px() + &(sel_size + sel_offset).px() * 2.0 * &selection;
let sel2_radius = &sel2_height / 2.0;
let select2 = Rect((&sel2_width,&sel2_height)).corners_radius(&sel2_radius);
let select2 = Rect((&sel2_width,&sel2_height)).corners_radius(sel2_radius);
let select = select2 - select;
let select = select.fill(sel_color);
@ -233,7 +233,7 @@ pub mod error_shape {
let stripe_red = Rect((&stripe_width,INFINITE.px()));
let stripe_angle_rad = stripe_angle.radians();
let pattern = stripe_red.repeat(repeat).rotate(stripe_angle_rad);
let mask = Rect((&width,&height)).corners_radius(&radius);
let mask = Rect((&width,&height)).corners_radius(radius);
let mask = mask.grow(error_width);
let pattern = mask.intersection(pattern).fill(color_rgba);

View File

@ -23,7 +23,7 @@ pub mod visibility {
let outer_radius = &unit*5.0;
let pupil = Circle(&unit * 1.0);
let inner_circle = Circle(&unit * 3.0);
let outer_circle = Circle(&outer_radius);
let outer_circle = Circle(outer_radius);
let right_edge = Triangle(&unit * 7.9, &unit * 4.6);
let right_edge = right_edge.rotate(right_angle);
let right_edge = right_edge.translate_x(&unit * 5.3);
@ -82,8 +82,8 @@ fn make_ring<T: Into<Var<Pixels>>, U: Into<Var<Pixels>>>(
outer_radius: T,
inner_radius: U,
) -> AnyShape {
let outer_circle = Circle(&outer_radius.into());
let inner_circle = Circle(&inner_radius.into());
let outer_circle = Circle(outer_radius.into());
let inner_circle = Circle(inner_radius.into());
let ring = outer_circle - inner_circle;
ring.into()
}

View File

@ -102,7 +102,7 @@ impl AllPortsShape {
let port_area_height = &inner_height + (&port_area_size - &shrink) * 2.0;
let outer_radius = &inner_radius + &port_area_size;
let shape = Rect((&port_area_width, &port_area_height));
let shape = shape.corners_radius(&outer_radius);
let shape = shape.corners_radius(outer_radius);
let shape = shape - &top_mask;
let corner_radius = &port_area_size / 2.0;
let corner_offset = &port_area_width / 2.0 - &corner_radius;
@ -115,7 +115,7 @@ impl AllPortsShape {
// === Hover Area ===
let hover_radius = &inner_radius + &HOVER_AREA_PADDING.px();
let hover = Rect((canvas_width, canvas_height)).corners_radius(&hover_radius);
let hover = Rect((canvas_width, canvas_height)).corners_radius(hover_radius);
let hover = (hover - &top_mask).into();
AllPortsShape { inner_radius, inner_width, shape, hover }

View File

@ -65,7 +65,7 @@ mod status_indicator_shape {
let height = height - node::PADDING.px() * 2.0;
let radius = node::RADIUS.px();
let base = Rect((&width,&height)).corners_radius(&radius);
let base = Rect((&width,&height)).corners_radius(radius);
let outer = base.grow(INDICATOR_WIDTH_OUTER.px());
let inner = base.grow(INDICATOR_WIDTH_INNER.px());

View File

@ -84,7 +84,7 @@ mod icon {
let needle = UnevenCapsule(needle_radius_outer,needle_radius_inner,needle_length);
let needle = needle.rotate(needle_angle);
let inner_circle = Circle(&inner_circle_radius);
let inner_circle = Circle(inner_circle_radius);
// === Composition ===

View File

@ -67,7 +67,7 @@ pub mod overlay {
let radius = 1.px() * &radius;
let corner_radius = &radius * &roundness;
let color_overlay = color::Rgba::new(1.0,0.0,0.0,0.000_000_1);
let overlay = Rect((&width,&height)).corners_radius(&corner_radius);
let overlay = Rect((&width,&height)).corners_radius(corner_radius);
let overlay = overlay.fill(color_overlay);
let out = overlay;
out.into()
@ -101,12 +101,12 @@ pub mod background {
let sel_width = &width - 1.px() + &sel_offset.px() * 2.0 * &selection;
let sel_height = &height - 1.px() + &sel_offset.px() * 2.0 * &selection;
let sel_radius = &corner_radius + &sel_offset.px();
let select = Rect((&sel_width,&sel_height)).corners_radius(&sel_radius);
let select = Rect((&sel_width,&sel_height)).corners_radius(sel_radius);
let sel2_width = &width - 2.px() + &(sel_size + sel_offset).px() * 2.0 * &selection;
let sel2_height = &height - 2.px() + &(sel_size + sel_offset).px() * 2.0 * &selection;
let sel2_radius = &corner_radius + &sel_offset.px() + &sel_size.px() * &selection;
let select2 = Rect((&sel2_width,&sel2_height)).corners_radius(&sel2_radius);
let select2 = Rect((&sel2_width,&sel2_height)).corners_radius(sel2_radius);
let select = select2 - select;
let select = select.fill(sel_color);

View File

@ -62,7 +62,7 @@ mod background {
let width = Var::<Pixels>::from("input_size.x");
let height = Var::<Pixels>::from("input_size.y");
let radius = node::RADIUS.px() ;
let background_rounded = Rect((&width,&height)).corners_radius(&radius);
let background_rounded = Rect((&width,&height)).corners_radius(radius);
let background_sharp = Rect((&width,&height/2.0)).translate_y(-&height/4.0);
let background = background_rounded + background_sharp;
let color_path = theme::graph_editor::visualization::action_bar::background;

View File

@ -35,7 +35,7 @@ pub mod background {
let color_path = theme::graph_editor::visualization::background;
let color_bg = style.get_color(color_path);
let corner_radius = &radius * &roundness;
let background = Rect((&width,&height)).corners_radius(&corner_radius);
let background = Rect((&width,&height)).corners_radius(corner_radius);
let background = background.fill(color_bg);
background.into()
}

View File

@ -24,7 +24,7 @@ pub mod shape {
let size = Var::canvas_size();
let radius = Min::min(size.x(),size.y()) / 2.0;
let round = &radius / 6.0;
let rect = Rect((&radius,&radius)).corners_radius(&round);
let rect = Rect((&radius,&radius)).corners_radius(round);
let strip_sizes = (&radius * 2.0 / 9.0, &radius*2.0);
let strip = Rect(strip_sizes).rotate(Radians::from(45.0.degrees()));
let icon = rect - strip;

View File

@ -31,7 +31,7 @@ pub fn write(path: impl AsRef<Path>, contents: impl AsRef<[u8]>) -> Result {
#[context("Failed to write path: {}", path.as_ref().display())]
pub fn write_json(path: impl AsRef<Path>, contents: &impl Serialize) -> Result {
let contents = serde_json::to_string(contents)?;
write(&path, &contents)
write(&path, contents)
}
/// Like the standard version but will create any missing parent directories from the path.

View File

@ -68,6 +68,6 @@ async fn main() -> Result {
downloader.download_all_to(temp.path()).await?;
let expected_path = temp.path().join(artifact_name);
assert_eq!(std::fs::read(&expected_path)?, std::fs::read(&file)?);
assert_eq!(std::fs::read(expected_path)?, std::fs::read(&file)?);
Ok(())
}

View File

@ -171,7 +171,7 @@ impl ContentHeaders {
if let Some(content_encoding) = self.content_encoding() {
request = request.content_encoding(content_encoding);
}
request.content_type(&self.content_type.to_string())
request.content_type(self.content_type.to_string())
}
}

View File

@ -86,7 +86,7 @@ impl BuiltEnso {
let google_api_test_data_dir =
paths.repo_root.join("test").join("Google_Api_Test").join("data");
ide_ci::fs::create_dir_if_missing(&google_api_test_data_dir)?;
ide_ci::fs::write(google_api_test_data_dir.join("secret.json"), &gdoc_key)?;
ide_ci::fs::write(google_api_test_data_dir.join("secret.json"), gdoc_key)?;
}
let _httpbin = crate::httpbin::get_and_spawn_httpbin_on_free_port(sbt).await?;

View File

@ -9,7 +9,6 @@
#![feature(option_result_contains)]
#![feature(result_flattening)]
#![feature(default_free_fn)]
#![feature(map_first_last)]
#![feature(result_option_inspect)]
#![feature(associated_type_defaults)]
#![feature(once_cell)]

View File

@ -232,7 +232,7 @@ pub fn base_version(changelog_path: impl AsRef<Path>) -> Result<Version> {
}
pub fn current_year() -> u64 {
chrono::Utc::today().year() as u64
chrono::Utc::now().year() as u64
}
pub fn generate_initial_version() -> Version {

View File

@ -204,7 +204,7 @@ pub mod new {
}
}
impl<Value, Borrowed: ?Sized> const RawVariable for SimpleVariable<Value, Borrowed> {
impl<Value, Borrowed: ?Sized> RawVariable for SimpleVariable<Value, Borrowed> {
fn name(&self) -> &str {
self.name
}

View File

@ -4,6 +4,7 @@ use crate::prelude::*;
/// A bunch of constant literals associated with a given OS. Follows the convention of constants
/// defined in [`std::env::consts`] module.
#[const_trait]
pub trait OsExt: Copy {
fn exe_suffix(self) -> &'static str;
fn exe_extension(self) -> &'static str;

View File

@ -19,7 +19,7 @@
#![feature(const_deref)]
#![feature(duration_constants)]
#![feature(const_trait_impl)]
#![feature(is_some_with)]
#![feature(is_some_and)]
#![feature(pin_macro)]
#![feature(result_option_inspect)]
#![feature(extend_one)]

View File

@ -24,7 +24,7 @@ pub struct MyLayer;
impl<S: Subscriber + Debug + for<'a> LookupSpan<'a>> tracing_subscriber::Layer<S> for MyLayer {
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest {
if metadata.module_path().is_some_and(|p| is_our_module_path(p)) {
if metadata.module_path().is_some_and(is_our_module_path) {
Interest::always()
} else {
// dbg!(metadata);

View File

@ -126,10 +126,9 @@ pub async fn compare_env(
changes.extend(
environment_before
.into_iter()
.map(|(variable_name, _)| Modification { variable_name, action: env::Action::Remove }),
.into_keys()
.map(|variable_name| Modification { variable_name, action: env::Action::Remove }),
);
// dbg!(&changes);
Ok(changes)
}

View File

@ -146,7 +146,7 @@ fn process_paths<T: AsRef<Path>>(paths: &[T]) {
for config in configs {
let file_name_suffix = config.to_file_name_suffix();
let file_name = format!("{command_name}-{name}{file_name_suffix}.xml");
let path = run_config_path.join(&file_name);
let path = run_config_path.join(file_name);
let xml = generate_run_config_xml(
command_name,
command,
@ -154,7 +154,7 @@ fn process_paths<T: AsRef<Path>>(paths: &[T]) {
config,
*cfg_type,
);
fs::write(&path, xml).expect("Unable to write the run configuration to {path:?}.");
fs::write(path, xml).expect("Unable to write the run configuration to {path:?}.");
}
}
}

View File

@ -6,6 +6,7 @@
#![feature(fn_traits)]
#![feature(unsize)]
#![feature(test)]
#![feature(tuple_trait)]
// === Standard Linter Configuration ===
#![deny(non_ascii_idents)]
#![warn(unsafe_code)]
@ -127,7 +128,7 @@ impl<F: ?Sized> Registry<F> {
/// Fires all registered callbacks and removes the ones which got dropped. The implementation
/// is safe - you are allowed to change the registry while a callback is running.
fn run_impl<Args: Copy>(&self, args: Args)
fn run_impl<Args: Copy + std::marker::Tuple>(&self, args: Args)
where F: FnMut<Args> {
self.model.run_impl(args)
}
@ -151,7 +152,7 @@ impl<F: ?Sized> RegistryModel<F> {
self.callback_list.borrow().is_empty() && self.callback_list_during_run.borrow().is_empty()
}
fn run_impl<Args: Copy>(&self, args: Args)
fn run_impl<Args: Copy + std::marker::Tuple>(&self, args: Args)
where F: FnMut<Args> {
if self.is_running.get() {
error!("Trying to run callback manager while it's already running, ignoring.");

View File

@ -104,7 +104,7 @@ impl<HeaderEntry: Entry> VisibleHeader<HeaderEntry> {
let next_section_y = entry::visible::position_y(self.section_rows.end, entry_size);
let min_y = next_section_y + entry_size.y / 2.0 + contour.size.y / 2.0 - contour_offset.y;
let x = entry::visible::position_x(col, entry_size, column_widths);
let y = (viewport.top - contour.size.y / 2.0 - contour_offset.y).min(max_y).max(min_y);
let y = (viewport.top - contour.size.y / 2.0 - contour_offset.y).clamp(min_y, max_y);
entry::MovedHeaderPosition { position: Vector2(x, y), y_range: min_y..=max_y }
}
}

View File

@ -47,7 +47,7 @@ mod background {
let width = width - padding.px() * 2.0;
let height = height - padding.px() * 2.0;
let radius = &height / 2.0;
let base_shape = Rect((&width,&height)).corners_radius(&radius);
let base_shape = Rect((&width,&height)).corners_radius(radius);
let shape = base_shape.fill(Var::<color::Rgba>::from(bg_color.clone()));
let alpha = Var::<f32>::from(format!("({0}.w)",bg_color));
let shadow = shadow::from_shape_with_alpha(base_shape.into(),&alpha,style);

View File

@ -204,7 +204,7 @@ impl<E: Entry> Model<E> {
let logger = Logger::new("SelectionContainer");
let display_object = display::object::Instance::new();
let scrolled_area = display::object::Instance::new();
let entries = entry::List::new(&logger, &app);
let entries = entry::List::new(logger, &app);
let background = background::View::new();
let overlay = overlay::View::new();
let selection = selection::View::new();

View File

@ -233,7 +233,7 @@ impl Frp {
// The size at which we render the thumb on screen, in normalized units. Can differ from
// the actual thumb size if the thumb is smaller than the min.
visual_size <- all_with(&normalized_size,&min_visual_size,|&size,&min|
size.max(min).min(1.0));
size.clamp(min, 1.0));
// The position at which we render the thumb on screen, in normalized units.
visual_start <- all_with(&normalized_position,&visual_size,|&pos,&size|
pos * (1.0 - size));

View File

@ -50,12 +50,12 @@ pub fn parameters_from_style_path(style: &StyleWatch, path: impl Into<style::Pat
let path: style::Path = path.into();
Parameters {
base_color: style.get_color(&path).into(),
fading: style.get_color(&path.sub("fading")).into(),
size: style.get_number(&path.sub("size")).into(),
spread: style.get_number(&path.sub("spread")).into(),
exponent: style.get_number(&path.sub("exponent")).into(),
offset_x: style.get_number(&path.sub("offset_x")).into(),
offset_y: style.get_number(&path.sub("offset_y")).into(),
fading: style.get_color(path.sub("fading")).into(),
size: style.get_number(path.sub("size")).into(),
spread: style.get_number(path.sub("spread")).into(),
exponent: style.get_number(path.sub("exponent")).into(),
offset_x: style.get_number(path.sub("offset_x")).into(),
offset_y: style.get_number(path.sub("offset_y")).into(),
}
}
@ -147,11 +147,11 @@ pub fn frp_from_style(style: &StyleWatchFrp, path: impl Into<style::Path>) -> Pa
let path: style::Path = path.into();
ParametersFrp {
base_color: style.get_color(&path),
fading: style.get_color(&path.sub("fading")),
size: style.get_number(&path.sub("size")),
spread: style.get_number(&path.sub("spread")),
exponent: style.get_number(&path.sub("exponent")),
offset_x: style.get_number(&path.sub("offset_x")),
offset_y: style.get_number(&path.sub("offset_y")),
fading: style.get_color(path.sub("fading")),
size: style.get_number(path.sub("size")),
spread: style.get_number(path.sub("spread")),
exponent: style.get_number(path.sub("exponent")),
offset_x: style.get_number(path.sub("offset_x")),
offset_y: style.get_number(path.sub("offset_y")),
}
}

View File

@ -847,7 +847,7 @@ lazy_static! {
/// the sRGB color space. Please read the docs of `LCH_MAX_LIGHTNESS_CHROMA_IN_SRGB_CORRELATION` to
/// learn more.
fn lch_lightness_to_max_chroma_in_srgb(l: f32) -> f32 {
let l = l.max(0.0).min(100.0);
let l = l.clamp(0.0, 100.0);
let l_scaled = l * 100.0;
let l_scaled_floor = l_scaled.floor();
let l_scaled_ceil = l_scaled.ceil();

View File

@ -922,8 +922,8 @@ impl SceneData {
let width = canvas.width.round() as i32;
let height = canvas.height.round() as i32;
debug_span!("Resized to {screen.width}px x {screen.height}px.").in_scope(|| {
self.dom.layers.canvas.set_attribute_or_warn("width", &width.to_string());
self.dom.layers.canvas.set_attribute_or_warn("height", &height.to_string());
self.dom.layers.canvas.set_attribute_or_warn("width", width.to_string());
self.dom.layers.canvas.set_attribute_or_warn("height", height.to_string());
if let Some(context) = &*self.context.borrow() {
context.viewport(0, 0, width, height);
}

View File

@ -152,7 +152,7 @@ impl Expression {
/// Simple reference (identity) expression constructor.
pub fn reference(path: impl Into<Path>) -> Self {
Self::new(&[path.into()], |t| t[0].clone())
Self::new([path.into()], |t| t[0].clone())
}
}

View File

@ -269,7 +269,7 @@ impl Manager {
let name = name.into();
let theme = self.data.borrow().combined.deep_clone();
self.register_internal(name.clone(), theme);
self.set_enabled(&[name]);
self.set_enabled([name]);
}
fn register_internal(&self, name: String, theme: Theme) {
@ -359,6 +359,6 @@ pub fn test() {
theme_manager.register("theme1", theme1);
theme_manager.register("theme2", theme2);
theme_manager.set_enabled(&["theme1".to_string()]);
theme_manager.set_enabled(["theme1".to_string()]);
theme_manager.set_enabled(["theme1", "theme2"]);
}

View File

@ -374,8 +374,8 @@ impl SpriteSystem {
let shader = self.symbol.shader();
let surface_material = Self::default_surface_material();
let geometry_material = Self::default_geometry_material();
shader.set_geometry_material(&geometry_material);
shader.set_material(&surface_material);
shader.set_geometry_material(geometry_material);
shader.set_material(surface_material);
}
/// The default geometry material for all sprites.

View File

@ -333,7 +333,7 @@ impl WorldData {
let logger = Logger::new("renderer");
let pipeline = render::Pipeline::new()
.add(SymbolsRenderPass::new(
&logger,
logger,
self.default_scene.symbols(),
&self.default_scene.layers,
))

View File

@ -83,7 +83,7 @@ pub fn main() {
theme_manager.register("theme1", theme1);
theme_manager.register("theme2", theme2);
theme_manager.set_enabled(&["theme1".to_string()]);
theme_manager.set_enabled(["theme1".to_string()]);
let style_watch = ensogl_core::display::shape::StyleWatch::new(&scene.style_sheet);
// style_watch.set_on_style_change(|| DEBUG!("Style changed!"));
@ -161,7 +161,7 @@ pub fn main() {
}
if frame == 200 {
DEBUG!("Changing the theme.");
theme_manager.set_enabled(&["theme2".to_string()]);
theme_manager.set_enabled(["theme2".to_string()]);
}
frame += 1;
})

View File

@ -129,7 +129,7 @@ fn init_theme(scene: &Scene) {
theme.set("component.label.text", color::Lcha::black());
theme_manager.register("theme", theme);
theme_manager.set_enabled(&["theme".to_string()]);
theme_manager.set_enabled(["theme".to_string()]);
}

View File

@ -111,7 +111,7 @@ fn init_theme(scene: &display::Scene) {
theme.set(COLOR_PATH, color::Rgb::new(1.0, 45.0 / 255.0, 0.0));
theme.set("component.label.text", color::Lcha::black());
theme_manager.register("theme", theme);
theme_manager.set_enabled(&["theme".to_string()]);
theme_manager.set_enabled(["theme".to_string()]);
let style_watch = ensogl_core::display::shape::StyleWatch::new(&scene.style_sheet);
style_watch.get(COLOR_PATH);
}

View File

@ -212,8 +212,8 @@ fn init(app: Application) {
let scene = scene.clone_ref();
let handler = app.display.on.before_frame.add(move |_time| {
let shape = scene.dom.shape();
div.set_style_or_warn("left", &format!("{}px", shape.width / 2.0));
div.set_style_or_warn("top", &format!("{}px", shape.height / 2.0 - 0.5));
div.set_style_or_warn("left", format!("{}px", shape.width / 2.0));
div.set_style_or_warn("top", format!("{}px", shape.height / 2.0 - 0.5));
});
mem::forget(handler);

View File

@ -44,7 +44,6 @@
//! Java code after all computation is completed.
// === Features ===
#![feature(map_first_last)]
#![feature(option_get_or_insert_default)]
// === Standard Linter Configuration ===
#![deny(non_ascii_idents)]

View File

@ -52,6 +52,6 @@ fn main() {
let dir = args.next().expect("Usage: generate-java <output-dir>");
for class in graph {
let code = class.to_string();
std::fs::write(format!("{}/{}.java", &dir, &class.name), &code).unwrap();
std::fs::write(format!("{}/{}.java", &dir, &class.name), code).unwrap();
}
}

View File

@ -121,7 +121,7 @@ pub extern "system" fn Java_org_enso_syntax2_Parser_getMetadata(
/// Allocate a new parser state object. The returned value should be passed to `freeState` when no
/// longer needed.
#[allow(unsafe_code)]
#[allow(unsafe_code, clippy::box_default)]
#[no_mangle]
pub extern "system" fn Java_org_enso_syntax2_Parser_allocState(
_env: JNIEnv,

View File

@ -107,7 +107,6 @@
//! it, and probably never will.)
// === Features ===
#![feature(map_first_last)]
#![feature(associated_type_defaults)]
#![feature(option_get_or_insert_default)]
// === Standard Linter Configuration ===

View File

@ -479,6 +479,7 @@ impl Acos for f32 {
/// Saturating addition. Computes self + rhs, saturating at the numeric bounds instead of
/// overflowing.
#[const_trait]
#[allow(missing_docs)]
pub trait SaturatingAdd<Rhs = Self> {
type Output;
@ -488,6 +489,7 @@ pub trait SaturatingAdd<Rhs = Self> {
/// Saturating subtraction. Computes self - rhs, saturating at the numeric bounds instead of
/// overflowing.
#[allow(missing_docs)]
#[const_trait]
pub trait SaturatingSub<Rhs = Self> {
type Output;
fn saturating_sub(self, rhs: Rhs) -> Self::Output;
@ -496,6 +498,7 @@ pub trait SaturatingSub<Rhs = Self> {
/// Saturating multiplication. Computes self * rhs, saturating at the numeric bounds instead of
/// overflowing.
#[allow(missing_docs)]
#[const_trait]
pub trait SaturatingMul<Rhs = Self> {
type Output;
fn saturating_mul(self, rhs: Rhs) -> Self::Output;
@ -503,6 +506,7 @@ pub trait SaturatingMul<Rhs = Self> {
/// Saturating power. Computes self ^ exp, saturating at the numeric bounds instead of overflowing.
#[allow(missing_docs)]
#[const_trait]
pub trait SaturatingPow {
type Output;
fn saturating_pow(self, exp: u32) -> Self::Output;

View File

@ -39,6 +39,7 @@ mod ops {
/// Unchecked unit conversion. You should use it only for unit conversion definition, never in
/// unit-usage code.
#[allow(missing_docs)]
#[const_trait]
pub trait UncheckedFrom<T> {
fn unchecked_from(t: T) -> Self;
}
@ -58,6 +59,7 @@ impl<V, R> const UncheckedFrom<R> for UnitData<V, R> {
/// Unchecked unit conversion. See [`UncheckedFrom`] to learn more.
#[allow(missing_docs)]
#[const_trait]
pub trait UncheckedInto<T> {
fn unchecked_into(self) -> T;
}
@ -326,11 +328,13 @@ impl<V, R> IntoUncheckedRawRange for ops::RangeFrom<UnitData<V, R>> {
macro_rules! gen_ops {
($rev_trait:ident, $trait:ident, $op:ident) => {
#[allow(missing_docs)]
#[const_trait]
pub trait $trait<T> {
type Output;
}
#[allow(missing_docs)]
#[const_trait]
pub trait $rev_trait<T> {
type Output;
}
@ -693,6 +697,7 @@ define_ops![
/// Methods of the [`Duration`] unit.
#[allow(missing_docs)]
#[const_trait]
pub trait DurationOps {
fn ms(t: f32) -> Duration;
fn s(t: f32) -> Duration;
@ -734,6 +739,7 @@ impl const DurationOps for Duration {
/// Methods of the [`Duration`] unit as extensions for numeric types.
#[allow(missing_docs)]
#[const_trait]
pub trait DurationNumberOps {
fn ms(self) -> Duration;
fn s(self) -> Duration;

View File

@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2022-09-21"
channel = "nightly-2022-11-22"
components = ["clippy", "rustfmt"]
profile = "default"
targets = ["wasm32-unknown-unknown"]