#![doc(
// The following are document setting according to
// https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html
// For html-pdf-viewer setting:
// https://tinytip.co/tips/html-pdf-params/
// html_favicon_url = "https://example.com/favicon.ico",
// html_logo_url = "https://example.com/logo.jpg",
html_playground_url = "https://play.rust-lang.org",
)]
#![deny(
// The following are allowed by default lints according to
// https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html
anonymous_parameters,
bare_trait_objects,
// box_pointers,
elided_lifetimes_in_paths, // allow anonymous lifetime
missing_debug_implementations,
// missing_docs, // TODO: add documents
trivial_casts, // TODO: remove trivial casts in code
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_extern_crates,
unused_import_braces,
unreachable_pub, // allow clippy::redundant_pub_crate lint instead
// unused_qualifications,
unused_results, // TODO: fix unused results
variant_size_differences,
// warnings, // treat all wanings as errors
clippy::all,
clippy::restriction,
clippy::pedantic,
clippy::nursery,
clippy::cargo
)]
#![allow(
// Some explicitly allowed Clippy lints, must have clear reason to allow
clippy::blanket_clippy_restriction_lints, // allow clippy::restriction
clippy::implicit_return, // actually omitting the return keyword is idiomatic Rust code
clippy::module_name_repetitions, // repeation of module name in a struct name is not big deal
clippy::multiple_crate_versions, // multi-version dependency crates is not able to fix
clippy::panic, // allow debug_assert, panic in production code
clippy::panic_in_result_fn,
clippy::missing_errors_doc, // TODO: add error docs
clippy::exhaustive_structs,
clippy::exhaustive_enums,
clippy::missing_panics_doc, // TODO: add panic docs
clippy::panic_in_result_fn,
clippy::print_stdout,
clippy::use_debug
)]
#![warn(
clippy::todo,
dead_code,
missing_copy_implementations, // Copy may cause unnecessary memory copy
missing_docs,
single_use_lifetimes, // TODO: fix lifetime names only used once
unused_qualifications,
)]
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;
pub mod common;
pub mod expression;
pub mod units;
pub mod library;
pub mod cell;
pub mod pin;
pub mod bus;
pub mod table;
pub mod bundle;
pub mod timing;
pub mod ast;
mod types;
mod util;
mod test{
use std::{str::FromStr, string};
struct A (String);
impl FromStr for A {
type Err=std::fmt::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.to_string()))
}
}
struct B (String);
impl FromStr for B {
type Err=std::fmt::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.to_string()))
}
}
struct MyStruct{
a: A,
b: B,
}
}