License rust and c source files

This commit is contained in:
Jianfeng Jiang
2024-01-03 03:22:36 +00:00
committed by Tate, Hongliang Tian
parent 5fb8a9f7e5
commit faaa4438d6
559 changed files with 1192 additions and 89 deletions

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
use std::collections::{BTreeMap, HashSet};
use std::{env, fs, io, path::PathBuf};

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
#![feature(rustc_private)]
extern crate rustc_ast;

View File

@ -1,4 +1,7 @@
//! This implementation is from rust-clippy
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
// This implementation is from rust clippy. We modified the code.
fn main() {
// Forward the profile to the main compilation

View File

@ -1,7 +1,8 @@
//! Licensed under the Apache License, Version 2.0 or the MIT License.
//! Copyright (C) 2023 Ant Group.
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
// This implementation is from rust clippy. We modified the code.
//! This implementation is from rust clippy. We modified the code.
#![feature(rustc_private)]
#![feature(once_cell)]

View File

@ -1,7 +1,7 @@
//! Licensed under the Apache License, Version 2.0 or the MIT License.
//! Copyright (C) 2023 Ant Group.
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This implementation is from rust clippy. We modified the code.
// This implementation is from rust clippy. We modified the code.
use std::env;
use std::path::PathBuf;

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that if two components have same name, the compiler will panic.
#![feature(once_cell)]

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that if Components.toml is missed, the compiler will panic.
#![feature(once_cell)]

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that if cargo-component can control reexported entry points.
#![feature(once_cell)]

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that visiting controlled resources in whitelist is allowed.
#![feature(once_cell)]

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
#![allow(unused)]
use std::path::PathBuf;

View File

@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that if cargo-component can control method and trait method
#![feature(once_cell)]

View File

@ -1,4 +1,8 @@
//! This test checks that if controlled resource not in whitelist is visited, cargo-component will report warning message.
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
//! This test checks that if controlled resource not in whitelist is visited, cargo-component will
//! report warning message.
#![feature(once_cell)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use proc_macro2::{TokenStream, TokenTree};
use quote::{ToTokens, TokenStreamExt};
use syn::parse::Parse;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//This crate defines the component system related macros.
//!

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use std::{collections::HashMap, fs::File, io::Read, ops::Add, process::Command, str::FromStr};
use json::JsonValue;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Component system
//!

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering::Relaxed;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use std::sync::atomic::{Ordering::Relaxed, AtomicBool};
use component::init_component;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use second_init::HAS_INIT;
use std::sync::atomic::Ordering::Relaxed;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use std::sync::atomic::{Ordering::Relaxed, AtomicBool};
use component::init_component;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use first_init::HAS_INIT;
use component::init_component;
use std::sync::atomic::Ordering::Relaxed;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! This crate defines two attribute macros `controlled` and `uncontrolled`.
//! This two macros are attached to functions or static variables to enable crate level access control.
//! To use these two macros, a crate must at first registers a tool named `component_access_control`,